{
if (warning (OPT_Wattributes, "function %q+D redeclared as inline",
newdecl))
- inform (input_location, "previous declaration of %q+D "
- "with attribute noinline", olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration of %qD with attribute noinline",
+ olddecl);
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& DECL_UNINLINABLE (newdecl)
{
if (warning (OPT_Wattributes, "function %q+D redeclared with "
"attribute noinline", newdecl))
- inform (input_location, "previous declaration of %q+D was inline",
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration of %qD was inline",
olddecl);
}
}
warning (0, "library function %q#D redeclared as non-function %q#D",
olddecl, newdecl);
else
- {
- error ("declaration of %q#D", newdecl);
- error ("conflicts with built-in declaration %q#D",
- olddecl);
- }
+ error ("declaration of %q#D conflicts with built-in "
+ "declaration %q#D", newdecl, olddecl);
return NULL_TREE;
}
else if (DECL_OMP_DECLARE_REDUCTION_P (olddecl))
gcc_assert (DECL_OMP_DECLARE_REDUCTION_P (newdecl));
error_at (DECL_SOURCE_LOCATION (newdecl),
"redeclaration of %<pragma omp declare reduction%>");
- error_at (DECL_SOURCE_LOCATION (olddecl),
- "previous %<pragma omp declare reduction%> declaration");
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous %<pragma omp declare reduction%> declaration");
return error_mark_node;
}
else if (!types_match)
/* A near match; override the builtin. */
if (TREE_PUBLIC (newdecl))
- {
- warning (0, "new declaration %q#D", newdecl);
- warning (0, "ambiguates built-in declaration %q#D",
- olddecl);
- }
+ warning (0, "new declaration %q#D ambiguates built-in "
+ "declaration %q#D", newdecl, olddecl);
else
warning (OPT_Wshadow,
DECL_BUILT_IN (olddecl)
error ("%q#D redeclared as different kind of symbol", newdecl);
if (TREE_CODE (olddecl) == TREE_LIST)
olddecl = TREE_VALUE (olddecl);
- inform (input_location, "previous declaration of %q+#D", olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration %q#D", olddecl);
return error_mark_node;
}
if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == TYPE_DECL
|| TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL)
{
- error ("declaration of template %q#D", newdecl);
- error ("conflicts with previous declaration %q+#D", olddecl);
+ error ("conflicting declaration of template %q#D", newdecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration %q#D", olddecl);
return error_mark_node;
}
else if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == FUNCTION_DECL
&& same_type_p (TREE_TYPE (TREE_TYPE (newdecl)),
TREE_TYPE (TREE_TYPE (olddecl))))
{
- error ("new declaration %q#D", newdecl);
- error ("ambiguates old declaration %q+#D", olddecl);
+ error ("ambiguating new declaration %q#D", newdecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "old declaration %q#D", olddecl);
}
return NULL_TREE;
}
{
if (DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl))
{
- error ("declaration of C function %q#D conflicts with",
+ error ("conflicting declaration of C function %q#D",
newdecl);
- error ("previous declaration %q+#D here", olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration %q#D", olddecl);
return NULL_TREE;
}
/* For function versions, params and types match, but they
&& compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)),
TYPE_ARG_TYPES (TREE_TYPE (olddecl))))
{
- error ("new declaration %q#D", newdecl);
- error ("ambiguates old declaration %q+#D", olddecl);
+ error ("ambiguating new declaration of %q#D", newdecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "old declaration %q#D", olddecl);
return error_mark_node;
}
else
else
{
error ("conflicting declaration %q#D", newdecl);
- inform (input_location,
- "%q+D has a previous declaration as %q#D", olddecl, olddecl);
+ 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 ("declaration of namespace %qD conflicts with", newdecl);
- error ("previous declaration of namespace %q+D here", olddecl);
+ error ("conflicting declaration of namespace %qD", newdecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration of namespace %qD here", olddecl);
return error_mark_node;
}
else
&& prototype_p (TREE_TYPE (newdecl)))
{
/* Prototype decl follows defn w/o prototype. */
- warning_at (input_location, 0, "prototype for %q+#D", newdecl);
- warning_at (DECL_SOURCE_LOCATION (olddecl), 0,
- "follows non-prototype definition here");
+ warning_at (DECL_SOURCE_LOCATION (newdecl), 0,
+ "prototype specified for %q#D", newdecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous non-prototype definition here");
}
else if (VAR_OR_FUNCTION_DECL_P (olddecl)
&& DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl))
}
else
{
- error ("previous declaration of %q+#D with %qL linkage",
- olddecl, DECL_LANGUAGE (olddecl));
- error ("conflicts with new declaration with %qL linkage",
- DECL_LANGUAGE (newdecl));
+ error ("conflicting declaration of %q#D with %qL linkage",
+ newdecl, DECL_LANGUAGE (newdecl));
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration with %qL linkage",
+ DECL_LANGUAGE (olddecl));
}
}
if (1 == simple_cst_equal (TREE_PURPOSE (t1),
TREE_PURPOSE (t2)))
{
- permerror (input_location,
- "default argument given for parameter %d "
- "of %q#D", i, newdecl);
- permerror (input_location,
- "after previous specification in %q+#D",
- olddecl);
+ if (permerror (input_location,
+ "default argument given for parameter "
+ "%d of %q#D", i, newdecl))
+ permerror (DECL_SOURCE_LOCATION (olddecl),
+ "previous specification in %q#D here",
+ olddecl);
}
else
{
error ("default argument given for parameter %d "
"of %q#D", i, newdecl);
- error ("after previous specification in %q+#D",
- olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous specification in %q#D here",
+ olddecl);
}
}
}
if (warning (OPT_Wredundant_decls,
"redundant redeclaration of %qD in same scope",
newdecl))
- inform (input_location, "previous declaration of %q+D", olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration of %qD", olddecl);
}
if (!(DECL_TEMPLATE_INSTANTIATION (olddecl)
if (DECL_DELETED_FN (newdecl))
{
error ("deleted definition of %qD", newdecl);
- error ("after previous declaration %q+D", olddecl);
+ inform (DECL_SOURCE_LOCATION (olddecl),
+ "previous declaration of %qD", olddecl);
}
DECL_DELETED_FN (newdecl) |= DECL_DELETED_FN (olddecl);
}
namespace N1
{
- #pragma omp declare reduction (+: ::S: omp_out.s *= omp_in.s) // { dg-error "previous" }
+ #pragma omp declare reduction (+: ::S: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (+: S: omp_out.s += omp_in.s) // { dg-error "redeclaration of" }
void
f5 ()
{
- #pragma omp declare reduction (f5: S: omp_out.s *= omp_in.s) // { dg-error "previous" }
+ #pragma omp declare reduction (f5: S: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (f5: ::S: omp_out.s += omp_in.s) // { dg-error "redeclaration of" }
}
}
namespace N3
{
- #pragma omp declare reduction (+: ::S: omp_out.s *= omp_in.s) // { dg-error "previous" }
+ #pragma omp declare reduction (+: ::S: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (+: T: omp_out.t += omp_in.t)
#pragma omp declare reduction (+: S: omp_out.s += omp_in.s) // { dg-error "redeclaration of" }
- #pragma omp declare reduction (n3: long: omp_out += omp_in) // { dg-error "previous" }
+ #pragma omp declare reduction (n3: long: omp_out += omp_in) // { dg-message "previous" }
#pragma omp declare reduction (n3: long int: omp_out += omp_in) // { dg-error "redeclaration of" }
#pragma omp declare reduction (n3: short unsigned: omp_out += omp_in)
#pragma omp declare reduction (n3: short int: omp_out += omp_in)
f6 ()
{
#pragma omp declare reduction (f6: T: omp_out.t += omp_in.t)
- #pragma omp declare reduction (f6: S: omp_out.s *= omp_in.s) // { dg-error "previous" }
+ #pragma omp declare reduction (f6: S: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (f6: ::S: omp_out.s += omp_in.s) // { dg-error "redeclaration of" }
- #pragma omp declare reduction (f6: long: omp_out += omp_in) // { dg-error "previous" }
+ #pragma omp declare reduction (f6: long: omp_out += omp_in) // { dg-message "previous" }
#pragma omp declare reduction (f6: long int: omp_out += omp_in) // { dg-error "redeclaration of" }
#pragma omp declare reduction (f6: short unsigned: omp_out += omp_in)
#pragma omp declare reduction (f6: short int: omp_out += omp_in)
int
f7 ()
{
- #pragma omp declare reduction (f7: T: omp_out.s *= omp_in.s) // { dg-error "previous" }
+ #pragma omp declare reduction (f7: T: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (f7: T: omp_out.s += omp_in.s) // { dg-error "redeclaration of" }
return 0;
}
f8 ()
{
#pragma omp declare reduction (f8: T: omp_out.t += omp_in.t)
- #pragma omp declare reduction (f8: U: omp_out.s *= omp_in.s) // { dg-error "previous" }
+ #pragma omp declare reduction (f8: U: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (f8: ::S: omp_out.s += omp_in.s) // { dg-error "redeclaration of" }
- #pragma omp declare reduction (f8: long: omp_out += omp_in) // { dg-error "previous" }
+ #pragma omp declare reduction (f8: long: omp_out += omp_in) // { dg-message "previous" }
#pragma omp declare reduction (f8: long int: omp_out += omp_in) // { dg-error "redeclaration of" }
#pragma omp declare reduction (f8: short unsigned: omp_out += omp_in)
#pragma omp declare reduction (f8: short int: omp_out += omp_in)