diff options
author | Jason Merrill <jason@redhat.com> | 2025-07-17 09:46:35 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-07-17 10:05:01 -0400 |
commit | b38382e36410a9a649b904a2d0a0abcb90f9c418 (patch) | |
tree | c96387977c7e680dda41040a177749b11ef7ec43 /gcc | |
parent | df7beaccef31f19ee73f034eb98e0e47be008d8e (diff) | |
download | gcc-b38382e36410a9a649b904a2d0a0abcb90f9c418.zip gcc-b38382e36410a9a649b904a2d0a0abcb90f9c418.tar.gz gcc-b38382e36410a9a649b904a2d0a0abcb90f9c418.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-array29.C | 13 |
1 files changed, 13 insertions, 0 deletions
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 0000000..714d050 --- /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; |