diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65cb5be..bd9f2f3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2015-05-04 Paolo Carlini <paolo.carlini@oracle.com> + Jakub Jelinek <jakub@redhat.com> + + PR c++/66007 + * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't + result in an actual error. + 2015-05-01 Paolo Carlini <paolo.carlini@oracle.com> Prathamesh Kulharni <prathamesh.kulkarni@linaro.org> diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 9a491aa..c0df823 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -958,10 +958,12 @@ check_narrowing (tree type, tree init, tsubst_flags_t complain) } else if (complain & tf_error) { + int savederrorcount = errorcount; global_dc->pedantic_errors = 1; - if (!pedwarn (EXPR_LOC_OR_LOC (init, input_location), OPT_Wnarrowing, - "narrowing conversion of %qE from %qT to %qT " - "inside { }", init, ftype, type)) + pedwarn (EXPR_LOC_OR_LOC (init, input_location), OPT_Wnarrowing, + "narrowing conversion of %qE from %qT to %qT " + "inside { }", init, ftype, type); + if (errorcount == savederrorcount) ok = true; global_dc->pedantic_errors = flag_pedantic_errors; } |