{
if (DECL_INITIAL (olddecl))
inform (DECL_SOURCE_LOCATION (olddecl),
- "previous definition of %q+D was here", olddecl);
+ "previous definition of %qD was here", olddecl);
else
inform (DECL_SOURCE_LOCATION (olddecl),
"previous declaration of %qD was here", olddecl);
do_default);
if (failure == 1)
{
- error ("initializer fails to determine size of %qD", decl);
+ error_at (EXPR_LOC_OR_LOC (initializer,
+ DECL_SOURCE_LOCATION (decl)),
+ "initializer fails to determine size of %qD", decl);
}
else if (failure == 2)
{
if (do_default)
{
- error ("array size missing in %qD", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "array size missing in %qD", decl);
}
/* If a `static' var's size isn't known, make it extern as
well as static, so it does not get allocated. If it's not
}
else if (failure == 3)
{
- error ("zero-size array %qD", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "zero-size array %qD", decl);
}
}
/* An automatic variable with an incomplete type: that is an error.
Don't talk about array types here, since we took care of that
message in grokdeclarator. */
- error ("storage size of %qD isn%'t known", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "storage size of %qD isn%'t known", decl);
TREE_TYPE (decl) = error_mark_node;
}
#if 0
constant_expression_warning (DECL_SIZE (decl));
else
{
- error ("storage size of %qD isn%'t constant", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "storage size of %qD isn%'t constant", decl);
TREE_TYPE (decl) = error_mark_node;
}
}
if (!COMPLETE_TYPE_P (complete_type (element_type)))
{
if (decl)
- error ("elements of array %q#D have incomplete type", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "elements of array %q#D have incomplete type", decl);
else
error ("elements of array %q#T have incomplete type", type);
return true;
}
else if (!COMPLETE_TYPE_P (type))
{
- error ("%q#D has incomplete type", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%q#D has incomplete type", decl);
TREE_TYPE (decl) = error_mark_node;
return NULL_TREE;
}
}
else if (init_len != 1 && TREE_CODE (type) != COMPLEX_TYPE)
{
- error ("scalar object %qD requires one element in initializer",
- decl);
+ error_at (EXPR_LOC_OR_LOC (init, DECL_SOURCE_LOCATION (decl)),
+ "scalar object %qD requires one element in "
+ "initializer", decl);
TREE_TYPE (decl) = error_mark_node;
return NULL_TREE;
}
{
/* Don't reshape if the class has constructors. */
if (cxx_dialect == cxx98)
- error ("in C++98 %qD must be initialized by constructor, "
- "not by %<{...}%>",
- decl);
+ error_at (EXPR_LOC_OR_LOC (init, DECL_SOURCE_LOCATION (decl)),
+ "in C++98 %qD must be initialized by "
+ "constructor, not by %<{...}%>",
+ decl);
}
else if (VECTOR_TYPE_P (type) && TYPE_VECTOR_OPAQUE (type))
{
&& DECL_INITIAL (decl)
&& TREE_CODE (DECL_INITIAL (decl)) == STRING_CST
&& PAREN_STRING_LITERAL_P (DECL_INITIAL (decl)))
- warning (0, "array %qD initialized by parenthesized string literal %qE",
- decl, DECL_INITIAL (decl));
+ warning_at (EXPR_LOC_OR_LOC (DECL_INITIAL (decl),
+ DECL_SOURCE_LOCATION (decl)),
+ 0, "array %qD initialized by parenthesized "
+ "string literal %qE",
+ decl, DECL_INITIAL (decl));
init = NULL;
}
}
&& tag_code != typename_type)
{
error ("%qT referred to as %qs", type, tag_name (tag_code));
- inform (input_location, "%q+T has a previous declaration here", type);
+ inform (location_of (type), "%qT has a previous declaration here", type);
return error_mark_node;
}
else if (TREE_CODE (type) != ENUMERAL_TYPE
&& tag_code == enum_type)
{
error ("%qT referred to as enum", type);
- inform (input_location, "%q+T has a previous declaration here", type);
+ inform (location_of (type), "%qT has a previous declaration here", type);
return error_mark_node;
}
else if (!allow_template_p