xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/g++.old-deja/g++.jason/local.C (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 // General testcase for local classes.
2 
3 int x;
f()4 void f ()
5 {
6   static int s;
7   int x;			// ERROR - referenced below
8   extern int q();
9 
10   struct local {
11     int g() { return x; }	// ERROR - automatic variable
12     int h() { return s; }	// gets bogus error - local class
13     int k() { return ::x; }	// OK
14     int l() { return q(); }	// OK
15     int m();			// OK - not defined
16     static int foo;		// ERROR - static data member of local class
17   };
18 }
19 
20 local* p = 0;			// ERROR - no such type in scope
21