C++ PATCH for c++/64356 and libstdc++/58777 (constexpr pointer arithmetic)

Jason Merrill jason@redhat.com
Tue Jan 13 21:10:00 GMT 2015


In this testcase we are iterating through an array which is a local 
variable in a constexpr function.  So its address is not constant, but 
we can still do arithmetic on it to get to the address of an element and 
then pull out the value of the element; we shouldn't reject the 
evaluation as non-constant unless the non-constant address is part of 
the value of the complete expression.

This patch also fixes libstdc++/58777, another issue with giving up on 
an intermediate non-constant address even though the final value is 
constant.

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


More information about the Gcc-patches mailing list