diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/init.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1b60dd4..64ea98e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-04-14 Jason Merrill <jason@redhat.com> + PR c++/48531 + * init.c (build_value_init_noctor): Check complain consistently. + PR c++/48557 * typeck.c (cp_build_binary_op): Don't decay void operands. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 32afa03..fad7f0c 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -422,7 +422,9 @@ build_value_init_noctor (tree type, tsubst_flags_t complain) as we don't know the size of the array yet. */ if (max_index == error_mark_node) { - error ("cannot value-initialize array of unknown bound %qT", type); + if (complain & tf_error) + error ("cannot value-initialize array of unknown bound %qT", + type); return error_mark_node; } gcc_assert (TREE_CODE (max_index) == INTEGER_CST); |