Commit 274d8c11 by Manuel López-Ibáñez Committed by Paolo Carlini

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
parent 36b7d827
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.
2015-07-24 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_call_abi_override): Call ix86_function_abi.
......
2015-07-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/64079
* c-c++-common/Wunused-function-1.c: New.
2015-07-24 Tom de Vries <tom@codesourcery.com>
* gcc.dg/parloops-exit-first-loop-alt-2.c: Use debug print for
......
/* PR c++/64079 */
/* { dg-do compile } */
/* { dg-options "-Wunused-function" } */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static void bar() {}
#pragma GCC diagnostic pop
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment