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