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