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