Commit 6626c52e by Jason Merrill Committed by Jason Merrill

re PR c++/61151 (ICE with lambda)

	PR c++/61151
	* semantics.c (is_this_parameter): Allow capture proxies too.

From-SVN: r210394
parent 2b107f6b
2014-05-13 Jason Merrill <jason@redhat.com>
PR c++/61151
* semantics.c (is_this_parameter): Allow capture proxies too.
2014-05-12 Jason Merrill <jason@redhat.com> 2014-05-12 Jason Merrill <jason@redhat.com>
* call.c (maybe_print_user_conv_context): New. * call.c (maybe_print_user_conv_context): New.
......
...@@ -8158,8 +8158,10 @@ maybe_initialize_constexpr_call_table (void) ...@@ -8158,8 +8158,10 @@ maybe_initialize_constexpr_call_table (void)
bool bool
is_this_parameter (tree t) is_this_parameter (tree t)
{ {
return (TREE_CODE (t) == PARM_DECL if (!DECL_P (t) || DECL_NAME (t) != this_identifier)
&& DECL_NAME (t) == this_identifier); return false;
gcc_assert (TREE_CODE (t) == PARM_DECL || is_capture_proxy (t));
return true;
} }
/* We have an expression tree T that represents a call, either CALL_EXPR /* We have an expression tree T that represents a call, either CALL_EXPR
......
// PR c++/61151
// { dg-do compile { target c++11 } }
struct B
{
void foo () {}
};
template <class>
struct A
{
template <class> void bar ();
B a;
};
template <class T>
template <class U>
void
A<T>::bar ()
{
auto f = [this] () { auto g = [=] () { a.foo (); }; g (); };
f ();
}
int
main ()
{
A<int> a;
a.bar <int> ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment