Hi,

this error recovery ICE (a low priority regression) can be easily avoided by checking the TREE_TYPE of exp too. Tested x86_64-linux.

Thanks,
Paolo.

///////////////////////
/cp
2013-10-04  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/58560
        * typeck2.c (build_functional_cast): Use error_operand_p on exp.

/testsuite
2013-10-04  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/58560
        * g++.dg/cpp0x/auto39.C: New.
Index: cp/typeck2.c
===================================================================
--- cp/typeck2.c        (revision 203200)
+++ cp/typeck2.c        (working copy)
@@ -1757,7 +1757,7 @@ build_functional_cast (tree exp, tree parms, tsubs
   tree type;
   vec<tree, va_gc> *parmvec;
 
-  if (exp == error_mark_node || parms == error_mark_node)
+  if (error_operand_p (exp) || parms == error_mark_node)
     return error_mark_node;
 
   if (TREE_CODE (exp) == TYPE_DECL)
Index: testsuite/g++.dg/cpp0x/auto39.C
===================================================================
--- testsuite/g++.dg/cpp0x/auto39.C     (revision 0)
+++ testsuite/g++.dg/cpp0x/auto39.C     (working copy)
@@ -0,0 +1,6 @@
+// PR c++/58560
+// { dg-do compile { target c++11 } }
+
+typedef auto T;     // { dg-error "typedef declared 'auto'" }
+
+void foo() { T(); }

Reply via email to