diff options
author | Richard Henderson <rth@redhat.com> | 2003-09-20 22:07:20 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-09-20 22:07:20 -0700 |
commit | ddd2d57e722237230da8eea70a2fcecb11bd0f81 (patch) | |
tree | 28f355780724c452ad42bb81a3672b2e8010c989 /gcc/cp/decl.c | |
parent | ccea753c0563b847b42d9ca5fc1b8afaee49f343 (diff) | |
download | gcc-ddd2d57e722237230da8eea70a2fcecb11bd0f81.zip gcc-ddd2d57e722237230da8eea70a2fcecb11bd0f81.tar.gz gcc-ddd2d57e722237230da8eea70a2fcecb11bd0f81.tar.bz2 |
c-format.c (gcc_diag_char_table): Add %J.
* c-format.c (gcc_diag_char_table): Add %J.
(gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
(check_format_types): Fix wanted_type name lookup.
(init_dynamic_diag_info): Setup %J.
* diagnostic.c (text_specifies_location): Implement %J.
* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.
* tree-inline.c: Include intl.h
(inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
* Makefile.in (tree-inline.o): Update.
cp/
* decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
* check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
* gcc.dg/format/gcc_diag-1.c: Add tests for %J.
From-SVN: r71619
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 095c6fd..892affa 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2755,19 +2755,18 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_UNINLINABLE (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warning ("%Hfunction '%D' redeclared as inline", - &DECL_SOURCE_LOCATION (newdecl), newdecl); - warning ("%Hprevious declaration of '%D' with attribute noinline", - &DECL_SOURCE_LOCATION (olddecl), olddecl); + warning ("%Jfunction '%D' redeclared as inline", newdecl, newdecl); + warning ("%Jprevious declaration of '%D' with attribute noinline", + olddecl, olddecl); } else if (DECL_DECLARED_INLINE_P (olddecl) && DECL_UNINLINABLE (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warning ("%Hfunction '%D' redeclared with attribute noinline", - &DECL_SOURCE_LOCATION (newdecl), newdecl); - warning ("%Hprevious declaration of '%D' was inline", - &DECL_SOURCE_LOCATION (olddecl), olddecl); + warning ("%Jfunction '%D' redeclared with attribute noinline", + newdecl, newdecl); + warning ("%Jprevious declaration of '%D' was inline", + olddecl, olddecl); } } @@ -3009,8 +3008,7 @@ duplicate_decls (tree newdecl, tree olddecl) { /* Prototype decl follows defn w/o prototype. */ cp_warning_at ("prototype for `%#D'", newdecl); - warning ("%Hfollows non-prototype definition here", - &DECL_SOURCE_LOCATION (olddecl)); + warning ("%Jfollows non-prototype definition here", olddecl); } else if (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl)) @@ -3065,10 +3063,8 @@ duplicate_decls (tree newdecl, tree olddecl) && ! DECL_DECLARED_INLINE_P (olddecl) && TREE_ADDRESSABLE (olddecl) && warn_inline) { - warning ("`%#D' was used before it was declared inline", - newdecl); - warning ("%Hprevious non-inline declaration here", - &DECL_SOURCE_LOCATION (olddecl)); + warning ("`%#D' was used before it was declared inline", newdecl); + warning ("%Jprevious non-inline declaration here", olddecl); } } } @@ -4790,7 +4786,7 @@ check_goto (tree decl) if (u > 1 && DECL_ARTIFICIAL (b)) /* Can't skip init of __exception_info. */ - error ("%H enters catch block", &DECL_SOURCE_LOCATION (b)); + error ("%J enters catch block", b); else if (u > 1) cp_error_at (" skips initialization of `%#D'", b); else @@ -6577,8 +6573,8 @@ fixup_anonymous_aggr (tree t) /* ISO C++ 9.5.3. Anonymous unions may not have function members. */ if (TYPE_METHODS (t)) - error ("%Han anonymous union cannot have function members", - &DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (t))); + error ("%Jan anonymous union cannot have function members", + TYPE_MAIN_DECL (t)); /* Anonymous aggregates cannot have fields with ctors, dtors or complex assignment operators (because they cannot have these methods themselves). @@ -6911,8 +6907,7 @@ start_decl (tree declarator, && DECL_DECLARED_INLINE_P (decl) && DECL_UNINLINABLE (decl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl))) - warning ("%Hinline function '%D' given attribute noinline", - &DECL_SOURCE_LOCATION (decl), decl); + warning ("%Jinline function '%D' given attribute noinline", decl, decl); if (context && COMPLETE_TYPE_P (complete_type (context))) { @@ -7281,8 +7276,8 @@ maybe_commonize_var (tree decl) TREE_PUBLIC (decl) = 0; DECL_COMMON (decl) = 0; cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl); - warning ("%H you can work around this by removing the initializer", - &DECL_SOURCE_LOCATION (decl)); + warning ("%J you can work around this by removing the initializer", + decl); } } } @@ -11019,8 +11014,7 @@ grokdeclarator (tree declarator, { decl = build_decl (TYPE_DECL, declarator, type); if (in_namespace || ctype) - error ("%Htypedef name may not be a nested-name-specifier", - &DECL_SOURCE_LOCATION (decl)); + error ("%Jtypedef name may not be a nested-name-specifier", decl); if (!current_function_decl) DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace); } @@ -11066,8 +11060,8 @@ grokdeclarator (tree declarator, if (ctype == NULL_TREE) { if (TREE_CODE (type) != METHOD_TYPE) - error ("%Hinvalid type qualifier for non-member function type", - &DECL_SOURCE_LOCATION (decl)); + error ("%Jinvalid type qualifier for non-member function type", + decl); else ctype = TYPE_METHOD_BASETYPE (type); } @@ -12903,8 +12897,7 @@ start_enum (tree name) if (enumtype != NULL_TREE && TREE_CODE (enumtype) == ENUMERAL_TYPE) { error ("multiple definition of `%#T'", enumtype); - error ("%Hprevious definition here", - &DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype))); + error ("%Jprevious definition here", TYPE_MAIN_DECL (enumtype)); /* Clear out TYPE_VALUES, and start again. */ TYPE_VALUES (enumtype) = NULL_TREE; } @@ -13346,8 +13339,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) if (DECL_DECLARED_INLINE_P (decl1) && lookup_attribute ("noinline", attrs)) - warning ("%Hinline function '%D' given attribute noinline", - &DECL_SOURCE_LOCATION (decl1), decl1); + warning ("%Jinline function '%D' given attribute noinline", decl1, decl1); if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1)) /* This is a constructor, we must ensure that any default args |