1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// PR c++/52688 // { dg-do link } template<class T> struct A { static bool test() { static bool value = false; if (value) return false; struct S { S() { value = true; } }; static S s; return true; } }; int main() { A<int>::test(); }