This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55076] ice when compiling lambda function
- From: "markus at trippelsdorf dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Oct 2012 16:48:46 +0000
- Subject: [Bug c++/55076] ice when compiling lambda function
- Auto-submitted: auto-generated
- References: <bug-55076-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55076
--- Comment #7 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-10-26 16:48:46 UTC ---
What about the following naÃve patch?
At least it fixes the problem and causes no new test suite regressions.
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8d555c2..0f1a75d 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -145,7 +145,7 @@ lvalue_kind (const_tree ref)
case ARRAY_REF:
case PARM_DECL:
case RESULT_DECL:
- if (TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE)
+ if (TREE_TYPE (ref) && TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE)
return clk_ordinary;
break;