brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · abd3354 Raw
25 lines · plain
1// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -emit-pch -o %t.pch %s2// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -include-pch %t.pch -verify %s3 4#ifndef HEADER5#define HEADER6 7typedef union {8  id f0;9} U0;10 11#else12 13// expected-note@-6 {{'U0' has subobjects that are non-trivial to destruct}}14// expected-note@-7 {{'U0' has subobjects that are non-trivial to copy}}15// expected-note@-8 {{'U0' has subobjects that are non-trivial to default-initialize}}16// expected-note@-8 {{f0 has type '__strong id' that is non-trivial to destruct}}17// expected-note@-9 {{f0 has type '__strong id' that is non-trivial to copy}}18// expected-note@-10 {{f0 has type '__strong id' that is non-trivial to default-initialize}}19 20U0 foo0(void); // expected-error {{cannot use type 'U0' for function/method return since it is a union that is non-trivial to destruct}} expected-error {{cannot use type 'U0' for function/method return since it is a union that is non-trivial to copy}}21 22U0 g0; // expected-error {{cannot default-initialize an object of type 'U0' since it is a union that is non-trivial to default-initialize}}23 24#endif25