1 // RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 -fsyntax-only -fblocks %s
3 // Classes that have an Objective-C object pointer.
4 struct HasObjectMember0 {
8 struct HasObjectMember1 {
12 struct HasObjectMember2 {
16 // Don't complain if the type has non-external linkage
18 struct HasObjectMember3 {
23 // Don't complain if the Objective-C pointer type was explicitly given
25 struct HasObjectMember3 {
26 __unsafe_unretained id x[3][2];
29 struct HasBlockPointerMember0 {
33 struct HasBlockPointerMember1 {
38 NonPOD(const NonPOD&);
41 struct HasObjectMemberAndNonPOD0 {
46 struct HasObjectMemberAndNonPOD1 {
51 struct HasObjectMemberAndNonPOD2 {
56 struct HasObjectMemberAndNonPOD3 {
57 HasObjectMemberAndNonPOD3 &operator=(const HasObjectMemberAndNonPOD3&);
58 ~HasObjectMemberAndNonPOD3();
63 struct HasBlockPointerMemberAndNonPOD0 {
68 struct HasBlockPointerMemberAndNonPOD1 {
73 int check_non_pod_objc_pointer0[__is_pod(id)? 1 : -1];
74 int check_non_pod_objc_pointer1[__is_pod(__strong id)? -1 : 1];
75 int check_non_pod_objc_pointer2[__is_pod(__unsafe_unretained id)? 1 : -1];
76 int check_non_pod_objc_pointer3[__is_pod(id[2][3])? 1 : -1];
77 int check_non_pod_objc_pointer4[__is_pod(__unsafe_unretained id[2][3])? 1 : -1];
78 int check_non_pod_block0[__is_pod(int (^)(int))? 1 : -1];
79 int check_non_pod_block1[__is_pod(int (^ __unsafe_unretained)(int))? 1 : -1];
81 struct FlexibleArrayMember0 {
83 id array[]; // expected-error{{flexible array member 'array' of type '__strong id[]' with non-trivial destruction}}
86 struct FlexibleArrayMember1 {
88 __unsafe_unretained id array[];
91 // It's okay to pass a retainable type through an ellipsis.
93 void test_variadic() {
94 variadic(1, 17, @"Foo");
97 // It's okay to create a VLA of retainable types.