[PATCH] don't treat as zero empty string initializers of pointer array elements (PR 89980)

Martin Sebor msebor@gmail.com
Fri Apr 5 18:25:00 GMT 2019


On 4/5/19 10:45 AM, Martin Sebor wrote:
> The change committed yesterday to handle the C++ 2a string literals
> as non-type template arguments treats empty string initializers for
> trailing pointer array elements as zero.  That's of course wrong
> because addresses of literals are non-zero.
> 
> The attached tweak constrains the trimming of trailing zero
> initializers to either non-pointer initializers or non-pointer
> types.
> 
> The patch passes x86_64 bootstrap (but so did the change yesterday).
> The tests are still running.  Is it okay to commit if the tests pass?
> 
> I'm also separately bootstrapping using the configure options from
> the report where apparently it caused the x86_64 bootstrap to fail.

This bootstrap also passed.

Attached is a slightly updated patch that, besides fixing this
bug, also reverts the use of TYPE_HAS_TRIVIAL_DFLT() in favor
of trivial_type_p().  Using the macro turned out not to be
quite right -- it caused cpp0x/constexpr-63241.C to be rejected.
I missed that among all the other test failures.

I'm still not sure what happened with my yesterday's build that
it doesn't show the bootstrap failure.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-89980.diff
Type: text/x-patch
Size: 4692 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190405/0d64443b/attachment.bin>


More information about the Gcc-patches mailing list