diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-12-15 06:28:23 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-12-15 06:28:23 +0000 |
commit | 4bb8ca281f0fb91d296116d2b7496b216c7c1bb3 (patch) | |
tree | cf0b0628bdaaa8f00ed673d539b8e8c5c1193fa3 /gcc/c-common.h | |
parent | 69f364953465519ced88df15edd1422c4382aecd (diff) | |
download | gcc-4bb8ca281f0fb91d296116d2b7496b216c7c1bb3.zip gcc-4bb8ca281f0fb91d296116d2b7496b216c7c1bb3.tar.gz gcc-4bb8ca281f0fb91d296116d2b7496b216c7c1bb3.tar.bz2 |
re PR c++/10779 (Error cascade for unknown type in function prototype)
* 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.
From-SVN: r74624
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r-- | gcc/c-common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h index ccfc779..326fe51 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -1330,6 +1330,7 @@ extern void c_stddef_cpp_builtins (void); extern void fe_file_change (const struct line_map *); extern int c_estimate_num_insns (tree decl); extern bool c_decl_uninit (tree t); +extern void c_parse_error (const char *, enum cpp_ttype, tree); /* The following have been moved here from c-tree.h, since they're needed in the ObjC++ world, too. What is more, stub-objc.c could use a few |