TYPE_ATTRIBUTES (TREE_TYPE (decl)))))
{
if (! TREE_USED (decl))
- warning (OPT_Wunused_variable, "unused variable %q+D", decl);
+ warning_at (DECL_SOURCE_LOCATION (decl),
+ OPT_Wunused_variable, "unused variable %qD", decl);
else if (DECL_CONTEXT (decl) == current_function_decl
// For -Wunused-but-set-variable leave references alone.
&& TREE_CODE (TREE_TYPE (decl)) != REFERENCE_TYPE
&& errorcount == unused_but_set_errorcount)
{
- warning (OPT_Wunused_but_set_variable,
- "variable %q+D set but not used", decl);
+ warning_at (DECL_SOURCE_LOCATION (decl),
+ OPT_Wunused_but_set_variable,
+ "variable %qD set but not used", decl);
unused_but_set_errorcount = errorcount;
}
}
if (permerror (DECL_SOURCE_LOCATION (newdecl),
"%qD was declared %<extern%> and later %<static%>", newdecl))
- inform (input_location, "previous declaration of %q+D", olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration of %qD", olddecl);
}
/* NEW_DECL is a redeclaration of OLD_DECL; both are functions or
t && t != void_list_node; t = TREE_CHAIN (t))
if (TREE_PURPOSE (t))
{
- permerror (input_location,
- "redeclaration of %q+#D may not have default "
+ permerror (DECL_SOURCE_LOCATION (decl),
+ "redeclaration of %q#D may not have default "
"arguments", decl);
return;
}
&& DECL_UNINLINABLE (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
- if (warning (OPT_Wattributes, "function %q+D redeclared as inline",
- newdecl))
+ if (warning_at (DECL_SOURCE_LOCATION (newdecl),
+ OPT_Wattributes, "function %qD redeclared as inline",
+ newdecl))
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of %qD with attribute noinline",
olddecl);
&& DECL_UNINLINABLE (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
- if (warning (OPT_Wattributes, "function %q+D redeclared with "
- "attribute noinline", newdecl))
+ if (warning_at (DECL_SOURCE_LOCATION (newdecl),
+ OPT_Wattributes, "function %qD redeclared with "
+ "attribute noinline", newdecl))
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of %qD was inline",
olddecl);
/* A near match; override the builtin. */
if (TREE_PUBLIC (newdecl))
- warning (0, "new declaration %q+#D ambiguates built-in "
- "declaration %q#D", newdecl, olddecl);
+ warning_at (DECL_SOURCE_LOCATION (newdecl), 0,
+ "new declaration %q#D ambiguates built-in "
+ "declaration %q#D", newdecl, olddecl);
else
warning (OPT_Wshadow,
DECL_BUILT_IN (olddecl)
{
error_at (DECL_SOURCE_LOCATION (newdecl), errmsg, newdecl);
if (DECL_NAME (olddecl) != NULL_TREE)
- inform (input_location,
+ inform (DECL_SOURCE_LOCATION (olddecl),
(DECL_INITIAL (olddecl) && namespace_bindings_p ())
- ? G_("%q+#D previously defined here")
- : G_("%q+#D previously declared here"), olddecl);
+ ? G_("%q#D previously defined here")
+ : G_("%q#D previously declared here"), olddecl);
return error_mark_node;
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
{
/* Prototype decl follows defn w/o prototype. */
if (warning_at (DECL_SOURCE_LOCATION (newdecl), 0,
- "prototype specified for %q+#D", newdecl))
+ "prototype specified for %q#D", newdecl))
inform (DECL_SOURCE_LOCATION (olddecl),
"previous non-prototype definition here");
}
&& (! DECL_TEMPLATE_SPECIALIZATION (newdecl)
|| DECL_TEMPLATE_SPECIALIZATION (olddecl)))
{
- if (warning (OPT_Wredundant_decls,
- "redundant redeclaration of %q+D in same scope",
- newdecl))
+ if (warning_at (DECL_SOURCE_LOCATION (newdecl),
+ OPT_Wredundant_decls,
+ "redundant redeclaration of %qD in same scope",
+ newdecl))
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of %qD", olddecl);
}
if (complained)
{
if (problem > 1)
- inform (input_location,
- " crosses initialization of %q+#D", new_decls);
+ inform (DECL_SOURCE_LOCATION (new_decls),
+ " crosses initialization of %q#D", new_decls);
else
- inform (input_location, " enters scope of %q+#D which has "
+ inform (DECL_SOURCE_LOCATION (new_decls),
+ " enters scope of %q#D which has "
"non-trivial destructor", new_decls);
}
}
if (ent->in_try_scope || ent->in_catch_scope
|| ent->in_omp_scope || !vec_safe_is_empty (ent->bad_decls))
{
- complained = permerror (input_location, "jump to label %q+D", decl);
+ complained = permerror (DECL_SOURCE_LOCATION (decl),
+ "jump to label %qD", decl);
if (complained)
inform (input_location, " from here");
identified = true;
else if (complained)
{
if (u > 1)
- inform (input_location, " skips initialization of %q+#D", bad);
+ inform (DECL_SOURCE_LOCATION (bad),
+ " skips initialization of %q#D", bad);
else
- inform (input_location, " enters scope of %q+#D which has "
+ inform (DECL_SOURCE_LOCATION (bad),
+ " enters scope of %q#D which has "
"non-trivial destructor", bad);
}
}
{
if (!identified)
{
- complained = permerror (input_location,
- "jump to label %q+D", decl);
+ complained = permerror (DECL_SOURCE_LOCATION (decl),
+ "jump to label %qD", decl);
if (complained)
inform (input_location, " from here");
identified = true;
&& DECL_DECLARED_INLINE_P (decl)
&& DECL_UNINLINABLE (decl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (decl)))
- warning (0, "inline function %q+D given attribute noinline", decl);
+ warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "inline function %qD given attribute noinline", decl);
if (TYPE_P (context) && COMPLETE_TYPE_P (complete_type (context)))
{
inform (DECL_SOURCE_LOCATION (defaulted_ctor),
"constructor is not user-provided because it is "
"explicitly defaulted in the class body");
- inform (0, "and the implicitly-defined constructor does not "
- "initialize %q+#D", field);
+ inform (DECL_SOURCE_LOCATION (field),
+ "and the implicitly-defined constructor does not "
+ "initialize %q#D", field);
}
}
}
if (DECL_DECLARED_INLINE_P (decl1)
&& lookup_attribute ("noinline", attrs))
- warning (0, "inline function %q+D given attribute noinline", decl1);
+ warning_at (DECL_SOURCE_LOCATION (decl1), 0,
+ "inline function %qD given attribute noinline", decl1);
/* Handle gnu_inline attribute. */
if (GNU_INLINE_P (decl1))
}
if (context == NULL)
- warning (OPT_Wmissing_declarations,
- "no previous declaration for %q+D", decl1);
+ warning_at (DECL_SOURCE_LOCATION (decl1),
+ OPT_Wmissing_declarations,
+ "no previous declaration for %qD", decl1);
}
decl1 = olddecl;
&& TREE_CODE (TREE_TYPE (decl)) != REFERENCE_TYPE
&& (!CLASS_TYPE_P (TREE_TYPE (decl))
|| !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl))))
- warning (OPT_Wunused_but_set_parameter,
- "parameter %q+D set but not used", decl);
+ warning_at (DECL_SOURCE_LOCATION (decl),
+ OPT_Wunused_but_set_parameter,
+ "parameter %qD set but not used", decl);
unused_but_set_errorcount = errorcount;
}