// RUN: %clang_cc1 -verify -ast-dump %s | \
// RUN: FileCheck --implicit-check-not OwnerAttr --implicit-check-not PointerAttr %s
int i;
// expected-error@-1 {{'Owner' attribute cannot be applied to types}}
void ;
// expected-error@-1 {{'Owner' attribute cannot be applied to types}}
void ;
// expected-warning@-1 {{'Owner' attribute only applies to structs}}
;
// expected-warning@-1 {{'Owner' attribute only applies to structs}}
;
S Instance;
// expected-error@-1 {{'Owner' attribute cannot be applied to types}}
;
// expected-error@-1 {{expected a type}}
;
// expected-error@-1 {{expected a type}}
;
// expected-error@-1 {{'Pointer' and 'Owner' attributes are not compatible}}
// expected-note@-2 {{conflicting attribute is here}}
// CHECK: CXXRecordDecl {{.*}} BothOwnerPointer
// CHECK: OwnerAttr {{.*}} int
;
// CHECK: CXXRecordDecl {{.*}} OwnerVoidDerefType
// CHECK: OwnerAttr {{.*}} void
;
// CHECK: CXXRecordDecl {{.*}} PointerVoidDerefType
// CHECK: PointerAttr {{.*}} void
;
// CHECK: CXXRecordDecl {{.*}} AddConflictLater
// CHECK: PointerAttr {{.*}} int
;
// expected-error@-1 {{'Owner' and 'Pointer' attributes are not compatible}}
// expected-note@-5 {{conflicting attribute is here}}
// CHECK: CXXRecordDecl {{.*}} AddConflictLater
// CHECK: PointerAttr {{.*}} Inherited int
;
// CHECK: CXXRecordDecl {{.*}} AddConflictLater2
// CHECK: OwnerAttr {{.*}} int
;
// expected-error@-1 {{'Owner' and 'Owner' attributes are not compatible}}
// expected-note@-5 {{conflicting attribute is here}}
// CHECK: CXXRecordDecl {{.*}} AddConflictLater
// CHECK: OwnerAttr {{.*}} Inherited int
;
// expected-error@-1 {{'Owner' and 'Owner' attributes are not compatible}}
// expected-note@-2 {{conflicting attribute is here}}
// CHECK: CXXRecordDecl {{.*}} WithAndWithoutParameter
// CHECK: OwnerAttr
;
// expected-error@-1 {{a reference type is an invalid argument to attribute 'Owner'}}
;
// expected-error@-1 {{an array type is an invalid argument to attribute 'Pointer'}}
;
// CHECK: CXXRecordDecl {{.*}} OwnerMissingParameter
// CHECK: OwnerAttr
;
// CHECK: CXXRecordDecl {{.*}} PointerMissingParameter
// CHECK: PointerAttr
;
// CHECK: CXXRecordDecl {{.*}} OwnerWithEmptyParameterList
// CHECK: OwnerAttr {{.*}}
;
// CHECK: CXXRecordDecl {{.*}} PointerWithEmptyParameterList
// CHECK: PointerAttr {{.*}}
;
// CHECK: CXXRecordDecl {{.*}} AnOwner
// CHECK: OwnerAttr {{.*}} int
;
;
// CHECK: CXXRecordDecl {{.*}} APointer
// CHECK: PointerAttr {{.*}} S
;
// CHECK: CXXRecordDecl {{.*}} DuplicateOwner
// CHECK: OwnerAttr {{.*}} int
;
// CHECK: CXXRecordDecl {{.*}} DuplicatePointer
// CHECK: PointerAttr {{.*}} int
;
// CHECK: CXXRecordDecl {{.*}} AddTheSameLater
// CHECK: OwnerAttr {{.*}} int
;
// CHECK: CXXRecordDecl {{.*}} prev {{.*}} AddTheSameLater
// CHECK: OwnerAttr {{.*}} int
;
// CHECK: ClassTemplateDecl {{.*}} ForwardDeclared
// CHECK: OwnerAttr {{.*}}
// CHECK: ClassTemplateSpecializationDecl {{.*}} ForwardDeclared
// CHECK: TemplateArgument type 'int'
// CHECK: OwnerAttr {{.*}}
;
static_assert; // Force instantiation.