http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50660
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-07 19:32:03 UTC --- Something like this handles correctly the testcase and passes the testsuite, but at the moment I don't know if we could do something else. Maybe Jason can have a quick look... Index: call.c =================================================================== --- call.c (revision 179660) +++ call.c (working copy) @@ -5559,6 +5559,7 @@ convert_like_real (conversion *convs, tree expr, t tree totype = convs->type; diagnostic_t diag_kind; int flags; + int savew = warningcount; if (convs->bad_p && !(complain & tf_error)) return error_mark_node; @@ -5783,7 +5784,9 @@ convert_like_real (conversion *convs, tree expr, t expr = convert_like_real (convs->u.next, expr, fn, argnum, convs->kind == ck_ref_bind ? -1 : 1, - convs->kind == ck_ref_bind ? issue_conversion_warnings : false, + convs->kind == ck_ref_bind + && warningcount == savew + ? issue_conversion_warnings : false, c_cast_p, complain); if (expr == error_mark_node)