1//==--- DiagnosticASTKinds.td - libast diagnostics ------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9let Component = "AST" in {
10
11// Constant expression diagnostics. These (and their users) belong in Sema.
12def note_expr_divide_by_zero : Note<"division by zero">;
13def note_constexpr_invalid_cast : Note<
14  "%select{reinterpret_cast|dynamic_cast|%select{this conversion|cast that"
15  " performs the conversions of a reinterpret_cast}1|cast from %1}0"
16  " is not allowed in a constant expression"
17  "%select{| in C++ standards before C++20||}0">;
18def note_constexpr_invalid_void_star_cast : Note<
19  "cast from %0 is not allowed in a constant expression "
20  "%select{in C++ standards before C++2c|because the pointed object "
21  "type %2 is not similar to the target type %3}1">;
22def note_constexpr_invalid_downcast : Note<
23  "cannot cast object of dynamic type %0 to type %1">;
24def note_constexpr_overflow : Note<
25  "value %0 is outside the range of representable values of type %1">;
26def note_constexpr_negative_shift : Note<"negative shift count %0">;
27def note_constexpr_large_shift : Note<
28  "shift count %0 >= width of type %1 (%2 bit%s2)">;
29def note_constexpr_lshift_of_negative : Note<"left shift of negative value %0">;
30def note_constexpr_lshift_discards : Note<"signed left shift discards bits">;
31def note_constexpr_invalid_function : Note<
32  "%select{non-constexpr|undefined}0 %select{function|constructor}1 %2 cannot "
33  "be used in a constant expression">;
34def note_constexpr_invalid_inhctor : Note<
35  "constructor inherited from base class %0 cannot be used in a "
36  "constant expression; derived class cannot be implicitly initialized">;
37def note_constexpr_no_return : Note<
38  "control reached end of constexpr function">;
39def note_constexpr_virtual_call : Note<
40  "cannot evaluate call to virtual function in a constant expression "
41  "in C++ standards before C++20">;
42def note_constexpr_pure_virtual_call : Note<
43  "pure virtual function %q0 called">;
44def note_constexpr_polymorphic_unknown_dynamic_type : Note<
45  "%select{|||||virtual function called on|dynamic_cast applied to|"
46  "typeid applied to|construction of|destruction of}0 object '%1' "
47  "whose dynamic type is not constant">;
48def note_constexpr_dynamic_cast_to_reference_failed : Note<
49  "reference dynamic_cast failed: %select{"
50  "static type %1 of operand is a non-public base class of dynamic type %2|"
51  "dynamic type %2 of operand does not have a base class of type %3|"
52  "%3 is an ambiguous base class of dynamic type %2 of operand|"
53  "%3 is a non-public base class of dynamic type %2 of operand}0">;
54def note_constexpr_virtual_base : Note<
55  "cannot construct object of type %0 with virtual base class "
56  "in a constant expression">;
57def note_constexpr_nonliteral : Note<
58  "non-literal type %0 cannot be used in a constant expression">;
59def note_constexpr_non_global : Note<
60  "%select{pointer|reference}0 to %select{|subobject of }1"
61  "%select{temporary|%3}2 is not a constant expression">;
62def note_constexpr_not_static : Note<
63  "address of non-static constexpr variable %0 may differ on each invocation "
64  "of the enclosing function; add 'static' to give it a constant address">;
65def note_constexpr_dynamic_alloc : Note<
66  "%select{pointer|reference}0 to %select{|subobject of }1"
67  "heap-allocated object is not a constant expression">;
68def note_consteval_address_accessible : Note<
69  "%select{pointer|reference}0 to a consteval declaration "
70  "is not a constant expression">;
71def note_constexpr_uninitialized : Note<
72  "subobject %select{of type |}0%1 is not initialized">;
73def note_constexpr_uninitialized_base : Note<
74  "constructor of base class %0 is not called">;
75def note_constexpr_static_local : Note<
76  "control flows through the definition of a %select{static|thread_local}0 variable">;
77def note_constexpr_subobject_declared_here : Note<
78  "subobject declared here">;
79def note_constexpr_array_index : Note<"cannot refer to element %0 of "
80  "%select{array of %2 element%plural{1:|:s}2|non-array object}1 "
81  "in a constant expression">;
82def note_constexpr_float_arithmetic : Note<
83  "floating point arithmetic produces %select{an infinity|a NaN}0">;
84def note_constexpr_dynamic_rounding : Note<
85  "cannot evaluate this expression if rounding mode is dynamic">;
86def note_constexpr_float_arithmetic_strict : Note<
87  "compile time floating point arithmetic suppressed in strict evaluation modes">;
88def note_constexpr_pointer_subtraction_not_same_array : Note<
89  "subtracted pointers are not elements of the same array">;
90def note_constexpr_pointer_subtraction_zero_size : Note<
91  "subtraction of pointers to type %0 of zero size">;
92def note_constexpr_pointer_comparison_unspecified : Note<
93  "comparison between '%0' and '%1' has unspecified value">;
94def note_constexpr_pointer_constant_comparison : Note<
95  "comparison of numeric address '%0' with pointer '%1' can only be performed "
96  "at runtime">;
97def note_constexpr_literal_comparison : Note<
98  "comparison of addresses of literals has unspecified value">;
99def note_constexpr_pointer_weak_comparison : Note<
100  "comparison against address of weak declaration '%0' can only be performed "
101  "at runtime">;
102def note_constexpr_mem_pointer_weak_comparison : Note<
103  "comparison against pointer to weak member %q0 can only be performed "
104  "at runtime">;
105def note_constexpr_pointer_comparison_past_end : Note<
106  "comparison against pointer '%0' that points past the end of a "
107  "complete object has unspecified value">;
108def note_constexpr_pointer_comparison_zero_sized : Note<
109  "comparison of pointers '%0' and '%1' to unrelated zero-sized objects">;
110def note_constexpr_pointer_comparison_base_classes : Note<
111  "comparison of addresses of subobjects of different base classes "
112  "has unspecified value">;
113def note_constexpr_pointer_comparison_base_field : Note<
114  "comparison of address of base class subobject %0 of class %1 to field %2 "
115  "has unspecified value">;
116def note_constexpr_pointer_comparison_differing_access : Note<
117  "comparison of address of fields %0 and %2 of %4 with differing access "
118  "specifiers (%1 vs %3) has unspecified value">;
119def note_constexpr_compare_virtual_mem_ptr : Note<
120  "comparison of pointer to virtual member function %0 has unspecified value">;
121def note_constexpr_past_end : Note<
122  "dereferenced pointer past the end of %select{|subobject of }0"
123  "%select{temporary|%2}1 is not a constant expression">;
124def note_constexpr_past_end_subobject : Note<
125  "cannot %select{access base class of|access derived class of|access field of|"
126  "access array element of|ERROR|"
127  "access real component of|access imaginary component of}0 "
128  "pointer past the end of object">;
129def note_non_null_attribute_failed : Note<
130  "null passed to a callee that requires a non-null argument">;
131def note_constexpr_null_subobject : Note<
132  "cannot %select{access base class of|access derived class of|access field of|"
133  "access array element of|perform pointer arithmetic on|"
134  "access real component of|"
135  "access imaginary component of}0 null pointer">;
136def note_constexpr_null_callee : Note<
137  "'%0' evaluates to a null function pointer">;
138def note_constexpr_function_param_value_unknown : Note<
139  "function parameter %0 with unknown value cannot be used in a constant "
140  "expression">;
141def note_constexpr_var_init_unknown : Note<
142  "initializer of %0 is unknown">;
143def note_constexpr_var_init_non_constant : Note<
144  "initializer of %0 is not a constant expression">;
145def note_constexpr_var_init_weak : Note<
146  "initializer of weak variable %0 is not considered constant because "
147  "it may be different at runtime">;
148def note_constexpr_typeid_polymorphic : Note<
149  "typeid applied to expression of polymorphic type %0 is "
150  "not allowed in a constant expression in C++ standards before C++20">;
151def note_constexpr_void_comparison : Note<
152  "comparison between unequal pointers to void has unspecified result">;
153def note_constexpr_temporary_here : Note<"temporary created here">;
154def note_constexpr_dynamic_alloc_here : Note<"heap allocation performed here">;
155def note_constexpr_conditional_never_const : Note<
156  "both arms of conditional operator are unable to produce a "
157  "constant expression">;
158def note_constexpr_depth_limit_exceeded : Note<
159  "constexpr evaluation exceeded maximum depth of %0 calls">;
160def note_constexpr_call_limit_exceeded : Note<
161  "constexpr evaluation hit maximum call limit">;
162def note_constexpr_step_limit_exceeded : Note<
163  "constexpr evaluation hit maximum step limit; possible infinite loop?">;
164def note_constexpr_heap_alloc_limit_exceeded : Note<
165  "constexpr evaluation hit maximum heap allocation limit">;
166def note_constexpr_this : Note<
167  "%select{|implicit }0use of 'this' pointer is only allowed within the "
168  "evaluation of a call to a 'constexpr' member function">;
169def note_constexpr_lifetime_ended : Note<
170  "%select{read of|read of|assignment to|increment of|decrement of|"
171  "member call on|dynamic_cast of|typeid applied to|construction of|"
172  "destruction of}0 %select{temporary|variable}1 whose "
173  "%plural{8:storage duration|:lifetime}0 has ended">;
174def note_constexpr_access_uninit : Note<
175  "%select{read of|read of|assignment to|increment of|decrement of|"
176  "member call on|dynamic_cast of|typeid applied to|"
177  "construction of subobject of|destruction of}0 "
178  "%select{object outside its lifetime|uninitialized object}1 "
179  "is not allowed in a constant expression">;
180def note_constexpr_use_uninit_reference : Note<
181  "use of reference outside its lifetime "
182  "is not allowed in a constant expression">;
183def note_constexpr_modify_const_type : Note<
184  "modification of object of const-qualified type %0 is not allowed "
185  "in a constant expression">;
186def note_constexpr_access_volatile_type : Note<
187  "%select{read of|read of|assignment to|increment of|decrement of|"
188  "<ERROR>|<ERROR>|<ERROR>|<ERROR>}0 "
189  "volatile-qualified type %1 is not allowed in a constant expression">;
190def note_constexpr_access_volatile_obj : Note<
191  "%select{read of|read of|assignment to|increment of|decrement of|"
192  "<ERROR>|<ERROR>|<ERROR>|<ERROR>}0 "
193  "volatile %select{temporary|object %2|member %2}1 is not allowed in "
194  "a constant expression">;
195def note_constexpr_volatile_here : Note<
196  "volatile %select{temporary created|object declared|member declared}0 here">;
197def note_constexpr_access_mutable : Note<
198  "%select{read of|read of|assignment to|increment of|decrement of|"
199  "member call on|dynamic_cast of|typeid applied to|construction of|"
200  "destruction of}0 "
201  "mutable member %1 is not allowed in a constant expression">;
202def note_constexpr_ltor_non_const_int : Note<
203  "read of non-const variable %0 is not allowed in a constant expression">;
204def note_constexpr_ltor_non_integral : Note<
205  "read of variable %0 of non-integral, non-enumeration type %1 "
206  "is not allowed in a constant expression">;
207def note_constexpr_ltor_non_constexpr : Note<
208  "read of non-constexpr variable %0 is not allowed in a constant expression">;
209def note_constexpr_ltor_incomplete_type : Note<
210  "read of incomplete type %0 is not allowed in a constant expression">;
211def note_constexpr_access_null : Note<
212  "%select{read of|read of|assignment to|increment of|decrement of|"
213  "member call on|dynamic_cast of|typeid applied to|construction of|"
214  "destruction of}0 "
215  "dereferenced null pointer is not allowed in a constant expression">;
216def note_constexpr_access_past_end : Note<
217  "%select{read of|read of|assignment to|increment of|decrement of|"
218  "member call on|dynamic_cast of|typeid applied to|construction of|"
219  "destruction of}0 "
220  "dereferenced one-past-the-end pointer is not allowed "
221  "in a constant expression">;
222def note_constexpr_access_unsized_array : Note<
223  "%select{read of|read of|assignment to|increment of|decrement of|"
224  "member call on|dynamic_cast of|typeid applied to|construction of|"
225  "destruction of}0 "
226  "element of array without known bound "
227  "is not allowed in a constant expression">;
228def note_constexpr_access_inactive_union_member : Note<
229  "%select{read of|read of|assignment to|increment of|decrement of|"
230  "member call on|dynamic_cast of|typeid applied to|"
231  "construction of subobject of|destruction of}0 "
232  "member %1 of union with %select{active member %3|no active member}2 "
233  "is not allowed in a constant expression">;
234def note_constexpr_union_member_change_during_init : Note<
235  "assignment would change active union member during the initialization of "
236  "a different member of the same union">;
237def note_constexpr_access_static_temporary : Note<
238  "%select{read of|read of|assignment to|increment of|decrement of|"
239  "member call on|dynamic_cast of|typeid applied to|reconstruction of|"
240  "destruction of}0 temporary "
241  "is not allowed in a constant expression outside the expression that "
242  "created the temporary">;
243def note_constexpr_access_unreadable_object : Note<
244  "%select{read of|read of|assignment to|increment of|decrement of|"
245  "member call on|dynamic_cast of|typeid applied to|construction of|"
246  "destruction of}0 "
247  "object '%1' whose value is not known">;
248def note_constexpr_access_deleted_object : Note<
249  "%select{read of|read of|assignment to|increment of|decrement of|"
250  "member call on|dynamic_cast of|typeid applied to|construction of|"
251  "destruction of}0 "
252  "heap allocated object that has been deleted">;
253def note_constexpr_modify_global : Note<
254  "a constant expression cannot modify an object that is visible outside "
255  "that expression">;
256def note_constexpr_stmt_expr_unsupported : Note<
257  "this use of statement expressions is not supported in a "
258  "constant expression">;
259def note_constexpr_calls_suppressed : Note<
260  "(skipping %0 call%s0 in backtrace; use -fconstexpr-backtrace-limit=0 to "
261  "see all)">;
262def note_constexpr_call_here : Note<"in call to '%0'">;
263def note_constexpr_inherited_ctor_call_here : Note<
264  "in implicit initialization for inherited constructor of %0">;
265def note_constexpr_baa_insufficient_alignment : Note<
266  "%select{alignment of|offset of the aligned pointer from}0 the base pointee "
267  "object (%1 %plural{1:byte|:bytes}1) is %select{less than|not a multiple of}0 the "
268  "asserted %2 %plural{1:byte|:bytes}2">;
269def note_constexpr_baa_value_insufficient_alignment : Note<
270  "value of the aligned pointer (%0) is not a multiple of the asserted %1 "
271  "%plural{1:byte|:bytes}1">;
272def note_constexpr_invalid_alignment : Note<
273  "requested alignment %0 is not a positive power of two">;
274def note_constexpr_alignment_too_big : Note<
275  "requested alignment must be %0 or less for type %1; %2 is invalid">;
276def note_constexpr_alignment_compute : Note<
277  "cannot constant evaluate whether run-time alignment is at least %0">;
278def note_constexpr_alignment_adjust : Note<
279  "cannot constant evaluate the result of adjusting alignment to %0">;
280def note_constexpr_destroy_out_of_lifetime : Note<
281  "destroying object '%0' whose lifetime has already ended">;
282def note_constexpr_unsupported_destruction : Note<
283  "non-trivial destruction of type %0 in a constant expression is not supported">;
284def note_constexpr_unsupported_temporary_nontrivial_dtor : Note<
285  "non-trivial destruction of lifetime-extended temporary with type %0 "
286  "used in the result of a constant expression is not yet supported">;
287def note_constexpr_unsupported_unsized_array : Note<
288  "array-to-pointer decay of array member without known bound is not supported">;
289def note_constexpr_unsized_array_indexed : Note<
290  "indexing of array without known bound is not allowed "
291  "in a constant expression">;
292def note_constexpr_memcmp_unsupported : Note<
293  "constant evaluation of %0 between arrays of types %1 and %2 "
294  "is not supported; only arrays of narrow character types can be compared">;
295def note_constexpr_memchr_unsupported : Note<
296  "constant evaluation of %0 on array of type %1 "
297  "is not supported; only arrays of narrow character types can be searched">;
298def note_constexpr_memcpy_null : Note<
299  "%select{source|destination}2 of "
300  "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' "
301  "is %3">;
302def note_constexpr_memcpy_type_pun : Note<
303  "cannot constant evaluate '%select{memcpy|memmove}0' from object of "
304  "type %1 to object of type %2">;
305def note_constexpr_memcpy_nontrivial : Note<
306  "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
307  "non-trivially-copyable type %1">;
308def note_constexpr_memcpy_incomplete_type : Note<
309  "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
310  "incomplete type %1">;
311def note_constexpr_memcpy_overlap : Note<
312  "'%select{memcpy|wmemcpy}0' between overlapping memory regions">;
313def note_constexpr_memcpy_unsupported : Note<
314  "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' "
315  "not supported: %select{"
316  "size to copy (%4) is not a multiple of size of element type %3 (%5)|"
317  "source is not a contiguous array of at least %4 elements of type %3|"
318  "destination is not a contiguous array of at least %4 elements of type %3}2">;
319def note_constexpr_bit_cast_unsupported_type : Note<
320  "constexpr bit_cast involving type %0 is not yet supported">;
321def note_constexpr_bit_cast_unsupported_bitfield : Note<
322  "constexpr bit_cast involving bit-field is not yet supported">;
323def note_constexpr_bit_cast_invalid_type : Note<
324  "bit_cast %select{from|to}0 a %select{|type with a }1"
325  "%select{union|pointer|member pointer|volatile|reference}2 "
326  "%select{type|member}1 is not allowed in a constant expression">;
327def note_constexpr_bit_cast_invalid_subtype : Note<
328  "invalid type %0 is a %select{member|base}1 of %2">;
329def note_constexpr_bit_cast_indet_dest : Note<
330  "indeterminate value can only initialize an object of type 'unsigned char'"
331  "%select{, 'char',|}1 or 'std::byte'; %0 is invalid">;
332def note_constexpr_bit_cast_unrepresentable_value : Note<
333  "value %1 cannot be represented in type %0">;
334def note_constexpr_pseudo_destructor : Note<
335  "pseudo-destructor call is not permitted in constant expressions "
336  "until C++20">;
337def note_constexpr_construct_complex_elem : Note<
338  "construction of individual component of complex number is not yet supported "
339  "in constant expressions">;
340def note_constexpr_destroy_complex_elem : Note<
341  "destruction of individual component of complex number is not yet supported "
342  "in constant expressions">;
343def note_constexpr_new : Note<
344  "dynamic memory allocation is not permitted in constant expressions "
345  "until C++20">;
346def note_constexpr_new_non_replaceable : Note<
347  "call to %select{placement|class-specific}0 %1">;
348def note_constexpr_new_placement : Note<
349  "this placement new expression is not yet supported in constant expressions">;
350def note_constexpr_placement_new_wrong_type : Note<
351  "placement new would change type of storage from %0 to %1">;
352def note_constexpr_new_negative : Note<
353  "cannot allocate array; evaluated array bound %0 is negative">;
354def note_constexpr_new_too_large : Note<
355  "cannot allocate array; evaluated array bound %0 is too large">;
356def note_constexpr_new_too_small : Note<
357  "cannot allocate array; evaluated array bound %0 is too small to hold "
358  "%1 explicitly initialized elements">;
359def note_constexpr_new_untyped : Note<
360  "cannot allocate untyped memory in a constant expression; "
361  "use 'std::allocator<T>::allocate' to allocate memory of type 'T'">;
362def note_constexpr_new_not_complete_object_type : Note<
363  "cannot allocate memory of %select{incomplete|function}0 type %1">;
364def note_constexpr_operator_new_bad_size : Note<
365  "allocated size %0 is not a multiple of size %1 of element type %2">;
366def note_constexpr_delete_not_heap_alloc : Note<
367  "delete of pointer '%0' that does not point to a heap-allocated object">;
368def note_constexpr_double_delete : Note<
369  "delete of pointer that has already been deleted">;
370def note_constexpr_double_destroy : Note<
371  "destruction of object that is already being destroyed">;
372def note_constexpr_new_delete_mismatch : Note<
373  "%plural{2:'delete' used to delete pointer to object "
374  "allocated with 'std::allocator<...>::allocate'|"
375  ":%select{non-array delete|array delete|'std::allocator<...>::deallocate'}0 "
376  "used to delete pointer to "
377  "%select{array object of type %2|non-array object of type %2|"
378  "object allocated with 'new'}0}1">;
379def note_constexpr_deallocate_null : Note<
380  "'std::allocator<...>::deallocate' used to delete a null pointer">;
381def note_constexpr_delete_subobject : Note<
382  "delete of pointer%select{ to subobject|}1 '%0' "
383  "%select{|that does not point to complete object}1">;
384def note_constexpr_delete_base_nonvirt_dtor : Note<
385  "delete of object with dynamic type %1 through pointer to "
386  "base class type %0 with non-virtual destructor">;
387def note_constexpr_memory_leak : Note<
388  "allocation performed here was not deallocated"
389  "%plural{0:|: (along with %0 other memory leak%s0)}0">;
390def note_constexpr_unsupported_layout : Note<
391  "type %0 has unexpected layout">;
392def note_constexpr_unsupported_flexible_array : Note<
393  "flexible array initialization is not yet supported">;
394def err_experimental_clang_interp_failed : Error<
395  "the experimental clang interpreter failed to evaluate an expression">;
396
397def warn_integer_constant_overflow : Warning<
398  "overflow in expression; result is %0 with type %1">,
399  InGroup<DiagGroup<"integer-overflow">>;
400def warn_fixedpoint_constant_overflow : Warning<
401  "overflow in expression; result is %0 with type %1">,
402  InGroup<DiagGroup<"fixed-point-overflow">>;
403def warn_constexpr_unscoped_enum_out_of_range : Warning<
404  "integer value %0 is outside the valid range of values [%1, %2] for the "
405  "enumeration type %3">, DefaultError, InGroup<DiagGroup<"enum-constexpr-conversion">>;
406
407// This is a temporary diagnostic, and shall be removed once our
408// implementation is complete, and like the preceding constexpr notes belongs
409// in Sema.
410def note_unimplemented_constexpr_lambda_feature_ast : Note<
411    "unimplemented constexpr lambda feature: %0 (coming soon!)">;
412
413def warn_is_constant_evaluated_always_true_constexpr : Warning<
414  "'%0' will always evaluate to 'true' in a manifestly constant-evaluated expression">,
415  InGroup<DiagGroup<"constant-evaluated">>;
416
417// inline asm related.
418let CategoryName = "Inline Assembly Issue" in {
419  def err_asm_invalid_escape : Error<
420    "invalid %% escape in inline assembly string">;
421  def err_asm_unknown_symbolic_operand_name : Error<
422    "unknown symbolic operand name in inline assembly string">;
423
424  def err_asm_unterminated_symbolic_operand_name : Error<
425    "unterminated symbolic operand name in inline assembly string">;
426  def err_asm_empty_symbolic_operand_name : Error<
427    "empty symbolic operand name in inline assembly string">;
428  def err_asm_invalid_operand_number : Error<
429    "invalid operand number in inline asm string">;
430}
431
432// vtable related.
433let CategoryName = "VTable ABI Issue" in {
434  def err_vftable_ambiguous_component : Error<
435    "ambiguous vftable component for %0 introduced via covariant thunks; "
436    "this is an inherent limitation of the ABI">;
437  def note_covariant_thunk : Note<
438    "covariant thunk required by %0">;
439}
440
441// Importing ASTs
442def err_odr_variable_type_inconsistent : Error<
443  "external variable %0 declared with incompatible types in different "
444  "translation units (%1 vs. %2)">;
445def warn_odr_variable_type_inconsistent : Warning<
446  "external variable %0 declared with incompatible types in different "
447  "translation units (%1 vs. %2)">,
448  InGroup<ODR>;
449def err_odr_variable_multiple_def : Error<
450  "external variable %0 defined in multiple translation units">;
451def warn_odr_variable_multiple_def : Warning<
452  "external variable %0 defined in multiple translation units">,
453  InGroup<ODR>;
454def note_odr_value_here : Note<"declared here with type %0">;
455def err_odr_function_type_inconsistent : Error<
456  "external function %0 declared with incompatible types in different "
457  "translation units (%1 vs. %2)">;
458def warn_odr_function_type_inconsistent : Warning<
459  "external function %0 declared with incompatible types in different "
460  "translation units (%1 vs. %2)">,
461  InGroup<ODR>;
462def err_odr_tag_type_inconsistent
463    : Error<"type %0 has incompatible definitions in different translation "
464            "units">;
465def warn_odr_tag_type_inconsistent
466    : Warning<"type %0 has incompatible definitions in different translation "
467              "units">,
468      InGroup<ODR>;
469def note_odr_tag_kind_here: Note<
470  "%0 is a %select{struct|interface|union|class|enum}1 here">;
471def note_odr_field : Note<"field %0 has type %1 here">;
472def note_odr_field_name : Note<"field has name %0 here">;
473def note_odr_missing_field : Note<"no corresponding field here">;
474def note_odr_base : Note<"class has base type %0">;
475def note_odr_virtual_base : Note<
476  "%select{non-virtual|virtual}0 derivation here">;
477def note_odr_missing_base : Note<"no corresponding base class here">;
478def note_odr_number_of_bases : Note<
479  "class has %0 base %plural{1:class|:classes}0">;
480def note_odr_enumerator : Note<"enumerator %0 with value %1 here">;
481def note_odr_missing_enumerator : Note<"no corresponding enumerator here">;
482def err_odr_field_type_inconsistent : Error<
483  "field %0 declared with incompatible types in different "
484  "translation units (%1 vs. %2)">;
485def warn_odr_field_type_inconsistent : Warning<
486  "field %0 declared with incompatible types in different "
487  "translation units (%1 vs. %2)">,
488  InGroup<ODR>;
489
490// Importing Objective-C ASTs
491def err_odr_ivar_type_inconsistent : Error<
492  "instance variable %0 declared with incompatible types in different "
493  "translation units (%1 vs. %2)">;
494def warn_odr_ivar_type_inconsistent : Warning<
495  "instance variable %0 declared with incompatible types in different "
496  "translation units (%1 vs. %2)">,
497  InGroup<ODR>;
498def err_odr_objc_superclass_inconsistent : Error<
499  "class %0 has incompatible superclasses">;
500def warn_odr_objc_superclass_inconsistent : Warning<
501  "class %0 has incompatible superclasses">,
502  InGroup<ODR>;
503def note_odr_objc_superclass : Note<"inherits from superclass %0 here">;
504def note_odr_objc_missing_superclass : Note<"no corresponding superclass here">;
505def err_odr_objc_method_result_type_inconsistent : Error<
506  "%select{class|instance}0 method %1 has incompatible result types in "
507  "different translation units (%2 vs. %3)">;
508def warn_odr_objc_method_result_type_inconsistent : Warning<
509  "%select{class|instance}0 method %1 has incompatible result types in "
510  "different translation units (%2 vs. %3)">,
511  InGroup<ODR>;
512def err_odr_objc_method_num_params_inconsistent : Error<
513  "%select{class|instance}0 method %1 has a different number of parameters in "
514  "different translation units (%2 vs. %3)">;
515def warn_odr_objc_method_num_params_inconsistent : Warning<
516  "%select{class|instance}0 method %1 has a different number of parameters in "
517  "different translation units (%2 vs. %3)">,
518  InGroup<ODR>;
519def err_odr_objc_method_param_type_inconsistent : Error<
520  "%select{class|instance}0 method %1 has a parameter with a different types "
521  "in different translation units (%2 vs. %3)">;
522def warn_odr_objc_method_param_type_inconsistent : Warning<
523  "%select{class|instance}0 method %1 has a parameter with a different types "
524  "in different translation units (%2 vs. %3)">,
525  InGroup<ODR>;
526def err_odr_objc_method_variadic_inconsistent : Error<
527  "%select{class|instance}0 method %1 is variadic in one translation unit "
528  "and not variadic in another">;
529def warn_odr_objc_method_variadic_inconsistent : Warning<
530  "%select{class|instance}0 method %1 is variadic in one translation unit "
531  "and not variadic in another">,
532  InGroup<ODR>;
533def note_odr_objc_method_here : Note<
534  "%select{class|instance}0 method %1 also declared here">;
535def err_odr_objc_property_type_inconsistent : Error<
536  "property %0 declared with incompatible types in different "
537  "translation units (%1 vs. %2)">;
538def warn_odr_objc_property_type_inconsistent : Warning<
539  "property %0 declared with incompatible types in different "
540  "translation units (%1 vs. %2)">,
541  InGroup<ODR>;
542def err_odr_objc_property_impl_kind_inconsistent : Error<
543  "property %0 is implemented with %select{@synthesize|@dynamic}1 in one "
544  "translation but %select{@dynamic|@synthesize}1 in another translation unit">;
545def warn_odr_objc_property_impl_kind_inconsistent : Warning<
546  "property %0 is implemented with %select{@synthesize|@dynamic}1 in one "
547  "translation but %select{@dynamic|@synthesize}1 in another translation unit">,
548  InGroup<ODR>;
549def note_odr_objc_property_impl_kind : Note<
550  "property %0 is implemented with %select{@synthesize|@dynamic}1 here">;
551def err_odr_objc_synthesize_ivar_inconsistent : Error<
552  "property %0 is synthesized to different ivars in different translation "
553  "units (%1 vs. %2)">;
554def warn_odr_objc_synthesize_ivar_inconsistent : Warning<
555  "property %0 is synthesized to different ivars in different translation "
556  "units (%1 vs. %2)">,
557  InGroup<ODR>;
558def note_odr_objc_synthesize_ivar_here : Note<
559  "property is synthesized to ivar %0 here">;
560
561// Importing C++ ASTs
562def note_odr_friend : Note<"friend declared here">;
563def note_odr_missing_friend : Note<"no corresponding friend here">;
564def err_odr_different_num_template_parameters : Error<
565  "template parameter lists have a different number of parameters (%0 vs %1)">;
566def warn_odr_different_num_template_parameters : Warning<
567  "template parameter lists have a different number of parameters (%0 vs %1)">,
568  InGroup<ODR>;
569def note_odr_template_parameter_list : Note<
570  "template parameter list also declared here">;
571def err_odr_different_template_parameter_kind : Error<
572  "template parameter has different kinds in different translation units">;
573def warn_odr_different_template_parameter_kind : Warning<
574  "template parameter has different kinds in different translation units">,
575  InGroup<ODR>;
576def note_odr_template_parameter_here : Note<
577  "template parameter declared here">;
578def err_odr_parameter_pack_non_pack : Error<
579  "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">;
580def warn_odr_parameter_pack_non_pack : Warning<
581  "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">,
582  InGroup<ODR>;
583def note_odr_parameter_pack_non_pack : Note<
584  "%select{parameter|parameter pack}0 declared here">;
585def err_odr_non_type_parameter_type_inconsistent : Error<
586  "non-type template parameter declared with incompatible types in different "
587  "translation units (%0 vs. %1)">;
588def warn_odr_non_type_parameter_type_inconsistent : Warning<
589  "non-type template parameter declared with incompatible types in different "
590  "translation units (%0 vs. %1)">,
591  InGroup<ODR>;
592def err_unsupported_ast_node: Error<"cannot import unsupported AST node %0">;
593
594// Compare ODR hashes
595def err_module_odr_violation_different_definitions : Error<
596  "%q0 has different definitions in different modules; "
597  "%select{definition in module '%2' is here|defined here}1">;
598def note_first_module_difference : Note<
599  "in first definition, possible difference is here">;
600def note_module_odr_violation_different_definitions : Note<
601  "definition in module '%0' is here">;
602def note_second_module_difference : Note<
603  "in second definition, possible difference is here">;
604
605def err_module_odr_violation_definition_data : Error <
606  "%q0 has different definitions in different modules; first difference is "
607  "%select{definition in module '%2'|defined here}1 found "
608  "%select{"
609  "%4 base %plural{1:class|:classes}4|"
610  "%4 virtual base %plural{1:class|:classes}4|"
611  "%ordinal4 base class with type %5|"
612  "%ordinal4 %select{non-virtual|virtual}5 base class %6|"
613  "%ordinal4 base class %5 with "
614  "%select{public|protected|private|no}6 access specifier}3">;
615
616def note_module_odr_violation_definition_data : Note <
617  "but in '%0' found "
618  "%select{"
619  "%2 base %plural{1:class|:classes}2|"
620  "%2 virtual base %plural{1:class|:classes}2|"
621  "%ordinal2 base class with different type %3|"
622  "%ordinal2 %select{non-virtual|virtual}3 base class %4|"
623  "%ordinal2 base class %3 with "
624  "%select{public|protected|private|no}4 access specifier}1">;
625
626def err_module_odr_violation_objc_interface : Error <
627  "%0 has different definitions in different modules; first difference is "
628  "%select{definition in module '%2'|defined here}1 found "
629  "%select{"
630  "%select{no super class|super class with type %5}4|"
631  "instance variable '%4' access control is "
632    "%select{|@private|@protected|@public|@package}5"
633  "}3">;
634def note_module_odr_violation_objc_interface : Note <
635  "but in %select{'%1'|definition here}0 found "
636  "%select{"
637  "%select{no super class|super class with type %4}3|"
638  "instance variable '%3' access control is "
639    "%select{|@private|@protected|@public|@package}4"
640  "}2">;
641
642def err_module_odr_violation_template_parameter : Error <
643  "%q0 has different definitions in different modules; first difference is "
644  "%select{definition in module '%2'|defined here}1 found "
645  "%select{"
646  "unnamed template parameter|"
647  "template parameter %5|"
648  "template parameter with %select{no |}4default argument|"
649  "template parameter with default argument}3">;
650
651def note_module_odr_violation_template_parameter : Note <
652  "but in '%0' found "
653  "%select{"
654  "unnamed template parameter %2|"
655  "template parameter %3|"
656  "template parameter with %select{no |}2default argument|"
657  "template parameter with different default argument}1">;
658
659def err_module_odr_violation_mismatch_decl : Error<
660  "%q0 has different definitions in different modules; first difference is "
661  "%select{definition in module '%2'|defined here}1 found "
662  "%select{end of class|public access specifier|private access specifier|"
663  "protected access specifier|static assert|field|method|type alias|typedef|"
664  "data member|friend declaration|function template|method|instance variable|"
665  "property}3">;
666def note_module_odr_violation_mismatch_decl : Note<
667  "but in %select{'%1'|definition here}0 found "
668  "%select{end of class|public access specifier|private access specifier|"
669  "protected access specifier|static assert|field|method|type alias|typedef|"
670  "data member|friend declaration|function template|method|instance variable|"
671  "property}2">;
672
673def err_module_odr_violation_record : Error<
674  "%q0 has different definitions in different modules; first difference is "
675  "%select{definition in module '%2'|defined here}1 found "
676  "%select{"
677  "static assert with condition|"
678  "static assert with message|"
679  "static assert with %select{|no }4message|"
680  "%select{method %5|constructor|destructor}4|"
681  "%select{method %5|constructor|destructor}4 "
682    "is %select{not deleted|deleted}6|"
683  "%select{method %5|constructor|destructor}4 "
684    "is %select{not defaulted|defaulted}6|"
685  "%select{method %5|constructor|destructor}4 "
686    "is %select{|pure }6%select{not virtual|virtual}7|"
687  "%select{method %5|constructor|destructor}4 "
688    "is %select{not static|static}6|"
689  "%select{method %5|constructor|destructor}4 "
690    "is %select{not volatile|volatile}6|"
691  "%select{method %5|constructor|destructor}4 "
692    "is %select{not const|const}6|"
693  "%select{method %5|constructor|destructor}4 "
694    "is %select{not inline|inline}6|"
695  "%select{method %5|constructor|destructor}4 "
696    "with %ordinal6 parameter with%select{out|}7 a default argument|"
697  "%select{method %5|constructor|destructor}4 "
698    "with %ordinal6 parameter with a default argument|"
699  "%select{method %5|constructor|destructor}4 "
700    "with %select{no |}6template arguments|"
701  "%select{method %5|constructor|destructor}4 "
702    "with %6 template argument%s6|"
703  "%select{method %5|constructor|destructor}4 "
704    "with %6 for %ordinal7 template argument|"
705  "%select{method %5|constructor|destructor}4 "
706    "with %select{no body|body}6|"
707  "%select{method %5|constructor|destructor}4 "
708    "with body|"
709  "friend %select{class|function}4|"
710  "friend %4|"
711  "friend function %4|"
712  "function template %4 with %5 template parameter%s5|"
713  "function template %4 with %ordinal5 template parameter being a "
714    "%select{type|non-type|template}6 template parameter|"
715  "function template %4 with %ordinal5 template parameter "
716    "%select{with no name|named %7}6|"
717  "function template %4 with %ordinal5 template parameter with "
718    "%select{no |}6default argument|"
719  "function template %4 with %ordinal5 template parameter with "
720    "default argument %6|"
721  "function template %4 with %ordinal5 template parameter with one type|"
722  "function template %4 with %ordinal5 template parameter %select{not |}6"
723    "being a template parameter pack|"
724  "}3">;
725
726def note_module_odr_violation_record : Note<"but in '%0' found "
727  "%select{"
728  "static assert with different condition|"
729  "static assert with different message|"
730  "static assert with %select{|no }2message|"
731  "%select{method %3|constructor|destructor}2|"
732  "%select{method %3|constructor|destructor}2 "
733    "is %select{not deleted|deleted}4|"
734  "%select{method %3|constructor|destructor}2 "
735    "is %select{not defaulted|defaulted}4|"
736  "%select{method %3|constructor|destructor}2 "
737    "is %select{|pure }4%select{not virtual|virtual}5|"
738  "%select{method %3|constructor|destructor}2 "
739    "is %select{not static|static}4|"
740  "%select{method %3|constructor|destructor}2 "
741    "is %select{not volatile|volatile}4|"
742  "%select{method %3|constructor|destructor}2 "
743    "is %select{not const|const}4|"
744  "%select{method %3|constructor|destructor}2 "
745    "is %select{not inline|inline}4|"
746  "%select{method %3|constructor|destructor}2 "
747    "with %ordinal4 parameter with%select{out|}5 a default argument|"
748  "%select{method %3|constructor|destructor}2 "
749    "with %ordinal4 parameter with a different default argument|"
750  "%select{method %3|constructor|destructor}2 "
751    "with %select{no |}4template arguments|"
752  "%select{method %3|constructor|destructor}2 "
753    "with %4 template argument%s4|"
754  "%select{method %3|constructor|destructor}2 "
755    "with %4 for %ordinal5 template argument|"
756  "%select{method %3|constructor|destructor}2 "
757    "with %select{no body|body}4|"
758  "%select{method %3|constructor|destructor}2 "
759    "with different body|"
760  "friend %select{class|function}2|"
761  "friend %2|"
762  "friend function %2|"
763  "function template %2 with %3 template parameter%s3|"
764  "function template %2 with %ordinal3 template paramter being a "
765    "%select{type|non-type|template}4 template parameter|"
766  "function template %2 with %ordinal3 template parameter "
767    "%select{with no name|named %5}4|"
768  "function template %2 with %ordinal3 template parameter with "
769    "%select{no |}4default argument|"
770  "function template %2 with %ordinal3 template parameter with "
771    "default argument %4|"
772  "function template %2 with %ordinal3 template parameter with different type|"
773  "function template %2 with %ordinal3 template parameter %select{not |}4"
774    "being a template parameter pack|"
775  "}1">;
776
777def err_module_odr_violation_field : Error<
778  "%q0 has different definitions in different modules; first difference is "
779  "%select{definition in module '%2'|defined here}1 found "
780  "%select{"
781  "field %4|"
782  "field %4 with type %5|"
783  "%select{non-|}5bitfield %4|"
784  "bitfield %4 with one width expression|"
785  "%select{non-|}5mutable field %4|"
786  "field %4 with %select{no|an}5 initializer|"
787  "field %4 with an initializer"
788  "}3">;
789def note_module_odr_violation_field : Note<
790  "but in %select{'%1'|definition here}0 found "
791  "%select{"
792  "field %3|"
793  "field %3 with type %4|"
794  "%select{non-|}4bitfield %3|"
795  "bitfield %3 with different width expression|"
796  "%select{non-|}4mutable field %3|"
797  "field %3 with %select{no|an}4 initializer|"
798  "field %3 with a different initializer"
799  "}2">;
800
801def err_module_odr_violation_typedef : Error<
802  "%q0 has different definitions in different modules; first difference is "
803  "%select{definition in module '%2'|defined here}1 found "
804  "%select{"
805  "%select{typedef|type alias}4 name %5|"
806  "%select{typedef|type alias}4 %5 with underlying type %6"
807  "}3">;
808def note_module_odr_violation_typedef : Note<"but in '%0' found "
809  "%select{"
810  "%select{typedef|type alias}2 name %3|"
811  "%select{typedef|type alias}2 %3 with different underlying type %4"
812  "}1">;
813
814def err_module_odr_violation_variable : Error<
815  "%q0 has different definitions in different modules; first difference is "
816  "%select{definition in module '%2'|defined here}1 found "
817  "%select{"
818  "data member with name %4|"
819  "data member %4 with type %5|"
820  "data member %4 with%select{out|}5 an initializer|"
821  "data member %4 with an initializer|"
822  "data member %4 %select{is constexpr|is not constexpr}5"
823  "}3">;
824def note_module_odr_violation_variable : Note<"but in '%0' found "
825  "%select{"
826  "data member with name %2|"
827  "data member %2 with different type %3|"
828  "data member %2 with%select{out|}3 an initializer|"
829  "data member %2 with a different initializer|"
830  "data member %2 %select{is constexpr|is not constexpr}3"
831  "}1">;
832
833def err_module_odr_violation_function : Error<
834  "%q0 has different definitions in different modules; "
835  "%select{definition in module '%2'|defined here}1 "
836  "first difference is "
837  "%select{"
838  "return type is %4|"
839  "%ordinal4 parameter with name %5|"
840  "%ordinal4 parameter with type %5%select{| decayed from %7}6|"
841  "%ordinal4 parameter with%select{out|}5 a default argument|"
842  "%ordinal4 parameter with a default argument|"
843  "function body"
844  "}3">;
845
846def note_module_odr_violation_function : Note<"but in '%0' found "
847  "%select{"
848  "different return type %2|"
849  "%ordinal2 parameter with name %3|"
850  "%ordinal2 parameter with type %3%select{| decayed from %5}4|"
851  "%ordinal2 parameter with%select{out|}3 a default argument|"
852  "%ordinal2 parameter with a different default argument|"
853  "a different body"
854  "}1">;
855
856def err_module_odr_violation_enum : Error<
857  "%q0 has different definitions in different modules; "
858  "%select{definition in module '%2'|defined here}1 "
859  "first difference is "
860  "%select{"
861  "enum that is %select{not scoped|scoped}4|"
862  "enum scoped with keyword %select{struct|class}4|"
863  "enum %select{without|with}4 specified type|"
864  "enum with specified type %4|"
865  "enum with %4 element%s4|"
866  "%ordinal4 element has name %5|"
867  "%ordinal4 element %5 %select{has|does not have}6 an initializer|"
868  "%ordinal4 element %5 has an initializer|"
869  "}3">;
870
871def note_module_odr_violation_enum : Note<"but in '%0' found "
872  "%select{"
873  "enum that is %select{not scoped|scoped}2|"
874  "enum scoped with keyword %select{struct|class}2|"
875  "enum %select{without|with}2 specified type|"
876  "enum with specified type %2|"
877  "enum with %2 element%s2|"
878  "%ordinal2 element has name %3|"
879  "%ordinal2 element %3 %select{has|does not have}4 an initializer|"
880  "%ordinal2 element %3 has different initializer|"
881  "}1">;
882
883def err_module_odr_violation_referenced_protocols : Error <
884  "%q0 has different definitions in different modules; first difference is "
885  "%select{definition in module '%2'|defined here}1 found "
886  "%select{"
887  "%4 referenced %plural{1:protocol|:protocols}4|"
888  "%ordinal4 referenced protocol with name %5"
889  "}3">;
890def note_module_odr_violation_referenced_protocols : Note <
891  "but in %select{'%1'|definition here}0 found "
892  "%select{"
893  "%3 referenced %plural{1:protocol|:protocols}3|"
894  "%ordinal3 referenced protocol with different name %4"
895  "}2">;
896
897def err_module_odr_violation_objc_method : Error<
898  "%q0 has different definitions in different modules; first difference is "
899  "%select{definition in module '%2'|defined here}1 found "
900  "%select{"
901  "method %4 with return type %5|"
902  "%select{class|instance}5 method %4|"
903  "%select{no|'required'|'optional'}4 method control|"
904  "method %4 with %select{no designated initializer|designated initializer}5|"
905  "%select{regular|direct}5 method %4|"
906  "method %4"
907  "}3">;
908def note_module_odr_violation_objc_method : Note<
909  "but in %select{'%1'|definition here}0 found "
910  "%select{"
911  "method %3 with different return type %4|"
912  "method %3 as %select{class|instance}4 method|"
913  "%select{no|'required'|'optional'}3 method control|"
914  "method %3 with %select{no designated initializer|designated initializer}4|"
915  "%select{regular|direct}4 method %3|"
916  "different method %3"
917  "}2">;
918
919def err_module_odr_violation_method_params : Error<
920  "%q0 has different definitions in different modules; first difference is "
921  "%select{definition in module '%2'|defined here}1 found "
922  "%select{"
923  "%select{method %5|constructor|destructor}4 "
924    "that has %6 parameter%s6|"
925  "%select{method %5|constructor|destructor}4 "
926    "with %ordinal6 parameter of type %7%select{| decayed from %9}8|"
927  "%select{method %5|constructor|destructor}4 "
928    "with %ordinal6 parameter named %7"
929  "}3">;
930def note_module_odr_violation_method_params : Note<
931  "but in %select{'%1'|definition here}0 found "
932  "%select{"
933  "%select{method %4|constructor|destructor}3 "
934    "that has %5 parameter%s5|"
935  "%select{method %4|constructor|destructor}3 "
936    "with %ordinal5 parameter of type %6%select{| decayed from %8}7|"
937  "%select{method %4|constructor|destructor}3 "
938    "with %ordinal5 parameter named %6"
939  "}2">;
940
941def err_module_odr_violation_objc_property : Error<
942  "%q0 has different definitions in different modules; first difference is "
943  "%select{definition in module '%2'|defined here}1 found "
944  "%select{"
945  "property %4|"
946  "property %4 with type %5|"
947  "%select{no|'required'|'optional'}4 property control|"
948  "property %4 with %select{default |}6'%select{none|readonly|getter|assign|"
949    "readwrite|retain|copy|nonatomic|setter|atomic|weak|strong|"
950    "unsafe_unretained|nullability|null_resettable|class|direct}5' attribute"
951  "}3">;
952def note_module_odr_violation_objc_property : Note<
953  "but in %select{'%1'|definition here}0 found "
954  "%select{"
955  "property %3|"
956  "property %3 with type %4|"
957  "%select{no|'required'|'optional'}3 property control|"
958  "property %3 with different '%select{none|readonly|getter|assign|"
959    "readwrite|retain|copy|nonatomic|setter|atomic|weak|strong|"
960    "unsafe_unretained|nullability|null_resettable|class|direct}4' attribute"
961  "}2">;
962
963def err_module_odr_violation_mismatch_decl_unknown : Error<
964  "%q0 %select{with definition in module '%2'|defined here}1 has different "
965  "definitions in different modules; first difference is this "
966  "%select{||||static assert|field|method|type alias|typedef|data member|"
967  "friend declaration|function template|method|instance variable|"
968  "property|unexpected decl}3">;
969def note_module_odr_violation_mismatch_decl_unknown : Note<
970  "but in %select{'%1'|definition here}0 found "
971  "%select{||||different static assert|different field|different method|"
972  "different type alias|different typedef|different data member|"
973  "different friend declaration|different function template|different method|"
974  "different instance variable|different property|another unexpected decl}2">;
975
976
977def remark_sanitize_address_insert_extra_padding_accepted : Remark<
978    "-fsanitize-address-field-padding applied to %0">, ShowInSystemHeader,
979    InGroup<SanitizeAddressRemarks>;
980def remark_sanitize_address_insert_extra_padding_rejected : Remark<
981    "-fsanitize-address-field-padding ignored for %0 because it "
982    "%select{is not C++|is packed|is a union|is trivially copyable|"
983    "has trivial destructor|is standard layout|is in a ignorelisted file|"
984    "is ignorelisted}1">, ShowInSystemHeader,
985    InGroup<SanitizeAddressRemarks>;
986
987def warn_npot_ms_struct : Warning<
988  "ms_struct may not produce Microsoft-compatible layouts with fundamental "
989  "data types with sizes that aren't a power of two">,
990  DefaultError, InGroup<IncompatibleMSStruct>;
991
992// -Wpadded, -Wpacked
993def warn_padded_struct_field : Warning<
994  "padding %select{struct|interface|class}0 %1 with %2 "
995  "%select{byte|bit}3%s2 to align %4">,
996  InGroup<Padded>, DefaultIgnore;
997def warn_padded_struct_anon_field : Warning<
998  "padding %select{struct|interface|class}0 %1 with %2 "
999  "%select{byte|bit}3%s2 to align anonymous bit-field">,
1000  InGroup<Padded>, DefaultIgnore;
1001def warn_padded_struct_size : Warning<
1002  "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
1003  InGroup<Padded>, DefaultIgnore;
1004def warn_unnecessary_packed : Warning<
1005  "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
1006def warn_unpacked_field
1007    : Warning<
1008          "not packing field %0 as it is non-POD for the purposes of layout">,
1009      InGroup<PackedNonPod>,
1010      DefaultIgnore;
1011
1012// -Wunaligned-access
1013def warn_unaligned_access : Warning<
1014  "field %1 within %0 is less aligned than %2 and is usually due to %0 being "
1015  "packed, which can lead to unaligned accesses">, InGroup<UnalignedAccess>, DefaultIgnore;
1016}
1017