diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Misc/ast-dump-attr.cpp | 17 | ||||
-rw-r--r-- | clang/test/Sema/anonymous-struct-union.c | 10 |
2 files changed, 26 insertions, 1 deletions
diff --git a/clang/test/Misc/ast-dump-attr.cpp b/clang/test/Misc/ast-dump-attr.cpp index 1aa6adf79b0..446f0fa692f 100644 --- a/clang/test/Misc/ast-dump-attr.cpp +++ b/clang/test/Misc/ast-dump-attr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s +// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++11 -Wno-deprecated-declarations -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s int TestLocation __attribute__((unused)); @@ -135,3 +135,18 @@ void func() { // CHECK-NOT: NoReturnAttr // CHECK: CXXConversionDecl{{.*}}operator void (*)() __attribute__((noreturn)) } + +namespace PR20930 { +struct S { + struct { int Test __attribute__((deprecated)); }; + // CHECK: FieldDecl{{.*}}Test 'int' + // CHECK-NEXT: DeprecatedAttr +}; + +void f() { + S s; + s.Test = 1; + // CHECK: IndirectFieldDecl{{.*}}Test 'int' + // CHECK: DeprecatedAttr +} +} diff --git a/clang/test/Sema/anonymous-struct-union.c b/clang/test/Sema/anonymous-struct-union.c index 26dbeb87f5f..652383eabb7 100644 --- a/clang/test/Sema/anonymous-struct-union.c +++ b/clang/test/Sema/anonymous-struct-union.c @@ -108,3 +108,13 @@ struct s { struct { int i; }; int a[]; }; + +// PR20930 +struct s3 { + struct { int A __attribute__((deprecated)); }; // expected-note {{'A' has been explicitly marked deprecated here}} +}; + +void deprecated_anonymous_struct_member(void) { + struct s3 s; + s.A = 1; // expected-warning {{'A' is deprecated}} +} |