diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-24 20:20:13 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-24 20:20:13 +0000 |
commit | 9e96f1e1b9731c4e1ef4fbbbf0997319973f0537 (patch) | |
tree | 5546702f4370a0141cb4902e6646f8d83f0e1492 /gcc/toplev.c | |
parent | f0ff386482debbbd1dc1686c71ea0f407edd6a6a (diff) | |
download | gcc-9e96f1e1b9731c4e1ef4fbbbf0997319973f0537.tar.gz |
2015-07-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/64079
* toplev.c (check_global_declaration): Use DECL_SOURCE_LOCATION
and "%qD" in warning_at instead of "%q+D" in warning.
/testsuite
2015-07-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/64079
* c-c++-common/Wunused-function-1.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226191 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 91be24f7bca..1bacb68889d 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -524,10 +524,11 @@ check_global_declaration (tree decl) && !DECL_STATIC_DESTRUCTOR (decl))) /* Otherwise, ask the language. */ && lang_hooks.decls.warn_unused_global (decl)) - warning ((TREE_CODE (decl) == FUNCTION_DECL) - ? OPT_Wunused_function - : OPT_Wunused_variable, - "%q+D defined but not used", decl); + warning_at (DECL_SOURCE_LOCATION (decl), + (TREE_CODE (decl) == FUNCTION_DECL) + ? OPT_Wunused_function + : OPT_Wunused_variable, + "%qD defined but not used", decl); } /* Compile an entire translation unit. Write a file of assembly |