]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/41876 (Parse problems with catch)
authorJason Merrill <jason@redhat.com>
Tue, 3 Nov 2009 21:52:56 +0000 (16:52 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 3 Nov 2009 21:52:56 +0000 (16:52 -0500)
PR c++/41876
* parser.c (cp_parser_exception_declaration): Pass true to
is_condition parm of cp_parser_type_specifier_seq.

From-SVN: r153873

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/eh-decl.C [new file with mode: 0644]

index f25835a640abece0713d02b2e4392cba69c7bac9..805c1e12758d12bb5db8e7c3b7cc0f897701d648 100644 (file)
@@ -1,3 +1,9 @@
+2009-11-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/41876
+       * parser.c (cp_parser_exception_declaration): Pass true to
+       is_condition parm of cp_parser_type_specifier_seq.
+
 2009-11-03  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/37093
index 644fd708521c22c65e33188cc8891f26dc95d1c5..4c4ba9c2d1de1243294d21b078bdedd5ce97988f 100644 (file)
@@ -15741,7 +15741,7 @@ cp_parser_exception_declaration (cp_parser* parser)
     = "types may not be defined in exception-declarations";
 
   /* Parse the type-specifier-seq.  */
-  cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+  cp_parser_type_specifier_seq (parser, /*is_declaration=*/true,
                                &type_specifiers);
   /* If it's a `)', then there is no declarator.  */
   if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN))
index 58136a56efe58fed93a20ddc1e6e9246f20ff04c..a4d37c41328082d09e95d802ef399b6b1910c95c 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-28  Jason Merrill  <jason@redhat.com>
+
+       PR c++/41876
+       * g++.dg/parse/eh-decl.C: New.
+
 2009-11-03  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/37093
diff --git a/gcc/testsuite/g++.dg/parse/eh-decl.C b/gcc/testsuite/g++.dg/parse/eh-decl.C
new file mode 100644 (file)
index 0000000..1c72fd3
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/41876
+
+struct A;
+
+void foo()
+{
+  try {} catch(int A) {}
+}