diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-07-24 20:20:13 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-07-24 20:20:13 +0000 |
commit | 274d8c11f37abd11a3a43b5bd129c194b0daeafc (patch) | |
tree | 5546702f4370a0141cb4902e6646f8d83f0e1492 /gcc/toplev.c | |
parent | 36b7d827dbcae9727c83ca10424d657109caa12b (diff) | |
download | gcc-274d8c11f37abd11a3a43b5bd129c194b0daeafc.zip gcc-274d8c11f37abd11a3a43b5bd129c194b0daeafc.tar.gz gcc-274d8c11f37abd11a3a43b5bd129c194b0daeafc.tar.bz2 |
re PR c++/64079 (%+D in diagnostics breaks pragma GCC diagnostic)
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.
From-SVN: r226191
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 91be24f..1bacb68 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 |