Commit ea48c8a0 by Jason Merrill Committed by Jason Merrill

re PR c++/54122 (segfault comparing enum class in lambda inside constructor of a templated class)

	PR c++/54122
	* tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
	METHOD_TYPE.

From-SVN: r195781
parent a283c407
2013-02-05 Jason Merrill <jason@redhat.com> 2013-02-05 Jason Merrill <jason@redhat.com>
PR c++/54122
* tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
METHOD_TYPE.
PR c++/56177 PR c++/56177
* decl.c (start_preparsed_function): Update restype if we change * decl.c (start_preparsed_function): Update restype if we change
decl1. decl1.
......
...@@ -143,9 +143,7 @@ lvalue_kind (const_tree ref) ...@@ -143,9 +143,7 @@ lvalue_kind (const_tree ref)
case ARRAY_REF: case ARRAY_REF:
case PARM_DECL: case PARM_DECL:
case RESULT_DECL: case RESULT_DECL:
if (TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE) return clk_ordinary;
return clk_ordinary;
break;
/* A scope ref in a template, left as SCOPE_REF to support later /* A scope ref in a template, left as SCOPE_REF to support later
access checking. */ access checking. */
......
// PR c++/54122
// { dg-options -std=c++11 }
enum E { F };
template <typename A>
struct C
{
E e;
void f () { auto l = [&](void)->void { if (e == F) return; }; }
};
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