Code: //-------- 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, -std=c++11) //-------- Error message: in constexpr expansion of ‘fn<Z>(Z())’ error: ‘v’ is not a constant expression constexpr auto t = fn(Z()); ^ Class Z is literal type. However, compilation error when it is call-by-value(more than once). I tested this code in gcc-4.7.3, is passed. The problem is reproduced in gcc-4.8.0, gcc-4.8.1
We may have a Dup of this.
Fixed for 4.8.2/4.9.0.