From d9b2742a3d4bfc03500e14e4e9bcc7ae9275a079 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 22 Mar 2003 03:28:39 +0000 Subject: c-common.c: Include intl.h. * c-common.c: Include intl.h. (shadow_warning): Rewrite to allow better diagnostic translations. * c-common.h: Update prototype of shadow_warning. Declare sw_kind enum. * c-decl.c (warn_if_shadowing): Update calls to shadow_warning; use it throughout. * Makefile.in (c-common.o): Add intl.h. cp: * decl.c: Update calls to shadow_warning. po: * gcc.pot: Regenerate. From-SVN: r64699 --- gcc/cp/ChangeLog | 46 +++++++++++++++++++++++++--------------------- gcc/cp/decl.c | 9 ++++++--- 2 files changed, 31 insertions(+), 24 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2546ea1..616078a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2003-03-21 Zack Weinberg + + * decl.c: Update calls to shadow_warning. + 2003-03-21 Nathan Sidwell PR c++/9898 @@ -22,8 +26,8 @@ (init_rtti_processing): initialize unemitted_tinfo_decls varray. (get_tinfo_decls): push new tinfo decl on unemitted_tinfo_decls. (emit_tinfo_decl): remove unused second parameter, add assertion - that decl hasn't already been emitted. - + that decl hasn't already been emitted. + 2003-03-19 Nathanael Nerode * dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return @@ -47,7 +51,7 @@ 2003-03-17 Jason Merrill PR c++/10091 - * typeck.c (build_class_member_access_expr): Compare + * typeck.c (build_class_member_access_expr): Compare TYPE_MAIN_VARIANTs. 2003-03-17 Mark Mitchell @@ -493,14 +497,14 @@ 2003-03-04 Gabriel Dos Reis - * cp-tree.h (cxx_saved_binding): Declare. - (struct saved_scope): Adjust type of field 'old_binding'. - * decl.c (cxx_saved_binding_make): New macro. - (struct cxx_saved_binding): Define. - (store_bindings): Adjust prototype. Use cxx_saved_binding to save - C++ bindings. - (maybe_push_to_top_level): Adjust local variable type. - (pop_from_top_level): Likewise. + * cp-tree.h (cxx_saved_binding): Declare. + (struct saved_scope): Adjust type of field 'old_binding'. + * decl.c (cxx_saved_binding_make): New macro. + (struct cxx_saved_binding): Define. + (store_bindings): Adjust prototype. Use cxx_saved_binding to save + C++ bindings. + (maybe_push_to_top_level): Adjust local variable type. + (pop_from_top_level): Likewise. 2003-03-04 Tom Tromey @@ -599,9 +603,9 @@ 2003-02-28 Aldy Hernandez - * parser.c (cp_parser_init_declarator): Revert opaque - vector_opaque_p change. - Do not include target.h. + * parser.c (cp_parser_init_declarator): Revert opaque + vector_opaque_p change. + Do not include target.h. 2003-02-28 Mark Mitchell @@ -905,7 +909,7 @@ 2003-02-14 Andrew Pinski - * decl.c: (define_label): Fix warning for return 0 instead of NULL. + * decl.c: (define_label): Fix warning for return 0 instead of NULL. 2003-02-13 Gabriel Dos Reis @@ -1109,7 +1113,7 @@ 2003-01-29 Fariborz Jahanian - * pt.c (last_pending_template) Declare GTY(). + * pt.c (last_pending_template) Declare GTY(). 2003-01-29 Kriang Lerdsuwanakij @@ -1234,7 +1238,7 @@ PR c++/9285 PR c++/9294 * parser.c (cp_parser_simple_declaration): Return quickly when - encountering errors. + encountering errors. 2003-01-21 Kaveh R. Ghazi @@ -1508,10 +1512,10 @@ 2003-01-09 Nathanael Nerode - * cfns.gperf: ANSIfy function declarations. - * cfns.h: Regenerate. - * cp-tree.h: ANSIfy function declarations. - * parser.c: ANSIfy function declarations & definitions. + * cfns.gperf: ANSIfy function declarations. + * cfns.h: Regenerate. + * cp-tree.h: ANSIfy function declarations. + * parser.c: ANSIfy function declarations & definitions. * decl.c (bad_specifiers): Fix parameter order error I introduced. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a0dba2f..99898d0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4123,7 +4123,8 @@ pushdecl (tree x) } if (warn_shadow && !err) - shadow_warning ("a parameter", name, oldlocal); + shadow_warning (SW_PARAM, false, + IDENTIFIER_POINTER (name), oldlocal); } /* Maybe warn if shadowing something else. */ @@ -4140,11 +4141,13 @@ pushdecl (tree x) IDENTIFIER_POINTER (name)); else if (oldlocal != NULL_TREE && TREE_CODE (oldlocal) == VAR_DECL) - shadow_warning ("a previous local", name, oldlocal); + shadow_warning (SW_LOCAL, false, + IDENTIFIER_POINTER (name), oldlocal); else if (oldglobal != NULL_TREE && TREE_CODE (oldglobal) == VAR_DECL) /* XXX shadow warnings in outer-more namespaces */ - shadow_warning ("a global declaration", name, oldglobal); + shadow_warning (SW_GLOBAL, false, + IDENTIFIER_POINTER (name), oldglobal); } } -- cgit v1.1