annotate gcc/testsuite/g++.old-deja/g++.jason/local.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do assemble }
kono
parents:
diff changeset
2 // General testcase for local classes.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 int x;
kono
parents:
diff changeset
5 void f ()
kono
parents:
diff changeset
6 {
kono
parents:
diff changeset
7 static int s;
kono
parents:
diff changeset
8 int x; // { dg-message "" } referenced below
kono
parents:
diff changeset
9 extern int q();
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 struct local {
kono
parents:
diff changeset
12 int g() { return x; } // { dg-error "" } automatic variable
kono
parents:
diff changeset
13 int h() { return s; } // { dg-bogus "" } local class
kono
parents:
diff changeset
14 int k() { return ::x; } // OK
kono
parents:
diff changeset
15 int l() { return q(); } // OK
kono
parents:
diff changeset
16 int m(); // OK - not defined
kono
parents:
diff changeset
17 static int foo; // { dg-error "" } static data member of local class
kono
parents:
diff changeset
18 };
kono
parents:
diff changeset
19 }
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 local* p = 0; // { dg-error "" } no such type in scope