This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] PR 55446
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Sat, 24 Nov 2012 04:24:48 +0100
- Subject: [C++ Patch] PR 55446
Hi,
this is a wrong code regression unfortunately caused by my fix for
c++/45385.
The story went (*) that in order to fix the latter missing warning we
decided to remove the kludge added in c++/35602 to avoid a bogus warning
*and* we also decided to early return from build_vec_init when maxindex
is integer_all_onesp. Unfortunately the latter change caused the
regression at issue, because we want to exactly use integer_all_onesp
for perfectly valid things like:
new S[0]
At first, before I figured out the whole story, I thought we could solve
the problem by simply doing nothing in case of 0 but then we don't
reject a private default constructor for S. Using integer_zero_node or
any other normal value is also not Ok, because it means the default
constructor is actually called at least once. It seems we really want
the special value to go through build_vec_init as it used to up to 4.6.x.
Note that, currently at least, for the testcase added for c++/35602
build_vec_init is *not* used at all thus it can't possibly regress.
Tested x86_64-linux.
Thanks,
Paolo.
(*) http://gcc.gnu.org/ml/gcc-patches/2011-10/msg01946.html
Attachment:
CL_55446
Description: Text document
Attachment:
patch_55446
Description: Text document