You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct__attribute__((ms_struct)) BitfieldStruct { // expected-warning {{padding size of 'BitfieldStruct' with 3 bytes to alignment boundary}}
4
+
char c : 1;
5
+
int : 0; // expected-warning {{padding struct 'BitfieldStruct' with 31 bits to align anonymous bit-field}}
6
+
char i;
7
+
};
8
+
9
+
struct__attribute__((ms_struct)) SevenBitfieldStruct { // expected-warning {{padding size of 'SevenBitfieldStruct' with 3 bytes to alignment boundary}}
10
+
char c : 7;
11
+
int : 0; // expected-warning {{padding struct 'SevenBitfieldStruct' with 25 bits to align anonymous bit-field}}
char : 1; // Same unit size attributes fall in the same unit + they fill the unit -> no padding
18
+
char i;
19
+
};
20
+
21
+
struct__attribute__((ms_struct)) DifferentUnitSizeBitfield { // expected-warning {{padding size of 'DifferentUnitSizeBitfield' with 3 bytes to alignment boundary}}
22
+
char c : 7;
23
+
int : 1; // expected-warning {{padding struct 'DifferentUnitSizeBitfield' with 25 bits to align anonymous bit-field}}
24
+
char i; // expected-warning {{padding struct 'DifferentUnitSizeBitfield' with 31 bits to align 'i'}}
struct__attribute__((ms_struct)) Foo { // expected-warning {{padding size of 'Foo' with 3 bytes to alignment boundary}}
5
+
int b : 1;
6
+
char a; // expected-warning {{padding struct 'Foo' with 31 bits to align 'a'}}
7
+
};
8
+
9
+
struct__attribute__((ms_struct)) AlignedStruct { // expected-warning {{padding size of 'AlignedStruct' with 4 bytes to alignment boundary}}
10
+
char c;
11
+
alignas(8) int i; // expected-warning {{padding struct 'AlignedStruct' with 7 bytes to align 'i'}}
12
+
};
13
+
14
+
15
+
structBase {
16
+
int b;
17
+
};
18
+
19
+
structDerived : publicBase { // expected-warning {{padding size of 'Derived' with 3 bytes to alignment boundary}}
20
+
char c;
21
+
};
22
+
23
+
union__attribute__((ms_struct)) Union {
24
+
char c;
25
+
longlong u;
26
+
};
27
+
28
+
struct__attribute__((ms_struct)) StructWithUnion { // expected-warning {{padding size of 'StructWithUnion' with 6 bytes to alignment boundary}}
29
+
char c;
30
+
int : 0;
31
+
Union t; // expected-warning {{padding struct 'StructWithUnion' with 7 bytes to align 't'}}
32
+
short i;
33
+
};
34
+
35
+
struct__attribute__((ms_struct)) EmptyStruct {};
36
+
37
+
struct__attribute__((ms_struct)) AlignedMemberStruct { // expected-warning {{padding size of 'AlignedMemberStruct' with 28 bytes to alignment boundary}}
38
+
alignas(32) int x;
39
+
};
40
+
41
+
structalignas(32) __attribute__((ms_struct)) AlignedNonEmptyStruct { // expected-warning {{padding size of 'AlignedNonEmptyStruct' with 28 bytes to alignment boundary}}
42
+
int x;
43
+
};
44
+
45
+
46
+
structalignas(16) __attribute__((ms_struct)) AlignedEmptyStruct {}; // expected-warning {{padding size of 'AlignedEmptyStruct' with 15 bytes to alignment boundary}}
0 commit comments