c++: constexpr and array[0] [PR101029]
commit08e1ff9d6e5a419d5b4a60c077df549e81601d9b
authorJason Merrill <jason@redhat.com>
Fri, 11 Jun 2021 20:55:30 +0000 (11 16:55 -0400)
committerJason Merrill <jason@redhat.com>
Sat, 12 Jun 2021 16:34:36 +0000 (12 12:34 -0400)
tree47e0d36efa71d5e46343023c6b51d6ce95e2423e
parentc4e50e500da7692aad53a4488aff32e056149b3c
c++: constexpr and array[0] [PR101029]

build_vec_init_elt exits early if we're initializing a zero-element array,
so build_vec_init needs to do the same to avoid trying to instantiate things
after we've already started throwing important bits away.

PR c++/101029

gcc/cp/ChangeLog:

* init.c (build_vec_init): Shortcut [0] case.

gcc/testsuite/ChangeLog:

* g++.dg/ext/array4.C: New test.
gcc/cp/init.c
gcc/testsuite/g++.dg/ext/array4.C [new file with mode: 0644]