diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C new file mode 100644 index 000000000..9aeb75d6b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C @@ -0,0 +1,14 @@ +// PR c++/49924 +// { dg-options -std=c++0x } + +struct A { constexpr A() { } }; + +struct B { + A array[1]; //non-static member array of a literal type w constexpr ctor + constexpr B() : array{} { } // here is the problem +}; + +int main() +{ + constexpr B b{}; // won't compile +} |