You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
496 B
31 lines
496 B
// RUN: %clang_cc1 -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 enclosing function 'f3'}}
|
|
};
|
|
};
|
|
}
|