diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2013-03-28 16:03:32 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-03-28 16:03:32 +0000 |
commit | 7abebba7f231dee68ab5a16f50a3f1b182b5a5cc (patch) | |
tree | 1e29e643bd0eae0c6a366fe4ce13190c450e7785 /gcc/cp | |
parent | 89ab31c15784b9d163e15688cc7c5bd589bcf465 (diff) | |
download | gcc-7abebba7f231dee68ab5a16f50a3f1b182b5a5cc.zip gcc-7abebba7f231dee68ab5a16f50a3f1b182b5a5cc.tar.gz gcc-7abebba7f231dee68ab5a16f50a3f1b182b5a5cc.tar.bz2 |
re PR c++/56725 (extra spaces in error message)
/cp
2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/56725
* call.c (convert_like_real): Change series of two permerrors
to permerror + inform (and likewise for two errors).
(build_new_method_call_1): Likewise.
* typeck.c (convert_for_initialization): Change additional
warning or error to inform.
/testsuite
2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56725
* g++.dg/conversion/op4.C: Adjust.
* g++.dg/cpp0x/rv1n.C: Likewise.
* g++.dg/cpp0x/rv2n.C: Likewise.
* g++.dg/cpp0x/template_deduction.C: Likewise.
* g++.dg/expr/cond8.C: Likewise.
* g++.dg/other/error4.C: Likewise.
* g++.old-deja/g++.bugs/900514_03.C: Likewise.
* g++.old-deja/g++.bugs/900519_02.C: Likewise.
* g++.old-deja/g++.bugs/900519_03.C: Likewise.
* g++.old-deja/g++.bugs/900520_02.C: Likewise.
* g++.old-deja/g++.jason/conversion2.C: Likewise.
* g++.old-deja/g++.law/cvt20.C: Likewise.
* g++.old-deja/g++.law/cvt8.C: Likewise.
* g++.old-deja/g++.law/init8.C: Likewise.
* g++.old-deja/g++.mike/net12.C: Likewise.
* g++.old-deja/g++.mike/net8.C: Likewise.
* g++.old-deja/g++.mike/p2793.C: Likewise.
* g++.old-deja/g++.mike/p3836.C: Likewise.
* g++.old-deja/g++.mike/p418.C: Likewise.
* g++.old-deja/g++.mike/p701.C: Likewise.
* g++.old-deja/g++.mike/p807.C: Likewise.
From-SVN: r197206
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/call.c | 26 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 13 |
3 files changed, 30 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f4952838..ecc5503 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2013-03-28 Paolo Carlini <paolo.carlini@oracle.com> + Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c++/56725 + * call.c (convert_like_real): Change series of two permerrors + to permerror + inform (and likewise for two errors). + (build_new_method_call_1): Likewise. + * typeck.c (convert_for_initialization): Change additional + warning or error to inform. + 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net> * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index cff653f..d39124d 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5836,11 +5836,11 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, break; } - permerror (loc, "invalid conversion from %qT to %qT", - TREE_TYPE (expr), totype); - if (fn) - permerror (DECL_SOURCE_LOCATION (fn), - " initializing argument %P of %qD", argnum, fn); + if (permerror (loc, "invalid conversion from %qT to %qT", + TREE_TYPE (expr), totype) + && fn) + inform (DECL_SOURCE_LOCATION (fn), + "initializing argument %P of %qD", argnum, fn); return cp_convert (totype, expr, complain); } @@ -5943,7 +5943,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, build_user_type_conversion (totype, convs->u.expr, LOOKUP_NORMAL, complain); if (fn) - error (" initializing argument %P of %q+D", argnum, fn); + inform (input_location, "initializing argument %P of %q+D", + argnum, fn); } return error_mark_node; @@ -6074,7 +6075,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, error_at (loc, "cannot bind %qT lvalue to %qT", TREE_TYPE (expr), totype); if (fn) - error (" initializing argument %P of %q+D", argnum, fn); + inform (input_location, + "initializing argument %P of %q+D", argnum, fn); return error_mark_node; } @@ -7467,11 +7469,11 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args, if (! (complain & tf_error)) return error_mark_node; - permerror (input_location, - "cannot call constructor %<%T::%D%> directly", - basetype, name); - permerror (input_location, " for a function-style cast, remove the " - "redundant %<::%D%>", name); + if (permerror (input_location, + "cannot call constructor %<%T::%D%> directly", + basetype, name)) + inform (input_location, "for a function-style cast, remove the " + "redundant %<::%D%>", name); call = build_functional_cast (basetype, build_tree_list_vec (user_args), complain); return call; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a0caa30..4b6468c 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7984,13 +7984,12 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags, if (fndecl) savew = warningcount + werrorcount, savee = errorcount; rhs = initialize_reference (type, rhs, flags, complain); - if (fndecl) - { - if (warningcount + werrorcount > savew) - warning (0, "in passing argument %P of %q+D", parmnum, fndecl); - else if (errorcount > savee) - error ("in passing argument %P of %q+D", parmnum, fndecl); - } + + if (fndecl + && (warningcount + werrorcount > savew || errorcount > savee)) + inform (input_location, + "in passing argument %P of %q+D", parmnum, fndecl); + return rhs; } |