// PR c++/81957 // { dg-do compile { target c++11 } } template struct integral_constant { }; struct f { template void operator()(integral_constant, Int i) { } }; template auto dispatch(F f, T...t) -> decltype(f(integral_constant()..., t...)) { return f(integral_constant()..., t...); } template auto dispatch(F f, bool b, T...t) -> decltype(dispatch(f, t...)) { if (b) return dispatch(f, t...); else return dispatch(f, t...); } int main() { dispatch(f(), true, 5); }