Convert diagnostics to use quoting flag q 8/n

Convert diagnostics to use quoting flag q 8/n
        * cvt.c (cp_convert_to_pointer, warn_ref_binding,
        convert_to_reference, ocp_convert, convert_to_void
        cp_convert_to_pointer):

From-SVN: r89924
This commit is contained in:
Gabriel Dos Reis 2004-11-01 00:11:49 +00:00 committed by Gabriel Dos Reis
parent 80439563c5
commit 939add704d
2 changed files with 52 additions and 41 deletions

View file

@ -1,3 +1,10 @@
2004-10-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 8/n
* cvt.c (cp_convert_to_pointer, warn_ref_binding,
convert_to_reference, ocp_convert, convert_to_void
cp_convert_to_pointer):
2004-10-31 Mark Mitchell <mark@codesourcery.com>
PR c++/15172

View file

@ -87,7 +87,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
intype = complete_type (intype);
if (!COMPLETE_TYPE_P (intype))
{
error ("can't convert from incomplete type `%T' to `%T'",
error ("can't convert from incomplete type %qT to %qT",
intype, type);
return error_mark_node;
}
@ -96,7 +96,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (rval)
{
if (rval == error_mark_node)
error ("conversion of `%E' from `%T' to `%T' is ambiguous",
error ("conversion of %qE from %qT to %qT is ambiguous",
expr, intype, type);
return rval;
}
@ -165,7 +165,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (TYPE_PTRMEMFUNC_P (type))
{
error ("cannot convert `%E' from type `%T' to type `%T'",
error ("cannot convert %qE from type %qT to type %qT",
expr, intype, type);
return error_mark_node;
}
@ -194,12 +194,12 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (bk == bk_via_virtual)
{
if (force)
warning ("pointer to member cast from `%T' to `%T' is via virtual base",
intype, type);
warning ("pointer to member cast from %qT to %qT is via"
" virtual base", intype, type);
else
{
error ("pointer to member cast from `%T' to `%T' is via virtual base",
intype, type);
error ("pointer to member cast from %qT to %qT is"
" via virtual base", intype, type);
return error_mark_node;
}
/* This is a reinterpret cast, whose result is unspecified.
@ -234,7 +234,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
TREE_OPERAND (expr, 1));
}
}
error ("cannot convert `%E' from type `%T' to type `%T'",
error ("cannot convert %qE from type %qT to type %qT",
expr, intype, type);
return error_mark_node;
}
@ -260,7 +260,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
}
else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form))
{
error ("invalid conversion from '%T' to '%T'", intype, type);
error ("invalid conversion from %qT to %qT", intype, type);
return error_mark_node;
}
@ -281,7 +281,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (type_unknown_p (expr))
return instantiate_type (type, expr, tf_error | tf_warning);
error ("cannot convert `%E' from type `%T' to type `%T'",
error ("cannot convert %qE from type %qT to type %qT",
expr, intype, type);
return error_mark_node;
}
@ -413,13 +413,17 @@ warn_ref_binding (tree reftype, tree intype, tree decl)
const char *msg;
if (CP_TYPE_VOLATILE_P (ttl) && decl)
msg = "initialization of volatile reference type `%#T' from rvalue of type `%T'";
msg = "initialization of volatile reference type %q#T from"
" rvalue of type %qT";
else if (CP_TYPE_VOLATILE_P (ttl))
msg = "conversion to volatile reference type `%#T' from rvalue of type `%T'";
msg = "conversion to volatile reference type %q#T "
" from rvalue of type %qT";
else if (decl)
msg = "initialization of non-const reference type `%#T' from rvalue of type `%T'";
msg = "initialization of non-const reference type %q#T from"
" rvalue of type %qT";
else
msg = "conversion to non-const reference type `%#T' from rvalue of type `%T'";
msg = "conversion to non-const reference type %q#T from"
" rvalue of type %qT";
pedwarn (msg, reftype, intype);
}
@ -492,7 +496,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
if (! (convtype & CONV_CONST)
&& !at_least_as_qualified_p (ttl, ttr))
pedwarn ("conversion from `%T' to `%T' discards qualifiers",
pedwarn ("conversion from %qT to %qT discards qualifiers",
ttr, reftype);
}
@ -510,7 +514,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
if (TREE_CODE (intype) == POINTER_TYPE
&& (comptypes (TREE_TYPE (intype), type,
COMPARE_BASE | COMPARE_DERIVED)))
warning ("casting `%T' to `%T' does not dereference pointer",
warning ("casting %qT to %qT does not dereference pointer",
intype, reftype);
rval = build_unary_op (ADDR_EXPR, expr, 0);
@ -537,7 +541,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
}
if (flags & LOOKUP_COMPLAIN)
error ("cannot convert type `%T' to type `%T'", intype, reftype);
error ("cannot convert type %qT to type %qT", intype, reftype);
return error_mark_node;
}
@ -661,7 +665,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
&& ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC))
|| (TREE_CODE (intype) == POINTER_TYPE)))
{
pedwarn ("conversion from `%#T' to `%#T'", intype, type);
pedwarn ("conversion from %q#T to %q#T", intype, type);
if (flag_pedantic_errors)
return error_mark_node;
@ -673,7 +677,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
if (rval)
return rval;
if (flags & LOOKUP_COMPLAIN)
error ("`%#T' used where a `%T' was expected", intype, type);
error ("%q#T used where a %qT was expected", intype, type);
return error_mark_node;
}
if (code == BOOLEAN_TYPE)
@ -693,7 +697,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
if (ret_val)
return ret_val;
if (flags & LOOKUP_COMPLAIN)
error ("`%#T' used where a `%T' was expected", in_vtype, type);
error ("%q#T used where a %qT was expected", in_vtype, type);
return error_mark_node;
}
return fold_if_not_in_template (convert_to_vector (type, e));
@ -708,7 +712,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
return rval;
else
if (flags & LOOKUP_COMPLAIN)
error ("`%#T' used where a floating point value was expected",
error ("%q#T used where a floating point value was expected",
TREE_TYPE (e));
}
if (code == REAL_TYPE)
@ -755,7 +759,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
}
if (flags & LOOKUP_COMPLAIN)
error ("conversion from `%T' to non-scalar type `%T' requested",
error ("conversion from %qT to non-scalar type %qT requested",
TREE_TYPE (expr), type);
return error_mark_node;
}
@ -843,10 +847,10 @@ convert_to_void (tree expr, const char *implicit)
int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (is_volatile && !is_complete)
warning ("object of incomplete type `%T' will not be accessed in %s",
warning ("object of incomplete type %qT will not be accessed in %s",
type, implicit ? implicit : "void context");
else if (is_reference && is_volatile)
warning ("object of type `%T' will not be accessed in %s",
warning ("object of type %qT will not be accessed in %s",
TREE_TYPE (TREE_OPERAND (expr, 0)),
implicit ? implicit : "void context");
if (is_reference || !is_volatile || !is_complete)
@ -862,7 +866,7 @@ convert_to_void (tree expr, const char *implicit)
int is_complete = COMPLETE_TYPE_P (complete_type (type));
if (TYPE_VOLATILE (type) && !is_complete)
warning ("object `%E' of incomplete type `%T' will not be accessed in %s",
warning ("object %qE of incomplete type %qT will not be accessed in %s",
expr, type, implicit ? implicit : "void context");
break;
}
@ -884,7 +888,7 @@ convert_to_void (tree expr, const char *implicit)
}
else if (implicit && probe == expr && is_overloaded_fn (probe))
/* Only warn when there is no &. */
warning ("%s is a reference, not call, to function `%E'",
warning ("%s is a reference, not call, to function %qE",
implicit, expr);
}
@ -1076,9 +1080,9 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
{
if (complain)
{
error ("ambiguous default type conversion from `%T'",
error ("ambiguous default type conversion from %qT",
basetype);
error (" candidate conversions include `%D' and `%D'",
error (" candidate conversions include %qD and %qD",
winner, cand);
}
return error_mark_node;