blob: 53c6db2b974f15024195dd202668093b1850d615 [file] [log] [blame]
// Test for variable templates in pack expansion
// { dg-do compile { target c++14 } }
template <int I> const int Val = I;
constexpr int f () { return 0; }
template <class T, class ...Ts>
constexpr int f(T t, Ts... ts)
{
return t + f(ts...);
}
template <int... Is>
constexpr int g()
{
return f(Val<Is>...);
}
#define SA(X) static_assert((X),#X)
SA((g<1,2,3,4>() == 1+2+3+4));