From: Mark Mitchell Date: Fri, 27 Feb 2004 00:31:49 +0000 (+0000) Subject: re PR c++/14278 (fails when calling through a function pointer) X-Git-Tag: releases/gcc-4.0.0~9808 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d5fe28997dc77c3afeb47d400b6e62418705c34;p=thirdparty%2Fgcc.git re PR c++/14278 (fails when calling through a function pointer) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index affca567d3aa..214dc92dc475 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-02-26 Mark Mitchell + + PR c++/14278 + * parser.c (cp_parser_parameter_declaration_list): Commit + to fewer tentative parses. + 2004-02-26 Giovanni Bajo PR c++/14284 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 3d6efe156791..3e26c2d51881 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f66cd592f96d..dda6ed78e957 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-02-26 Mark Mitchell + + PR c++/14278 + * g++.dg/parse/comma1.C: New test. + 2004-02-26 Giovanni Bajo 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 index 000000000000..33d222cbc04e --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/comma1.C @@ -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)));