Convert diagnostics to use quoting flag q 4/n
Convert diagnostics to use quoting flag q 4/n * except.c (decl_is_java_type, build_throw, is_admissible_throw_operand, check_handlers_1, check_handlers): Use quoting formats. * friend.c (add_friend, make_friend_class, do_friend): Likewise. * init.c (sort_mem_initializers, emit_mem_initializers, member_init_ok_or_else, expand_member_init, is_aggr_type, build_offset_ref, build_java_class_ref): Likewise. From-SVN: r88511
This commit is contained in:
parent
0955276329
commit
15a7ee2932
4 changed files with 65 additions and 52 deletions
|
@ -1,3 +1,14 @@
|
|||
2004-10-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
Convert diagnostics to use quoting flag q 4/n
|
||||
* except.c (decl_is_java_type, build_throw,
|
||||
is_admissible_throw_operand, check_handlers_1, check_handlers):
|
||||
Use quoting formats.
|
||||
* friend.c (add_friend, make_friend_class, do_friend): Likewise.
|
||||
* init.c (sort_mem_initializers, emit_mem_initializers,
|
||||
member_init_ok_or_else, expand_member_init, is_aggr_type,
|
||||
build_offset_ref, build_java_class_ref): Likewise.
|
||||
|
||||
2004-10-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
Convert diagnostics to use quoting flag q 3/n
|
||||
|
|
|
@ -236,8 +236,8 @@ decl_is_java_type (tree decl, int err)
|
|||
&& 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)
|
||||
|
@ -247,15 +247,15 @@ decl_is_java_type (tree decl, int err)
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ build_throw (tree exp)
|
|||
}
|
||||
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);
|
||||
|
@ -807,7 +807,8 @@ is_admissible_throw_operand (tree expr)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -891,9 +892,9 @@ check_handlers_1 (tree master, tree_stmt_iterator i)
|
|||
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;
|
||||
}
|
||||
|
@ -923,7 +924,7 @@ check_handlers (tree handlers)
|
|||
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);
|
||||
|
|
|
@ -149,7 +149,7 @@ add_friend (tree type, tree decl, bool complain)
|
|||
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;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
|
||||
if (! IS_AGGR_TYPE (friend_type))
|
||||
{
|
||||
error ("invalid type `%T' declared `friend'", friend_type);
|
||||
error ("invalid type %qT declared %<friend%>", friend_type);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
/* [temp.friend]
|
||||
Friend declarations shall not declare partial
|
||||
specializations. */
|
||||
error ("partial specialization `%T' declared `friend'",
|
||||
error ("partial specialization %qT declared %<friend%>",
|
||||
friend_type);
|
||||
return;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
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;
|
||||
}
|
||||
|
@ -245,19 +245,19 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -276,8 +276,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -286,8 +285,7 @@ make_friend_class (tree type, tree friend_type, bool complain)
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -411,7 +409,7 @@ do_friend (tree ctype, tree declarator, tree decl,
|
|||
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.
|
||||
|
@ -467,10 +465,14 @@ do_friend (tree ctype, tree declarator, tree decl,
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -514,15 +514,15 @@ sort_mem_initializers (tree t, tree mem_inits)
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -666,7 +666,7 @@ emit_mem_initializers (tree mem_inits)
|
|||
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));
|
||||
|
||||
|
@ -890,26 +890,26 @@ member_init_ok_or_else (tree field, tree type, tree member_name)
|
|||
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;
|
||||
}
|
||||
|
@ -942,7 +942,7 @@ expand_member_init (tree name)
|
|||
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:
|
||||
|
@ -950,7 +950,7 @@ expand_member_init (tree name)
|
|||
(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;
|
||||
}
|
||||
|
@ -996,7 +996,7 @@ expand_member_init (tree name)
|
|||
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;
|
||||
}
|
||||
|
@ -1004,10 +1004,10 @@ expand_member_init (tree name)
|
|||
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;
|
||||
}
|
||||
|
@ -1286,7 +1286,7 @@ is_aggr_type (tree type, int or_else)
|
|||
&& 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;
|
||||
|
@ -1378,7 +1378,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
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;
|
||||
}
|
||||
|
@ -1386,8 +1386,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -1406,7 +1405,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1433,7 +1432,7 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1535,13 +1534,13 @@ build_offset_ref (tree type, tree name, bool address_p)
|
|||
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;
|
||||
|
@ -1696,7 +1695,7 @@ build_java_class_ref (tree type)
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
@ -1825,7 +1824,7 @@ build_new_1 (tree exp)
|
|||
|
||||
if (TREE_CODE (true_type) == VOID_TYPE)
|
||||
{
|
||||
error ("invalid type `void' for new");
|
||||
error ("invalid type %<void%> for new");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -1835,7 +1834,7 @@ build_new_1 (tree exp)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -1868,12 +1867,12 @@ build_new_1 (tree exp)
|
|||
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);
|
||||
|
@ -1908,7 +1907,7 @@ build_new_1 (tree exp)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue