summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/static8.C
blob: 9b2ca8283dfa16995869251a293037a378b46f87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// { dg-do run  }
// Origin: Mark Mitchell <mark@codesourcery.com>

int i;

template <class T>
struct S {
  S() { ++i; }

  virtual void g() {}
  virtual void f();

  static S s;
};

template <class T>
void S<T>::f() {
  s.f();
}

S<int> si;

template <class T>
S<T> S<T>::s;

int main ()
{
  si.g();
  if (i != 2)
    return 1;
  else
    return 0;
}