&& TYPE_FOR_JAVA (TREE_TYPE (decl)))
{
/* Can't throw a reference. */
- error ("type `%T' is disallowed in Java `throw' or `catch'",
- decl);
+ error ("type %qT is disallowed in Java %<throw%> or %<catch%>",
+ decl);
}
if (r)
if (jthrow_node == NULL_TREE)
fatal_error
- ("call to Java `catch' or `throw' with `jthrowable' undefined");
+ ("call to Java %<catch%> or %<throw%> with %<jthrowable%> undefined");
jthrow_node = TREE_TYPE (TREE_TYPE (jthrow_node));
if (! DERIVED_FROM_P (jthrow_node, TREE_TYPE (decl)))
{
/* Thrown object must be a Throwable. */
- error ("type `%T' is not derived from `java::lang::Throwable'",
- TREE_TYPE (decl));
+ error ("type %qT is not derived from %<java::lang::Throwable%>",
+ TREE_TYPE (decl));
}
}
}
}
else if (really_overloaded_fn (fn))
{
- error ("`%D' should never be overloaded", fn);
+ error ("%qD should never be overloaded", fn);
return error_mark_node;
}
fn = OVL_CURRENT (fn);
conversion. */
else if (CLASS_TYPE_P (type) && CLASSTYPE_PURE_VIRTUALS (type))
{
- error ("expression '%E' of abstract class type '%T' cannot be used in throw-expression", expr, type);
+ error ("expression %qE of abstract class type %qT cannot "
+ "be used in throw-expression", expr, type);
return false;
}
tree handler = tsi_stmt (i);
if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler)))
{
- warning ("%Hexception of type `%T' will be caught",
+ warning ("%Hexception of type %qT will be caught",
EXPR_LOCUS (handler), TREE_TYPE (handler));
- warning ("%H by earlier handler for `%T'",
+ warning ("%H by earlier handler for %qT",
EXPR_LOCUS (master), type);
break;
}
if (tsi_end_p (i))
break;
if (TREE_TYPE (handler) == NULL_TREE)
- pedwarn ("%H`...' handler must be the last handler for"
+ pedwarn ("%H%<...%> handler must be the last handler for"
" its try block", EXPR_LOCUS (handler));
else
check_handlers_1 (handler, i);
if (decl == TREE_VALUE (friends))
{
if (complain)
- warning ("`%D' is already a friend of class `%T'",
+ warning ("%qD is already a friend of class %qT",
decl, type);
return;
}
if (! IS_AGGR_TYPE (friend_type))
{
- error ("invalid type `%T' declared `friend'", friend_type);
+ error ("invalid type %qT declared %<friend%>", friend_type);
return;
}
/* [temp.friend]
Friend declarations shall not declare partial
specializations. */
- error ("partial specialization `%T' declared `friend'",
+ error ("partial specialization %qT declared %<friend%>",
friend_type);
return;
}
else if (same_type_p (type, friend_type))
{
if (complain)
- pedwarn ("class `%T' is implicitly friends with itself",
+ pedwarn ("class %qT is implicitly friends with itself",
type);
return;
}
else if (TREE_CODE (friend_type) == TYPENAME_TYPE)
{
/* template <class T> friend typename S<T>::X; */
- error ("typename type `%#T' declared `friend'", friend_type);
+ error ("typename type %q#T declared %<friend%>", friend_type);
return;
}
else if (TREE_CODE (friend_type) == TEMPLATE_TYPE_PARM)
{
/* template <class T> friend class T; */
- error ("template parameter type `%T' declared `friend'", friend_type);
+ error ("template parameter type %qT declared %<friend%>", friend_type);
return;
}
else if (!CLASSTYPE_TEMPLATE_INFO (friend_type))
{
/* template <class T> friend class A; where A is not a template */
- error ("`%#T' is not a template", friend_type);
+ error ("%q#T is not a template", friend_type);
return;
}
if (friend_type == probe)
{
if (complain)
- warning ("`%D' is already a friend of `%T'",
- probe, type);
+ warning ("%qD is already a friend of %qT", probe, type);
break;
}
}
if (same_type_p (probe, friend_type))
{
if (complain)
- warning ("`%T' is already a friend of `%T'",
- probe, type);
+ warning ("%qT is already a friend of %qT", probe, type);
break;
}
}
add_friend (current_class_type, decl, /*complain=*/true);
}
else
- error ("member `%D' declared as friend before type `%T' defined",
+ error ("member %qD declared as friend before type %qT defined",
decl, ctype);
}
/* A global friend.
if (warn)
{
static int explained;
- warning ("friend declaration `%#D' declares a non-template function", decl);
+ warning ("friend declaration %q#D declares a non-template "
+ "function", decl);
if (! explained)
{
- warning ("(if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -Wno-non-template-friend disables this warning");
+ warning ("(if this is not what you intended, make sure "
+ "the function template has already been declared "
+ "and add <> after the function name here) "
+ "-Wno-non-template-friend disables this warning");
explained = 1;
}
}
if (warn_reorder && !subobject_init)
{
if (TREE_CODE (TREE_PURPOSE (next_subobject)) == FIELD_DECL)
- cp_warning_at ("`%D' will be initialized after",
+ cp_warning_at ("%qD will be initialized after",
TREE_PURPOSE (next_subobject));
else
- warning ("base `%T' will be initialized after",
+ warning ("base %qT will be initialized after",
TREE_PURPOSE (next_subobject));
if (TREE_CODE (subobject) == FIELD_DECL)
- cp_warning_at (" `%#D'", subobject);
+ cp_warning_at (" %q#D", subobject);
else
- warning (" base `%T'", subobject);
+ warning (" base %qT", subobject);
warning ("%J when initialized here", current_function_decl);
}
if (extra_warnings && !arguments
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl)
&& TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)))
- warning ("%Jbase class `%#T' should be explicitly initialized in the "
+ warning ("%Jbase class %q#T should be explicitly initialized in the "
"copy constructor",
current_function_decl, BINFO_TYPE (subobject));
return 0;
if (!field)
{
- error ("class `%T' does not have any field named `%D'", type,
+ error ("class %qT does not have any field named %qD", type,
member_name);
return 0;
}
if (TREE_CODE (field) == VAR_DECL)
{
- error ("`%#D' is a static data member; it can only be "
+ error ("%q#D is a static data member; it can only be "
"initialized at its definition",
field);
return 0;
}
if (TREE_CODE (field) != FIELD_DECL)
{
- error ("`%#D' is not a non-static data member of `%T'",
+ error ("%q#D is not a non-static data member of %qT",
field, type);
return 0;
}
if (initializing_context (field) != type)
{
- error ("class `%T' does not have any field named `%D'", type,
+ error ("class %qT does not have any field named %qD", type,
member_name);
return 0;
}
switch (BINFO_N_BASE_BINFOS (TYPE_BINFO (current_class_type)))
{
case 0:
- error ("unnamed initializer for `%T', which has no base classes",
+ error ("unnamed initializer for %qT, which has no base classes",
current_class_type);
return NULL_TREE;
case 1:
(BINFO_BASE_BINFO (TYPE_BINFO (current_class_type), 0));
break;
default:
- error ("unnamed initializer for `%T', which uses multiple inheritance",
+ error ("unnamed initializer for %qT, which uses multiple inheritance",
current_class_type);
return NULL_TREE;
}
base class, the mem-initializer is ill-formed. */
if (direct_binfo && virtual_binfo)
{
- error ("'%D' is both a direct base and an indirect virtual base",
+ error ("%qD is both a direct base and an indirect virtual base",
basetype);
return NULL_TREE;
}
if (!direct_binfo && !virtual_binfo)
{
if (CLASSTYPE_VBASECLASSES (current_class_type))
- error ("type `%D' is not a direct or virtual base of `%T'",
+ error ("type %qD is not a direct or virtual base of %qT",
name, current_class_type);
else
- error ("type `%D' is not a direct base of `%T'",
+ error ("type %qD is not a direct base of %qT",
name, current_class_type);
return NULL_TREE;
}
&& TREE_CODE (type) != BOUND_TEMPLATE_TEMPLATE_PARM)
{
if (or_else)
- error ("`%T' is not an aggregate type", type);
+ error ("%qT is not an aggregate type", type);
return 0;
}
return 1;
if (TREE_CODE (name) == BIT_NOT_EXPR)
{
if (! check_dtor_name (type, name))
- error ("qualified type `%T' does not match destructor name `~%T'",
+ error ("qualified type %qT does not match destructor name %<~%T%>",
type, TREE_OPERAND (name, 0));
name = dtor_identifier;
}
if (!COMPLETE_TYPE_P (complete_type (type))
&& !TYPE_BEING_DEFINED (type))
{
- error ("incomplete type `%T' does not have member `%D'", type,
- name);
+ error ("incomplete type %qT does not have member %qD", type, name);
return error_mark_node;
}
if (!member)
{
- error ("`%D' is not a member of type `%T'", name, type);
+ error ("%qD is not a member of type %qT", name, type);
return error_mark_node;
}
if (TREE_CODE (member) == FIELD_DECL && DECL_C_BIT_FIELD (member))
{
- error ("invalid pointer to bit-field `%D'", member);
+ error ("invalid pointer to bit-field %qD", member);
return error_mark_node;
}
PTRMEM_OK_P (member) = 1;
return build_unary_op (ADDR_EXPR, member, 0);
}
- error ("invalid use of non-static member function `%D'",
+ error ("invalid use of non-static member function %qD",
TREE_OPERAND (member, 1));
return member;
}
else if (TREE_CODE (member) == FIELD_DECL)
{
- error ("invalid use of non-static data member `%D'", member);
+ error ("invalid use of non-static data member %qD", member);
return error_mark_node;
}
return member;
{
jclass_node = IDENTIFIER_GLOBAL_VALUE (get_identifier ("jclass"));
if (jclass_node == NULL_TREE)
- fatal_error ("call to Java constructor, while `jclass' undefined");
+ fatal_error ("call to Java constructor, while %<jclass%> undefined");
jclass_node = TREE_TYPE (jclass_node);
}
if (TREE_CODE (true_type) == VOID_TYPE)
{
- error ("invalid type `void' for new");
+ error ("invalid type %<void%> for new");
return error_mark_node;
}
is_initialized = (TYPE_NEEDS_CONSTRUCTING (type) || init);
if (CP_TYPE_CONST_P (true_type) && !is_initialized)
{
- error ("uninitialized const in `new' of `%#T'", true_type);
+ error ("uninitialized const in %<new%> of %q#T", true_type);
return error_mark_node;
}
if (!get_global_value_if_present (get_identifier (alloc_name),
&alloc_decl))
{
- error ("call to Java constructor with `%s' undefined", alloc_name);
+ error ("call to Java constructor with %qs undefined", alloc_name);
return error_mark_node;
}
else if (really_overloaded_fn (alloc_decl))
{
- error ("`%D' should never be overloaded", alloc_decl);
+ error ("%qD should never be overloaded", alloc_decl);
return error_mark_node;
}
alloc_decl = OVL_CURRENT (alloc_decl);
fns = lookup_fnfields (true_type, fnname, /*protect=*/2);
if (TREE_CODE (fns) == TREE_LIST)
{
- error ("request for member `%D' is ambiguous", fnname);
+ error ("request for member %qD is ambiguous", fnname);
print_candidates (fns);
return error_mark_node;
}