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
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/ms_struct-bitfield-padding.cpp
+24-8Lines changed: 24 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ static_assert(sizeof(F) == 4);
55
55
structG {
56
56
EnumU32_1 a : 15;
57
57
EnumU64 b : 15;
58
-
// expected-warning@-1 {{bit-field 'b' of type 'EnumU64' has a different storage size than the preceding bit-field (8 vs 4 bytes) and will not be packed under the MSVC ABI}}
58
+
// expected-warning@-1 {{bit-field 'b' of type 'EnumU64' has a different storage size than the preceding bit-field (8 vs 4 bytes) and will not be packed under the MS Windows platform ABI}}
59
59
// expected-note@-3 {{preceding bit-field 'a' declared here with type 'EnumU32_1'}}
60
60
};
61
61
@@ -76,7 +76,7 @@ struct I {
76
76
EnumU8 a : 3;
77
77
EnumI8 b : 5;
78
78
EnumU32_1 c : 10;
79
-
// expected-warning@-1 {{bit-field 'c' of type 'EnumU32_1' has a different storage size than the preceding bit-field (4 vs 1 bytes) and will not be packed under the MSVC ABI}}
79
+
// expected-warning@-1 {{bit-field 'c' of type 'EnumU32_1' has a different storage size than the preceding bit-field (4 vs 1 bytes) and will not be packed under the MS Windows platform ABI}}
80
80
// expected-note@-3 {{preceding bit-field 'b' declared here with type 'EnumI8'}}
// expected-warning@-1 {{bit-field 'b' of type 'EnumU64' has a different storage size than the preceding bit-field (8 vs 4 bytes) and will not be packed under the MSVC ABI}}
119
+
// expected-warning@-1 {{bit-field 'b' of type 'EnumU64' has a different storage size than the preceding bit-field (8 vs 4 bytes) and will not be packed under the MS Windows platform ABI}}
120
120
// expected-note@-3 {{preceding bit-field 'a' declared here with type 'EnumU32_1'}}
121
121
EnumU32_1 c : 10;
122
-
// expected-warning@-1 {{bit-field 'c' of type 'EnumU32_1' has a different storage size than the preceding bit-field (4 vs 8 bytes) and will not be packed under the MSVC ABI}}
122
+
// expected-warning@-1 {{bit-field 'c' of type 'EnumU32_1' has a different storage size than the preceding bit-field (4 vs 8 bytes) and will not be packed under the MS Windows platform ABI}}
123
123
// expected-note@-5 {{preceding bit-field 'b' declared here with type 'EnumU64'}}
// expected-warning@-1 {{bit-field 'b' of type 'EnumU32_1' has a different storage size than the preceding bit-field (4 vs 2 bytes) and will not be packed under the MSVC ABI}}
135
+
// expected-warning@-1 {{bit-field 'b' of type 'EnumU32_1' has a different storage size than the preceding bit-field (4 vs 2 bytes) and will not be packed under the MS Windows platform ABI}}
136
136
// expected-note@-3 {{preceding bit-field 'a' declared here with type 'EnumU16'}}
// expected-warning@-1 {{bit-field 'b' of type 'EnumU16' has a different storage size than the preceding bit-field (2 vs 4 bytes) and will not be packed under the MSVC ABI}}
147
+
// expected-warning@-1 {{bit-field 'b' of type 'EnumU16' has a different storage size than the preceding bit-field (2 vs 4 bytes) and will not be packed under the MS Windows platform ABI}}
148
148
// expected-note@-3 {{preceding bit-field 'a' declared here with type 'EnumU32_1'}}
// expected-warning@-1 {{bit-field 'b' of type 'EnumU16' has a different storage size than the preceding bit-field (2 vs 1 bytes) and will not be packed under the MSVC ABI}}
159
+
// expected-warning@-1 {{bit-field 'b' of type 'EnumU16' has a different storage size than the preceding bit-field (2 vs 1 bytes) and will not be packed under the MS Windows platform ABI}}
160
160
// expected-note@-3 {{preceding bit-field 'a' declared here with type 'EnumU8'}}
161
161
};
162
162
#ifdef MS_BITFIELDS
@@ -169,7 +169,7 @@ struct R {
169
169
EnumU16 a : 9;
170
170
EnumU16 b : 9;
171
171
EnumU8 c : 6;
172
-
// expected-warning@-1 {{bit-field 'c' of type 'EnumU8' has a different storage size than the preceding bit-field (1 vs 2 bytes) and will not be packed under the MSVC ABI}}
172
+
// expected-warning@-1 {{bit-field 'c' of type 'EnumU8' has a different storage size than the preceding bit-field (1 vs 2 bytes) and will not be packed under the MS Windows platform ABI}}
173
173
// expected-note@-3 {{preceding bit-field 'b' declared here with type 'EnumU16'}}
// expected-warning@-1 {{bit-field 'x' of type 'short' has a different storage size than the preceding bit-field (2 vs 1 bytes) and will not be packed under the MS Windows platform ABI}}
189
+
// expected-note@-3 {{preceding bit-field 'd' declared here with type 'char'}}
190
+
// This is a false positive. Reporting this correctly requires duplicating the record layout process
191
+
// in target and MS layout modes, and it's also unclear if that's the correct choice for users of
0 commit comments