diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C new file mode 100644 index 0000000..1fc3738 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C @@ -0,0 +1,16 @@ +// PR c++/57901 +// { dg-require-effective-target c++11 } + +struct Z { + Z() = default; + Z(Z const&) = default; + constexpr Z(Z&&) {} /* non-trivial (constexpr) move ctor */ +}; + +template<typename T> +constexpr int fn0(T v) { return 0; } +template<typename T> +constexpr int fn (T v) { return fn0(v); } + +constexpr auto t0 = fn0(Z()); // OK! +constexpr auto t = fn (Z()); // error! (GCC 4.8.1) |