summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/static3.C
blob: 65cf2c9e7b2149dfa24331b7c8ca92af113f4053 (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
template <class data> class foo
{
    public:
	static const int a;
	static const int b;
	static const int c;
	static const int d;
};

template <class data> const int foo<data>::a = 1;
template <class data> const int foo<data>::b = a;
template <class data> const int foo<data>::c = b;
template <class data> const int foo<data>::d = c;

typedef foo<int> fooInt;

int main( void )
{
    fooInt *f;

    f = new fooInt();

    if (f->c != 1 || f->d != 1)
      return 1;
}