This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/10779] [3.4 regression] Error cascade for unknown type in function prototype
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2003 06:28:37 -0000
- Subject: [Bug c++/10779] [3.4 regression] Error cascade for unknown type in function prototype
- References: <20030514122600.10779.gerald@pfeifer.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-12-15 06:28 -------
Subject: Bug 10779
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2003-12-15 06:28:23
Modified files:
gcc : ChangeLog c-common.c c-common.h c-parse.in
gcc/cp : ChangeLog parser.c
gcc/testsuite : ChangeLog
gcc/testsuite/g++.dg/abi: mangle4.C
gcc/testsuite/g++.dg/lookup: using5.C
gcc/testsuite/g++.dg/other: error2.C
gcc/testsuite/g++.dg/parse: typename5.C undefined1.C
gcc/testsuite/g++.dg/template: arg2.C ttp3.C type1.C
gcc/testsuite/g++.old-deja/g++.other: crash32.C
gcc/testsuite/g++.old-deja/g++.pt: defarg8.C
Added files:
gcc/testsuite/g++.dg/parse: error3.C error4.C
Log message:
* c-common.h (c_parse_error): Declare it.
* c-common.c (c_parse_error): New function.
* c-parse.y (yyerror): Use it.
* parser.c (struct cp_parser): Add in_template_argument_list_p.
(cp_parser_error): Use c_parse_error.
(cp_parser_name_lookup_error): New function.
(cp_parser_new): Initialize it.
(cp_parser_declarator): Add parenthesized_p parameter.
(cp_parser_nested_name_specifier_opt): Use
cp_parser_name_lookup_error.
(cp_parser_parenthesized_expression_list): Improve comments.
(cp_parser_condition): Adjust call to cp_parser_declarator.
(cp_parser_template_parameter): Adjust call to
cp_parser_parameter_declaration.
(cp_parser_template_argument_list): Set
in_template_argument_list_p.
(cp_parser_explicit_instantiation): Adjust call to
cp_parser_declarator.
(cp_parser_simple_type_specifier): Remove unncessary code.
(cp_parser_using_declaration): Use cp_parser_name_lookup_error.
(cp_parser_init_declarator): Handle member function definitions.
(cp_parser_direct_declarator): Adjust call to
cp_parser_declarator.
(cp_parser_type_id): Adjust call to cp_parser_declarator.
(cp_parser_parameter_declaration_list): Avoid backtracking where
possible.
(cp_parser_parameter_declaration): Add parenthesized_p parameter.
(cp_parser_function_definition): Remove.
(cp_parser_member_declaration): Do not backtrack to look for
function definitions.
(cp_parser_exception_declaration): Adjust call to
cp_parser_declarator.
(cp_parser_single_declaration): Handle function definitions via
cp_parser_init_declarator.
(cp_parser_save_member_function_body): New function.
PR c++/10779
PR c++/12160
* g++.dg/parse/error3.C: New test.
* g++.dg/parse/error4.C: Likewise.
* g++.dg/abi/mangle4.C: Tweak error messages.
* g++.dg/lookup/using5.C: Likewise.
* g++.dg/other/error2.C: Likewise.
* g++.dg/parse/typename5.C: Likewise.
* g++.dg/parse/undefined1.C: Likewise.
* g++.dg/template/arg2.C: Likewise.
* g++.dg/template/ttp3.C: Likewise.
* g++.dg/template/type1.C: Likewise.
* g++.old-deja/g++.other/crash32.C: Likewise.
* g++.old-djea/g++.pt/defarg8.C: Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1993&r2=2.1994
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.467&r2=1.468
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.h.diff?cvsroot=gcc&r1=1.210&r2=1.211
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&r1=1.191&r2=1.192
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3799&r2=1.3800
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.130&r2=1.131
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3251&r2=1.3252
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/abi/mangle4.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/using5.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/error2.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typename5.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/undefined1.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/arg2.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ttp3.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/type1.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/crash32.C.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C.diff?cvsroot=gcc&r1=1.5&r2=1.6
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10779