https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88820
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
A little bit more simplified:
template <int> struct S;
template <S> struct W {
template <typename> static int foo();
bool b = foo<int>();
};
