blob: d888a6d93633098feb1af48d81b7a17e6741f8d7 (
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
|
// RUN: clang-cc -fsyntax-only -verify %s
void f1() {
struct X {
struct Y;
};
struct X::Y {
void f() {}
};
}
void f2() {
struct X {
struct Y;
struct Y {
void f() {}
};
};
}
// A class nested within a local class is a local class.
void f3(int a) { // expected-note{{'a' declared here}}
struct X {
struct Y {
int f() { return a; } // expected-error{{reference to local variable 'a' declared in enclosed function 'f3'}}
};
};
}
|