1// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -emit-pch -o %t.pch %s
2// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -include-pch %t.pch -verify %s
3
4#ifndef HEADER
5#define HEADER
6
7typedef union {
8  id f0;
9} U0;
10
11#else
12
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#endif
25