================
@@ -1,30 +1,111 @@
-// 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'}}
- };
- };
-}
+// RUN: %clang_cc1 -fsyntax-only -verify -verify-directives %s
+
----------------
Sirraide wrote:
Another test case:
```c++
decltype(auto) f() {
struct S { struct A; };
return S();
}
using X = decltype(f());
struct X::A {};
```
(As an aside, GCC currently crashes on this but there is already a bug for
that: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88003)
https://github.com/llvm/llvm-project/pull/197863
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits