if (code == MINUS_EXPR && v_binfo)
{
- error ("cannot convert from base `%T' to derived type `%T' via virtual base `%T'",
+ error ("cannot convert from base %qT to derived type %qT via virtual base %qT",
BINFO_TYPE (binfo), BINFO_TYPE (d_binfo), BINFO_TYPE (v_binfo));
return error_mark_node;
}
if (TYPE_FOR_JAVA (type))
error (DECL_ARTIFICIAL (method)
- ? "Java class '%T' cannot have an implicit non-trivial destructor"
- : "Java class '%T' cannot have a destructor",
+ ? "Java class %qT cannot have an implicit non-trivial destructor"
+ : "Java class %qT cannot have a destructor",
DECL_CONTEXT (method));
}
else
if (TREE_VALUE (elem) != access)
{
if (TREE_CODE (TREE_TYPE (fdecl)) == FUNCTION_DECL)
- cp_error_at ("conflicting access specifications for method `%D', ignored", TREE_TYPE (fdecl));
+ cp_error_at ("conflicting access specifications for method"
+ " %qD, ignored", TREE_TYPE (fdecl));
else
- error ("conflicting access specifications for field `%E', ignored",
+ error ("conflicting access specifications for field %qE, ignored",
DECL_NAME (fdecl));
}
else
if (constructor_name_p (name, ctype))
{
- cp_error_at ("`%D' names constructor", using_decl);
+ cp_error_at ("%qD names constructor", using_decl);
return;
}
if (constructor_name_p (name, t))
{
- cp_error_at ("`%D' invalid in `%T'", using_decl, t);
+ cp_error_at ("%qD invalid in %qT", using_decl, t);
return;
}
if (!fdecl)
{
- cp_error_at ("no members matching `%D' in `%#T'", using_decl, ctype);
+ cp_error_at ("no members matching %qD in %q#T", using_decl, ctype);
return;
}
the same name already present in the current class. */;
else
{
- cp_error_at ("`%D' invalid in `%#T'", using_decl, t);
- cp_error_at (" because of local method `%#D' with same name",
+ cp_error_at ("%qD invalid in %q#T", using_decl, t);
+ cp_error_at (" because of local method %q#D with same name",
OVL_CURRENT (old_value));
return;
}
}
else if (!DECL_ARTIFICIAL (old_value))
{
- cp_error_at ("`%D' invalid in `%#T'", using_decl, t);
- cp_error_at (" because of local member `%#D' with same name", old_value);
+ cp_error_at ("%qD invalid in %q#T", using_decl, t);
+ cp_error_at (" because of local member %q#D with same name", old_value);
return;
}
dtor is handled in finish_struct_1. */
if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype)
&& TYPE_HAS_DESTRUCTOR (basetype))
- warning ("base class `%#T' has a non-virtual destructor",
- basetype);
+ warning ("base class %q#T has a non-virtual destructor", basetype);
/* If the base class doesn't have copy constructors or
assignment operators that take const references, then the
{
*cant_have_default_ctor_p = 1;
if (! TYPE_HAS_CONSTRUCTOR (t))
- pedwarn ("base `%T' with only non-default constructor in class without a constructor",
- basetype);
+ pedwarn ("base %qT with only non-default constructor in class "
+ "without a constructor",
+ basetype);
}
if (BINFO_VIRTUAL_P (base_binfo))
}
if (!has_nonprivate_method)
{
- warning ("all member functions in class `%T' are private", t);
+ warning ("all member functions in class %qT are private", t);
return;
}
}
if (TYPE_HAS_DESTRUCTOR (t)
&& TREE_PRIVATE (CLASSTYPE_DESTRUCTORS (t)))
{
- warning ("`%#T' only defines a private destructor and has no friends",
+ warning ("%q#T only defines a private destructor and has no friends",
t);
return;
}
if (nonprivate_ctor == 0)
{
- warning ("`%#T' only defines private constructors and has no friends",
- t);
+ warning ("%q#T only defines private constructors and has no friends",
+ t);
return;
}
}
/* If there was no winner, issue an error message. */
if (!ffod.candidates || TREE_CHAIN (ffod.candidates))
{
- error ("no unique final overrider for `%D' in `%T'", fn,
+ error ("no unique final overrider for %qD in %qT", fn,
BINFO_TYPE (derived));
return error_mark_node;
}
while (base_fndecls)
{
/* Here we know it is a hider, and no overrider exists. */
- cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
- cp_warning_at (" by `%D'", fns);
+ cp_warning_at ("%qD was hidden", TREE_VALUE (base_fndecls));
+ cp_warning_at (" by %qD", fns);
base_fndecls = TREE_CHAIN (base_fndecls);
}
}
if (TREE_CODE (elt) != FIELD_DECL)
{
- cp_pedwarn_at ("`%#D' invalid; an anonymous union can only have non-static data members",
+ cp_pedwarn_at ("%q#D invalid; an anonymous union can "
+ "only have non-static data members",
elt);
continue;
}
if (TREE_PRIVATE (elt))
- cp_pedwarn_at ("private member `%#D' in anonymous union",
+ cp_pedwarn_at ("private member %q#D in anonymous union",
elt);
else if (TREE_PROTECTED (elt))
- cp_pedwarn_at ("protected member `%#D' in anonymous union",
+ cp_pedwarn_at ("protected member %q#D in anonymous union",
elt);
TREE_PRIVATE (elt) = TREE_PRIVATE (field);
else
{
if (warn_abi && virtual_dtor)
- warning ("vtable layout for class `%T' may not be ABI-compliant "
+ warning ("vtable layout for class %qT may not be ABI-compliant "
"and may change in a future version of GCC due to implicit "
"virtual destructor",
t);
if (DECL_INITIAL (field)
&& ! INTEGRAL_TYPE_P (TREE_TYPE (field)))
{
- cp_error_at ("bit-field `%#D' with non-integral type", field);
+ cp_error_at ("bit-field %q#D with non-integral type", field);
w = error_mark_node;
}
if (TREE_CODE (w) != INTEGER_CST)
{
- cp_error_at ("bit-field `%D' width not an integer constant",
+ cp_error_at ("bit-field %qD width not an integer constant",
field);
w = error_mark_node;
}
else if (tree_int_cst_sgn (w) < 0)
{
- cp_error_at ("negative width in bit-field `%D'", field);
+ cp_error_at ("negative width in bit-field %qD", field);
w = error_mark_node;
}
else if (integer_zerop (w) && DECL_NAME (field) != 0)
{
- cp_error_at ("zero width for bit-field `%D'", field);
+ cp_error_at ("zero width for bit-field %qD", field);
w = error_mark_node;
}
else if (compare_tree_int (w, TYPE_PRECISION (type)) > 0
&& TREE_CODE (type) != ENUMERAL_TYPE
&& TREE_CODE (type) != BOOLEAN_TYPE)
- cp_warning_at ("width of `%D' exceeds its type", field);
+ cp_warning_at ("width of %qD exceeds its type", field);
else if (TREE_CODE (type) == ENUMERAL_TYPE
&& (0 > compare_tree_int (w,
min_precision (TYPE_MIN_VALUE (type),
min_precision
(TYPE_MAX_VALUE (type),
TYPE_UNSIGNED (type)))))
- cp_warning_at ("`%D' is too small to hold all values of `%#T'",
+ cp_warning_at ("%qD is too small to hold all values of %q#T",
field, type);
}
if (TREE_CODE (t) == UNION_TYPE)
{
if (TYPE_NEEDS_CONSTRUCTING (type))
- cp_error_at ("member `%#D' with constructor not allowed in union",
+ cp_error_at ("member %q#D with constructor not allowed in union",
field);
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
- cp_error_at ("member `%#D' with destructor not allowed in union",
+ cp_error_at ("member %q#D with destructor not allowed in union",
field);
if (TYPE_HAS_COMPLEX_ASSIGN_REF (type))
- cp_error_at ("member `%#D' with copy assignment operator not allowed in union",
+ cp_error_at ("member %q#D with copy assignment operator not allowed in union",
field);
}
else
/* `build_class_init_list' does not recognize
non-FIELD_DECLs. */
if (TREE_CODE (t) == UNION_TYPE && any_default_members != 0)
- error ("multiple fields in union `%T' initialized", t);
+ error ("multiple fields in union %qT initialized", t);
*any_default_members = 1;
}
}
{
if (!pod_type_p (TREE_TYPE (x)) && !TYPE_PACKED (TREE_TYPE (x)))
cp_warning_at
- ("ignoring packed attribute on unpacked non-POD field `%#D'",
+ ("ignoring packed attribute on unpacked non-POD field %q#D",
x);
else
DECL_PACKED (x) = 1;
reference type, the program is ill-formed. */
if (TREE_CODE (x) == VAR_DECL)
{
- cp_error_at ("`%D' may not be static because it is a member of a union", x);
+ cp_error_at ("%qD may not be static because it is a member of a union", x);
continue;
}
if (TREE_CODE (type) == REFERENCE_TYPE)
{
- cp_error_at ("`%D' may not have reference type `%T' because it is a member of a union",
+ cp_error_at ("%qD may not have reference type `%T' because it is a member of a union",
x, type);
continue;
}
/* ``A local class cannot have static data members.'' ARM 9.4 */
if (current_function_decl && TREE_STATIC (x))
- cp_error_at ("field `%D' in local class cannot be static", x);
+ cp_error_at ("field %qD in local class cannot be static", x);
/* Perform error checking that did not get done in
grokdeclarator. */
if (TREE_CODE (type) == FUNCTION_TYPE)
{
- cp_error_at ("field `%D' invalidly declared function type",
- x);
+ cp_error_at ("field %qD invalidly declared function type", x);
type = build_pointer_type (type);
TREE_TYPE (x) = type;
}
else if (TREE_CODE (type) == METHOD_TYPE)
{
- cp_error_at ("field `%D' invalidly declared method type", x);
+ cp_error_at ("field %qD invalidly declared method type", x);
type = build_pointer_type (type);
TREE_TYPE (x) = type;
}
if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
&& extra_warnings)
- cp_warning_at ("non-static reference `%#D' in class without a constructor", x);
+ cp_warning_at ("non-static reference %q#D in class without a constructor", x);
}
type = strip_array_types (type);
if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
&& extra_warnings)
- cp_warning_at ("non-static const member `%#D' in class without a constructor", x);
+ cp_warning_at ("non-static const member %q#D in class without a constructor", x);
}
/* A field that is pseudo-const makes the structure likewise. */
else if (CLASS_TYPE_P (type))
different name from the class iff the class has a
user-defined constructor. */
if (constructor_name_p (DECL_NAME (x), t) && TYPE_HAS_CONSTRUCTOR (t))
- cp_pedwarn_at ("field `%#D' with same name as class", x);
+ cp_pedwarn_at ("field %q#D with same name as class", x);
/* We set DECL_C_BIT_FIELD in grokbitfield.
If the type and width are valid, we'll also set DECL_BIT_FIELD. */
&& TYPE_HAS_DESTRUCTOR (t)
&& !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
{
- warning ("`%#T' has pointer data members", t);
+ warning ("%q#T has pointer data members", t);
if (! TYPE_HAS_INIT_REF (t))
{
- warning (" but does not override `%T(const %T&)'", t, t);
+ warning (" but does not override %<%T(const %T&)%>", t, t);
if (! TYPE_HAS_ASSIGN_REF (t))
- warning (" or `operator=(const %T&)'", t);
+ warning (" or %<operator=(const %T&)%>", t);
}
else if (! TYPE_HAS_ASSIGN_REF (t))
- warning (" but does not override `operator=(const %T&)'", t);
+ warning (" but does not override %<operator=(const %T&)%>", t);
}
propagate_binfo_offsets
(binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo)));
else if (warn_abi)
- warning ("offset of empty base `%T' may not be ABI-compliant and may"
+ warning ("offset of empty base %qT may not be ABI-compliant and may"
"change in a future version of GCC",
BINFO_TYPE (binfo));
}
if (abi_version_at_least (2))
CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
else if (warn_abi)
- warning ("class `%T' will be considered nearly empty in a "
+ warning ("class %qT will be considered nearly empty in a "
"future version of GCC", t);
}
}
{
check_for_override (x, t);
if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x))
- cp_error_at ("initializer specified for non-virtual method `%D'", x);
+ cp_error_at ("initializer specified for non-virtual method %qD", x);
/* The name of the field is the original field name
Save this in auxiliary field for later overloading. */
if (DECL_VINDEX (x))
CLASSTYPE_ALIGN (basetype)),
bitsize_unit_node),
BINFO_OFFSET (vbase))))
- warning ("offset of virtual base `%T' is not ABI-compliant and may change in a future version of GCC",
+ warning ("offset of virtual base %qT is not ABI-compliant and "
+ "may change in a future version of GCC",
basetype);
first_vbase = false;
basetype = BINFO_TYPE (base_binfo);
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL))
- warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
+ warning ("direct base %qT inaccessible in %qT due to ambiguity",
basetype, t);
}
basetype = BINFO_TYPE (binfo);
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL))
- warning ("virtual base `%T' inaccessible in `%T' due to ambiguity",
+ warning ("virtual base %qT inaccessible in %qT due to ambiguity",
basetype, t);
}
}
&& DECL_MODE (field) != TYPE_MODE (type))
/* Versions of G++ before G++ 3.4 did not reset the
DECL_MODE. */
- warning ("the offset of `%D' may not be ABI-compliant and may "
+ warning ("the offset of %qD may not be ABI-compliant and may "
"change in a future version of GCC", field);
}
else
&& !integer_zerop (size_binop (TRUNC_MOD_EXPR,
DECL_FIELD_BIT_OFFSET (field),
bitsize_unit_node)))
- cp_warning_at ("offset of `%D' is not ABI-compliant and may change in a future version of GCC",
+ cp_warning_at ("offset of %qD is not ABI-compliant and may "
+ "change in a future version of GCC",
field);
/* G++ used to use DECL_FIELD_OFFSET as if it were the byte
&& !tree_int_cst_equal (DECL_FIELD_OFFSET (field),
byte_position (field))
&& contains_empty_class_p (TREE_TYPE (field)))
- cp_warning_at ("`%D' contains empty classes which may cause base "
+ cp_warning_at ("%qD contains empty classes which may cause base "
"classes to be placed at different locations in a "
"future version of GCC",
field);
TYPE_SIZE (base_t) = bitsize_zero_node;
TYPE_SIZE_UNIT (base_t) = size_zero_node;
if (warn_abi && !integer_zerop (rli_size_unit_so_far (rli)))
- warning ("layout of classes derived from empty class `%T' "
+ warning ("layout of classes derived from empty class %qT "
"may change in a future version of GCC",
t);
}
if (COMPLETE_TYPE_P (t))
{
gcc_assert (IS_AGGR_TYPE (t));
- error ("redefinition of `%#T'", t);
+ error ("redefinition of %q#T", t);
popclass ();
return;
}
if (!TREE_PRIVATE (dtor) ||
(CLASSTYPE_FRIEND_CLASSES (t) ||
DECL_FRIENDLIST (TYPE_MAIN_DECL (t))))
- warning ("%#T' has virtual functions but non-virtual destructor", t);
+ warning ("%q#T has virtual functions but non-virtual destructor", t);
}
complete_vars (t);
/* There were *no* matches. */
if (flags & tf_error)
{
- error ("no matches converting function `%D' to type `%#T'",
- DECL_NAME (OVL_FUNCTION (overload)),
- target_type);
+ error ("no matches converting function %qD to type %q#T",
+ DECL_NAME (OVL_FUNCTION (overload)),
+ target_type);
/* print_candidates expects a chain with the functions in
TREE_VALUE slots, so we cons one up here (we're losing anyway,
{
tree match;
- error ("converting overloaded function `%D' to type `%#T' is ambiguous",
+ error ("converting overloaded function %qD to type %q#T is ambiguous",
DECL_NAME (OVL_FUNCTION (overload)),
target_type);
if (!(flags & tf_error))
return error_mark_node;
- pedwarn ("assuming pointer to member `%D'", fn);
+ pedwarn ("assuming pointer to member %qD", fn);
if (!explained)
{
- pedwarn ("(a pointer to member can only be formed with `&%E')", fn);
+ pedwarn ("(a pointer to member can only be formed with %<&%E%>)", fn);
explained = 1;
}
}
else
{
if (flags & tf_error)
- error ("argument of type `%T' does not match `%T'",
+ error ("argument of type %qT does not match %qT",
TREE_TYPE (rhs), lhstype);
return error_mark_node;
}
A name N used in a class S shall refer to the same declaration
in its context and when re-evaluated in the completed scope of
S. */
- error ("declaration of `%#D'", decl);
- cp_error_at ("changes meaning of `%D' from `%+#D'",
+ error ("declaration of %q#D", decl);
+ cp_error_at ("changes meaning of %qD from %q+#D",
DECL_NAME (OVL_CURRENT (decl)),
(tree) n->value);
}