https://gcc.gnu.org/g:10846d82a895cbc95b7819a5c44cd0216bb21bf4
commit r15-9990-g10846d82a895cbc95b7819a5c44cd0216bb21bf4 Author: Jason Merrill <ja...@redhat.com> Date: Thu Jul 17 09:46:35 2025 -0400 c++: constexpr array testcase [PR87097] This seems to have been fixed by r15-7260 for PR118285, but is sufficiently different to merit its own test. PR c++/87097 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-array29.C: New test. Diff: --- gcc/testsuite/g++.dg/cpp0x/constexpr-array29.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array29.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array29.C new file mode 100644 index 000000000000..714d050b503e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array29.C @@ -0,0 +1,13 @@ +// PR c++/87097 +// { dg-do compile { target c++11 } } + +struct A { + constexpr A() : data() {} + struct X { int n; }; + X data[2]; +}; + +static_assert((A(), true), ""); +static_assert(A().data[0].n == 0, ""); +static_assert(A().data[1].n == 0, ""); +constexpr A x;