2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / static3.C
blob00c72651be35ea10fb6a6c05c64ce27ceef3b076
1 // { dg-do link }
3 class Foo {
4 public:
5   // No out-of-class definition is provided for these class members.
6   // That's technically a violation of the standard, but no diagnostic
7   // is required, and, as a QOI issue, we should optimize away all
8   // references.
9   static const int erf = 0;
10   static const int foo = 1;
13 int one()
15   return Foo::foo;
18 int two()
20   return Foo::foo + Foo::erf;
23 int three(int x)
25   return x ? Foo::erf : Foo::foo;
28 int i;
30 int main ()
32   one ();
33   two ();
34   three (i);