From 02715667d7d76bc111ea0ed1874260a02bf04b82 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 7 Sep 2011 17:16:23 +0000 Subject: [PATCH] /cp 2011-09-07 Paolo Carlini PR c++/50309 * decl.c (grokdeclarator): Check u.function.exception_specification for error_mark_node. /testsuite 2011-09-07 Paolo Carlini 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 | 6 ++++++ gcc/cp/decl.c | 4 ++++ gcc/testsuite/ChangeLog | 9 +++++++-- gcc/testsuite/g++.dg/cpp0x/noexcept14.C | 4 ++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept14.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1c6c5a1..9810d7d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-07 Paolo Carlini + + PR c++/50309 + * decl.c (grokdeclarator): Check u.function.exception_specification + for error_mark_node. + 2011-09-07 Jason Merrill PR c++/50298 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index eed4535..e30fe18 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f3d6ddb..c0bc7cc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-09-07 Paolo Carlini + + PR c++/50309 + * g++.dg/cpp0x/noexcept14.C: New. + 2011-09-07 Jason Merrill * 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 - + * gcc.dg/section1.c: Don't xfail for avr. - + 2011-09-07 Georg-Johann Lay 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 index 0000000..eba2c40 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept14.C @@ -0,0 +1,4 @@ +// PR c++/50309 +// { dg-options -std=c++0x } + +void foo () noexcept () { } // { dg-error "expected" } -- 2.7.4