#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407) #define OLD_GNU #endif #ifdef OLD_GNU template struct Interface; #endif template struct Interface #ifdef OLD_GNU #endif { static int accumulate() { return I + Interface::accumulate(); } }; template struct Interface { static int accumulate() { return I; } }; // Note: split this into a separate test if a // cxx_variadic_template_template_parameters feature is added. template struct eval { enum { Matched = 0 }; }; template class T, typename... U> struct eval > { enum { Matched = 1 }; }; template struct A { }; template struct B { }; template struct C { }; template struct D { }; // Note: This test assumes that a compiler supporting this feature // supports static_assert. Add a workaround if that does not hold. static_assert(eval >::Matched, "A Matches"); static_assert(eval >::Matched, "A Matches"); static_assert(eval >::Matched, "A Matches"); static_assert(eval >::Matched, "B Matches"); static_assert(eval >::Matched, "C Matches"); static_assert(eval >::Matched, "D Matches"); static_assert(eval >::Matched, "D Matches"); static_assert(eval >::Matched, "D Matches");