1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef char __attribute__((aligned(2))) AlignedChar
;
4 typedef AlignedChar arrayType0
[4]; // expected-error {{size of array element}}
6 struct __attribute__((aligned(8))) AlignedStruct
{
10 struct __attribute__((packed
)) PackedStruct
{
15 typedef PackedStruct AlignedPackedStruct
__attribute__((aligned(4)));
16 typedef AlignedPackedStruct arrayType1
[4]; // expected-error {{(5 bytes) isn't a multiple of its alignment (4 bytes)}}
18 AlignedChar a0
[1]; // expected-error {{size of array element}}
20 AlignedPackedStruct a2
[1]; // expected-error {{size of array element}}
23 AlignedChar m0
[1]; // expected-error {{size of array element}}
25 AlignedPackedStruct m2
[1]; // expected-error {{size of array element}}
29 auto p0
= (AlignedChar(*)[1])p
; // expected-error {{size of array element}}
30 auto r0
= (AlignedChar(&)[1])(*p
); // expected-error {{size of array element}}
31 auto p1
= new AlignedChar
[1]; // expected-error {{size of array element}}
32 auto p2
= (AlignedStruct(*)[1])p
;
33 auto p3
= new AlignedStruct
[1];
34 auto p4
= (AlignedPackedStruct(*)[1])p
; // expected-error {{size of array element}}
35 auto p5
= new AlignedPackedStruct
[1]; // expected-error {{size of array element}}
36 auto p6
= new AlignedPackedStruct
;