OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Sep 2011 17:16:23 +0000 (17:16 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Sep 2011 17:16:23 +0000 (17:16 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178654 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 1c6c5a1..9810d7d 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 eed4535..e30fe18 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 f3d6ddb..c0bc7cc 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" }