]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/14278 (fails when calling through a function pointer)
authorMark Mitchell <mark@codesourcery.com>
Fri, 27 Feb 2004 00:31:49 +0000 (00:31 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 27 Feb 2004 00:31:49 +0000 (00:31 +0000)
PR c++/14278
* parser.c (cp_parser_parameter_declaration_list): Commit
to fewer tentative parses.

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

From-SVN: r78542

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

index affca567d3aa56d9ddef6a48b9871b4713eefe2c..214dc92dc4756fe662f657124b701e26470197bc 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 3d6efe1567914c5bf96004c04aad82a0abbbb1cf..3e26c2d51881621ce6246dafe4432fcf42aa85f1 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 f66cd592f96daf0baef47588fc1a006b73b5a889..dda6ed78e9575ebd6b25fc900c5840df36e0f783 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)));