20 lines · c
1// For backward compatibility, fields of C unions declared in system headers2// that have non-trivial ObjC ownership qualifications are marked as unavailable3// unless the qualifier is explicit and __strong.4 5#pragma clang system_header6 7typedef __strong id StrongID;8 9typedef union {10 id f0;11 _Nonnull id f1;12 __weak id f2;13 StrongID f3;14} U0_SystemHeader;15 16typedef union { // expected-note {{'U1_SystemHeader' has subobjects that are non-trivial to destruct}} expected-note {{'U1_SystemHeader' has subobjects that are non-trivial to copy}}17 __strong id f0; // expected-note {{f0 has type '__strong id' that is non-trivial to destruct}} expected-note {{f0 has type '__strong id' that is non-trivial to copy}}18 _Nonnull id f1;19} U1_SystemHeader;20