diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-18 13:36:38 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-18 13:36:38 +0000 |
commit | 1269ac1c72c5d1b4038a34a6fa5387ed6f938181 (patch) | |
tree | 2b2244051f5df75ce11258f354090a2201a8dc5e /gcc/tree.c | |
parent | bbcc9042c56a12308c08452ac790353667257b94 (diff) | |
download | gcc-1269ac1c72c5d1b4038a34a6fa5387ed6f938181.tar.gz |
* tree.c (warn_deprecated_use): Show declaration with inform.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217714 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 3f801af5344..091a4d093fc 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -12034,17 +12034,17 @@ warn_deprecated_use (tree node, tree attr) else msg = NULL; + bool w; if (DECL_P (node)) { - expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node)); if (msg) - warning (OPT_Wdeprecated_declarations, - "%qD is deprecated (declared at %r%s:%d%R): %s", - node, "locus", xloc.file, xloc.line, msg); + w = warning (OPT_Wdeprecated_declarations, + "%qD is deprecated: %s", node, msg); else - warning (OPT_Wdeprecated_declarations, - "%qD is deprecated (declared at %r%s:%d%R)", - node, "locus", xloc.file, xloc.line); + w = warning (OPT_Wdeprecated_declarations, + "%qD is deprecated", node); + if (w) + inform (DECL_SOURCE_LOCATION (node), "declared here"); } else if (TYPE_P (node)) { @@ -12062,30 +12062,26 @@ warn_deprecated_use (tree node, tree attr) if (decl) { - expanded_location xloc - = expand_location (DECL_SOURCE_LOCATION (decl)); if (what) { if (msg) - warning (OPT_Wdeprecated_declarations, - "%qE is deprecated (declared at %r%s:%d%R): %s", - what, "locus", xloc.file, xloc.line, msg); + w = warning (OPT_Wdeprecated_declarations, + "%qE is deprecated: %s", what, msg); else - warning (OPT_Wdeprecated_declarations, - "%qE is deprecated (declared at %r%s:%d%R)", - what, "locus", xloc.file, xloc.line); + w = warning (OPT_Wdeprecated_declarations, + "%qE is deprecated", what); } else { if (msg) - warning (OPT_Wdeprecated_declarations, - "type is deprecated (declared at %r%s:%d%R): %s", - "locus", xloc.file, xloc.line, msg); + w = warning (OPT_Wdeprecated_declarations, + "type is deprecated: %s", msg); else - warning (OPT_Wdeprecated_declarations, - "type is deprecated (declared at %r%s:%d%R)", - "locus", xloc.file, xloc.line); + w = warning (OPT_Wdeprecated_declarations, + "type is deprecated"); } + if (w) + inform (DECL_SOURCE_LOCATION (decl), "declared here"); } else { |