diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C new file mode 100644 index 000000000..3e08fb0ef --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C @@ -0,0 +1,13 @@ +// Allow static_assert in constexpr constructors, too. +// { dg-options -std=c++0x } + +template<typename T> +struct A +{ + int i; + + constexpr A(int i) : i(i) + { + static_assert(sizeof(T) == 1, ""); + } +}; |