diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-12-18 23:39:11 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-12-18 23:39:11 +0000 |
commit | c428869b6d7ddcb0b94d1f248b433040601532f0 (patch) | |
tree | 62a8cb00c31cde57061d66894ed4d2c0b06f94ac /gcc | |
parent | 2ad8d9105d0f772c46c12d65c799ed3938285346 (diff) | |
download | gcc-c428869b6d7ddcb0b94d1f248b433040601532f0.zip gcc-c428869b6d7ddcb0b94d1f248b433040601532f0.tar.gz gcc-c428869b6d7ddcb0b94d1f248b433040601532f0.tar.bz2 |
semantics.c (finish_compound_literal): Don't call check_narrowing if !(complain & tf_warning_or_error).
2011-12-18 Paolo Carlini <paolo.carlini@oracle.com>
* semantics.c (finish_compound_literal): Don't call check_narrowing
if !(complain & tf_warning_or_error).
From-SVN: r182462
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 18f1dfd..7d625ee 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-12-18 Paolo Carlini <paolo.carlini@oracle.com> + + * semantics.c (finish_compound_literal): Don't call check_narrowing + if !(complain & tf_warning_or_error). + 2011-12-17 Jason Merrill <jason@redhat.com> PR c++/51588 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ab9227f..76b0b18 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2370,7 +2370,8 @@ finish_compound_literal (tree type, tree compound_literal, return error_mark_node; compound_literal = reshape_init (type, compound_literal, complain); if (SCALAR_TYPE_P (type) - && !BRACE_ENCLOSED_INITIALIZER_P (compound_literal)) + && !BRACE_ENCLOSED_INITIALIZER_P (compound_literal) + && (complain & tf_warning_or_error)) check_narrowing (type, compound_literal); if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE) |