&& DECL_ARTIFICIAL (olddecl))
return;
- if (permerror (input_location,
+ if (permerror (DECL_SOURCE_LOCATION (newdecl),
"%qD was declared %<extern%> and later %<static%>", newdecl))
inform (input_location, "previous declaration of %q+D", olddecl);
}
&& flag_exceptions
&& !comp_except_specs (new_exceptions, old_exceptions, ce_normal))
{
- error ("declaration of %qF has a different exception specifier",
+ error ("declaration of %q+F has a different exception specifier",
new_decl);
- error ("from previous declaration %q+F", old_decl);
+ inform (0, "from previous declaration %q+F", old_decl);
}
}
&& DECL_TEMPLATE_SPECIALIZATION (new_decl))
return true;
- error ("redeclaration %qD differs in %<constexpr%>", new_decl);
+ error ("redeclaration %q+D differs in %<constexpr%>", new_decl);
error ("from previous declaration %q+D", old_decl);
return false;
}
if (TREE_PURPOSE (t))
{
permerror (input_location,
- "redeclaration of %q#D may not have default "
+ "redeclaration of %q+#D may not have default "
"arguments", decl);
return;
}
/* If the built-in is not ansi, then programs can override
it even globally without an error. */
else if (! DECL_BUILT_IN (olddecl))
- warning (0, "library function %q#D redeclared as non-function %q#D",
+ warning (0, "library function %q#D redeclared as non-function %q+#D",
olddecl, newdecl);
else
- error ("declaration of %q#D conflicts with built-in "
+ error ("declaration of %q+#D conflicts with built-in "
"declaration %q#D", newdecl, olddecl);
return NULL_TREE;
}
/* A near match; override the builtin. */
if (TREE_PUBLIC (newdecl))
- warning (0, "new declaration %q#D ambiguates built-in "
+ warning (0, "new declaration %q+#D ambiguates built-in "
"declaration %q#D", newdecl, olddecl);
else
warning (OPT_Wshadow,
if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == TYPE_DECL
|| TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL)
{
- error ("conflicting declaration of template %q#D", newdecl);
+ error ("conflicting declaration of template %q+#D", newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration %q#D", olddecl);
return error_mark_node;
&& same_type_p (TREE_TYPE (TREE_TYPE (newdecl)),
TREE_TYPE (TREE_TYPE (olddecl))))
{
- error ("ambiguating new declaration %q#D", newdecl);
+ error ("ambiguating new declaration %q+#D", newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"old declaration %q#D", olddecl);
}
{
if (DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl))
{
- error ("conflicting declaration of C function %q#D",
+ error ("conflicting declaration of C function %q+#D",
newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration %q#D", olddecl);
&& compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)),
TYPE_ARG_TYPES (TREE_TYPE (olddecl))))
{
- error ("ambiguating new declaration of %q#D", newdecl);
+ error ("ambiguating new declaration of %q+#D", newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"old declaration %q#D", olddecl);
return error_mark_node;
}
else
{
- error ("conflicting declaration %q#D", newdecl);
+ error ("conflicting declaration %q+#D", newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration as %q#D", olddecl);
return error_mark_node;
A namespace-name defined at global scope shall not be
declared as the name of any other entity in any global scope
of the program. */
- error ("conflicting declaration of namespace %qD", newdecl);
+ error ("conflicting declaration of namespace %q+D", newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of namespace %qD here", olddecl);
return error_mark_node;
{
/* 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");
}
}
else
{
- error ("conflicting declaration of %q#D with %qL linkage",
+ error ("conflicting declaration of %q+#D with %qL linkage",
newdecl, DECL_LANGUAGE (newdecl));
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration with %qL linkage",
|| DECL_TEMPLATE_SPECIALIZATION (olddecl)))
{
if (warning (OPT_Wredundant_decls,
- "redundant redeclaration of %qD in same scope",
+ "redundant redeclaration of %q+D in same scope",
newdecl))
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of %qD", olddecl);
{
if (DECL_DELETED_FN (newdecl))
{
- error ("deleted definition of %qD", newdecl);
+ error ("deleted definition of %q+D", newdecl);
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of %qD", olddecl);
}
void baz4() throw(int, Int, char); // ... so this is a duplicate
void baz4() throw(Int, char){}
-void fna() throw(int, char); // { dg-error "" } to previous declaration
+void fna() throw(int, char); // { dg-message "" } to previous declaration
void fna() throw(int const, char); // { dg-error "" } declaration different exceptions // ERROR - to previous declaration
void fna() throw(int){} // { dg-error "" } declaration different exceptions
-void fnb() throw(int, char); // { dg-error "" } to previous declaration
+void fnb() throw(int, char); // { dg-message "" } to previous declaration
void fnb() throw(char){} // { dg-error "" } declaration different exceptions
-void fnc() throw(int, char); // { dg-error "" } to previous declaration
+void fnc() throw(int, char); // { dg-message "" } to previous declaration
void fnc() throw(char, int, float){} // { dg-error "" } declaration different exceptions
-void fnd() throw(); // { dg-error "" } to previous declaration
+void fnd() throw(); // { dg-message "" } to previous declaration
void fnd() throw(char){} // { dg-error "" } declaration different exceptions
-void fne() throw(char); // { dg-error "" } to previous declaration
+void fne() throw(char); // { dg-message "" } to previous declaration
void fne() throw(){} // { dg-error "" } declaration different exceptions
-void fnf(); // { dg-error "" } to previous declaration
+void fnf(); // { dg-message "" } to previous declaration
void fnf() throw(char){} // { dg-error "" } declaration different exceptions
-void fng() throw(char); // { dg-error "" } to previous declaration
+void fng() throw(char); // { dg-message "" } to previous declaration
void fng(){} // { dg-error "" } declaration different exceptions
-void fnh() throw(int, char); // { dg-error "" } to previous declaration
+void fnh() throw(int, char); // { dg-message "" } to previous declaration
void fnh() throw(int, float){} // { dg-error "" } declaration different exceptions
-void fni() throw(int, char); // { dg-error "" } to previous declaration
+void fni() throw(int, char); // { dg-message "" } to previous declaration
void fni() throw(float, char){} // { dg-error "" } declaration different exceptions
// [except.spec] 3, virtual function overriders shall throw a subset of the