aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-11-18 08:36:38 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-11-18 08:36:38 -0500
commit59f1d0db7ae9ccc8049eb2933ff631dab77e1c17 (patch)
tree2b2244051f5df75ce11258f354090a2201a8dc5e /gcc/tree.c
parent023d89c70b3912087d9e4a1db51993ed94fdd088 (diff)
downloadgcc-59f1d0db7ae9ccc8049eb2933ff631dab77e1c17.zip
gcc-59f1d0db7ae9ccc8049eb2933ff631dab77e1c17.tar.gz
gcc-59f1d0db7ae9ccc8049eb2933ff631dab77e1c17.tar.bz2
* tree.c (warn_deprecated_use): Show declaration with inform.
From-SVN: r217714
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 3f801af..091a4d0 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
{