aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/static34.C
blob: 122fffafbcb569971cb45ec01731eb7a550a59a9 (plain)
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();
}