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|cast that performs the conversions of"
15  " a reinterpret_cast|cast from %1}0 is not allowed in a constant expression"
16  "%select{| in C++ standards before C++20||}0">;
17def note_constexpr_invalid_downcast : Note<
18  "cannot cast object of dynamic type %0 to type %1">;
19def note_constexpr_overflow : Note<
20  "value %0 is outside the range of representable values of type %1">;
21def note_constexpr_negative_shift : Note<"negative shift count %0">;
22def note_constexpr_large_shift : Note<
23  "shift count %0 >= width of type %1 (%2 bit%s2)">;
24def note_constexpr_lshift_of_negative : Note<"left shift of negative value %0">;
25def note_constexpr_lshift_discards : Note<"signed left shift discards bits">;
26def note_constexpr_invalid_function : Note<
27  "%select{non-constexpr|undefined}0 %select{function|constructor}1 %2 cannot "
28  "be used in a constant expression">;
29def note_constexpr_invalid_inhctor : Note<
30  "constructor inherited from base class %0 cannot be used in a "
31  "constant expression; derived class cannot be implicitly initialized">;
32def note_constexpr_no_return : Note<
33  "control reached end of constexpr function">;
34def note_constexpr_virtual_call : Note<
35  "cannot evaluate call to virtual function in a constant expression "
36  "in C++ standards before C++20">;
37def note_constexpr_pure_virtual_call : Note<
38  "pure virtual function %q0 called">;
39def note_constexpr_polymorphic_unknown_dynamic_type : Note<
40  "%select{|||||virtual function called on|dynamic_cast applied to|"
41  "typeid applied to|construction of|destruction of}0 object '%1' "
42  "whose dynamic type is not constant">;
43def note_constexpr_dynamic_cast_to_reference_failed : Note<
44  "reference dynamic_cast failed: %select{"
45  "static type %1 of operand is a non-public base class of dynamic type %2|"
46  "dynamic type %2 of operand does not have a base class of type %3|"
47  "%3 is an ambiguous base class of dynamic type %2 of operand|"
48  "%3 is a non-public base class of dynamic type %2 of operand}0">;
49def note_constexpr_virtual_base : Note<
50  "cannot construct object of type %0 with virtual base class "
51  "in a constant expression">;
52def note_constexpr_nonliteral : Note<
53  "non-literal type %0 cannot be used in a constant expression">;
54def note_constexpr_non_global : Note<
55  "%select{pointer|reference}0 to %select{|subobject of }1"
56  "%select{temporary|%3}2 is not a constant expression">;
57def note_constexpr_dynamic_alloc : Note<
58  "%select{pointer|reference}0 to %select{|subobject of }1"
59  "heap-allocated object is not a constant expression">;
60def note_constexpr_uninitialized : Note<
61  "%select{|sub}0object of type %1 is not initialized">;
62def note_constexpr_subobject_declared_here : Note<
63  "subobject declared here">;
64def note_constexpr_array_index : Note<"cannot refer to element %0 of "
65  "%select{array of %2 element%plural{1:|:s}2|non-array object}1 "
66  "in a constant expression">;
67def note_constexpr_float_arithmetic : Note<
68  "floating point arithmetic produces %select{an infinity|a NaN}0">;
69def note_constexpr_pointer_subtraction_not_same_array : Note<
70  "subtracted pointers are not elements of the same array">;
71def note_constexpr_pointer_subtraction_zero_size : Note<
72  "subtraction of pointers to type %0 of zero size">;
73def note_constexpr_pointer_comparison_unspecified : Note<
74  "comparison has unspecified value">;
75def note_constexpr_pointer_comparison_base_classes : Note<
76  "comparison of addresses of subobjects of different base classes "
77  "has unspecified value">;
78def note_constexpr_pointer_comparison_base_field : Note<
79  "comparison of address of base class subobject %0 of class %1 to field %2 "
80  "has unspecified value">;
81def note_constexpr_pointer_comparison_differing_access : Note<
82  "comparison of address of fields %0 and %2 of %4 with differing access "
83  "specifiers (%1 vs %3) has unspecified value">;
84def note_constexpr_compare_virtual_mem_ptr : Note<
85  "comparison of pointer to virtual member function %0 has unspecified value">;
86def note_constexpr_past_end : Note<
87  "dereferenced pointer past the end of %select{|subobject of }0"
88  "%select{temporary|%2}1 is not a constant expression">;
89def note_constexpr_past_end_subobject : Note<
90  "cannot %select{access base class of|access derived class of|access field of|"
91  "access array element of|ERROR|"
92  "access real component of|access imaginary component of}0 "
93  "pointer past the end of object">;
94def note_non_null_attribute_failed : Note<
95  "null passed to a callee that requires a non-null argument">;
96def note_constexpr_null_subobject : Note<
97  "cannot %select{access base class of|access derived class of|access field of|"
98  "access array element of|perform pointer arithmetic on|"
99  "access real component of|"
100  "access imaginary component of}0 null pointer">;
101def note_constexpr_var_init_non_constant : Note<
102  "initializer of %0 is not a constant expression">;
103def note_constexpr_typeid_polymorphic : Note<
104  "typeid applied to expression of polymorphic type %0 is "
105  "not allowed in a constant expression in C++ standards before C++20">;
106def note_constexpr_void_comparison : Note<
107  "comparison between unequal pointers to void has unspecified result">;
108def note_constexpr_temporary_here : Note<"temporary created here">;
109def note_constexpr_dynamic_alloc_here : Note<"heap allocation performed here">;
110def note_constexpr_conditional_never_const : Note<
111  "both arms of conditional operator are unable to produce a "
112  "constant expression">;
113def note_constexpr_depth_limit_exceeded : Note<
114  "constexpr evaluation exceeded maximum depth of %0 calls">;
115def note_constexpr_call_limit_exceeded : Note<
116  "constexpr evaluation hit maximum call limit">;
117def note_constexpr_step_limit_exceeded : Note<
118  "constexpr evaluation hit maximum step limit; possible infinite loop?">;
119def note_constexpr_heap_alloc_limit_exceeded : Note<
120  "constexpr evaluation hit maximum heap allocation limit">;
121def note_constexpr_this : Note<
122  "%select{|implicit }0use of 'this' pointer is only allowed within the "
123  "evaluation of a call to a 'constexpr' member function">;
124def note_constexpr_lifetime_ended : Note<
125  "%select{read of|read of|assignment to|increment of|decrement of|"
126  "member call on|dynamic_cast of|typeid applied to|construction of|"
127  "destruction of}0 %select{temporary|variable}1 whose "
128  "%plural{8:storage duration|:lifetime}0 has ended">;
129def note_constexpr_access_uninit : Note<
130  "%select{read of|read of|assignment to|increment of|decrement of|"
131  "member call on|dynamic_cast of|typeid applied to|"
132  "construction of subobject of|destruction of}0 "
133  "%select{object outside its lifetime|uninitialized object}1 "
134  "is not allowed in a constant expression">;
135def note_constexpr_use_uninit_reference : Note<
136  "use of reference outside its lifetime "
137  "is not allowed in a constant expression">;
138def note_constexpr_modify_const_type : Note<
139  "modification of object of const-qualified type %0 is not allowed "
140  "in a constant expression">;
141def note_constexpr_access_volatile_type : Note<
142  "%select{read of|read of|assignment to|increment of|decrement of|"
143  "<ERROR>|<ERROR>|<ERROR>|<ERROR>}0 "
144  "volatile-qualified type %1 is not allowed in a constant expression">;
145def note_constexpr_access_volatile_obj : Note<
146  "%select{read of|read of|assignment to|increment of|decrement of|"
147  "<ERROR>|<ERROR>|<ERROR>|<ERROR>}0 "
148  "volatile %select{temporary|object %2|member %2}1 is not allowed in "
149  "a constant expression">;
150def note_constexpr_volatile_here : Note<
151  "volatile %select{temporary created|object declared|member declared}0 here">;
152def note_constexpr_access_mutable : Note<
153  "%select{read of|read of|assignment to|increment of|decrement of|"
154  "member call on|dynamic_cast of|typeid applied to|construction of|"
155  "destruction of}0 "
156  "mutable member %1 is not allowed in a constant expression">;
157def note_constexpr_ltor_non_const_int : Note<
158  "read of non-const variable %0 is not allowed in a constant expression">;
159def note_constexpr_ltor_non_constexpr : Note<
160  "read of non-constexpr variable %0 is not allowed in a constant expression">;
161def note_constexpr_ltor_incomplete_type : Note<
162  "read of incomplete type %0 is not allowed in a constant expression">;
163def note_constexpr_access_null : Note<
164  "%select{read of|read of|assignment to|increment of|decrement of|"
165  "member call on|dynamic_cast of|typeid applied to|construction of|"
166  "destruction of}0 "
167  "dereferenced null pointer is not allowed in a constant expression">;
168def note_constexpr_access_past_end : Note<
169  "%select{read of|read of|assignment to|increment of|decrement of|"
170  "member call on|dynamic_cast of|typeid applied to|construction of|"
171  "destruction of}0 "
172  "dereferenced one-past-the-end pointer is not allowed "
173  "in a constant expression">;
174def note_constexpr_access_unsized_array : Note<
175  "%select{read of|read of|assignment to|increment of|decrement of|"
176  "member call on|dynamic_cast of|typeid applied to|construction of|"
177  "destruction of}0 "
178  "element of array without known bound "
179  "is not allowed in a constant expression">;
180def note_constexpr_access_inactive_union_member : Note<
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}0 "
184  "member %1 of union with %select{active member %3|no active member}2 "
185  "is not allowed in a constant expression">;
186def note_constexpr_access_static_temporary : Note<
187  "%select{read of|read of|assignment to|increment of|decrement of|"
188  "member call on|dynamic_cast of|typeid applied to|reconstruction of|"
189  "destruction of}0 temporary "
190  "is not allowed in a constant expression outside the expression that "
191  "created the temporary">;
192def note_constexpr_access_unreadable_object : Note<
193  "%select{read of|read of|assignment to|increment of|decrement of|"
194  "member call on|dynamic_cast of|typeid applied to|construction of|"
195  "destruction of}0 "
196  "object '%1' whose value is not known">;
197def note_constexpr_access_deleted_object : Note<
198  "%select{read of|read of|assignment to|increment of|decrement of|"
199  "member call on|dynamic_cast of|typeid applied to|construction of|"
200  "destruction of}0 "
201  "heap allocated object that has been deleted">;
202def note_constexpr_modify_global : Note<
203  "a constant expression cannot modify an object that is visible outside "
204  "that expression">;
205def note_constexpr_stmt_expr_unsupported : Note<
206  "this use of statement expressions is not supported in a "
207  "constant expression">;
208def note_constexpr_calls_suppressed : Note<
209  "(skipping %0 call%s0 in backtrace; use -fconstexpr-backtrace-limit=0 to "
210  "see all)">;
211def note_constexpr_call_here : Note<"in call to '%0'">;
212def note_constexpr_inherited_ctor_call_here : Note<
213  "in implicit initialization for inherited constructor of %0">;
214def note_constexpr_baa_insufficient_alignment : Note<
215  "%select{alignment of|offset of the aligned pointer from}0 the base pointee "
216  "object (%1 %plural{1:byte|:bytes}1) is %select{less than|not a multiple of}0 the "
217  "asserted %2 %plural{1:byte|:bytes}2">;
218def note_constexpr_baa_value_insufficient_alignment : Note<
219  "value of the aligned pointer (%0) is not a multiple of the asserted %1 "
220  "%plural{1:byte|:bytes}1">;
221def note_constexpr_invalid_alignment : Note<
222  "requested alignment %0 is not a positive power of two">;
223def note_constexpr_alignment_too_big : Note<
224  "requested alignment must be %0 or less for type %1; %2 is invalid">;
225def note_constexpr_alignment_compute : Note<
226  "cannot constant evaluate whether run-time alignment is at least %0">;
227def note_constexpr_alignment_adjust : Note<
228  "cannot constant evaluate the result of adjusting alignment to %0">;
229def note_constexpr_destroy_out_of_lifetime : Note<
230  "destroying object '%0' whose lifetime has already ended">;
231def note_constexpr_unsupported_destruction : Note<
232  "non-trivial destruction of type %0 in a constant expression is not supported">;
233def note_constexpr_unsupported_tempoarary_nontrivial_dtor : Note<
234  "non-trivial destruction of lifetime-extended temporary with type %0 "
235  "used in the result of a constant expression is not yet supported">;
236def note_constexpr_unsupported_unsized_array : Note<
237  "array-to-pointer decay of array member without known bound is not supported">;
238def note_constexpr_unsized_array_indexed : Note<
239  "indexing of array without known bound is not allowed "
240  "in a constant expression">;
241def note_constexpr_memcpy_null : Note<
242  "%select{source|destination}2 of "
243  "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' "
244  "is %3">;
245def note_constexpr_memcpy_type_pun : Note<
246  "cannot constant evaluate '%select{memcpy|memmove}0' from object of "
247  "type %1 to object of type %2">;
248def note_constexpr_memcpy_nontrivial : Note<
249  "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
250  "non-trivially-copyable type %1">;
251def note_constexpr_memcpy_incomplete_type : Note<
252  "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
253  "incomplete type %1">;
254def note_constexpr_memcpy_overlap : Note<
255  "'%select{memcpy|wmemcpy}0' between overlapping memory regions">;
256def note_constexpr_memcpy_unsupported : Note<
257  "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' "
258  "not supported: %select{"
259  "size to copy (%4) is not a multiple of size of element type %3 (%5)|"
260  "source is not a contiguous array of at least %4 elements of type %3|"
261  "destination is not a contiguous array of at least %4 elements of type %3}2">;
262def note_constexpr_bit_cast_unsupported_type : Note<
263  "constexpr bit_cast involving type %0 is not yet supported">;
264def note_constexpr_bit_cast_unsupported_bitfield : Note<
265  "constexpr bit_cast involving bit-field is not yet supported">;
266def note_constexpr_bit_cast_invalid_type : Note<
267  "bit_cast %select{from|to}0 a %select{|type with a }1"
268  "%select{union|pointer|member pointer|volatile|reference}2 "
269  "%select{type|member}1 is not allowed in a constant expression">;
270def note_constexpr_bit_cast_invalid_subtype : Note<
271  "invalid type %0 is a %select{member|base}1 of %2">;
272def note_constexpr_bit_cast_indet_dest : Note<
273  "indeterminate value can only initialize an object of type 'unsigned char'"
274  "%select{, 'char',|}1 or 'std::byte'; %0 is invalid">;
275def note_constexpr_pseudo_destructor : Note<
276  "pseudo-destructor call is not permitted in constant expressions "
277  "until C++20">;
278def note_constexpr_construct_complex_elem : Note<
279  "construction of individual component of complex number is not yet supported "
280  "in constant expressions">;
281def note_constexpr_destroy_complex_elem : Note<
282  "destruction of individual component of complex number is not yet supported "
283  "in constant expressions">;
284def note_constexpr_new : Note<
285  "dynamic memory allocation is not permitted in constant expressions "
286  "until C++20">;
287def note_constexpr_new_non_replaceable : Note<
288  "call to %select{placement|class-specific}0 %1">;
289def note_constexpr_new_placement : Note<
290  "this placement new expression is not yet supported in constant expressions">;
291def note_constexpr_placement_new_wrong_type : Note<
292  "placement new would change type of storage from %0 to %1">;
293def note_constexpr_new_negative : Note<
294  "cannot allocate array; evaluated array bound %0 is negative">;
295def note_constexpr_new_too_large : Note<
296  "cannot allocate array; evaluated array bound %0 is too large">;
297def note_constexpr_new_too_small : Note<
298  "cannot allocate array; evaluated array bound %0 is too small to hold "
299  "%1 explicitly initialized elements">;
300def note_constexpr_new_untyped : Note<
301  "cannot allocate untyped memory in a constant expression; "
302  "use 'std::allocator<T>::allocate' to allocate memory of type 'T'">;
303def note_constexpr_new_not_complete_object_type : Note<
304  "cannot allocate memory of %select{incomplete|function}0 type %1">;
305def note_constexpr_operator_new_bad_size : Note<
306  "allocated size %0 is not a multiple of size %1 of element type %2">;
307def note_constexpr_delete_not_heap_alloc : Note<
308  "delete of pointer '%0' that does not point to a heap-allocated object">;
309def note_constexpr_double_delete : Note<
310  "delete of pointer that has already been deleted">;
311def note_constexpr_double_destroy : Note<
312  "destruction of object that is already being destroyed">;
313def note_constexpr_new_delete_mismatch : Note<
314  "%plural{2:'delete' used to delete pointer to object "
315  "allocated with 'std::allocator<...>::allocate'|"
316  ":%select{non-array delete|array delete|'std::allocator<...>::deallocate'}0 "
317  "used to delete pointer to "
318  "%select{array object of type %2|non-array object of type %2|"
319  "object allocated with 'new'}0}1">;
320def note_constexpr_delete_subobject : Note<
321  "delete of pointer%select{ to subobject|}1 '%0' "
322  "%select{|that does not point to complete object}1">;
323def note_constexpr_delete_base_nonvirt_dtor : Note<
324  "delete of object with dynamic type %1 through pointer to "
325  "base class type %0 with non-virtual destructor">;
326def note_constexpr_memory_leak : Note<
327  "allocation performed here was not deallocated"
328  "%plural{0:|: (along with %0 other memory leak%s0)}0">;
329def err_experimental_clang_interp_failed : Error<
330  "the experimental clang interpreter failed to evaluate an expression">;
331
332def warn_integer_constant_overflow : Warning<
333  "overflow in expression; result is %0 with type %1">,
334  InGroup<DiagGroup<"integer-overflow">>;
335
336// This is a temporary diagnostic, and shall be removed once our
337// implementation is complete, and like the preceding constexpr notes belongs
338// in Sema.
339def note_unimplemented_constexpr_lambda_feature_ast : Note<
340    "unimplemented constexpr lambda feature: %0 (coming soon!)">;
341
342def warn_is_constant_evaluated_always_true_constexpr : Warning<
343  "'%0' will always evaluate to 'true' in a manifestly constant-evaluated expression">,
344  InGroup<DiagGroup<"constant-evaluated">>;
345
346// inline asm related.
347let CategoryName = "Inline Assembly Issue" in {
348  def err_asm_invalid_escape : Error<
349    "invalid %% escape in inline assembly string">;
350  def err_asm_unknown_symbolic_operand_name : Error<
351    "unknown symbolic operand name in inline assembly string">;
352
353  def err_asm_unterminated_symbolic_operand_name : Error<
354    "unterminated symbolic operand name in inline assembly string">;
355  def err_asm_empty_symbolic_operand_name : Error<
356    "empty symbolic operand name in inline assembly string">;
357  def err_asm_invalid_operand_number : Error<
358    "invalid operand number in inline asm string">;
359}
360
361// vtable related.
362let CategoryName = "VTable ABI Issue" in {
363  def err_vftable_ambiguous_component : Error<
364    "ambiguous vftable component for %0 introduced via covariant thunks; "
365    "this is an inherent limitation of the ABI">;
366  def note_covariant_thunk : Note<
367    "covariant thunk required by %0">;
368}
369
370// Importing ASTs
371def err_odr_variable_type_inconsistent : Error<
372  "external variable %0 declared with incompatible types in different "
373  "translation units (%1 vs. %2)">;
374def warn_odr_variable_type_inconsistent : Warning<
375  "external variable %0 declared with incompatible types in different "
376  "translation units (%1 vs. %2)">,
377  InGroup<ODR>;
378def err_odr_variable_multiple_def : Error<
379  "external variable %0 defined in multiple translation units">;
380def warn_odr_variable_multiple_def : Warning<
381  "external variable %0 defined in multiple translation units">,
382  InGroup<ODR>;
383def note_odr_value_here : Note<"declared here with type %0">;
384def err_odr_function_type_inconsistent : Error<
385  "external function %0 declared with incompatible types in different "
386  "translation units (%1 vs. %2)">;
387def warn_odr_function_type_inconsistent : Warning<
388  "external function %0 declared with incompatible types in different "
389  "translation units (%1 vs. %2)">,
390  InGroup<ODR>;
391def err_odr_tag_type_inconsistent
392    : Error<"type %0 has incompatible definitions in different translation "
393            "units">;
394def warn_odr_tag_type_inconsistent
395    : Warning<"type %0 has incompatible definitions in different translation "
396              "units">,
397      InGroup<ODR>;
398def note_odr_tag_kind_here: Note<
399  "%0 is a %select{struct|interface|union|class|enum}1 here">;
400def note_odr_field : Note<"field %0 has type %1 here">;
401def note_odr_field_name : Note<"field has name %0 here">;
402def note_odr_missing_field : Note<"no corresponding field here">;
403def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">;
404def note_odr_not_bit_field : Note<"field %0 is not a bit-field">;
405def note_odr_base : Note<"class has base type %0">;
406def note_odr_virtual_base : Note<
407  "%select{non-virtual|virtual}0 derivation here">;
408def note_odr_missing_base : Note<"no corresponding base class here">;
409def note_odr_number_of_bases : Note<
410  "class has %0 base %plural{1:class|:classes}0">;
411def note_odr_enumerator : Note<"enumerator %0 with value %1 here">;
412def note_odr_missing_enumerator : Note<"no corresponding enumerator here">;
413def err_odr_field_type_inconsistent : Error<
414  "field %0 declared with incompatible types in different "
415  "translation units (%1 vs. %2)">;
416def warn_odr_field_type_inconsistent : Warning<
417  "field %0 declared with incompatible types in different "
418  "translation units (%1 vs. %2)">,
419  InGroup<ODR>;
420
421// Importing Objective-C ASTs
422def err_odr_ivar_type_inconsistent : Error<
423  "instance variable %0 declared with incompatible types in different "
424  "translation units (%1 vs. %2)">;
425def warn_odr_ivar_type_inconsistent : Warning<
426  "instance variable %0 declared with incompatible types in different "
427  "translation units (%1 vs. %2)">,
428  InGroup<ODR>;
429def err_odr_objc_superclass_inconsistent : Error<
430  "class %0 has incompatible superclasses">;
431def warn_odr_objc_superclass_inconsistent : Warning<
432  "class %0 has incompatible superclasses">,
433  InGroup<ODR>;
434def note_odr_objc_superclass : Note<"inherits from superclass %0 here">;
435def note_odr_objc_missing_superclass : Note<"no corresponding superclass here">;
436def err_odr_objc_method_result_type_inconsistent : Error<
437  "%select{class|instance}0 method %1 has incompatible result types in "
438  "different translation units (%2 vs. %3)">;
439def warn_odr_objc_method_result_type_inconsistent : Warning<
440  "%select{class|instance}0 method %1 has incompatible result types in "
441  "different translation units (%2 vs. %3)">,
442  InGroup<ODR>;
443def err_odr_objc_method_num_params_inconsistent : Error<
444  "%select{class|instance}0 method %1 has a different number of parameters in "
445  "different translation units (%2 vs. %3)">;
446def warn_odr_objc_method_num_params_inconsistent : Warning<
447  "%select{class|instance}0 method %1 has a different number of parameters in "
448  "different translation units (%2 vs. %3)">,
449  InGroup<ODR>;
450def err_odr_objc_method_param_type_inconsistent : Error<
451  "%select{class|instance}0 method %1 has a parameter with a different types "
452  "in different translation units (%2 vs. %3)">;
453def warn_odr_objc_method_param_type_inconsistent : Warning<
454  "%select{class|instance}0 method %1 has a parameter with a different types "
455  "in different translation units (%2 vs. %3)">,
456  InGroup<ODR>;
457def err_odr_objc_method_variadic_inconsistent : Error<
458  "%select{class|instance}0 method %1 is variadic in one translation unit "
459  "and not variadic in another">;
460def warn_odr_objc_method_variadic_inconsistent : Warning<
461  "%select{class|instance}0 method %1 is variadic in one translation unit "
462  "and not variadic in another">,
463  InGroup<ODR>;
464def note_odr_objc_method_here : Note<
465  "%select{class|instance}0 method %1 also declared here">;
466def err_odr_objc_property_type_inconsistent : Error<
467  "property %0 declared with incompatible types in different "
468  "translation units (%1 vs. %2)">;
469def warn_odr_objc_property_type_inconsistent : Warning<
470  "property %0 declared with incompatible types in different "
471  "translation units (%1 vs. %2)">,
472  InGroup<ODR>;
473def err_odr_objc_property_impl_kind_inconsistent : Error<
474  "property %0 is implemented with %select{@synthesize|@dynamic}1 in one "
475  "translation but %select{@dynamic|@synthesize}1 in another translation unit">;
476def warn_odr_objc_property_impl_kind_inconsistent : Warning<
477  "property %0 is implemented with %select{@synthesize|@dynamic}1 in one "
478  "translation but %select{@dynamic|@synthesize}1 in another translation unit">,
479  InGroup<ODR>;
480def note_odr_objc_property_impl_kind : Note<
481  "property %0 is implemented with %select{@synthesize|@dynamic}1 here">;
482def err_odr_objc_synthesize_ivar_inconsistent : Error<
483  "property %0 is synthesized to different ivars in different translation "
484  "units (%1 vs. %2)">;
485def warn_odr_objc_synthesize_ivar_inconsistent : Warning<
486  "property %0 is synthesized to different ivars in different translation "
487  "units (%1 vs. %2)">,
488  InGroup<ODR>;
489def note_odr_objc_synthesize_ivar_here : Note<
490  "property is synthesized to ivar %0 here">;
491
492// Importing C++ ASTs
493def note_odr_friend : Note<"friend declared here">;
494def note_odr_missing_friend : Note<"no corresponding friend here">;
495def err_odr_different_num_template_parameters : Error<
496  "template parameter lists have a different number of parameters (%0 vs %1)">;
497def warn_odr_different_num_template_parameters : Warning<
498  "template parameter lists have a different number of parameters (%0 vs %1)">,
499  InGroup<ODR>;
500def note_odr_template_parameter_list : Note<
501  "template parameter list also declared here">;
502def err_odr_different_template_parameter_kind : Error<
503  "template parameter has different kinds in different translation units">;
504def warn_odr_different_template_parameter_kind : Warning<
505  "template parameter has different kinds in different translation units">,
506  InGroup<ODR>;
507def note_odr_template_parameter_here : Note<
508  "template parameter declared here">;
509def err_odr_parameter_pack_non_pack : Error<
510  "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">;
511def warn_odr_parameter_pack_non_pack : Warning<
512  "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">,
513  InGroup<ODR>;
514def note_odr_parameter_pack_non_pack : Note<
515  "%select{parameter|parameter pack}0 declared here">;
516def err_odr_non_type_parameter_type_inconsistent : Error<
517  "non-type template parameter declared with incompatible types in different "
518  "translation units (%0 vs. %1)">;
519def warn_odr_non_type_parameter_type_inconsistent : Warning<
520  "non-type template parameter declared with incompatible types in different "
521  "translation units (%0 vs. %1)">,
522  InGroup<ODR>;
523def err_unsupported_ast_node: Error<"cannot import unsupported AST node %0">;
524
525def remark_sanitize_address_insert_extra_padding_accepted : Remark<
526    "-fsanitize-address-field-padding applied to %0">, ShowInSystemHeader,
527    InGroup<SanitizeAddressRemarks>;
528def remark_sanitize_address_insert_extra_padding_rejected : Remark<
529    "-fsanitize-address-field-padding ignored for %0 because it "
530    "%select{is not C++|is packed|is a union|is trivially copyable|"
531    "has trivial destructor|is standard layout|is in a blacklisted file|"
532    "is blacklisted}1">, ShowInSystemHeader,
533    InGroup<SanitizeAddressRemarks>;
534
535def warn_npot_ms_struct : Warning<
536  "ms_struct may not produce Microsoft-compatible layouts with fundamental "
537  "data types with sizes that aren't a power of two">,
538  DefaultError, InGroup<IncompatibleMSStruct>;
539
540// -Wpadded, -Wpacked
541def warn_padded_struct_field : Warning<
542  "padding %select{struct|interface|class}0 %1 with %2 "
543  "%select{byte|bit}3%s2 to align %4">,
544  InGroup<Padded>, DefaultIgnore;
545def warn_padded_struct_anon_field : Warning<
546  "padding %select{struct|interface|class}0 %1 with %2 "
547  "%select{byte|bit}3%s2 to align anonymous bit-field">,
548  InGroup<Padded>, DefaultIgnore;
549def warn_padded_struct_size : Warning<
550  "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
551  InGroup<Padded>, DefaultIgnore;
552def warn_unnecessary_packed : Warning<
553  "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
554}
555