diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-value.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-value.C | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-value.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-value.C new file mode 100644 index 000000000..85799d90b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-value.C @@ -0,0 +1,10 @@ +// { dg-options -std=c++0x } + +struct HopefullyLiteral { + HopefullyLiteral() = default; // Should be a constexpr c'tor as of 12.1/6 and 8.4.2/4 +}; + +constexpr HopefullyLiteral var1{}; // OK +constexpr HopefullyLiteral var2 = HopefullyLiteral{}; // #1 +constexpr HopefullyLiteral var3 = HopefullyLiteral(); // #2 +constexpr HopefullyLiteral var4 = HopefullyLiteral(var3); // #3 |