Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/57901 |
2 // { dg-require-effective-target c++11 } | |
3 | |
4 struct Z { | |
5 Z() = default; | |
6 Z(Z const&) = default; | |
7 constexpr Z(Z&&) {} /* non-trivial (constexpr) move ctor */ | |
8 }; | |
9 | |
10 template<typename T> | |
11 constexpr int fn0(T v) { return 0; } | |
12 template<typename T> | |
13 constexpr int fn (T v) { return fn0(v); } | |
14 | |
15 constexpr auto t0 = fn0(Z()); // OK! | |
16 constexpr auto t = fn (Z()); // error! (GCC 4.8.1) |