PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-local3.C
blob76d4b55c416c126afc908e7d5c2230c05f814338
1 // PR c++/64647
2 // { dg-do compile { target c++14 } }
4 template<typename T>
5 constexpr T foo(T t)
7   T tt = t;
8   return tt;
11 struct X
13   X() { }
16 int main()
18   X x;
19   foo(x);