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