+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
--- /dev/null
+/* 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
&& !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