PR c++/14278
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Feb 2004 00:31:49 +0000 (00:31 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Feb 2004 00:31:49 +0000 (00:31 +0000)
* parser.c (cp_parser_parameter_declaration_list): Commit
to fewer tentative parses.

PR c++/14278
* g++.dg/parse/comma1.C: New test.

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

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

index affca56..214dc92 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-26  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/14278
+       * parser.c (cp_parser_parameter_declaration_list): Commit
+       to fewer tentative parses.
+
 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14284
index 3d6efe1..3e26c2d 100644 (file)
@@ -11108,6 +11108,7 @@ cp_parser_parameter_declaration_list (cp_parser* parser)
             cannot use this technique when inside a template argument
             list.  */
          if (!parser->in_template_argument_list_p
+             && !parser->in_type_id_in_expr_p
              && cp_parser_parsing_tentatively (parser)
              && !cp_parser_committed_to_tentative_parse (parser)
              /* However, a parameter-declaration of the form
index f66cd59..dda6ed7 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-26  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/14278
+       * g++.dg/parse/comma1.C: New test.
+
 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14284
diff --git a/gcc/testsuite/g++.dg/parse/comma1.C b/gcc/testsuite/g++.dg/parse/comma1.C
new file mode 100644 (file)
index 0000000..33d222c
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/14278
+
+struct X { 
+  X (int p);
+};
+
+struct A {
+  A(X);
+};
+
+void *p_fun;
+
+A a(X ((*(int (*)(int, int)) p_fun)(0, 0)));