C++ PATCH for c++/64899 (constexpr default-initialized array)

Jason Merrill jason@redhat.com
Mon Feb 9 19:15:00 GMT 2015


build_vec_init works to evaluate constant values for elements of a 
vector initializer, but it wasn't working properly for a 
default-initialized array with a constexpr default constructor.  First I 
needed to add that case to the try_const condition; then I needed to 
change tho form of the initialization because when building the 
constructor call to refer to *iterator, constexpr evaluation saw that 
'iterator' isn't constant and gave up.  To completely solve this for 
cases where we refer to the address of the object or the value of a 
previous element we should hand the whole initialization loop to 
constexpr evaluation, but just using the value-init path fixes this 
testcase.

Tested x86_64-pc-linux-gnu, applying to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 64899.patch
Type: text/x-patch
Size: 2409 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150209/295fbae7/attachment.bin>


More information about the Gcc-patches mailing list