]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td
Merge once more from ^/vendor/llvm-project/release-10.x, to get the
[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_constexpr_uninitialized : Note<
61   "%select{|sub}0object of type %1 is not initialized">;
62 def note_constexpr_subobject_declared_here : Note<
63   "subobject declared here">;
64 def 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">;
67 def note_constexpr_float_arithmetic : Note<
68   "floating point arithmetic produces %select{an infinity|a NaN}0">;
69 def note_constexpr_pointer_subtraction_not_same_array : Note<
70   "subtracted pointers are not elements of the same array">;
71 def note_constexpr_pointer_subtraction_zero_size : Note<
72   "subtraction of pointers to type %0 of zero size">;
73 def note_constexpr_pointer_comparison_unspecified : Note<
74   "comparison has unspecified value">;
75 def note_constexpr_pointer_comparison_base_classes : Note<
76   "comparison of addresses of subobjects of different base classes "
77   "has unspecified value">;
78 def 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">;
81 def 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">;
84 def note_constexpr_compare_virtual_mem_ptr : Note<
85   "comparison of pointer to virtual member function %0 has unspecified value">;
86 def 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">;
89 def 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">;
94 def note_non_null_attribute_failed : Note<
95   "null passed to a callee that requires a non-null argument">;
96 def 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">;
101 def note_constexpr_var_init_non_constant : Note<
102   "initializer of %0 is not a constant expression">;
103 def 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">;
106 def note_constexpr_void_comparison : Note<
107   "comparison between unequal pointers to void has unspecified result">;
108 def note_constexpr_temporary_here : Note<"temporary created here">;
109 def note_constexpr_dynamic_alloc_here : Note<"heap allocation performed here">;
110 def note_constexpr_conditional_never_const : Note<
111   "both arms of conditional operator are unable to produce a "
112   "constant expression">;
113 def note_constexpr_depth_limit_exceeded : Note<
114   "constexpr evaluation exceeded maximum depth of %0 calls">;
115 def note_constexpr_call_limit_exceeded : Note<
116   "constexpr evaluation hit maximum call limit">;
117 def note_constexpr_step_limit_exceeded : Note<
118   "constexpr evaluation hit maximum step limit; possible infinite loop?">;
119 def note_constexpr_heap_alloc_limit_exceeded : Note<
120   "constexpr evaluation hit maximum heap allocation limit">;
121 def 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">;
124 def 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">;
129 def 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">;
135 def note_constexpr_use_uninit_reference : Note<
136   "use of reference outside its lifetime "
137   "is not allowed in a constant expression">;
138 def note_constexpr_modify_const_type : Note<
139   "modification of object of const-qualified type %0 is not allowed "
140   "in a constant expression">;
141 def 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">;
145 def 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">;
150 def note_constexpr_volatile_here : Note<
151   "volatile %select{temporary created|object declared|member declared}0 here">;
152 def 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">;
157 def note_constexpr_ltor_non_const_int : Note<
158   "read of non-const variable %0 is not allowed in a constant expression">;
159 def note_constexpr_ltor_non_constexpr : Note<
160   "read of non-constexpr variable %0 is not allowed in a constant expression">;
161 def note_constexpr_ltor_incomplete_type : Note<
162   "read of incomplete type %0 is not allowed in a constant expression">;
163 def 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">;
168 def 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">;
174 def 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">;
180 def 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">;
186 def 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">;
192 def 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">;
197 def 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">;
202 def note_constexpr_modify_global : Note<
203   "a constant expression cannot modify an object that is visible outside "
204   "that expression">;
205 def note_constexpr_stmt_expr_unsupported : Note<
206   "this use of statement expressions is not supported in a "
207   "constant expression">;
208 def note_constexpr_calls_suppressed : Note<
209   "(skipping %0 call%s0 in backtrace; use -fconstexpr-backtrace-limit=0 to "
210   "see all)">;
211 def note_constexpr_call_here : Note<"in call to '%0'">;
212 def note_constexpr_inherited_ctor_call_here : Note<
213   "in implicit initialization for inherited constructor of %0">;
214 def 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">;
218 def 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">;
221 def note_constexpr_invalid_alignment : Note<
222   "requested alignment %0 is not a positive power of two">;
223 def note_constexpr_alignment_too_big : Note<
224   "requested alignment must be %0 or less for type %1; %2 is invalid">;
225 def note_constexpr_alignment_compute : Note<
226   "cannot constant evaluate whether run-time alignment is at least %0">;
227 def note_constexpr_alignment_adjust : Note<
228   "cannot constant evaluate the result of adjusting alignment to %0">;
229 def note_constexpr_destroy_out_of_lifetime : Note<
230   "destroying object '%0' whose lifetime has already ended">;
231 def note_constexpr_unsupported_destruction : Note<
232   "non-trivial destruction of type %0 in a constant expression is not supported">;
233 def 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">;
236 def note_constexpr_unsupported_unsized_array : Note<
237   "array-to-pointer decay of array member without known bound is not supported">;
238 def note_constexpr_unsized_array_indexed : Note<
239   "indexing of array without known bound is not allowed "
240   "in a constant expression">;
241 def 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">;
245 def 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">;
248 def note_constexpr_memcpy_nontrivial : Note<
249   "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
250   "non-trivially-copyable type %1">;
251 def note_constexpr_memcpy_incomplete_type : Note<
252   "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
253   "incomplete type %1">;
254 def note_constexpr_memcpy_overlap : Note<
255   "'%select{memcpy|wmemcpy}0' between overlapping memory regions">;
256 def 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">;
262 def note_constexpr_bit_cast_unsupported_type : Note<
263   "constexpr bit_cast involving type %0 is not yet supported">;
264 def note_constexpr_bit_cast_unsupported_bitfield : Note<
265   "constexpr bit_cast involving bit-field is not yet supported">;
266 def 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">;
270 def note_constexpr_bit_cast_invalid_subtype : Note<
271   "invalid type %0 is a %select{member|base}1 of %2">;
272 def 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">;
275 def note_constexpr_pseudo_destructor : Note<
276   "pseudo-destructor call is not permitted in constant expressions "
277   "until C++20">;
278 def note_constexpr_construct_complex_elem : Note<
279   "construction of individual component of complex number is not yet supported "
280   "in constant expressions">;
281 def note_constexpr_destroy_complex_elem : Note<
282   "destruction of individual component of complex number is not yet supported "
283   "in constant expressions">;
284 def note_constexpr_new : Note<
285   "dynamic memory allocation is not permitted in constant expressions "
286   "until C++20">;
287 def note_constexpr_new_non_replaceable : Note<
288   "call to %select{placement|class-specific}0 %1">;
289 def note_constexpr_new_placement : Note<
290   "this placement new expression is not yet supported in constant expressions">;
291 def note_constexpr_placement_new_wrong_type : Note<
292   "placement new would change type of storage from %0 to %1">;
293 def note_constexpr_new_negative : Note<
294   "cannot allocate array; evaluated array bound %0 is negative">;
295 def note_constexpr_new_too_large : Note<
296   "cannot allocate array; evaluated array bound %0 is too large">;
297 def note_constexpr_new_too_small : Note<
298   "cannot allocate array; evaluated array bound %0 is too small to hold "
299   "%1 explicitly initialized elements">;
300 def 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'">;
303 def note_constexpr_new_not_complete_object_type : Note<
304   "cannot allocate memory of %select{incomplete|function}0 type %1">;
305 def note_constexpr_operator_new_bad_size : Note<
306   "allocated size %0 is not a multiple of size %1 of element type %2">;
307 def note_constexpr_delete_not_heap_alloc : Note<
308   "delete of pointer '%0' that does not point to a heap-allocated object">;
309 def note_constexpr_double_delete : Note<
310   "delete of pointer that has already been deleted">;
311 def note_constexpr_double_destroy : Note<
312   "destruction of object that is already being destroyed">;
313 def 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">;
320 def note_constexpr_delete_subobject : Note<
321   "delete of pointer%select{ to subobject|}1 '%0' "
322   "%select{|that does not point to complete object}1">;
323 def 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">;
326 def note_constexpr_memory_leak : Note<
327   "allocation performed here was not deallocated"
328   "%plural{0:|: (along with %0 other memory leak%s0)}0">;
329 def err_experimental_clang_interp_failed : Error<
330   "the experimental clang interpreter failed to evaluate an expression">;
331
332 def 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.
339 def note_unimplemented_constexpr_lambda_feature_ast : Note<
340     "unimplemented constexpr lambda feature: %0 (coming soon!)">;
341
342 def 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.
347 let 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.
362 let 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
371 def err_odr_variable_type_inconsistent : Error<
372   "external variable %0 declared with incompatible types in different "
373   "translation units (%1 vs. %2)">;
374 def 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>;
378 def err_odr_variable_multiple_def : Error<
379   "external variable %0 defined in multiple translation units">;
380 def warn_odr_variable_multiple_def : Warning<
381   "external variable %0 defined in multiple translation units">,
382   InGroup<ODR>;
383 def note_odr_value_here : Note<"declared here with type %0">;
384 def err_odr_function_type_inconsistent : Error<
385   "external function %0 declared with incompatible types in different "
386   "translation units (%1 vs. %2)">;
387 def 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>;
391 def err_odr_tag_type_inconsistent
392     : Error<"type %0 has incompatible definitions in different translation "
393             "units">;
394 def warn_odr_tag_type_inconsistent
395     : Warning<"type %0 has incompatible definitions in different translation "
396               "units">,
397       InGroup<ODR>;
398 def note_odr_tag_kind_here: Note<
399   "%0 is a %select{struct|interface|union|class|enum}1 here">;
400 def note_odr_field : Note<"field %0 has type %1 here">;
401 def note_odr_field_name : Note<"field has name %0 here">;
402 def note_odr_missing_field : Note<"no corresponding field here">;
403 def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">;
404 def note_odr_not_bit_field : Note<"field %0 is not a bit-field">;
405 def note_odr_base : Note<"class has base type %0">;
406 def note_odr_virtual_base : Note<
407   "%select{non-virtual|virtual}0 derivation here">;
408 def note_odr_missing_base : Note<"no corresponding base class here">;
409 def note_odr_number_of_bases : Note<
410   "class has %0 base %plural{1:class|:classes}0">;
411 def note_odr_enumerator : Note<"enumerator %0 with value %1 here">;
412 def note_odr_missing_enumerator : Note<"no corresponding enumerator here">;
413 def err_odr_field_type_inconsistent : Error<
414   "field %0 declared with incompatible types in different "
415   "translation units (%1 vs. %2)">;
416 def 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
422 def err_odr_ivar_type_inconsistent : Error<
423   "instance variable %0 declared with incompatible types in different "
424   "translation units (%1 vs. %2)">;
425 def 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>;
429 def err_odr_objc_superclass_inconsistent : Error<
430   "class %0 has incompatible superclasses">;
431 def warn_odr_objc_superclass_inconsistent : Warning<
432   "class %0 has incompatible superclasses">,
433   InGroup<ODR>;
434 def note_odr_objc_superclass : Note<"inherits from superclass %0 here">;
435 def note_odr_objc_missing_superclass : Note<"no corresponding superclass here">;
436 def 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)">;
439 def 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>;
443 def 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)">;
446 def 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>;
450 def 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)">;
453 def 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>;
457 def 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">;
460 def 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>;
464 def note_odr_objc_method_here : Note<
465   "%select{class|instance}0 method %1 also declared here">;
466 def err_odr_objc_property_type_inconsistent : Error<
467   "property %0 declared with incompatible types in different "
468   "translation units (%1 vs. %2)">;
469 def 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>;
473 def 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">;
476 def 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>;
480 def note_odr_objc_property_impl_kind : Note<
481   "property %0 is implemented with %select{@synthesize|@dynamic}1 here">;
482 def err_odr_objc_synthesize_ivar_inconsistent : Error<
483   "property %0 is synthesized to different ivars in different translation "
484   "units (%1 vs. %2)">;
485 def 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>;
489 def note_odr_objc_synthesize_ivar_here : Note<
490   "property is synthesized to ivar %0 here">;
491
492 // Importing C++ ASTs
493 def note_odr_friend : Note<"friend declared here">;
494 def note_odr_missing_friend : Note<"no corresponding friend here">;
495 def err_odr_different_num_template_parameters : Error<
496   "template parameter lists have a different number of parameters (%0 vs %1)">;
497 def warn_odr_different_num_template_parameters : Warning<
498   "template parameter lists have a different number of parameters (%0 vs %1)">,
499   InGroup<ODR>;
500 def note_odr_template_parameter_list : Note<
501   "template parameter list also declared here">;
502 def err_odr_different_template_parameter_kind : Error<
503   "template parameter has different kinds in different translation units">;
504 def warn_odr_different_template_parameter_kind : Warning<
505   "template parameter has different kinds in different translation units">,
506   InGroup<ODR>;
507 def note_odr_template_parameter_here : Note<
508   "template parameter declared here">;
509 def err_odr_parameter_pack_non_pack : Error<
510   "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">;
511 def warn_odr_parameter_pack_non_pack : Warning<
512   "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">,
513   InGroup<ODR>;
514 def note_odr_parameter_pack_non_pack : Note<
515   "%select{parameter|parameter pack}0 declared here">;
516 def 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)">;
519 def 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>;
523 def err_unsupported_ast_node: Error<"cannot import unsupported AST node %0">;
524
525 def remark_sanitize_address_insert_extra_padding_accepted : Remark<
526     "-fsanitize-address-field-padding applied to %0">, ShowInSystemHeader,
527     InGroup<SanitizeAddressRemarks>;
528 def 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
535 def 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
541 def 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;
545 def 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;
549 def warn_padded_struct_size : Warning<
550   "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
551   InGroup<Padded>, DefaultIgnore;
552 def warn_unnecessary_packed : Warning<
553   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
554 }