re PR c++/50309 ([C++0x] ICE: tree check: expected tree_list, have error_mark in...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 7 Sep 2011 17:16:23 +0000 (17:16 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 7 Sep 2011 17:16:23 +0000 (17:16 +0000)
/cp
2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/50309
* decl.c (grokdeclarator): Check u.function.exception_specification
for error_mark_node.

/testsuite
2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/50309
* g++.dg/cpp0x/noexcept14.C: New.

From-SVN: r178654

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/noexcept14.C [new file with mode: 0644]

index 1c6c5a160c0b6526b59435059664b747769764b3..9810d7d5384893d1e70d00267ea1e27ddea4664a 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50309
+       * decl.c (grokdeclarator): Check u.function.exception_specification
+       for error_mark_node.
+
 2011-09-07  Jason Merrill  <jason@redhat.com>
 
        PR c++/50298
index eed45352871a99b02902dc96559c9207a51633dc..e30fe18dc788c25c9d8a964683563d55a367ea5c 100644 (file)
@@ -9049,6 +9049,10 @@ grokdeclarator (const cp_declarator *declarator,
             virt_specifiers = declarator->u.function.virt_specifiers;
            /* Pick up the exception specifications.  */
            raises = declarator->u.function.exception_specification;
+           /* If the exception-specification is ill-formed, let's pretend
+              there wasn't one.  */
+           if (raises == error_mark_node)
+             raises = NULL_TREE;
 
            /* Say it's a definition only for the CALL_EXPR
               closest to the identifier.  */
index f3d6ddb6bfff4249cefce2879b012430cf1f9a1f..c0bc7cca85852d6b26a12f8525b0619b327e4f76 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50309
+       * g++.dg/cpp0x/noexcept14.C: New.
+
 2011-09-07  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/cpp0x/constexpr-ref3.C: New.
@@ -5,9 +10,9 @@
        * g++.dg/cpp0x/sfinae11.C: Check for explanatory diagnostic.
 
 2011-09-07  Georg-Johann Lay  <avr@gjlay.de>
-       
+
        * gcc.dg/section1.c: Don't xfail for avr.
-       
+
 2011-09-07  Georg-Johann Lay  <avr@gjlay.de>
 
        PR tree-optimization/50322
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept14.C b/gcc/testsuite/g++.dg/cpp0x/noexcept14.C
new file mode 100644 (file)
index 0000000..eba2c40
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/50309
+// { dg-options -std=c++0x }
+
+void foo () noexcept () { } // { dg-error "expected" }