Hi,
I have the below simple patch to avoid the ICE after error. Tested
x86_64-linux. Is it Ok? In case, if it applies as-is, 4_6-branch too?
Thanks,
Paolo.
////////////////
/cp
2011-09-07 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/50309
* decl.c (grokdeclarator): Check u.function.exception_specification
for error_mark_node.
/testsuite
2011-09-07 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/50309
* g++.dg/cpp0x/noexcept14.C: New.
Index: testsuite/g++.dg/cpp0x/noexcept14.C
===================================================================
--- testsuite/g++.dg/cpp0x/noexcept14.C (revision 0)
+++ testsuite/g++.dg/cpp0x/noexcept14.C (revision 0)
@@ -0,0 +1,4 @@
+// PR c++/50309
+// { dg-options -std=c++0x }
+
+void foo () noexcept () { } // { dg-error "expected" }
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 178631)
+++ cp/decl.c (working copy)
@@ -9049,6 +9049,8 @@ grokdeclarator (const cp_declarator *declarator,
virt_specifiers = declarator->u.function.virt_specifiers;
/* Pick up the exception specifications. */
raises = declarator->u.function.exception_specification;
+ if (raises == error_mark_node)
+ return error_mark_node;
/* Say it's a definition only for the CALL_EXPR
closest to the identifier. */