/* Effective C++ rule 12 requires that all data members be
initialized. */
if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE)
- warning (OPT_Weffc__, "%J%qD should be initialized in the member initialization "
- "list", current_function_decl, member);
+ warning_at (DECL_SOURCE_LOCATION (current_function_decl), OPT_Weffc__,
+ "%qD should be initialized in the member initialization list",
+ member);
/* Get an lvalue for the data member. */
decl = build_class_member_access_expr (current_class_ref, member,
else
{
if (TREE_CODE (type) == REFERENCE_TYPE)
- permerror (input_location, "%Jvalue-initialization of %q#D, "
- "which has reference type",
- current_function_decl, member);
+ permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "value-initialization of %q#D, which has reference type",
+ member);
else
{
init = build2 (INIT_EXPR, type, decl, build_value_init (type));
&& !type_has_user_provided_default_constructor (type))
/* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
vtable; still give this diagnostic. */
- permerror (input_location, "%Juninitialized member %qD with %<const%> type %qT",
- current_function_decl, member, type);
+ permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "uninitialized member %qD with %<const%> type %qT",
+ member, type);
finish_expr_stmt (build_aggr_init (decl, init, 0,
tf_warning_or_error));
}
{
/* member traversal: note it leaves init NULL */
if (TREE_CODE (type) == REFERENCE_TYPE)
- permerror (input_location, "%Juninitialized reference member %qD",
- current_function_decl, member);
+ permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "uninitialized reference member %qD",
+ member);
else if (CP_TYPE_CONST_P (type))
- permerror (input_location, "%Juninitialized member %qD with %<const%> type %qT",
- current_function_decl, member, type);
+ permerror (DECL_SOURCE_LOCATION (current_function_decl),
+ "uninitialized member %qD with %<const%> type %qT",
+ member, type);
}
else if (TREE_CODE (init) == TREE_LIST)
/* There was an explicit member initialization. Do some work
warning (OPT_Wreorder, " %q+#D", subobject);
else
warning (OPT_Wreorder, " base %qT", subobject);
- warning (OPT_Wreorder, "%J when initialized here", current_function_decl);
+ warning_at (DECL_SOURCE_LOCATION (current_function_decl),
+ OPT_Wreorder, " when initialized here");
}
/* Look again, from the beginning of the list. */
if (TREE_VALUE (subobject_init))
{
if (TREE_CODE (subobject) == FIELD_DECL)
- error ("%Jmultiple initializations given for %qD",
- current_function_decl, subobject);
+ error_at (DECL_SOURCE_LOCATION (current_function_decl),
+ "multiple initializations given for %qD",
+ subobject);
else
- error ("%Jmultiple initializations given for base %qT",
- current_function_decl, subobject);
+ error_at (DECL_SOURCE_LOCATION (current_function_decl),
+ "multiple initializations given for base %qT",
+ subobject);
}
/* Record the initialization. */
if (same_type_p (last_field_type, field_type))
{
if (TREE_CODE (field_type) == UNION_TYPE)
- error ("%Jinitializations for multiple members of %qT",
- current_function_decl, last_field_type);
+ error_at (DECL_SOURCE_LOCATION (current_function_decl),
+ "initializations for multiple members of %qT",
+ last_field_type);
done = 1;
break;
}
if (extra_warnings && !arguments
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl)
&& type_has_user_nondefault_constructor (BINFO_TYPE (subobject)))
- warning (OPT_Wextra, "%Jbase class %q#T should be explicitly initialized in the "
- "copy constructor",
- current_function_decl, BINFO_TYPE (subobject));
+ warning_at (DECL_SOURCE_LOCATION (current_function_decl), OPT_Wextra,
+ "base class %q#T should be explicitly initialized in the "
+ "copy constructor",
+ BINFO_TYPE (subobject));
/* Initialize the base. */
if (BINFO_VIRTUAL_P (subobject))