xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td (revision 52418fc2be8efa5172b90a3a9e617017173612c4)
1//==--- DiagnosticSemaKinds.td - libsema 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//===----------------------------------------------------------------------===//
10// Semantic Analysis
11//===----------------------------------------------------------------------===//
12
13let Component = "Sema" in {
14let CategoryName = "Semantic Issue" in {
15def note_previous_decl : Note<"%0 declared here">;
16def note_entity_declared_at : Note<"%0 declared here">;
17def note_callee_decl : Note<"%0 declared here">;
18def note_defined_here : Note<"%0 defined here">;
19
20// For loop analysis
21def warn_variables_not_in_loop_body : Warning<
22  "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
23  "used in loop condition not modified in loop body">,
24  InGroup<ForLoopAnalysis>, DefaultIgnore;
25def warn_redundant_loop_iteration : Warning<
26  "variable %0 is %select{decremented|incremented}1 both in the loop header "
27  "and in the loop body">,
28  InGroup<ForLoopAnalysis>, DefaultIgnore;
29def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
30
31def warn_duplicate_enum_values : Warning<
32  "element %0 has been implicitly assigned %1 which another element has "
33  "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
34def note_duplicate_element : Note<"element %0 also has value %1">;
35
36// Absolute value functions
37def warn_unsigned_abs : Warning<
38  "taking the absolute value of unsigned type %0 has no effect">,
39  InGroup<AbsoluteValue>;
40def note_remove_abs : Note<
41  "remove the call to '%0' since unsigned values cannot be negative">;
42def warn_abs_too_small : Warning<
43  "absolute value function %0 given an argument of type %1 but has parameter "
44  "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>;
45def warn_wrong_absolute_value_type : Warning<
46  "using %select{integer|floating point|complex}1 absolute value function %0 "
47  "when argument is of %select{integer|floating point|complex}2 type">,
48  InGroup<AbsoluteValue>;
49def note_replace_abs_function : Note<"use function '%0' instead">;
50def warn_pointer_abs : Warning<
51  "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">,
52  InGroup<AbsoluteValue>;
53
54def warn_max_unsigned_zero : Warning<
55  "taking the max of "
56  "%select{a value and unsigned zero|unsigned zero and a value}0 "
57  "is always equal to the other value">,
58  InGroup<MaxUnsignedZero>;
59def note_remove_max_call : Note<
60  "remove call to max function and unsigned zero argument">;
61
62def warn_infinite_recursive_function : Warning<
63  "all paths through this function will call itself">,
64  InGroup<InfiniteRecursion>, DefaultIgnore;
65
66def warn_comma_operator : Warning<"possible misuse of comma operator here">,
67  InGroup<DiagGroup<"comma">>, DefaultIgnore;
68def note_cast_to_void : Note<"cast expression to void to silence warning">;
69def note_cast_operand_to_int : Note<"cast one or both operands to int to silence this warning">;
70
71// Constant expressions
72def err_expr_not_ice : Error<
73  "expression is not an %select{integer|integral}0 constant expression">;
74def ext_expr_not_ice : Extension<
75  "expression is not an %select{integer|integral}0 constant expression; "
76  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
77def err_typecheck_converted_constant_expression : Error<
78  "value of type %0 is not implicitly convertible to %1">;
79def err_typecheck_converted_constant_expression_disallowed : Error<
80  "conversion from %0 to %1 is not allowed in a converted constant expression">;
81def err_typecheck_converted_constant_expression_indirect : Error<
82  "conversion from %0 to %1 in converted constant expression would "
83  "bind reference to a temporary">;
84def err_expr_not_cce : Error<
85  "%select{case value|enumerator value|non-type template argument|"
86  "array size|explicit specifier argument|noexcept specifier argument|"
87  "call to 'size()'|call to 'data()'}0 is not a constant expression">;
88def ext_cce_narrowing : ExtWarn<
89  "%select{case value|enumerator value|non-type template argument|"
90  "array size|explicit specifier argument|noexcept specifier argument|"
91  "call to 'size()'|call to 'data()'}0 %select{cannot be narrowed from "
92  "type %2 to %3|evaluates to %2, which cannot be narrowed to type %3}1">,
93  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
94def err_ice_not_integral : Error<
95  "%select{integer|integral}1 constant expression must have "
96  "%select{integer|integral or unscoped enumeration}1 type, not %0">;
97def err_ice_incomplete_type : Error<
98  "integral constant expression has incomplete class type %0">;
99def err_ice_explicit_conversion : Error<
100  "integral constant expression requires explicit conversion from %0 to %1">;
101def note_ice_conversion_here : Note<
102  "conversion to %select{integral|enumeration}0 type %1 declared here">;
103def err_ice_ambiguous_conversion : Error<
104  "ambiguous conversion from type %0 to an integral or unscoped "
105  "enumeration type">;
106def err_ice_too_large : Error<
107  "integer constant expression evaluates to value %0 that cannot be "
108  "represented in a %1-bit %select{signed|unsigned}2 integer type">;
109def err_expr_not_string_literal : Error<"expression is not a string literal">;
110
111// Semantic analysis of constant literals.
112def ext_predef_outside_function : Warning<
113  "predefined identifier is only valid inside function">,
114  InGroup<DiagGroup<"predefined-identifier-outside-function">>;
115def ext_init_from_predefined : ExtWarn<
116  "initializing an array from a '%0' predefined identifier is a Microsoft extension">,
117  InGroup<MicrosoftInitFromPredefined>;
118def ext_string_literal_from_predefined : ExtWarn<
119  "expansion of predefined identifier '%0' to a string literal is a Microsoft extension">,
120  InGroup<MicrosoftStringLiteralFromPredefined>;
121def warn_float_overflow : Warning<
122  "magnitude of floating-point constant too large for type %0; maximum is %1">,
123   InGroup<LiteralRange>;
124def warn_float_underflow : Warning<
125  "magnitude of floating-point constant too small for type %0; minimum is %1">,
126  InGroup<LiteralRange>;
127def warn_float_compare_literal : Warning<
128  "floating-point comparison is always %select{true|false}0; "
129  "constant cannot be represented exactly in type %1">,
130  InGroup<LiteralRange>;
131def warn_double_const_requires_fp64 : Warning<
132  "double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, "
133  "casting to single precision">;
134def err_half_const_requires_fp16 : Error<
135  "half precision constant requires cl_khr_fp16">;
136
137// C99 variable-length arrays
138def ext_vla : Extension<"variable length arrays are a C99 feature">,
139  InGroup<VLAExtension>;
140// In C++ language modes, we warn by default as an extension, while in GNU++
141// language modes, we warn as an extension but add the warning group to -Wall.
142def ext_vla_cxx : ExtWarn<
143  "variable length arrays in C++ are a Clang extension">,
144  InGroup<VLACxxExtension>;
145def ext_vla_cxx_in_gnu_mode : Extension<ext_vla_cxx.Summary>,
146  InGroup<VLACxxExtension>;
147def ext_vla_cxx_static_assert : ExtWarn<
148  "variable length arrays in C++ are a Clang extension; did you mean to use "
149  "'static_assert'?">, InGroup<VLAUseStaticAssert>;
150def ext_vla_cxx_in_gnu_mode_static_assert : Extension<
151  ext_vla_cxx_static_assert.Summary>, InGroup<VLAUseStaticAssert>;
152def warn_vla_used : Warning<"variable length array used">,
153  InGroup<VLA>, DefaultIgnore;
154def err_vla_in_sfinae : Error<
155  "variable length array cannot be formed during template argument deduction">;
156def err_array_star_in_function_definition : Error<
157  "variable length array must be bound in function definition">;
158def err_vla_decl_in_file_scope : Error<
159  "variable length array declaration not allowed at file scope">;
160def err_vla_decl_has_static_storage : Error<
161  "variable length array declaration cannot have 'static' storage duration">;
162def err_vla_decl_has_extern_linkage : Error<
163  "variable length array declaration cannot have 'extern' linkage">;
164def ext_vla_folded_to_constant : ExtWarn<
165  "variable length array folded to constant array as an extension">,
166  InGroup<GNUFoldingConstant>;
167def err_vla_unsupported : Error<
168  "variable length arrays are not supported %select{for the current target|in '%1'}0">;
169def err_vla_in_coroutine_unsupported : Error<
170  "variable length arrays in a coroutine are not supported">;
171def note_vla_unsupported : Note<
172  "variable length arrays are not supported for the current target">;
173
174// C99 variably modified types
175def err_variably_modified_template_arg : Error<
176  "variably modified type %0 cannot be used as a template argument">;
177def err_variably_modified_nontype_template_param : Error<
178  "non-type template parameter of variably modified type %0">;
179def err_variably_modified_new_type : Error<
180  "'new' cannot allocate object of variably modified type %0">;
181
182// C99 Designated Initializers
183def ext_designated_init : Extension<
184  "designated initializers are a C99 feature">, InGroup<C99Designator>;
185def err_array_designator_negative : Error<
186  "array designator value '%0' is negative">;
187def err_array_designator_empty_range : Error<
188  "array designator range [%0, %1] is empty">;
189def err_array_designator_non_array : Error<
190  "array designator cannot initialize non-array type %0">;
191def err_array_designator_too_large : Error<
192  "array designator index (%0) exceeds array bounds (%1)">;
193def err_field_designator_non_aggr : Error<
194  "field designator cannot initialize a "
195  "%select{non-struct, non-union|non-class}0 type %1">;
196def err_field_designator_unknown : Error<
197  "field designator %0 does not refer to any field in type %1">;
198def err_field_designator_nonfield : Error<
199  "field designator %0 does not refer to a non-static data member">;
200def note_field_designator_found : Note<"field designator refers here">;
201def err_designator_for_scalar_or_sizeless_init : Error<
202  "designator in initializer for %select{scalar|indivisible sizeless}0 "
203  "type %1">;
204def warn_initializer_overrides : Warning<
205  "initializer %select{partially |}0overrides prior initialization of "
206  "this subobject">, InGroup<InitializerOverrides>;
207def ext_initializer_overrides : ExtWarn<warn_initializer_overrides.Summary>,
208  InGroup<InitializerOverrides>, SFINAEFailure;
209def ext_initializer_union_overrides : ExtWarn<warn_initializer_overrides.Summary>,
210  InGroup<InitializerOverrides>, DefaultError, SFINAEFailure;
211def err_initializer_overrides_destructed : Error<
212  "initializer would partially override prior initialization of object of "
213  "type %1 with non-trivial destruction">;
214def note_previous_initializer : Note<
215  "previous initialization %select{|with side effects }0is here"
216  "%select{| (side effects will not occur at run time)}0">;
217def err_designator_into_flexible_array_member : Error<
218  "designator into flexible array member subobject">;
219def note_flexible_array_member : Note<
220  "initialized flexible array member %0 is here">;
221def ext_flexible_array_init : Extension<
222  "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
223
224// C++20 designated initializers
225def ext_cxx_designated_init : Extension<
226  "designated initializers are a C++20 extension">, InGroup<CXX20Designator>,
227  SuppressInSystemMacro;
228def warn_cxx17_compat_designated_init : Warning<
229  "designated initializers are incompatible with C++ standards before C++20">,
230  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
231def ext_designated_init_mixed : ExtWarn<
232  "mixture of designated and non-designated initializers in the same "
233  "initializer list is a C99 extension">, InGroup<C99Designator>;
234def note_designated_init_mixed : Note<
235  "first non-designated initializer is here">;
236def ext_designated_init_array : ExtWarn<
237  "array designators are a C99 extension">, InGroup<C99Designator>;
238def ext_designated_init_nested : ExtWarn<
239  "nested designators are a C99 extension">, InGroup<C99Designator>;
240def ext_designated_init_reordered : ExtWarn<
241  "ISO C++ requires field designators to be specified in declaration order; "
242  "field %1 will be initialized after field %0">, InGroup<ReorderInitList>,
243  SFINAEFailure;
244def note_previous_field_init : Note<
245  "previous initialization for field %0 is here">;
246def ext_designated_init_brace_elision : ExtWarn<
247  "brace elision for designated initializer is a C99 extension">,
248  InGroup<C99Designator>, SFINAEFailure;
249
250// Declarations.
251def ext_plain_complex : ExtWarn<
252  "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
253def ext_imaginary_constant : Extension<
254  "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
255def ext_integer_complex : Extension<
256  "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
257def ext_c23_auto_non_plain_identifier : Extension<
258  "type inference of a declaration other than a plain identifier with optional "
259  "trailing attributes is a Clang extension">,
260  InGroup<DiagGroup<"auto-decl-extensions">>;
261
262def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
263  "'_Fract' or '_Accum', not '%0'">;
264def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
265def err_invalid_width_spec : Error<
266  "'%select{|short|long|long long}0 %1' is invalid">;
267def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
268
269def ext_auto_type_specifier : ExtWarn<
270  "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
271def warn_auto_storage_class : Warning<
272  "'auto' storage class specifier is redundant and incompatible with C++11">,
273  InGroup<CXX11Compat>, DefaultIgnore;
274
275def warn_deprecated_register : Warning<
276  "'register' storage class specifier is deprecated "
277  "and incompatible with C++17">, InGroup<DeprecatedRegister>;
278def ext_register_storage_class : ExtWarn<
279  "ISO C++17 does not allow 'register' storage class specifier">,
280  DefaultError, InGroup<Register>;
281
282def err_invalid_decl_spec_combination : Error<
283  "cannot combine with previous '%0' declaration specifier">;
284def err_invalid_vector_decl_spec_combination : Error<
285  "cannot combine with previous '%0' declaration specifier. "
286  "'__vector' must be first">;
287def err_invalid_pixel_decl_spec_combination : Error<
288  "'__pixel' must be preceded by '__vector'.  "
289  "'%0' declaration specifier not allowed here">;
290def err_invalid_vector_bool_decl_spec : Error<
291  "cannot use '%0' with '__vector bool'">;
292def err_invalid_vector_long_decl_spec : Error<
293  "cannot use 'long' with '__vector'">;
294def err_invalid_vector_float_decl_spec : Error<
295  "cannot use 'float' with '__vector'">;
296def err_invalid_vector_double_decl_spec : Error <
297  "use of 'double' with '__vector' requires VSX support to be enabled "
298  "(available on POWER7 or later)">;
299def err_invalid_vector_bool_int128_decl_spec : Error <
300  "use of '__int128' with '__vector bool' requires VSX support enabled (on "
301  "POWER10 or later)">;
302def err_invalid_vector_int128_decl_spec : Error<
303  "use of '__int128' with '__vector' requires extended Altivec support"
304  " (available on POWER8 or later)">;
305def err_invalid_vector_long_long_decl_spec : Error <
306  "use of 'long long' with '__vector' requires VSX support (available on "
307  "POWER7 or later) to be enabled">;
308def err_invalid_vector_long_double_decl_spec : Error<
309  "cannot use 'long double' with '__vector'">;
310def err_invalid_vector_complex_decl_spec : Error<
311  "cannot use '_Complex' with '__vector'">;
312def warn_vector_long_decl_spec_combination : Warning<
313  "use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
314
315def err_redeclaration_different_type : Error<
316  "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
317def err_bad_variable_name : Error<
318  "%0 cannot be the name of a variable or data member">;
319def err_bad_parameter_name : Error<
320  "%0 cannot be the name of a parameter">;
321def err_bad_parameter_name_template_id : Error<
322  "parameter name cannot have template arguments">;
323def ext_parameter_name_omitted_c23 : ExtWarn<
324  "omitting the parameter name in a function definition is a C23 extension">,
325  InGroup<C23>;
326def err_anyx86_interrupt_attribute : Error<
327  "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
328  "have %select{a 'void' return type|"
329  "only a pointer parameter optionally followed by an integer parameter|"
330  "a pointer as the first parameter|a %2 type as the second parameter}1">;
331def err_anyx86_interrupt_called : Error<
332  "interrupt service routine cannot be called directly">;
333def warn_anyx86_excessive_regsave : Warning<
334  "%select{interrupt service routine|function with attribute"
335  " 'no_caller_saved_registers'}0 should only call a function"
336  " with attribute 'no_caller_saved_registers'"
337  " or be compiled with '-mgeneral-regs-only'">,
338  InGroup<DiagGroup<"excessive-regsave">>;
339def warn_arm_interrupt_vfp_clobber : Warning<
340  "interrupt service routine with vfp enabled may clobber the "
341  "interruptee's vfp state">,
342  InGroup<DiagGroup<"arm-interrupt-vfp-clobber">>;
343def err_arm_interrupt_called : Error<
344  "interrupt service routine cannot be called directly">;
345def warn_interrupt_attribute_invalid : Warning<
346   "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to "
347   "functions that have %select{no parameters|a 'void' return type}1">,
348   InGroup<IgnoredAttributes>;
349def warn_riscv_repeated_interrupt_attribute : Warning<
350  "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
351def note_riscv_repeated_interrupt_attribute : Note<
352  "repeated RISC-V 'interrupt' attribute is here">;
353def warn_unused_parameter : Warning<"unused parameter %0">,
354  InGroup<UnusedParameter>, DefaultIgnore;
355def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">,
356  InGroup<UnusedButSetParameter>, DefaultIgnore;
357def warn_unused_variable : Warning<"unused variable %0">,
358  InGroup<UnusedVariable>, DefaultIgnore;
359def warn_unused_but_set_variable : Warning<"variable %0 set but not used">,
360  InGroup<UnusedButSetVariable>, DefaultIgnore;
361def warn_unused_local_typedef : Warning<
362  "unused %select{typedef|type alias}0 %1">,
363  InGroup<UnusedLocalTypedef>, DefaultIgnore;
364def warn_unused_property_backing_ivar :
365  Warning<"ivar %0 which backs the property is not "
366  "referenced in this property's accessor">,
367  InGroup<UnusedPropertyIvar>, DefaultIgnore;
368def warn_unused_const_variable : Warning<"unused variable %0">,
369  InGroup<UnusedConstVariable>, DefaultIgnore;
370def warn_unused_exception_param : Warning<"unused exception parameter %0">,
371  InGroup<UnusedExceptionParameter>, DefaultIgnore;
372def warn_decl_in_param_list : Warning<
373  "declaration of %0 will not be visible outside of this function">,
374  InGroup<Visibility>;
375def warn_redefinition_in_param_list : Warning<
376  "redefinition of %0 will not be visible outside of this function">,
377  InGroup<Visibility>;
378def warn_empty_parens_are_function_decl : Warning<
379  "empty parentheses interpreted as a function declaration">,
380  InGroup<VexingParse>;
381def warn_parens_disambiguated_as_function_declaration : Warning<
382  "parentheses were disambiguated as a function declaration">,
383  InGroup<VexingParse>;
384def warn_parens_disambiguated_as_variable_declaration : Warning<
385  "parentheses were disambiguated as redundant parentheses around declaration "
386  "of variable named %0">, InGroup<VexingParse>;
387def warn_redundant_parens_around_declarator : Warning<
388  "redundant parentheses surrounding declarator">,
389  InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
390def note_additional_parens_for_variable_declaration : Note<
391  "add a pair of parentheses to declare a variable">;
392def note_raii_guard_add_name : Note<
393  "add a variable name to declare a %0 initialized with %1">;
394def note_function_style_cast_add_parentheses : Note<
395  "add enclosing parentheses to perform a function-style cast">;
396def note_remove_parens_for_variable_declaration : Note<
397  "remove parentheses to silence this warning">;
398def note_empty_parens_function_call : Note<
399  "change this ',' to a ';' to call %0">;
400def note_empty_parens_default_ctor : Note<
401  "remove parentheses to declare a variable">;
402def note_empty_parens_zero_initialize : Note<
403  "replace parentheses with an initializer to declare a variable">;
404def warn_unused_function : Warning<"unused function %0">,
405  InGroup<UnusedFunction>, DefaultIgnore;
406def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
407  InGroup<UnusedTemplate>, DefaultIgnore;
408def warn_unused_member_function : Warning<"unused member function %0">,
409  InGroup<UnusedMemberFunction>, DefaultIgnore;
410def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
411  InGroup<UsedButMarkedUnused>, DefaultIgnore;
412def warn_unneeded_internal_decl : Warning<
413  "%select{function|variable}0 %1 is not needed and will not be emitted">,
414  InGroup<UnneededInternalDecl>, DefaultIgnore;
415def warn_unneeded_static_internal_decl : Warning<
416  "'static' function %0 declared in header file "
417  "should be declared 'static inline'">,
418  InGroup<UnneededInternalDecl>, DefaultIgnore;
419def warn_unneeded_member_function : Warning<
420  "member function %0 is not needed and will not be emitted">,
421  InGroup<UnneededMemberFunction>, DefaultIgnore;
422def warn_unused_private_field: Warning<"private field %0 is not used">,
423  InGroup<UnusedPrivateField>, DefaultIgnore;
424def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
425  "%select{used|required to be captured for this use}1">,
426  InGroup<UnusedLambdaCapture>, DefaultIgnore;
427
428def warn_reserved_extern_symbol: Warning<
429  "identifier %0 is reserved because %select{"
430  "<ERROR>|" // ReservedIdentifierStatus::NotReserved
431  "it starts with '_' at global scope|"
432  "it starts with '_' and has C language linkage|"
433  "it starts with '__'|"
434  "it starts with '_' followed by a capital letter|"
435  "it contains '__'}1">,
436  InGroup<ReservedIdentifier>, DefaultIgnore;
437def warn_deprecated_literal_operator_id: Warning<
438  "identifier %0 preceded by whitespace in a literal operator declaration "
439  "is deprecated">, InGroup<DeprecatedLiteralOperator>, DefaultIgnore;
440def warn_reserved_module_name : Warning<
441  "%0 is a reserved name for a module">, InGroup<ReservedModuleIdentifier>;
442
443def warn_parameter_size: Warning<
444  "%0 is a large (%1 bytes) pass-by-value argument; "
445  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
446def warn_return_value_size: Warning<
447  "return value of %0 is a large (%1 bytes) pass-by-value object; "
448  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
449def warn_return_value_udt: Warning<
450  "%0 has C-linkage specified, but returns user-defined type %1 which is "
451  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
452def warn_return_value_udt_incomplete: Warning<
453  "%0 has C-linkage specified, but returns incomplete type %1 which could be "
454  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
455def warn_implicit_function_decl : Warning<
456  "implicit declaration of function %0">,
457  InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
458def ext_implicit_function_decl_c99 : ExtWarn<
459  "call to undeclared function %0; ISO C99 and later do not support implicit "
460  "function declarations">, InGroup<ImplicitFunctionDeclare>;
461def note_function_suggestion : Note<"did you mean %0?">;
462
463def err_ellipsis_first_param : Error<
464  "ISO C requires a named parameter before '...'">;
465def err_declarator_need_ident : Error<"declarator requires an identifier">;
466def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
467def ext_use_out_of_scope_declaration : ExtWarn<
468  "use of out-of-scope declaration of %0%select{| whose type is not "
469  "compatible with that of an implicit declaration}1">,
470  InGroup<DiagGroup<"out-of-scope-function">>;
471def err_inline_non_function : Error<
472  "'inline' can only appear on functions%select{| and non-local variables}0">;
473def err_noreturn_non_function : Error<
474  "'_Noreturn' can only appear on functions">;
475def warn_qual_return_type : Warning<
476  "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
477  InGroup<IgnoredQualifiers>, DefaultIgnore;
478def warn_deprecated_redundant_constexpr_static_def : Warning<
479  "out-of-line definition of constexpr static data member is redundant "
480  "in C++17 and is deprecated">,
481  InGroup<DeprecatedRedundantConstexprStaticDef>, DefaultIgnore;
482
483def warn_decl_shadow :
484  Warning<"declaration shadows a %select{"
485          "local variable|"
486          "variable in %2|"
487          "static data member of %2|"
488          "field of %2|"
489          "typedef in %2|"
490          "type alias in %2|"
491          "structured binding}1">,
492  InGroup<Shadow>, DefaultIgnore, SuppressInSystemMacro;
493def warn_decl_shadow_uncaptured_local :
494  Warning<warn_decl_shadow.Summary>,
495  InGroup<ShadowUncapturedLocal>, DefaultIgnore;
496def warn_ctor_parm_shadows_field:
497  Warning<"constructor parameter %0 shadows the field %1 of %2">,
498  InGroup<ShadowFieldInConstructor>, DefaultIgnore;
499def warn_modifying_shadowing_decl :
500  Warning<"modifying constructor parameter %0 that shadows a "
501          "field of %1">,
502  InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
503
504// C++ decomposition declarations
505def err_decomp_decl_context : Error<
506  "decomposition declaration not permitted in this context">;
507def warn_cxx14_compat_decomp_decl : Warning<
508  "decomposition declarations are incompatible with "
509  "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
510def ext_decomp_decl : ExtWarn<
511  "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
512def ext_decomp_decl_cond : ExtWarn<
513  "ISO C++17 does not permit structured binding declaration in a condition">,
514  InGroup<DiagGroup<"binding-in-condition">>;
515def err_decomp_decl_spec : Error<
516  "decomposition declaration cannot be declared "
517  "%plural{1:'%1'|:with '%1' specifiers}0">;
518def ext_decomp_decl_spec : ExtWarn<
519  "decomposition declaration declared "
520  "%plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension">,
521  InGroup<CXX20>;
522def warn_cxx17_compat_decomp_decl_spec : Warning<
523  "decomposition declaration declared "
524  "%plural{1:'%1'|:with '%1' specifiers}0 "
525  "is incompatible with C++ standards before C++20">,
526  InGroup<CXXPre20Compat>, DefaultIgnore;
527def err_decomp_decl_type : Error<
528  "decomposition declaration cannot be declared with type %0; "
529  "declared type must be 'auto' or reference to 'auto'">;
530def err_decomp_decl_constraint : Error<
531  "decomposition declaration cannot be declared with constrained 'auto'">;
532def err_decomp_decl_parens : Error<
533  "decomposition declaration cannot be declared with parentheses">;
534def err_decomp_decl_template : Error<
535  "decomposition declaration template not supported">;
536def err_decomp_decl_not_alone : Error<
537  "decomposition declaration must be the only declaration in its group">;
538def err_decomp_decl_requires_init : Error<
539  "decomposition declaration %0 requires an initializer">;
540def err_decomp_decl_wrong_number_bindings : Error<
541  "type %0 decomposes into %3 %plural{1:element|:elements}2, but "
542  "%select{%plural{0:no|:only %1}1|%1}4 "
543  "%plural{1:name was|:names were}1 provided">;
544def err_decomp_decl_unbindable_type : Error<
545  "cannot decompose %select{union|non-class, non-array}1 type %2">;
546def err_decomp_decl_multiple_bases_with_members : Error<
547  "cannot decompose class type %1: "
548  "%select{its base classes %2 and|both it and its base class}0 %3 "
549  "have non-static data members">;
550def err_decomp_decl_ambiguous_base : Error<
551  "cannot decompose members of ambiguous base class %1 of %0:%2">;
552def err_decomp_decl_inaccessible_base : Error<
553  "cannot decompose members of inaccessible base class %1 of %0">,
554  AccessControl;
555def err_decomp_decl_inaccessible_field : Error<
556  "cannot decompose %select{private|protected}0 member %1 of %3">,
557  AccessControl;
558def err_decomp_decl_lambda : Error<
559  "cannot decompose lambda closure type">;
560def err_decomp_decl_anon_union_member : Error<
561  "cannot decompose class type %0 because it has an anonymous "
562  "%select{struct|union}1 member">;
563def err_decomp_decl_std_tuple_element_not_specialized : Error<
564  "cannot decompose this type; 'std::tuple_element<%0>::type' "
565  "does not name a type">;
566def err_decomp_decl_std_tuple_size_not_constant : Error<
567  "cannot decompose this type; 'std::tuple_size<%0>::value' "
568  "is not a valid integral constant expression">;
569def note_in_binding_decl_init : Note<
570  "in implicit initialization of binding declaration %0">;
571
572def err_std_type_trait_not_class_template : Error<
573  "unsupported standard library implementation: "
574  "'std::%0' is not a class template">;
575
576// C++ using declarations
577def err_using_requires_qualname : Error<
578  "using declaration requires a qualified name">;
579def err_using_typename_non_type : Error<
580  "'typename' keyword used on a non-type">;
581def err_using_dependent_value_is_type : Error<
582  "dependent using declaration resolved to type without 'typename'">;
583def err_using_decl_nested_name_specifier_is_not_class : Error<
584  "using declaration in class refers into '%0', which is not a class">;
585def warn_cxx17_compat_using_decl_non_member_enumerator : Warning<
586  "member using declaration naming non-class '%0' enumerator is "
587  "incompatible with C++ standards before C++20">, InGroup<CXXPre20Compat>,
588  DefaultIgnore;
589def err_using_decl_nested_name_specifier_is_current_class : Error<
590  "using declaration refers to its own class">;
591def err_using_decl_nested_name_specifier_is_not_base_class : Error<
592  "using declaration refers into '%0', which is not a base class of %1">;
593def err_using_decl_constructor_not_in_direct_base : Error<
594  "%0 is not a direct base of %1, cannot inherit constructors">;
595def err_using_decl_can_not_refer_to_class_member : Error<
596  "using declaration cannot refer to class member">;
597def warn_cxx17_compat_using_decl_class_member_enumerator : Warning<
598  "member using declaration naming a non-member enumerator is incompatible "
599  "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
600def err_using_enum_is_dependent : Error<
601  "using-enum cannot name a dependent type">;
602def err_using_enum_not_enum : Error<
603  "%0 is not an enumerated type">;
604def err_ambiguous_inherited_constructor : Error<
605  "constructor of %0 inherited from multiple base class subobjects">;
606def note_ambiguous_inherited_constructor_using : Note<
607  "inherited from base class %0 here">;
608def note_using_decl_class_member_workaround : Note<
609  "use %select{an alias declaration|a typedef declaration|a reference|"
610  "a const variable|a constexpr variable}0 instead">;
611def err_using_decl_can_not_refer_to_namespace : Error<
612  "using declaration cannot refer to a namespace">;
613def note_namespace_using_decl : Note<
614  "did you mean 'using namespace'?">;
615def warn_cxx17_compat_using_decl_scoped_enumerator: Warning<
616  "using declaration naming a scoped enumerator is incompatible with "
617  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
618def ext_using_decl_scoped_enumerator : ExtWarn<
619  "using declaration naming a scoped enumerator is a C++20 extension">,
620  InGroup<CXX20>;
621def err_using_decl_constructor : Error<
622  "using declaration cannot refer to a constructor">;
623def warn_cxx98_compat_using_decl_constructor : Warning<
624  "inheriting constructors are incompatible with C++98">,
625  InGroup<CXX98Compat>, DefaultIgnore;
626def err_using_decl_destructor : Error<
627  "using declaration cannot refer to a destructor">;
628def err_using_decl_template_id : Error<
629  "using declaration cannot refer to a template specialization">;
630def note_using_decl_target : Note<"target of using declaration">;
631def note_using_decl_conflict : Note<"conflicting declaration">;
632def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
633def err_using_decl_conflict : Error<
634  "target of using declaration conflicts with declaration already in scope">;
635def err_using_decl_conflict_reverse : Error<
636  "declaration conflicts with target of using declaration already in scope">;
637def note_using_decl : Note<"%select{|previous }0using declaration">;
638def err_using_decl_redeclaration_expansion : Error<
639  "using declaration pack expansion at block scope produces multiple values">;
640def err_use_of_empty_using_if_exists : Error<
641  "reference to unresolved using declaration">;
642def note_empty_using_if_exists_here : Note<
643  "using declaration annotated with 'using_if_exists' here">;
644def err_using_if_exists_on_ctor : Error<
645  "'using_if_exists' attribute cannot be applied to an inheriting constructor">;
646def err_using_enum_decl_redeclaration : Error<
647  "redeclaration of using-enum declaration">;
648def note_using_enum_decl : Note<"%select{|previous }0using-enum declaration">;
649
650def warn_access_decl_deprecated : Warning<
651  "access declarations are deprecated; use using declarations instead">,
652  InGroup<Deprecated>;
653def err_access_decl : Error<
654  "ISO C++11 does not allow access declarations; "
655  "use using declarations instead">;
656def warn_deprecated_copy : Warning<
657  "definition of implicit copy %select{constructor|assignment operator}1 "
658  "for %0 is deprecated because it has a user-declared copy "
659  "%select{assignment operator|constructor}1">,
660  InGroup<DeprecatedCopy>, DefaultIgnore;
661def warn_deprecated_copy_with_dtor : Warning<
662  "definition of implicit copy %select{constructor|assignment operator}1 "
663  "for %0 is deprecated because it has a user-declared destructor">,
664  InGroup<DeprecatedCopyWithDtor>, DefaultIgnore;
665def warn_deprecated_copy_with_user_provided_copy: Warning<
666  "definition of implicit copy %select{constructor|assignment operator}1 "
667  "for %0 is deprecated because it has a user-provided copy "
668  "%select{assignment operator|constructor}1">,
669  InGroup<DeprecatedCopyWithUserProvidedCopy>, DefaultIgnore;
670def warn_deprecated_copy_with_user_provided_dtor : Warning<
671  "definition of implicit copy %select{constructor|assignment operator}1 "
672  "for %0 is deprecated because it has a user-provided destructor">,
673  InGroup<DeprecatedCopyWithUserProvidedDtor>, DefaultIgnore;
674def warn_cxx17_compat_exception_spec_in_signature : Warning<
675  "mangled name of %0 will change in C++17 due to non-throwing exception "
676  "specification in function signature">, InGroup<CXX17CompatMangling>;
677
678def warn_global_constructor : Warning<
679  "declaration requires a global constructor">,
680  InGroup<GlobalConstructors>, DefaultIgnore;
681def warn_global_destructor : Warning<
682  "declaration requires a global destructor">,
683   InGroup<GlobalConstructors>, DefaultIgnore;
684def warn_exit_time_destructor : Warning<
685  "declaration requires an exit-time destructor">,
686  InGroup<ExitTimeDestructors>, DefaultIgnore;
687
688def err_invalid_thread : Error<
689  "'%0' is only allowed on variable declarations">;
690def err_thread_non_global : Error<
691  "'%0' variables must have global storage">;
692def err_thread_unsupported : Error<
693  "thread-local storage is not supported for the current target">;
694
695// FIXME: Combine fallout warnings to just one warning.
696def warn_maybe_falloff_nonvoid_function : Warning<
697  "non-void function does not return a value in all control paths">,
698  InGroup<ReturnType>;
699def warn_falloff_nonvoid_function : Warning<
700  "non-void function does not return a value">,
701  InGroup<ReturnType>;
702def warn_const_attr_with_pure_attr : Warning<
703  "'const' attribute imposes more restrictions; 'pure' attribute ignored">,
704  InGroup<IgnoredAttributes>;
705def warn_pure_function_returns_void : Warning<
706  "'%select{pure|const}0' attribute on function returning 'void'; attribute ignored">,
707  InGroup<IgnoredAttributes>;
708
709def err_maybe_falloff_nonvoid_block : Error<
710  "non-void block does not return a value in all control paths">;
711def err_falloff_nonvoid_block : Error<
712  "non-void block does not return a value">;
713def warn_maybe_falloff_nonvoid_coroutine : Warning<
714  "non-void coroutine does not return a value in all control paths">,
715  InGroup<ReturnType>;
716def warn_falloff_nonvoid_coroutine : Warning<
717  "non-void coroutine does not return a value">,
718  InGroup<ReturnType>;
719def warn_suggest_noreturn_function : Warning<
720  "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
721  InGroup<MissingNoreturn>, DefaultIgnore;
722def warn_suggest_noreturn_block : Warning<
723  "block could be declared with attribute 'noreturn'">,
724  InGroup<MissingNoreturn>, DefaultIgnore;
725
726// Unreachable code.
727def warn_unreachable : Warning<
728  "code will never be executed">,
729  InGroup<UnreachableCode>, DefaultIgnore;
730def warn_unreachable_break : Warning<
731  "'break' will never be executed">,
732  InGroup<UnreachableCodeBreak>, DefaultIgnore;
733def warn_unreachable_return : Warning<
734  "'return' will never be executed">,
735  InGroup<UnreachableCodeReturn>, DefaultIgnore;
736def warn_unreachable_loop_increment : Warning<
737  "loop will run at most once (loop increment never executed)">,
738  InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
739def warn_unreachable_fallthrough_attr : Warning<
740  "fallthrough annotation in unreachable code">,
741  InGroup<UnreachableCodeFallthrough>, DefaultIgnore;
742def note_unreachable_silence : Note<
743  "silence by adding parentheses to mark code as explicitly dead">;
744def warn_unreachable_association : Warning<
745  "due to lvalue conversion of the controlling expression, association of type "
746  "%0 will never be selected because it is %select{of array type|qualified}1">,
747  InGroup<UnreachableCodeGenericAssoc>;
748
749/// Built-in functions.
750def ext_implicit_lib_function_decl : ExtWarn<
751  "implicitly declaring library function '%0' with type %1">,
752  InGroup<ImplicitFunctionDeclare>;
753def ext_implicit_lib_function_decl_c99 : ExtWarn<
754  "call to undeclared library function '%0' with type %1; ISO C99 and later "
755  "do not support implicit function declarations">,
756  InGroup<ImplicitFunctionDeclare>;
757def note_include_header_or_declare : Note<
758  "include the header <%0> or explicitly provide a declaration for '%1'">;
759def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
760def warn_implicit_decl_no_jmp_buf
761    : Warning<"declaration of built-in function '%0' requires the declaration"
762    " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>">,
763      InGroup<DiagGroup<"incomplete-setjmp-declaration">>;
764def warn_implicit_decl_requires_sysheader : Warning<
765  "declaration of built-in function '%1' requires inclusion of the header <%0>">,
766  InGroup<BuiltinRequiresHeader>;
767def warn_redecl_library_builtin : Warning<
768  "incompatible redeclaration of library function %0">,
769  InGroup<DiagGroup<"incompatible-library-redeclaration">>;
770def err_builtin_definition : Error<"definition of builtin function %0">;
771def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
772def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
773def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as "
774  "%select{GCP|CDE}1">;
775def warn_invalid_cpu_supports : Warning<"invalid cpu feature string for builtin">;
776def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
777def err_invalid_cpu_specific_dispatch_value : Error<
778"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
779def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
780  InGroup<ImplicitFunctionDeclare>, DefaultError;
781def warn_cstruct_memaccess : Warning<
782  "%select{destination for|source of|first operand of|second operand of}0 this "
783  "%1 call is a pointer to record %2 that is not trivial to "
784  "%select{primitive-default-initialize|primitive-copy}3">,
785  InGroup<NonTrivialMemaccess>;
786def note_nontrivial_field : Note<
787  "field is non-trivial to %select{copy|default-initialize}0">;
788def err_non_trivial_c_union_in_invalid_context : Error<
789  "cannot %select{"
790  "use type %1 for a function/method parameter|"
791  "use type %1 for function/method return|"
792  "default-initialize an object of type %1|"
793  "declare an automatic variable of type %1|"
794  "copy-initialize an object of type %1|"
795  "assign to a variable of type %1|"
796  "construct an automatic compound literal of type %1|"
797  "capture a variable of type %1|"
798  "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion"
799  "}3 "
800  "since it %select{contains|is}2 a union that is non-trivial to "
801  "%select{default-initialize|destruct|copy}0">;
802def note_non_trivial_c_union : Note<
803  "%select{%2 has subobjects that are|%3 has type %2 that is}0 "
804  "non-trivial to %select{default-initialize|destruct|copy}1">;
805def warn_dyn_class_memaccess : Warning<
806  "%select{destination for|source of|first operand of|second operand of}0 this "
807  "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
808  "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
809  InGroup<DynamicClassMemaccess>;
810def note_bad_memaccess_silence : Note<
811  "explicitly cast the pointer to silence this warning">;
812def warn_sizeof_pointer_expr_memaccess : Warning<
813  "'%0' call operates on objects of type %1 while the size is based on a "
814  "different type %2">,
815  InGroup<SizeofPointerMemaccess>;
816def warn_sizeof_pointer_expr_memaccess_note : Note<
817  "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
818  "it by the number of elements)|remove the addressof in the argument to "
819  "'sizeof' (and multiply it by the number of elements)|provide an explicit "
820  "length}0?">;
821def warn_sizeof_pointer_type_memaccess : Warning<
822  "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
823  "%select{destination|source}2; expected %3 or an explicit length">,
824  InGroup<SizeofPointerMemaccess>;
825def warn_strlcpycat_wrong_size : Warning<
826  "size argument in %0 call appears to be size of the source; "
827  "expected the size of the destination">,
828  InGroup<DiagGroup<"strlcpy-strlcat-size">>;
829def note_strlcpycat_wrong_size : Note<
830  "change size argument to be the size of the destination">;
831def warn_memsize_comparison : Warning<
832  "size argument in %0 call is a comparison">,
833  InGroup<DiagGroup<"memsize-comparison">>;
834def note_memsize_comparison_paren : Note<
835  "did you mean to compare the result of %0 instead?">;
836def note_memsize_comparison_cast_silence : Note<
837  "explicitly cast the argument to size_t to silence this warning">;
838def warn_suspicious_sizeof_memset : Warning<
839  "%select{'size' argument to memset is '0'|"
840  "setting buffer to a 'sizeof' expression}0"
841  "; did you mean to transpose the last two arguments?">,
842  InGroup<MemsetTransposedArgs>;
843def note_suspicious_sizeof_memset_silence : Note<
844  "%select{parenthesize the third argument|"
845  "cast the second argument to 'int'}0 to silence">;
846def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
847  InGroup<SuspiciousBzero>;
848def note_suspicious_bzero_size_silence : Note<
849  "parenthesize the second argument to silence">;
850
851def warn_strncat_large_size : Warning<
852  "the value of the size argument in 'strncat' is too large, might lead to a "
853  "buffer overflow">, InGroup<StrncatSize>;
854def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
855  "to be size of the source">, InGroup<StrncatSize>;
856def warn_strncat_wrong_size : Warning<
857  "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
858def note_strncat_wrong_size : Note<
859  "change the argument to be the free space in the destination buffer minus "
860  "the terminating null byte">;
861
862def warn_assume_side_effects : Warning<
863  "assumption is ignored because it contains (potential) side-effects">,
864  InGroup<DiagGroup<"assume">>;
865def warn_omp_assume_attribute_string_unknown : Warning<
866  "unknown assumption string '%0'; attribute is potentially ignored">,
867  InGroup<UnknownAssumption>;
868def warn_omp_assume_attribute_string_unknown_suggested : Warning<
869  "unknown assumption string '%0' may be misspelled; attribute is potentially "
870  "ignored, did you mean '%1'?">,
871  InGroup<MisspelledAssumption>;
872
873def warn_builtin_chk_overflow : Warning<
874  "'%0' will always overflow; destination buffer has size %1,"
875  " but size argument is %2">,
876  InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
877
878def warn_fortify_source_overflow
879  : Warning<warn_builtin_chk_overflow.Summary>, InGroup<FortifySource>;
880def warn_fortify_source_size_mismatch : Warning<
881  "'%0' size argument is too large; destination buffer has size %1,"
882  " but size argument is %2">, InGroup<FortifySource>;
883
884def warn_fortify_strlen_overflow: Warning<
885  "'%0' will always overflow; destination buffer has size %1,"
886  " but the source string has length %2 (including NUL byte)">,
887  InGroup<FortifySource>;
888
889def subst_format_overflow : TextSubstitution<
890  "'%0' will always overflow; destination buffer has size %1,"
891  " but format string expands to at least %2">;
892
893def warn_format_overflow : Warning<
894  "%sub{subst_format_overflow}0,1,2">,
895  InGroup<FormatOverflow>;
896
897def warn_format_overflow_non_kprintf : Warning<
898  "%sub{subst_format_overflow}0,1,2">,
899  InGroup<FormatOverflowNonKprintf>;
900
901def subst_format_truncation: TextSubstitution<
902  "'%0' will always be truncated; specified size is %1,"
903  " but format string expands to at least %2">;
904
905def warn_format_truncation: Warning<
906  "%sub{subst_format_truncation}0,1,2">,
907  InGroup<FormatTruncation>;
908
909def warn_format_truncation_non_kprintf: Warning<
910  "%sub{subst_format_truncation}0,1,2">,
911  InGroup<FormatTruncationNonKprintf>;
912
913def warn_fortify_scanf_overflow : Warning<
914  "'%0' may overflow; destination buffer in argument %1 has size "
915  "%2, but the corresponding specifier may require size %3">,
916  InGroup<FortifySource>;
917
918def err_function_start_invalid_type: Error<
919  "argument must be a function">;
920
921def err_ptrauth_disabled :
922  Error<"this target does not support pointer authentication">;
923def err_ptrauth_invalid_key :
924  Error<"%0 does not identify a valid pointer authentication key for "
925        "the current target">;
926def err_ptrauth_value_bad_type :
927  Error<"%select{signed value|extra discriminator|blended pointer|blended "
928        "integer}0 must have %select{pointer|integer|pointer or integer}1 "
929        "type; type here is %2">;
930def err_ptrauth_bad_constant_pointer :
931  Error<"argument to ptrauth_sign_constant must refer to a global variable "
932        "or function">;
933def err_ptrauth_bad_constant_discriminator :
934  Error<"discriminator argument to ptrauth_sign_constant must be a constant "
935        "integer, the address of the global variable where the result "
936        "will be stored, or a blend of the two">;
937def warn_ptrauth_sign_null_pointer :
938  Warning<"signing a null pointer will yield a non-null pointer">,
939  InGroup<PtrAuthNullPointers>;
940def warn_ptrauth_auth_null_pointer :
941  Warning<"authenticating a null pointer will almost certainly trap">,
942  InGroup<PtrAuthNullPointers>;
943def err_ptrauth_string_not_literal : Error<
944  "argument must be a string literal%select{| of char type}0">;
945def err_ptrauth_type_disc_undiscriminated : Error<
946  "cannot pass undiscriminated type %0 to "
947  "'__builtin_ptrauth_type_discriminator'">;
948
949def note_ptrauth_virtual_function_pointer_incomplete_arg_ret :
950  Note<"cannot take an address of a virtual member function if its return or "
951       "argument types are incomplete">;
952def note_ptrauth_virtual_function_incomplete_arg_ret_type :
953  Note<"%0 is incomplete">;
954
955def err_ptrauth_indirect_goto_addrlabel_arithmetic : Error<
956  "%select{subtraction|addition}0 of address-of-label expressions is not "
957  "supported with ptrauth indirect gotos">;
958
959/// main()
960// static main() is not an error in C, just in C++.
961def warn_static_main : Warning<"'main' should not be declared static">,
962    InGroup<Main>;
963def err_static_main : Error<"'main' is not allowed to be declared static">;
964def err_inline_main : Error<"'main' is not allowed to be declared inline">;
965def ext_variadic_main : ExtWarn<
966  "'main' is not allowed to be declared variadic">, InGroup<Main>;
967def ext_noreturn_main : ExtWarn<
968  "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
969def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
970def err_constexpr_main : Error<
971  "'main' is not allowed to be declared %select{constexpr|consteval}0">;
972def err_deleted_main : Error<"'main' is not allowed to be deleted">;
973def err_mainlike_template_decl : Error<"%0 cannot be a template">;
974def err_main_returns_nonint : Error<"'main' must return 'int'">;
975def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
976    InGroup<MainReturnType>;
977def note_main_change_return_type : Note<"change return type to 'int'">;
978def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
979    "must be 0, 2, or 3">;
980def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
981    InGroup<Main>;
982def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
983    "parameter of 'main' (%select{argument count|argument array|environment|"
984    "platform-specific data}0) must be of type %1">;
985def warn_main_returns_bool_literal : Warning<"bool literal returned from "
986    "'main'">, InGroup<Main>;
987def err_main_global_variable :
988    Error<"main cannot be declared as global variable">;
989def warn_main_redefined : Warning<"variable named 'main' with external linkage "
990    "has undefined behavior">, InGroup<Main>;
991def ext_main_used : Extension<
992    "referring to 'main' within an expression is a Clang extension">, InGroup<Main>;
993
994/// parser diagnostics
995def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
996  InGroup<MissingDeclarations>;
997def err_no_declarators : Error<"declaration does not declare anything">;
998def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
999  InGroup<MissingDeclarations>;
1000def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
1001
1002def ext_non_c_like_anon_struct_in_typedef : ExtWarn<
1003  "anonymous non-C-compatible type given name for linkage purposes "
1004  "by %select{typedef|alias}0 declaration; "
1005  "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>;
1006def err_non_c_like_anon_struct_in_typedef : Error<
1007  "anonymous non-C-compatible type given name for linkage purposes "
1008  "by %select{typedef|alias}0 declaration after its linkage was computed; "
1009  "add a tag name here to establish linkage prior to definition">;
1010def err_typedef_changes_linkage : Error<
1011  "unsupported: anonymous type given name for linkage purposes "
1012  "by %select{typedef|alias}0 declaration after its linkage was computed; "
1013  "add a tag name here to establish linkage prior to definition">;
1014def note_non_c_like_anon_struct : Note<
1015  "type is not C-compatible due to this "
1016  "%select{base class|default member initializer|lambda expression|"
1017  "friend declaration|member declaration}0">;
1018def note_typedef_for_linkage_here : Note<
1019  "type is given name %0 for linkage purposes by this "
1020  "%select{typedef|alias}1 declaration">;
1021
1022def err_statically_allocated_object : Error<
1023  "interface type cannot be statically allocated">;
1024def err_object_cannot_be_passed_returned_by_value : Error<
1025  "interface type %1 cannot be %select{returned|passed}0 by value"
1026  "; did you forget * in %1?">;
1027def err_parameters_retval_cannot_have_fp16_type : Error<
1028  "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
1029def err_opencl_half_load_store : Error<
1030  "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
1031  "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
1032def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
1033def err_opencl_half_declaration : Error<
1034  "declaring variable of type %0 is not allowed">;
1035def err_opencl_invalid_param : Error<
1036  "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">;
1037def err_opencl_invalid_return : Error<
1038  "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
1039def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
1040def warn_pragma_options_align_reset_failed : Warning<
1041  "#pragma options align=reset failed: %0">,
1042  InGroup<IgnoredPragmas>;
1043def err_pragma_options_align_mac68k_target_unsupported : Error<
1044  "mac68k alignment pragma is not supported on this target">;
1045def warn_pragma_align_not_xl_compatible : Warning<
1046  "#pragma align(packed) may not be compatible with objects generated with AIX XL C/C++">,
1047  InGroup<AIXCompat>;
1048def warn_pragma_pack_invalid_alignment : Warning<
1049  "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
1050  InGroup<IgnoredPragmas>;
1051def err_pragma_pack_invalid_alignment : Error<
1052  warn_pragma_pack_invalid_alignment.Summary>;
1053def warn_pragma_pack_non_default_at_include : Warning<
1054  "non-default #pragma pack value changes the alignment of struct or union "
1055  "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
1056  DefaultIgnore;
1057def warn_pragma_pack_modified_after_include : Warning<
1058  "the current #pragma pack alignment value is modified in the included "
1059  "file">, InGroup<PragmaPack>;
1060def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
1061  "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
1062def note_pragma_pack_here : Note<
1063  "previous '#pragma pack' directive that modifies alignment is here">;
1064def note_pragma_pack_pop_instead_reset : Note<
1065  "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
1066// Follow the Microsoft implementation.
1067def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
1068def warn_pragma_pack_pop_identifier_and_alignment : Warning<
1069  "specifying both a name and alignment to 'pop' is undefined">;
1070def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
1071  InGroup<IgnoredPragmas>;
1072def err_pragma_fc_pp_scope : Error<
1073  "'#pragma float_control push/pop' can only appear at file or namespace scope "
1074  "or within a language linkage specification">;
1075def err_pragma_fc_noprecise_requires_nofenv : Error<
1076  "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
1077def err_pragma_fc_except_requires_precise : Error<
1078  "'#pragma float_control(except, on)' is illegal when precise is disabled">;
1079def err_pragma_fc_noprecise_requires_noexcept : Error<
1080  "'#pragma float_control(precise, off)' is illegal when except is enabled">;
1081def err_pragma_fenv_requires_precise : Error<
1082  "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">;
1083def warn_cxx_ms_struct :
1084  Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
1085          "with base classes or virtual functions">,
1086  DefaultError, InGroup<IncompatibleMSStruct>;
1087def err_pragma_pack_identifer_not_supported : Error<
1088  "specifying an identifier within `#pragma pack` is not supported on this target">;
1089def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
1090def warn_section_msvc_compat : Warning<"`#pragma const_seg` for section %1 will"
1091  " not apply to %0 due to the presence of a %select{mutable field||non-trivial constructor|non-trivial destructor}2">,
1092  InGroup<IncompatibleMSPragmaSection>;
1093def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
1094def err_invalid_super_scope : Error<"invalid use of '__super', "
1095  "this keyword can only be used inside class or member function scope">;
1096def err_super_in_lambda_unsupported : Error<
1097  "use of '__super' inside a lambda is unsupported">;
1098
1099def err_pragma_expected_file_scope : Error<
1100  "'#pragma %0' can only appear at file scope">;
1101def err_pragma_alloc_text_c_linkage: Error<
1102  "'#pragma alloc_text' is applicable only to functions with C linkage">;
1103def err_pragma_alloc_text_not_function: Error<
1104  "'#pragma alloc_text' is applicable only to functions">;
1105
1106def warn_pragma_unused_undeclared_var : Warning<
1107  "undeclared variable %0 used as an argument for '#pragma unused'">,
1108  InGroup<IgnoredPragmas>;
1109def warn_atl_uuid_deprecated : Warning<
1110  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
1111  InGroup<DeprecatedDeclarations>;
1112def warn_pragma_unused_expected_var_arg : Warning<
1113  "only variables can be arguments to '#pragma unused'">,
1114  InGroup<IgnoredPragmas>;
1115def err_pragma_push_visibility_mismatch : Error<
1116  "#pragma visibility push with no matching #pragma visibility pop">;
1117def note_surrounding_namespace_ends_here : Note<
1118  "surrounding namespace with visibility attribute ends here">;
1119def err_pragma_pop_visibility_mismatch : Error<
1120  "#pragma visibility pop with no matching #pragma visibility push">;
1121def note_surrounding_namespace_starts_here : Note<
1122  "surrounding namespace with visibility attribute starts here">;
1123def err_pragma_loop_invalid_argument_type : Error<
1124  "invalid argument of type %0; expected an integer type">;
1125def err_pragma_loop_compatibility : Error<
1126  "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
1127def err_pragma_loop_precedes_nonloop : Error<
1128  "expected a for, while, or do-while loop to follow '%0'">;
1129
1130def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
1131  "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
1132  "those declarations">;
1133def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
1134  "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
1135def err_pragma_attribute_invalid_matchers : Error<
1136  "attribute %0 can't be applied to %1">;
1137def err_pragma_attribute_stack_mismatch : Error<
1138  "'#pragma clang attribute %select{%1.|}0pop' with no matching"
1139  " '#pragma clang attribute %select{%1.|}0push'">;
1140def warn_pragma_attribute_unused : Warning<
1141  "unused attribute %0 in '#pragma clang attribute push' region">,
1142  InGroup<PragmaClangAttribute>;
1143def note_pragma_attribute_region_ends_here : Note<
1144  "'#pragma clang attribute push' regions ends here">;
1145def err_pragma_attribute_no_pop_eof : Error<"unterminated "
1146  "'#pragma clang attribute push' at end of file">;
1147def note_pragma_attribute_applied_decl_here : Note<
1148  "when applied to this declaration">;
1149def err_pragma_attr_attr_no_push : Error<
1150  "'#pragma clang attribute' attribute with no matching "
1151  "'#pragma clang attribute push'">;
1152
1153/// Objective-C parser diagnostics
1154def err_duplicate_class_def : Error<
1155  "duplicate interface definition for class %0">;
1156def err_undef_superclass : Error<
1157  "cannot find interface declaration for %0, superclass of %1">;
1158def err_forward_superclass : Error<
1159  "attempting to use the forward class %0 as superclass of %1">;
1160def err_no_nsconstant_string_class : Error<
1161  "cannot find interface declaration for %0">;
1162def err_recursive_superclass : Error<
1163  "trying to recursively use %0 as superclass of %1">;
1164def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
1165def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
1166def warn_duplicate_protocol_def : Warning<
1167  "duplicate protocol definition of %0 is ignored">,
1168  InGroup<DiagGroup<"duplicate-protocol">>;
1169def err_protocol_has_circular_dependency : Error<
1170  "protocol has circular dependency">;
1171def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
1172def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
1173def err_atprotocol_protocol : Error<
1174  "@protocol is using a forward protocol declaration of %0">;
1175def warn_readonly_property : Warning<
1176  "attribute 'readonly' of property %0 restricts attribute "
1177  "'readwrite' of property inherited from %1">,
1178  InGroup<PropertyAttr>;
1179
1180def warn_property_attribute : Warning<
1181  "'%1' attribute on property %0 does not match the property inherited from %2">,
1182  InGroup<PropertyAttr>;
1183def warn_property_types_are_incompatible : Warning<
1184  "property type %0 is incompatible with type %1 inherited from %2">,
1185  InGroup<DiagGroup<"incompatible-property-type">>;
1186def warn_protocol_property_mismatch : Warning<
1187  "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
1188  "getter %1|with setter %1}0 was selected for synthesis">,
1189  InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
1190def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Summary>;
1191def err_undef_interface : Error<"cannot find interface declaration for %0">;
1192def err_category_forward_interface : Error<
1193  "cannot define %select{category|class extension}0 for undefined class %1">;
1194def err_class_extension_after_impl : Error<
1195  "cannot declare class extension for %0 after class implementation">;
1196def note_implementation_declared : Note<
1197  "class implementation is declared here">;
1198def note_while_in_implementation : Note<
1199  "detected while default synthesizing properties in class implementation">;
1200def note_class_declared : Note<
1201  "class is declared here">;
1202def note_receiver_class_declared : Note<
1203  "receiver is instance of class declared here">;
1204def note_receiver_expr_here : Note<
1205  "receiver expression is here">;
1206def note_receiver_is_id : Note<
1207  "receiver is treated with 'id' type for purpose of method lookup">;
1208def note_suppressed_class_declare : Note<
1209  "class with specified objc_requires_property_definitions attribute is declared here">;
1210def err_objc_root_class_subclass : Error<
1211  "objc_root_class attribute may only be specified on a root class declaration">;
1212def err_restricted_superclass_mismatch : Error<
1213  "cannot subclass a class that was declared with the "
1214  "'objc_subclassing_restricted' attribute">;
1215def err_class_stub_subclassing_mismatch : Error<
1216  "'objc_class_stub' attribute cannot be specified on a class that does not "
1217  "have the 'objc_subclassing_restricted' attribute">;
1218def err_implementation_of_class_stub : Error<
1219  "cannot declare implementation of a class declared with the "
1220  "'objc_class_stub' attribute">;
1221def warn_objc_root_class_missing : Warning<
1222  "class %0 defined without specifying a base class">,
1223  InGroup<ObjCRootClass>;
1224def err_objc_runtime_visible_category : Error<
1225  "cannot implement a category for class %0 that is only visible via the "
1226  "Objective-C runtime">;
1227def err_objc_runtime_visible_subclass : Error<
1228  "cannot implement subclass %0 of a superclass %1 that is only visible via the "
1229  "Objective-C runtime">;
1230def note_objc_needs_superclass : Note<
1231  "add a super class to fix this problem">;
1232def err_conflicting_super_class : Error<"conflicting super class name %0">;
1233def err_dup_implementation_class : Error<"reimplementation of class %0">;
1234def err_dup_implementation_category : Error<
1235  "reimplementation of category %1 for class %0">;
1236def err_conflicting_ivar_type : Error<
1237  "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
1238def err_duplicate_ivar_declaration : Error<
1239  "instance variable is already declared">;
1240def warn_on_superclass_use : Warning<
1241  "class implementation may not have super class">;
1242def err_conflicting_ivar_bitwidth : Error<
1243  "instance variable %0 has conflicting bit-field width">;
1244def err_conflicting_ivar_name : Error<
1245  "conflicting instance variable names: %0 vs %1">;
1246def err_inconsistent_ivar_count : Error<
1247  "inconsistent number of instance variables specified">;
1248def warn_undef_method_impl : Warning<"method definition for %0 not found">,
1249  InGroup<DiagGroup<"incomplete-implementation">>;
1250def warn_objc_boxing_invalid_utf8_string : Warning<
1251  "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
1252  InGroup<ObjCBoxing>;
1253
1254def err_objc_non_runtime_protocol_in_protocol_expr : Error<
1255  "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">;
1256def err_objc_direct_on_protocol : Error<
1257  "'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
1258  "declared in an Objective-C protocol">;
1259def err_objc_direct_duplicate_decl : Error<
1260  "%select{|direct }0%select{method|property}1 declaration conflicts "
1261  "with previous %select{|direct }2declaration of %select{method|property}1 %3">;
1262def err_objc_direct_impl_decl_mismatch : Error<
1263  "direct method was declared in %select{the primary interface|an extension|a category}0 "
1264  "but is implemented in %select{the primary interface|a category|a different category}1">;
1265def err_objc_direct_missing_on_decl : Error<
1266  "direct method implementation was previously declared not direct">;
1267def err_objc_direct_on_override : Error<
1268  "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">;
1269def err_objc_override_direct_method : Error<
1270  "cannot override a method that is declared direct by a superclass">;
1271def warn_objc_direct_ignored : Warning<
1272  "%0 attribute isn't implemented by this Objective-C runtime">,
1273  InGroup<IgnoredAttributes>;
1274def warn_objc_direct_property_ignored : Warning<
1275  "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
1276  InGroup<IgnoredAttributes>;
1277def err_objc_direct_dynamic_property : Error<
1278  "direct property cannot be @dynamic">;
1279def err_objc_direct_protocol_conformance : Error<
1280  "%select{category %1|class extension}0 cannot conform to protocol %2 because "
1281  "of direct members declared in interface %3">;
1282def note_direct_member_here : Note<"direct member declared here">;
1283
1284def warn_conflicting_overriding_ret_types : Warning<
1285  "conflicting return type in "
1286  "declaration of %0%diff{: $ vs $|}1,2">,
1287  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1288
1289def warn_conflicting_ret_types : Warning<
1290  "conflicting return type in "
1291  "implementation of %0%diff{: $ vs $|}1,2">,
1292  InGroup<MismatchedReturnTypes>;
1293
1294def warn_conflicting_overriding_ret_type_modifiers : Warning<
1295  "conflicting distributed object modifiers on return type "
1296  "in declaration of %0">,
1297  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1298
1299def warn_conflicting_ret_type_modifiers : Warning<
1300  "conflicting distributed object modifiers on return type "
1301  "in implementation of %0">,
1302  InGroup<DistributedObjectModifiers>;
1303
1304def warn_non_covariant_overriding_ret_types : Warning<
1305  "conflicting return type in "
1306  "declaration of %0: %1 vs %2">,
1307  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1308
1309def warn_non_covariant_ret_types : Warning<
1310  "conflicting return type in "
1311  "implementation of %0: %1 vs %2">,
1312  InGroup<MethodSignatures>, DefaultIgnore;
1313
1314def warn_conflicting_overriding_param_types : Warning<
1315  "conflicting parameter types in "
1316  "declaration of %0%diff{: $ vs $|}1,2">,
1317  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1318
1319def warn_conflicting_param_types : Warning<
1320  "conflicting parameter types in "
1321  "implementation of %0%diff{: $ vs $|}1,2">,
1322  InGroup<MismatchedParameterTypes>;
1323
1324def warn_conflicting_param_modifiers : Warning<
1325  "conflicting distributed object modifiers on parameter type "
1326  "in implementation of %0">,
1327  InGroup<DistributedObjectModifiers>;
1328
1329def warn_conflicting_overriding_param_modifiers : Warning<
1330  "conflicting distributed object modifiers on parameter type "
1331  "in declaration of %0">,
1332  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1333
1334def warn_non_contravariant_overriding_param_types : Warning<
1335  "conflicting parameter types in "
1336  "declaration of %0: %1 vs %2">,
1337  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1338
1339def warn_non_contravariant_param_types : Warning<
1340  "conflicting parameter types in "
1341  "implementation of %0: %1 vs %2">,
1342  InGroup<MethodSignatures>, DefaultIgnore;
1343
1344def warn_conflicting_overriding_variadic :Warning<
1345  "conflicting variadic declaration of method and its "
1346  "implementation">,
1347  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1348
1349def warn_conflicting_variadic :Warning<
1350  "conflicting variadic declaration of method and its "
1351  "implementation">;
1352
1353def warn_category_method_impl_match:Warning<
1354  "category is implementing a method which will also be implemented"
1355  " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1356
1357def warn_implements_nscopying : Warning<
1358"default assign attribute on property %0 which implements "
1359"NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1360
1361def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1362  InGroup<ObjCMultipleMethodNames>;
1363def warn_strict_multiple_method_decl : Warning<
1364  "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1365def warn_accessor_property_type_mismatch : Warning<
1366  "type of property %0 does not match type of accessor %1">;
1367def note_conv_function_declared_at : Note<"type conversion function declared here">;
1368def note_method_declared_at : Note<"method %0 declared here">;
1369def note_direct_method_declared_at : Note<"direct method %0 declared here">;
1370def note_property_attribute : Note<"property %0 is declared "
1371  "%select{deprecated|unavailable|partial}1 here">;
1372def err_setter_type_void : Error<"type of setter must be void">;
1373def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1374def warn_duplicate_method_decl :
1375  Warning<"multiple declarations of method %0 found and ignored">,
1376  InGroup<MethodDuplicate>, DefaultIgnore;
1377def warn_objc_cdirective_format_string :
1378  Warning<"using %0 directive in %select{NSString|CFString}1 "
1379          "which is being passed as a formatting argument to the formatting "
1380          "%select{method|CFfunction}2">,
1381  InGroup<ObjCCStringFormat>, DefaultIgnore;
1382def err_objc_var_decl_inclass :
1383    Error<"cannot declare variable inside @interface or @protocol">;
1384def err_missing_method_context : Error<
1385  "missing context for method declaration">;
1386def err_objc_property_attr_mutually_exclusive : Error<
1387  "property attributes '%0' and '%1' are mutually exclusive">;
1388def err_objc_property_requires_object : Error<
1389  "property with '%0' attribute must be of object type">;
1390def warn_objc_property_assign_on_object : Warning<
1391  "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1392  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1393def warn_objc_property_no_assignment_attribute : Warning<
1394  "no 'assign', 'retain', or 'copy' attribute is specified - "
1395  "'assign' is assumed">,
1396  InGroup<ObjCPropertyNoAttribute>;
1397def warn_objc_isa_use : Warning<
1398  "direct access to Objective-C's isa is deprecated in favor of "
1399  "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1400def warn_objc_isa_assign : Warning<
1401  "assignment to Objective-C's isa is deprecated in favor of "
1402  "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1403def warn_objc_pointer_masking : Warning<
1404  "bitmasking for introspection of Objective-C object pointers is strongly "
1405  "discouraged">,
1406  InGroup<ObjCPointerIntrospect>;
1407def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Summary>,
1408  InGroup<ObjCPointerIntrospectPerformSelector>;
1409def warn_objc_property_default_assign_on_object : Warning<
1410  "default property attribute 'assign' not appropriate for object">,
1411  InGroup<ObjCPropertyNoAttribute>;
1412def warn_property_attr_mismatch : Warning<
1413  "property attribute in class extension does not match the primary class">,
1414  InGroup<PropertyAttr>;
1415def warn_property_implicitly_mismatched : Warning <
1416  "primary property declaration is implicitly strong while redeclaration "
1417  "in class extension is weak">,
1418  InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1419def warn_objc_property_copy_missing_on_block : Warning<
1420    "'copy' attribute must be specified for the block property "
1421    "when -fobjc-gc-only is specified">;
1422def warn_objc_property_retain_of_block : Warning<
1423    "retain'ed block property does not copy the block "
1424    "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1425def warn_objc_readonly_property_has_setter : Warning<
1426    "setter cannot be specified for a readonly property">,
1427    InGroup<ObjCReadonlyPropertyHasSetter>;
1428def warn_atomic_property_rule : Warning<
1429  "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1430  "with a user defined %select{getter|setter}2">,
1431  InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1432def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1433  "synthesized, or both be user defined, or the property must be nonatomic">;
1434def err_atomic_property_nontrivial_assign_op : Error<
1435  "atomic property of reference type %0 cannot have non-trivial assignment"
1436  " operator">;
1437def warn_cocoa_naming_owned_rule : Warning<
1438  "property follows Cocoa naming"
1439  " convention for returning 'owned' objects">,
1440  InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1441def err_cocoa_naming_owned_rule : Error<
1442  "property follows Cocoa naming"
1443  " convention for returning 'owned' objects">;
1444def note_cocoa_naming_declare_family : Note<
1445  "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1446  "object">;
1447def warn_auto_synthesizing_protocol_property :Warning<
1448  "auto property synthesis will not synthesize property %0"
1449  " declared in protocol %1">,
1450  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1451def note_add_synthesize_directive : Note<
1452  "add a '@synthesize' directive">;
1453def warn_no_autosynthesis_shared_ivar_property : Warning <
1454  "auto property synthesis will not synthesize property "
1455  "%0 because it cannot share an ivar with another synthesized property">,
1456  InGroup<ObjCNoPropertyAutoSynthesis>;
1457def warn_no_autosynthesis_property : Warning<
1458  "auto property synthesis will not synthesize property "
1459  "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1460  "via another property">,
1461  InGroup<ObjCNoPropertyAutoSynthesis>;
1462def warn_autosynthesis_property_in_superclass : Warning<
1463  "auto property synthesis will not synthesize property "
1464  "%0; it will be implemented by its superclass, use @dynamic to "
1465  "acknowledge intention">,
1466  InGroup<ObjCNoPropertyAutoSynthesis>;
1467def warn_autosynthesis_property_ivar_match :Warning<
1468  "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1469  "%2, not existing instance variable %3">,
1470  InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1471def warn_missing_explicit_synthesis : Warning <
1472  "auto property synthesis is synthesizing property not explicitly synthesized">,
1473  InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1474def warn_property_getter_owning_mismatch : Warning<
1475  "property declared as returning non-retained objects"
1476  "; getter returning retained objects">;
1477def warn_property_redecl_getter_mismatch : Warning<
1478  "getter name mismatch between property redeclaration (%1) and its original "
1479  "declaration (%0)">, InGroup<PropertyAttr>;
1480def err_property_setter_ambiguous_use : Error<
1481  "synthesized properties %0 and %1 both claim setter %2 -"
1482  " use of this setter will cause unexpected behavior">;
1483def warn_default_atomic_custom_getter_setter : Warning<
1484  "atomic by default property %0 has a user defined %select{getter|setter}1 "
1485  "(property should be marked 'atomic' if this is intended)">,
1486  InGroup<CustomAtomic>, DefaultIgnore;
1487def err_use_continuation_class : Error<
1488  "illegal redeclaration of property in class extension %0"
1489  " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1490def err_type_mismatch_continuation_class : Error<
1491  "type of property %0 in class extension does not match "
1492  "property type in primary class">;
1493def err_use_continuation_class_redeclaration_readwrite : Error<
1494  "illegal redeclaration of 'readwrite' property in class extension %0"
1495  " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1496  "'readonly' public property?)">;
1497def err_continuation_class : Error<"class extension has no primary class">;
1498def err_property_type : Error<"property cannot have array or function type %0">;
1499def err_missing_property_context : Error<
1500  "missing context for property implementation declaration">;
1501def err_bad_property_decl : Error<
1502  "property implementation must have its declaration in interface %0 or one of "
1503  "its extensions">;
1504def err_category_property : Error<
1505  "property declared in category %0 cannot be implemented in "
1506  "class implementation">;
1507def note_property_declare : Note<
1508  "property declared here">;
1509def note_protocol_property_declare : Note<
1510  "it could also be property "
1511  "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1512  "%1|with setter %1}0 declared here">;
1513def note_property_synthesize : Note<
1514  "property synthesized here">;
1515def err_synthesize_category_decl : Error<
1516  "@synthesize not allowed in a category's implementation">;
1517def err_synthesize_on_class_property : Error<
1518  "@synthesize not allowed on a class property %0">;
1519def err_missing_property_interface : Error<
1520  "property implementation in a category with no category declaration">;
1521def err_bad_category_property_decl : Error<
1522  "property implementation must have its declaration in the category %0">;
1523def err_bad_property_context : Error<
1524  "property implementation must be in a class or category implementation">;
1525def err_missing_property_ivar_decl : Error<
1526  "synthesized property %0 must either be named the same as a compatible"
1527  " instance variable or must explicitly name an instance variable">;
1528def err_arc_perform_selector_retains : Error<
1529  "performSelector names a selector which retains the object">;
1530def warn_arc_perform_selector_leaks : Warning<
1531  "performSelector may cause a leak because its selector is unknown">,
1532  InGroup<DiagGroup<"arc-performSelector-leaks">>;
1533def warn_dealloc_in_category : Warning<
1534"-dealloc is being overridden in a category">,
1535InGroup<DeallocInCategory>;
1536def err_gc_weak_property_strong_type : Error<
1537  "weak attribute declared on a __strong type property in GC mode">;
1538def warn_arc_repeated_use_of_weak : Warning <
1539  "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1540  "accessed multiple times in this %select{function|method|block|lambda}2 "
1541  "but may be unpredictably set to nil; assign to a strong variable to keep "
1542  "the object alive">,
1543  InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1544def warn_implicitly_retains_self : Warning <
1545  "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1546  "this is intended behavior">,
1547  InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1548def warn_arc_possible_repeated_use_of_weak : Warning <
1549  "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1550  "be accessed multiple times in this %select{function|method|block|lambda}2 "
1551  "and may be unpredictably set to nil; assign to a strong variable to keep "
1552  "the object alive">,
1553  InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1554def note_arc_weak_also_accessed_here : Note<
1555  "also accessed here">;
1556def err_incomplete_synthesized_property : Error<
1557  "cannot synthesize property %0 with incomplete type %1">;
1558
1559def err_property_ivar_type : Error<
1560  "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1561def err_property_accessor_type : Error<
1562  "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1563def err_ivar_in_superclass_use : Error<
1564  "property %0 attempting to use instance variable %1 declared in super class %2">;
1565def err_weak_property : Error<
1566  "existing instance variable %1 for __weak property %0 must be __weak">;
1567def err_strong_property : Error<
1568  "existing instance variable %1 for strong property %0 may not be __weak">;
1569def err_dynamic_property_ivar_decl : Error<
1570  "dynamic property cannot have instance variable specification">;
1571def err_duplicate_ivar_use : Error<
1572  "synthesized properties %0 and %1 both claim instance variable %2">;
1573def err_property_implemented : Error<"property %0 is already implemented">;
1574def warn_objc_missing_super_call : Warning<
1575  "method possibly missing a [super %0] call">,
1576  InGroup<ObjCMissingSuperCalls>;
1577def err_dealloc_bad_result_type : Error<
1578  "dealloc return type must be correctly specified as 'void' under ARC, "
1579  "instead of %0">;
1580def warn_undeclared_selector : Warning<
1581  "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1582def warn_undeclared_selector_with_typo : Warning<
1583  "undeclared selector %0; did you mean %1?">,
1584  InGroup<UndeclaredSelector>, DefaultIgnore;
1585def warn_implicit_atomic_property : Warning<
1586  "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1587def note_auto_readonly_iboutlet_fixup_suggest : Note<
1588  "property should be changed to be readwrite">;
1589def warn_auto_readonly_iboutlet_property : Warning<
1590  "readonly IBOutlet property %0 when auto-synthesized may "
1591  "not work correctly with 'nib' loader">,
1592  InGroup<DiagGroup<"readonly-iboutlet-property">>;
1593def warn_auto_implicit_atomic_property : Warning<
1594  "property is assumed atomic when auto-synthesizing the property">,
1595  InGroup<ImplicitAtomic>, DefaultIgnore;
1596def warn_unimplemented_selector:  Warning<
1597  "no method with selector %0 is implemented in this translation unit">,
1598  InGroup<Selector>, DefaultIgnore;
1599def warn_unimplemented_protocol_method : Warning<
1600  "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1601def warn_multiple_selectors: Warning<
1602  "several methods with selector %0 of mismatched types are found "
1603  "for the @selector expression">,
1604  InGroup<SelectorTypeMismatch>, DefaultIgnore;
1605def err_direct_selector_expression : Error<
1606  "@selector expression formed with direct selector %0">;
1607def warn_potentially_direct_selector_expression : Warning<
1608  "@selector expression formed with potentially direct selector %0">,
1609  InGroup<ObjCPotentiallyDirectSelector>;
1610def warn_strict_potentially_direct_selector_expression : Warning<
1611  warn_potentially_direct_selector_expression.Summary>,
1612  InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore;
1613
1614def err_objc_kindof_nonobject : Error<
1615  "'__kindof' specifier cannot be applied to non-object type %0">;
1616def err_objc_kindof_wrong_position : Error<
1617  "'__kindof' type specifier must precede the declarator">;
1618
1619def err_objc_method_unsupported_param_ret_type : Error<
1620  "%0 %select{parameter|return}1 type is unsupported; "
1621  "support for vector types for this target is introduced in %2">;
1622
1623def warn_messaging_unqualified_id : Warning<
1624  "messaging unqualified id">, DefaultIgnore,
1625  InGroup<DiagGroup<"objc-messaging-id">>;
1626def err_messaging_unqualified_id_with_direct_method : Error<
1627  "messaging unqualified id with a method that is possibly direct">;
1628def err_messaging_super_with_direct_method : Error<
1629  "messaging super with a direct method">;
1630def err_messaging_class_with_direct_method : Error<
1631  "messaging a Class with a method that is possibly direct">;
1632
1633// C++ declarations
1634def err_static_assert_expression_is_not_constant : Error<
1635  "static assertion expression is not an integral constant expression">;
1636def err_constexpr_if_condition_expression_is_not_constant : Error<
1637  "constexpr if condition is not a constant expression">;
1638def err_static_assert_failed : Error<"static assertion failed%select{: %1|}0">;
1639def err_static_assert_requirement_failed : Error<
1640  "static assertion failed due to requirement '%0'%select{: %2|}1">;
1641def note_expr_evaluates_to : Note<
1642  "expression evaluates to '%0 %1 %2'">;
1643def err_static_assert_invalid_message : Error<
1644  "the message in a static assertion must be a string literal or an "
1645  "object with 'data()' and 'size()' member functions">;
1646def err_static_assert_missing_member_function : Error<
1647  "the message object in this static assertion is missing %select{"
1648  "a 'size()' member function|"
1649  "a 'data()' member function|"
1650  "'data()' and 'size()' member functions}0">;
1651def err_static_assert_invalid_mem_fn_ret_ty : Error<
1652  "the message in a static assertion must have a '%select{size|data}0()' member "
1653  "function returning an object convertible to '%select{std::size_t|const char *}0'">;
1654def warn_static_assert_message_constexpr : Warning<
1655  "the message in this static assertion is not a "
1656  "constant expression">,
1657  DefaultError, InGroup<DiagGroup<"invalid-static-assert-message">>;
1658def err_static_assert_message_constexpr : Error<
1659  "the message in a static assertion must be produced by a "
1660  "constant expression">;
1661
1662def warn_consteval_if_always_true : Warning<
1663  "consteval if is always true in an %select{unevaluated|immediate}0 context">,
1664  InGroup<DiagGroup<"redundant-consteval-if">>;
1665
1666def ext_inline_variable : ExtWarn<
1667  "inline variables are a C++17 extension">, InGroup<CXX17>;
1668def warn_cxx14_compat_inline_variable : Warning<
1669  "inline variables are incompatible with C++ standards before C++17">,
1670  DefaultIgnore, InGroup<CXXPre17Compat>;
1671
1672def warn_inline_namespace_reopened_noninline : Warning<
1673  "inline namespace reopened as a non-inline namespace">,
1674  InGroup<InlineNamespaceReopenedNoninline>;
1675def err_inline_namespace_mismatch : Error<
1676  "non-inline namespace cannot be reopened as inline">;
1677def err_inline_namespace_std : Error<
1678  "cannot declare the namespace 'std' to be inline">;
1679
1680def err_unexpected_friend : Error<
1681  "friends can only be classes or functions">;
1682def ext_enum_friend : ExtWarn<
1683  "elaborated enum specifier cannot be declared as a friend">,
1684  InGroup<DiagGroup<"friend-enum">>;
1685def note_enum_friend : Note<
1686  "remove 'enum%select{| struct| class}0' to befriend an enum">;
1687def ext_nonclass_type_friend : ExtWarn<
1688  "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1689def warn_cxx98_compat_nonclass_type_friend : Warning<
1690  "non-class friend type %0 is incompatible with C++98">,
1691  InGroup<CXX98Compat>, DefaultIgnore;
1692def err_friend_is_member : Error<
1693  "friends cannot be members of the declaring class">;
1694def warn_cxx98_compat_friend_is_member : Warning<
1695  "friend declaration naming a member of the declaring class is incompatible "
1696  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1697def ext_unelaborated_friend_type : ExtWarn<
1698  "unelaborated friend declaration is a C++11 extension; specify "
1699  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1700  InGroup<CXX11>;
1701def warn_cxx98_compat_unelaborated_friend_type : Warning<
1702  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1703  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1704def err_qualified_friend_no_match : Error<
1705  "friend declaration of %0 does not match any declaration in %1">;
1706def err_introducing_special_friend : Error<
1707  "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1708  " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1709  "as a friend">;
1710def err_tagless_friend_type_template : Error<
1711  "friend type templates must use an elaborated type">;
1712def err_no_matching_local_friend : Error<
1713  "no matching function found in local scope">;
1714def err_no_matching_local_friend_suggest : Error<
1715  "no matching function %0 found in local scope; did you mean %3?">;
1716def err_partial_specialization_friend : Error<
1717  "partial specialization cannot be declared as a friend">;
1718def err_qualified_friend_def : Error<
1719  "friend function definition cannot be qualified with '%0'">;
1720def err_friend_def_in_local_class : Error<
1721  "friend function cannot be defined in a local class">;
1722def err_friend_specialization_def : Error<
1723  "friend function specialization cannot be defined">;
1724def err_friend_not_first_in_declaration : Error<
1725  "'friend' must appear first in a non-function declaration">;
1726def err_using_decl_friend : Error<
1727  "cannot befriend target of using declaration">;
1728def warn_template_qualified_friend_unsupported : Warning<
1729  "dependent nested name specifier '%0' for friend class declaration is "
1730  "not supported; turning off access control for %1">,
1731  InGroup<UnsupportedFriend>;
1732def warn_template_qualified_friend_ignored : Warning<
1733  "dependent nested name specifier '%0' for friend template declaration is "
1734  "not supported; ignoring this friend declaration">,
1735  InGroup<UnsupportedFriend>;
1736def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1737  "unqualified friend declaration referring to type outside of the nearest "
1738  "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1739  InGroup<MicrosoftUnqualifiedFriend>;
1740def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1741
1742def err_invalid_base_in_interface : Error<
1743  "interface type cannot inherit from "
1744  "%select{struct|non-public interface|class}0 %1">;
1745
1746def err_abstract_type_in_decl : Error<
1747  "%select{return|parameter|variable|field|instance variable|"
1748  "synthesized instance variable}0 type %1 is an abstract class">;
1749def err_allocation_of_abstract_type : Error<
1750  "allocating an object of abstract class type %0">;
1751def err_throw_abstract_type : Error<
1752  "cannot throw an object of abstract type %0">;
1753def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1754def err_capture_of_abstract_type : Error<
1755  "by-copy capture of value of abstract type %0">;
1756def err_capture_of_incomplete_or_sizeless_type : Error<
1757  "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">;
1758def err_capture_default_non_local : Error<
1759  "non-local lambda expression cannot have a capture-default">;
1760
1761def err_multiple_final_overriders : Error<
1762  "virtual function %q0 has more than one final overrider in %1">;
1763def note_final_overrider : Note<"final overrider of %q0 in %1">;
1764
1765def err_type_defined_in_type_specifier : Error<
1766  "%0 cannot be defined in a type specifier">;
1767def err_type_defined_in_result_type : Error<
1768  "%0 cannot be defined in the result type of a function">;
1769def err_type_defined_in_param_type : Error<
1770  "%0 cannot be defined in a parameter type">;
1771def err_type_defined_in_alias_template : Error<
1772  "%0 cannot be defined in a type alias template">;
1773def err_type_defined_in_condition : Error<
1774  "%0 cannot be defined in a condition">;
1775def err_type_defined_in_enum : Error<
1776  "%0 cannot be defined in an enumeration">;
1777def ext_type_defined_in_offsetof : Extension<
1778  "defining a type within '%select{__builtin_offsetof|offsetof}0' is a C23 "
1779  "extension">, InGroup<C23>;
1780
1781def note_pure_virtual_function : Note<
1782  "unimplemented pure virtual method %0 in %1">;
1783
1784def note_pure_qualified_call_kext : Note<
1785  "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1786
1787def err_deleted_decl_not_first : Error<
1788  "deleted definition must be first declaration">;
1789
1790def err_deleted_override : Error<
1791  "deleted function %0 cannot override a non-deleted function">;
1792def err_non_deleted_override : Error<
1793  "non-deleted function %0 cannot override a deleted function">;
1794def err_consteval_override : Error<
1795  "consteval function %0 cannot override a non-consteval function">;
1796def err_non_consteval_override : Error<
1797  "non-consteval function %0 cannot override a consteval function">;
1798
1799def warn_weak_vtable : Warning<
1800  "%0 has no out-of-line virtual method definitions; its vtable will be "
1801  "emitted in every translation unit">,
1802  InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1803def warn_weak_template_vtable : Warning<
1804  "this warning is no longer in use and will be removed in the next release">,
1805  InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1806
1807def ext_using_undefined_std : ExtWarn<
1808  "using directive refers to implicitly-defined namespace 'std'">;
1809
1810// C++ exception specifications
1811def err_exception_spec_in_typedef : Error<
1812  "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1813def err_distant_exception_spec : Error<
1814  "exception specifications are not allowed beyond a single level "
1815  "of indirection">;
1816def err_incomplete_in_exception_spec : Error<
1817  "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1818  "in exception specification">;
1819def err_sizeless_in_exception_spec : Error<
1820  "%select{|reference to }0sizeless type %1 is not allowed "
1821  "in exception specification">;
1822def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Summary>,
1823  InGroup<MicrosoftExceptionSpec>;
1824def err_rref_in_exception_spec : Error<
1825  "rvalue reference type %0 is not allowed in exception specification">;
1826def err_mismatched_exception_spec : Error<
1827  "exception specification in declaration does not match previous declaration">;
1828def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Summary>,
1829  InGroup<MicrosoftExceptionSpec>;
1830def err_override_exception_spec : Error<
1831  "exception specification of overriding function is more lax than "
1832  "base version">;
1833def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Summary>,
1834  InGroup<MicrosoftExceptionSpec>;
1835def err_incompatible_exception_specs : Error<
1836  "target exception specification is not superset of source">;
1837def warn_incompatible_exception_specs : Warning<
1838  err_incompatible_exception_specs.Summary>, InGroup<IncompatibleExceptionSpec>;
1839def err_deep_exception_specs_differ : Error<
1840  "exception specifications of %select{return|argument}0 types differ">;
1841def warn_deep_exception_specs_differ : Warning<
1842  err_deep_exception_specs_differ.Summary>, InGroup<IncompatibleExceptionSpec>;
1843def err_missing_exception_specification : Error<
1844  "%0 is missing exception specification '%1'">;
1845def ext_missing_exception_specification : ExtWarn<
1846  err_missing_exception_specification.Summary>,
1847  InGroup<DiagGroup<"missing-exception-spec">>;
1848def err_exception_spec_not_parsed : Error<
1849  "exception specification is not available until end of class definition">;
1850def err_exception_spec_cycle : Error<
1851  "exception specification of %0 uses itself">;
1852def err_exception_spec_incomplete_type : Error<
1853  "exception specification needed for member of incomplete class %0">;
1854def warn_wasm_dynamic_exception_spec_ignored : ExtWarn<
1855  "dynamic exception specifications with types are currently ignored in wasm">,
1856  InGroup<WebAssemblyExceptionSpec>;
1857
1858// C++ access checking
1859def err_class_redeclared_with_different_access : Error<
1860  "%0 redeclared with '%1' access">;
1861def err_access : Error<
1862  "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1863def ext_ms_using_declaration_inaccessible : ExtWarn<
1864  "using declaration referring to inaccessible member '%0' (which refers "
1865  "to accessible member '%1') is a Microsoft compatibility extension">,
1866    AccessControl, InGroup<MicrosoftUsingDecl>;
1867def err_access_ctor : Error<
1868  "calling a %select{private|protected}0 constructor of class %2">,
1869  AccessControl;
1870def ext_rvalue_to_reference_access_ctor : Extension<
1871  "C++98 requires an accessible copy constructor for class %2 when binding "
1872  "a reference to a temporary; was %select{private|protected}0">,
1873  AccessControl, InGroup<BindToTemporaryCopy>;
1874def err_access_base_ctor : Error<
1875  // The ERRORs represent other special members that aren't constructors, in
1876  // hopes that someone will bother noticing and reporting if they appear
1877  "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1878  "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1879  "|*ERROR*|}2constructor">, AccessControl;
1880def err_access_field_ctor : Error<
1881  // The ERRORs represent other special members that aren't constructors, in
1882  // hopes that someone will bother noticing and reporting if they appear
1883  "field of type %0 has %select{private|protected}2 "
1884  "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1885  AccessControl;
1886def err_access_friend_function : Error<
1887  "friend function %1 is a %select{private|protected}0 member of %3">,
1888  AccessControl;
1889
1890def err_access_dtor : Error<
1891  "calling a %select{private|protected}1 destructor of class %0">,
1892  AccessControl;
1893def err_access_dtor_base :
1894    Error<"base class %0 has %select{private|protected}1 destructor">,
1895    AccessControl;
1896def err_access_dtor_vbase :
1897    Error<"inherited virtual base class %1 has "
1898    "%select{private|protected}2 destructor">,
1899    AccessControl;
1900def err_access_dtor_temp :
1901    Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1902    AccessControl;
1903def err_access_dtor_exception :
1904    Error<"exception object of type %0 has %select{private|protected}1 "
1905          "destructor">, AccessControl;
1906def err_access_dtor_field :
1907    Error<"field of type %1 has %select{private|protected}2 destructor">,
1908    AccessControl;
1909def err_access_dtor_var :
1910    Error<"variable of type %1 has %select{private|protected}2 destructor">,
1911    AccessControl;
1912def err_access_dtor_ivar :
1913    Error<"instance variable of type %0 has %select{private|protected}1 "
1914          "destructor">,
1915    AccessControl;
1916def note_previous_access_declaration : Note<
1917  "previously declared '%1' here">;
1918def note_access_natural : Note<
1919  "%select{|implicitly }1declared %select{private|protected}0 here">;
1920def note_access_constrained_by_path : Note<
1921  "constrained by %select{|implicitly }1%select{private|protected}0"
1922  " inheritance here">;
1923def note_access_protected_restricted_noobject : Note<
1924  "must name member using the type of the current context %0">;
1925def note_access_protected_restricted_ctordtor : Note<
1926  "protected %select{constructor|destructor}0 can only be used to "
1927  "%select{construct|destroy}0 a base class subobject">;
1928def note_access_protected_restricted_object : Note<
1929  "can only access this member on an object of type %0">;
1930def warn_cxx98_compat_sfinae_access_control : Warning<
1931  "substitution failure due to access control is incompatible with C++98">,
1932  InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1933
1934// C++ name lookup
1935def err_incomplete_nested_name_spec : Error<
1936  "incomplete type %0 named in nested name specifier">;
1937def err_incomplete_enum : Error<
1938  "enumeration %0 is incomplete">;
1939def err_dependent_nested_name_spec : Error<
1940  "nested name specifier for a declaration cannot depend on a template "
1941  "parameter">;
1942def err_nested_name_member_ref_lookup_ambiguous : Error<
1943  "lookup of %0 in member access expression is ambiguous">;
1944def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1945  "lookup of %0 in member access expression is ambiguous; using member of %1">,
1946  InGroup<AmbigMemberTemplate>;
1947def note_ambig_member_ref_object_type : Note<
1948  "lookup in the object type %0 refers here">;
1949def note_ambig_member_ref_scope : Note<
1950  "lookup from the current scope refers here">;
1951def err_qualified_member_nonclass : Error<
1952  "qualified member access refers to a member in %0">;
1953def err_incomplete_member_access : Error<
1954  "member access into incomplete type %0">;
1955def err_incomplete_type : Error<
1956  "incomplete type %0 where a complete type is required">;
1957def warn_cxx98_compat_enum_nested_name_spec : Warning<
1958  "enumeration type in nested name specifier is incompatible with C++98">,
1959  InGroup<CXX98Compat>, DefaultIgnore;
1960def err_nested_name_spec_is_not_class : Error<
1961  "%0 cannot appear before '::' because it is not a class"
1962  "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1963def ext_nested_name_spec_is_enum : ExtWarn<
1964  "use of enumeration in a nested name specifier is a C++11 extension">,
1965  InGroup<CXX11>;
1966def err_out_of_line_qualified_id_type_names_constructor : Error<
1967  "qualified reference to %0 is a constructor name rather than a "
1968  "%select{template name|type}1 in this context">;
1969def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1970  "ISO C++ specifies that "
1971  "qualified reference to %0 is a constructor name rather than a "
1972  "%select{template name|type}1 in this context, despite preceding "
1973  "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1974  InGroup<DiagGroup<"injected-class-name">>;
1975
1976// C++ class members
1977def err_storageclass_invalid_for_member : Error<
1978  "storage class specified for a member declaration">;
1979def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1980def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1981def ext_mutable_reference : ExtWarn<
1982  "'mutable' on a reference type is a Microsoft extension">,
1983  InGroup<MicrosoftMutableReference>;
1984def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1985def err_mutable_nonmember : Error<
1986  "'mutable' can only be applied to member variables">;
1987def err_virtual_in_union : Error<
1988  "unions cannot have virtual functions">;
1989def err_virtual_non_function : Error<
1990  "'virtual' can only appear on non-static member functions">;
1991def err_virtual_out_of_class : Error<
1992  "'virtual' can only be specified inside the class definition">;
1993def err_virtual_member_function_template : Error<
1994  "'virtual' cannot be specified on member function templates">;
1995def err_static_overrides_virtual : Error<
1996  "'static' member function %0 overrides a virtual function in a base class">;
1997def err_explicit_non_function : Error<
1998  "'explicit' can only appear on non-static member functions">;
1999def err_explicit_out_of_class : Error<
2000  "'explicit' can only be specified inside the class definition">;
2001def err_explicit_non_ctor_or_conv_function : Error<
2002  "'explicit' can only be applied to a constructor or conversion function">;
2003def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
2004def err_static_out_of_line : Error<
2005  "'static' can only be specified inside the class definition">;
2006def ext_static_out_of_line : ExtWarn<
2007  err_static_out_of_line.Summary>,
2008  InGroup<MicrosoftTemplate>;
2009def err_storage_class_for_static_member : Error<
2010  "static data member definition cannot specify a storage class">;
2011def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
2012def err_not_integral_type_bitfield : Error<
2013  "bit-field %0 has non-integral type %1">;
2014def err_not_integral_type_anon_bitfield : Error<
2015  "anonymous bit-field has non-integral type %0">;
2016def err_anon_bitfield_qualifiers : Error<
2017  "anonymous bit-field cannot have qualifiers">;
2018def err_member_function_initialization : Error<
2019  "initializer on function does not look like a pure-specifier">;
2020def err_non_virtual_pure : Error<
2021  "%0 is not virtual and cannot be declared pure">;
2022def ext_pure_function_definition : ExtWarn<
2023  "function definition with pure-specifier is a Microsoft extension">,
2024  InGroup<MicrosoftPureDefinition>;
2025def err_qualified_member_of_unrelated : Error<
2026  "%q0 is not a member of class %1">;
2027
2028def err_member_function_call_bad_cvr : Error<
2029  "'this' argument to member function %0 has type %1, but function is not marked "
2030  "%select{const|restrict|const or restrict|volatile|const or volatile|"
2031  "volatile or restrict|const, volatile, or restrict}2">;
2032def err_member_function_call_bad_ref : Error<
2033  "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
2034  "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
2035def err_member_function_call_bad_type : Error<
2036  "cannot initialize object parameter of type %0 with an expression "
2037  "of type %1">;
2038
2039def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
2040  "call to pure virtual member function %0 has undefined behavior; "
2041  "overrides of %0 in subclasses are not available in the "
2042  "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
2043
2044def select_special_member_kind : TextSubstitution<
2045  "%select{default constructor|copy constructor|move constructor|"
2046  "copy assignment operator|move assignment operator|destructor}0">;
2047
2048def note_member_declared_at : Note<"member is declared here">;
2049def note_ivar_decl : Note<"instance variable is declared here">;
2050def note_bitfield_decl : Note<"bit-field is declared here">;
2051def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
2052def note_member_synthesized_at : Note<
2053  "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 "
2054  "first required here">;
2055def note_comparison_synthesized_at : Note<
2056  "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 "
2057  "first required here">;
2058def err_missing_default_ctor : Error<
2059  "%select{constructor for %1 must explicitly initialize the|"
2060  "implicit default constructor for %1 must explicitly initialize the|"
2061  "cannot use constructor inherited from base class %4;}0 "
2062  "%select{base class|member}2 %3 %select{which|which|of %1}0 "
2063  "does not have a default constructor">;
2064def note_due_to_dllexported_class : Note<
2065  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
2066
2067def err_illegal_union_or_anon_struct_member : Error<
2068  "%select{anonymous struct|union}0 member %1 has a non-trivial "
2069  "%sub{select_special_member_kind}2">;
2070
2071def warn_frame_address : Warning<
2072  "calling '%0' with a nonzero argument is unsafe">,
2073  InGroup<FrameAddress>, DefaultIgnore;
2074
2075def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
2076  "%select{anonymous struct|union}0 member %1 with a non-trivial "
2077  "%sub{select_special_member_kind}2 is incompatible with C++98">,
2078  InGroup<CXX98Compat>, DefaultIgnore;
2079
2080def note_nontrivial_virtual_dtor : Note<
2081  "destructor for %0 is not trivial because it is virtual">;
2082def note_nontrivial_has_virtual : Note<
2083  "because type %0 has a virtual %select{member function|base class}1">;
2084def note_nontrivial_no_def_ctor : Note<
2085  "because %select{base class of |field of |}0type %1 has no "
2086  "default constructor">;
2087def note_user_declared_ctor : Note<
2088  "implicit default constructor suppressed by user-declared constructor">;
2089def note_nontrivial_no_copy : Note<
2090  "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
2091  "assignment operator|<<ERROR>>}2 can be used to "
2092  "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
2093  "%select{base class|field|an object}0 of type %3">;
2094def note_nontrivial_user_provided : Note<
2095  "because %select{base class of |field of |}0type %1 has a user-provided "
2096  "%sub{select_special_member_kind}2">;
2097def note_nontrivial_default_member_init : Note<
2098  "because field %0 has an initializer">;
2099def note_nontrivial_param_type : Note<
2100  "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
2101def note_nontrivial_default_arg : Note<"because it has a default argument">;
2102def note_nontrivial_variadic : Note<"because it is a variadic function">;
2103def note_nontrivial_subobject : Note<
2104  "because the function selected to %select{construct|copy|move|copy|move|"
2105  "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
2106def note_nontrivial_objc_ownership : Note<
2107  "because type %0 has a member with %select{no|no|__strong|__weak|"
2108  "__autoreleasing}1 ownership">;
2109
2110/// Selector for a TagTypeKind value.
2111def select_tag_type_kind : TextSubstitution<
2112  "%select{struct|interface|union|class|enum}0">;
2113
2114def err_static_data_member_not_allowed_in_anon_struct : Error<
2115  "static data member %0 not allowed in anonymous "
2116  "%sub{select_tag_type_kind}1">;
2117def ext_static_data_member_in_union : ExtWarn<
2118  "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
2119def warn_cxx98_compat_static_data_member_in_union : Warning<
2120  "static data member %0 in union is incompatible with C++98">,
2121  InGroup<CXX98Compat>, DefaultIgnore;
2122def ext_union_member_of_reference_type : ExtWarn<
2123  "union member %0 has reference type %1, which is a Microsoft extension">,
2124  InGroup<MicrosoftUnionMemberReference>;
2125def err_union_member_of_reference_type : Error<
2126  "union member %0 has reference type %1">;
2127def ext_anonymous_struct_union_qualified : Extension<
2128  "anonymous %select{struct|union}0 cannot be '%1'">;
2129def err_different_return_type_for_overriding_virtual_function : Error<
2130  "virtual function %0 has a different return type "
2131  "%diff{($) than the function it overrides (which has return type $)|"
2132  "than the function it overrides}1,2">;
2133def note_overridden_virtual_function : Note<
2134  "overridden virtual function is here">;
2135def err_conflicting_overriding_attributes : Error<
2136  "virtual function %0 has different attributes "
2137  "%diff{($) than the function it overrides (which has $)|"
2138  "than the function it overrides}1,2">;
2139def err_conflicting_overriding_cc_attributes : Error<
2140  "virtual function %0 has different calling convention attributes "
2141  "%diff{($) than the function it overrides (which has calling convention $)|"
2142  "than the function it overrides}1,2">;
2143def warn_overriding_method_missing_noescape : Warning<
2144  "parameter of overriding method should be annotated with "
2145  "__attribute__((noescape))">, InGroup<MissingNoEscape>;
2146def note_overridden_marked_noescape : Note<
2147  "parameter of overridden method is annotated with __attribute__((noescape))">;
2148def note_cat_conform_to_noescape_prot : Note<
2149  "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
2150
2151def err_covariant_return_inaccessible_base : Error<
2152  "invalid covariant return for virtual function: %1 is a "
2153  "%select{private|protected}2 base class of %0">, AccessControl;
2154def err_covariant_return_ambiguous_derived_to_base_conv : Error<
2155  "return type of virtual function %3 is not covariant with the return type of "
2156  "the function it overrides (ambiguous conversion from derived class "
2157  "%0 to base class %1:%2)">;
2158def err_covariant_return_not_derived : Error<
2159  "return type of virtual function %0 is not covariant with the return type of "
2160  "the function it overrides (%1 is not derived from %2)">;
2161def err_covariant_return_incomplete : Error<
2162  "return type of virtual function %0 is not covariant with the return type of "
2163  "the function it overrides (%1 is incomplete)">;
2164def err_covariant_return_type_different_qualifications : Error<
2165  "return type of virtual function %0 is not covariant with the return type of "
2166  "the function it overrides (%1 has different qualifiers than %2)">;
2167def err_covariant_return_type_class_type_more_qualified : Error<
2168  "return type of virtual function %0 is not covariant with the return type of "
2169  "the function it overrides (class type %1 is more qualified than class "
2170  "type %2">;
2171
2172// C++ implicit special member functions
2173def note_in_declaration_of_implicit_special_member : Note<
2174  "while declaring the implicit %sub{select_special_member_kind}1"
2175  " for %0">;
2176
2177// C++ constructors
2178def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
2179def err_invalid_qualified_constructor : Error<
2180  "'%0' qualifier is not allowed on a constructor">;
2181def err_ref_qualifier_constructor : Error<
2182  "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
2183
2184def err_constructor_return_type : Error<
2185  "constructor cannot have a return type">;
2186def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
2187def err_constructor_byvalue_arg : Error<
2188  "copy constructor must pass its first argument by reference">;
2189def warn_no_constructor_for_refconst : Warning<
2190  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
2191  "constructor to initialize its non-modifiable members">;
2192def note_refconst_member_not_initialized : Note<
2193  "%select{const|reference}0 member %1 will never be initialized">;
2194def ext_ms_explicit_constructor_call : ExtWarn<
2195  "explicit constructor calls are a Microsoft extension">,
2196  InGroup<MicrosoftExplicitConstructorCall>;
2197
2198// C++ destructors
2199def err_destructor_not_member : Error<
2200  "destructor must be a non-static member function">;
2201def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
2202def err_invalid_qualified_destructor : Error<
2203  "'%0' qualifier is not allowed on a destructor">;
2204def err_ref_qualifier_destructor : Error<
2205  "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
2206def err_destructor_return_type : Error<"destructor cannot have a return type">;
2207def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
2208def err_destructor_with_params : Error<"destructor cannot have any parameters">;
2209def err_destructor_variadic : Error<"destructor cannot be variadic">;
2210def ext_destructor_typedef_name : ExtWarn<
2211  "destructor cannot be declared using a %select{typedef|type alias}1 %0 "
2212  "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>;
2213def err_undeclared_destructor_name : Error<
2214  "undeclared identifier %0 in destructor name">;
2215def err_destructor_name : Error<
2216  "expected the class name after '~' to name the enclosing class">;
2217def err_destructor_name_nontype : Error<
2218  "identifier %0 after '~' in destructor name does not name a type">;
2219def err_destructor_expr_mismatch : Error<
2220  "identifier %0 in object destruction expression does not name the type "
2221  "%1 of the object being destroyed">;
2222def err_destructor_expr_nontype : Error<
2223  "identifier %0 in object destruction expression does not name a type">;
2224def err_destructor_expr_type_mismatch : Error<
2225  "destructor type %0 in object destruction expression does not match the "
2226  "type %1 of the object being destroyed">;
2227def note_destructor_type_here : Note<
2228  "type %0 found by destructor name lookup">;
2229def note_destructor_nontype_here : Note<
2230  "non-type declaration found by destructor name lookup">;
2231def ext_dtor_named_in_wrong_scope : Extension<
2232  "ISO C++ requires the name after '::~' to be found in the same scope as "
2233  "the name before '::~'">, InGroup<DtorName>;
2234def ext_qualified_dtor_named_in_lexical_scope : ExtWarn<
2235  "qualified destructor name only found in lexical scope; omit the qualifier "
2236  "to find this type name by unqualified lookup">, InGroup<DtorName>;
2237def ext_dtor_name_ambiguous : Extension<
2238  "ISO C++ considers this destructor name lookup to be ambiguous">,
2239  InGroup<DtorName>;
2240
2241def err_destroy_attr_on_non_static_var : Error<
2242  "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
2243  " variable with static or thread storage duration">;
2244
2245def err_destructor_template : Error<
2246  "destructor cannot be declared as a template">;
2247
2248// C++ initialization
2249def err_init_conversion_failed : Error<
2250  "cannot initialize %select{a variable|a parameter|template parameter|"
2251  "return object|statement expression result|an "
2252  "exception object|a member subobject|an array element|a new value|a value|a "
2253  "base class|a constructor delegation|a vector element|a block element|a "
2254  "block element|a complex element|a lambda capture|a compound literal "
2255  "initializer|a related result|a parameter of CF audited function|a "
2256  "structured binding|a member subobject}0 "
2257  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2258  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2259  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2260  "|: different number of parameters (%5 vs %6)"
2261  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2262  "|: different return type%diff{ ($ vs $)|}5,6"
2263  "|: different qualifiers (%5 vs %6)"
2264  "|: different exception specifications}4">;
2265def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2266  "declared here; conversion would be valid if it was derived from %1">;
2267
2268def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2269  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2270def err_lvalue_reference_bind_to_initlist : Error<
2271  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2272  "initializer list temporary">;
2273def err_lvalue_reference_bind_to_temporary : Error<
2274  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2275  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2276def err_lvalue_reference_bind_to_unrelated : Error<
2277  "%select{non-const|volatile}0 lvalue reference "
2278  "%diff{to type $ cannot bind to a value of unrelated type $|"
2279  "cannot bind to a value of unrelated type}1,2">;
2280def err_reference_bind_drops_quals : Error<
2281  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2282  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2283  "not permitted due to incompatible qualifiers}2">;
2284def err_reference_bind_failed : Error<
2285  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2286  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2287  "incompatible type}0,3">;
2288def err_reference_bind_temporary_addrspace : Error<
2289  "reference of type %0 cannot bind to a temporary object because of "
2290  "address space mismatch">;
2291def err_reference_bind_init_list : Error<
2292  "reference to type %0 cannot bind to an initializer list">;
2293def err_init_list_bad_dest_type : Error<
2294  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2295  "list">;
2296def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2297  "aggregate initialization of type %0 with user-declared constructors "
2298  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2299def warn_cxx17_compat_aggregate_init_paren_list : Warning<
2300  "aggregate initialization of type %0 from a parenthesized list of values "
2301  "is a C++20 extension">, DefaultIgnore, InGroup<CXX20>;
2302
2303def err_reference_bind_to_bitfield : Error<
2304  "%select{non-const|volatile}0 reference cannot bind to "
2305  "bit-field%select{| %1}2">;
2306def err_reference_bind_to_bitfield_in_cce : Error<
2307  "reference cannot bind to bit-field in converted constant expression">;
2308def err_reference_bind_to_vector_element : Error<
2309  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2310def err_reference_bind_to_matrix_element : Error<
2311  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2312def err_reference_var_requires_init : Error<
2313  "declaration of reference variable %0 requires an initializer">;
2314def err_reference_without_init : Error<
2315  "reference to type %0 requires an initializer">;
2316def note_value_initialization_here : Note<
2317  "in value-initialization of type %0 here">;
2318def err_reference_has_multiple_inits : Error<
2319  "reference cannot be initialized with multiple values">;
2320def err_init_non_aggr_init_list : Error<
2321  "initialization of non-aggregate type %0 with an initializer list">;
2322def err_designated_init_for_non_aggregate : Error<
2323  "initialization of non-aggregate type %0 with a designated initializer list">;
2324def err_init_reference_member_uninitialized : Error<
2325  "reference member of type %0 uninitialized">;
2326def note_uninit_reference_member : Note<
2327  "uninitialized reference member is here">;
2328def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2329  InGroup<Uninitialized>;
2330def warn_base_class_is_uninit : Warning<
2331  "base class %0 is uninitialized when used here to access %q1">,
2332  InGroup<Uninitialized>;
2333def warn_reference_field_is_uninit : Warning<
2334  "reference %0 is not yet bound to a value when used here">,
2335  InGroup<Uninitialized>;
2336def note_uninit_in_this_constructor : Note<
2337  "during field initialization in %select{this|the implicit default}0 "
2338  "constructor">;
2339def warn_static_self_reference_in_init : Warning<
2340  "static variable %0 is suspiciously used within its own initialization">,
2341  InGroup<UninitializedStaticSelfInit>;
2342def warn_uninit_self_reference_in_init : Warning<
2343  "variable %0 is uninitialized when used within its own initialization">,
2344  InGroup<Uninitialized>;
2345def warn_uninit_self_reference_in_reference_init : Warning<
2346  "reference %0 is not yet bound to a value when used within its own"
2347  " initialization">,
2348  InGroup<Uninitialized>;
2349def warn_uninit_var : Warning<
2350  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2351  InGroup<Uninitialized>, DefaultIgnore;
2352def warn_sometimes_uninit_var : Warning<
2353  "variable %0 is %select{used|captured}1 uninitialized whenever "
2354  "%select{'%3' condition is %select{true|false}4|"
2355  "'%3' loop %select{is entered|exits because its condition is false}4|"
2356  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2357  "switch %3 is taken|"
2358  "its declaration is reached|"
2359  "%3 is called}2">,
2360  InGroup<UninitializedSometimes>, DefaultIgnore;
2361def warn_maybe_uninit_var : Warning<
2362  "variable %0 may be uninitialized when "
2363  "%select{used here|captured by block}1">,
2364  InGroup<UninitializedMaybe>, DefaultIgnore;
2365def note_var_declared_here : Note<"variable %0 is declared here">;
2366def note_uninit_var_use : Note<
2367  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2368def warn_uninit_byref_blockvar_captured_by_block : Warning<
2369  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2370  "block">, InGroup<Uninitialized>, DefaultIgnore;
2371def note_block_var_fixit_add_initialization : Note<
2372  "did you mean to use __block %0?">;
2373def note_in_omitted_aggregate_initializer : Note<
2374  "in implicit initialization of %select{"
2375  "array element %1 with omitted initializer|"
2376  "field %1 with omitted initializer|"
2377  "trailing array elements in runtime-sized array new}0">;
2378def note_in_reference_temporary_list_initializer : Note<
2379  "in initialization of temporary of type %0 created to "
2380  "list-initialize this reference">;
2381def note_var_fixit_add_initialization : Note<
2382  "initialize the variable %0 to silence this warning">;
2383def note_uninit_fixit_remove_cond : Note<
2384  "remove the %select{'%1' if its condition|condition if it}0 "
2385  "is always %select{false|true}2">;
2386def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2387def err_list_init_in_parens : Error<
2388  "cannot initialize %select{non-class|reference}0 type %1 with a "
2389  "parenthesized initializer list">;
2390
2391def warn_uninit_const_reference : Warning<
2392  "variable %0 is uninitialized when passed as a const reference argument "
2393  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2394
2395def warn_unsequenced_mod_mod : Warning<
2396  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2397def warn_unsequenced_mod_use : Warning<
2398  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2399
2400def select_initialized_entity_kind : TextSubstitution<
2401  "%select{copying variable|copying parameter|initializing template parameter|"
2402  "returning object|initializing statement expression result|"
2403  "throwing object|copying member subobject|copying array element|"
2404  "allocating object|copying temporary|initializing base subobject|"
2405  "initializing vector element|capturing value}0">;
2406
2407def err_temp_copy_no_viable : Error<
2408  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2409def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2410  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2411  "C++98 requires a copy constructor when binding a reference to a temporary">,
2412  InGroup<BindToTemporaryCopy>;
2413def err_temp_copy_ambiguous : Error<
2414  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2415  "of type %1">;
2416def err_temp_copy_deleted : Error<
2417  "%sub{select_initialized_entity_kind}0 of type %1 "
2418  "invokes deleted constructor">;
2419def err_temp_copy_incomplete : Error<
2420  "copying a temporary object of incomplete type %0">;
2421def warn_cxx98_compat_temp_copy : Warning<
2422  "%sub{select_initialized_entity_kind}1 "
2423  "of type %2 when binding a reference to a temporary would %select{invoke "
2424  "an inaccessible constructor|find no viable constructor|find ambiguous "
2425  "constructors|invoke a deleted constructor}0 in C++98">,
2426  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2427def err_selected_explicit_constructor : Error<
2428  "chosen constructor is explicit in copy-initialization">;
2429def note_explicit_ctor_deduction_guide_here : Note<
2430  "explicit %select{constructor|deduction guide}0 declared here">;
2431def note_implicit_deduction_guide : Note<"implicit deduction guide declared as '%0'">;
2432
2433// C++11 auto
2434def warn_cxx98_compat_auto_type_specifier : Warning<
2435  "'auto' type specifier is incompatible with C++98">,
2436  InGroup<CXX98Compat>, DefaultIgnore;
2437def err_auto_variable_cannot_appear_in_own_initializer : Error<
2438  "variable %0 declared with deduced type %1 "
2439  "cannot appear in its own initializer">;
2440def err_binding_cannot_appear_in_own_initializer : Error<
2441  "binding %0 cannot appear in the initializer of its own "
2442  "decomposition declaration">;
2443def err_new_array_of_auto : Error<
2444  "cannot allocate array of 'auto'">;
2445def err_auto_not_allowed : Error<
2446  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2447  "use of "
2448  "%select{class template|function template|variable template|alias template|"
2449  "template template parameter|concept|template}2 %3 requires template "
2450  "arguments; argument deduction}0 not allowed "
2451  "%select{in function prototype"
2452  "|in non-static struct member|in struct member"
2453  "|in non-static union member|in union member"
2454  "|in non-static class member|in interface member"
2455  "|in exception declaration|in template parameter until C++17|in block literal"
2456  "|in template argument|in typedef|in type alias|in function return type"
2457  "|in conversion function type|here|in lambda parameter"
2458  "|in type allocated by 'new'|in K&R-style function parameter"
2459  "|in template parameter|in friend declaration|in function prototype that is "
2460  "not a function declaration|in requires expression parameter"
2461  "|in array declaration"
2462  "|in declaration of conversion function template"
2463  "|in lambda parameter before C++14}1">;
2464
2465def err_dependent_deduced_tst : Error<
2466  "typename specifier refers to "
2467  "%select{class template|function template|variable template|alias template|"
2468  "template template parameter|template}0 member in %1; "
2469  "argument deduction not allowed here">;
2470def err_deduced_tst : Error<
2471  "typename specifier refers to "
2472  "%select{class template|function template|variable template|alias template|"
2473  "template template parameter|template}0; argument deduction not allowed "
2474  "here">;
2475def err_auto_not_allowed_var_inst : Error<
2476  "'auto' variable template instantiation is not allowed">;
2477def err_auto_var_requires_init : Error<
2478  "declaration of variable %0 with deduced type %1 requires an initializer">;
2479def err_auto_new_requires_ctor_arg : Error<
2480  "new expression for type %0 requires a constructor argument">;
2481def ext_auto_new_list_init : Extension<
2482  "ISO C++ standards before C++17 do not allow new expression for "
2483  "type %0 to use list-initialization">, InGroup<CXX17>;
2484def err_auto_var_init_no_expression : Error<
2485  "initializer for variable %0 with type %1 is empty">;
2486def err_auto_expr_init_no_expression : Error<
2487  "initializer for functional-style cast to %0 is empty">;
2488def err_auto_var_init_multiple_expressions : Error<
2489  "initializer for variable %0 with type %1 contains multiple expressions">;
2490def err_auto_expr_init_multiple_expressions : Error<
2491  "initializer for functional-style cast to %0 contains multiple expressions">;
2492def err_auto_var_init_paren_braces : Error<
2493  "cannot deduce type for variable %1 with type %2 from "
2494  "%select{parenthesized|nested}0 initializer list">;
2495def err_auto_new_ctor_multiple_expressions : Error<
2496  "new expression for type %0 contains multiple constructor arguments">;
2497def err_auto_expr_init_paren_braces : Error<
2498  "cannot deduce actual type for %1 from "
2499  "%select{parenthesized|nested}0 initializer list">;
2500def warn_cxx20_compat_auto_expr : Warning<
2501  "'auto' as a functional-style cast is incompatible with C++ standards "
2502  "before C++23">, InGroup<CXXPre23Compat>, DefaultIgnore;
2503def err_auto_missing_trailing_return : Error<
2504  "'auto' return without trailing return type; deduced return types are a "
2505  "C++14 extension">;
2506def err_deduced_return_type : Error<
2507  "deduced return types are a C++14 extension">;
2508def err_trailing_return_without_auto : Error<
2509  "function with trailing return type must specify return type 'auto', not %0">;
2510def err_trailing_return_in_parens : Error<
2511  "trailing return type may not be nested within parentheses">;
2512def err_auto_var_deduction_failure : Error<
2513  "variable %0 with type %1 has incompatible initializer of type %2">;
2514def err_auto_var_deduction_failure_from_init_list : Error<
2515  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2516def err_auto_expr_deduction_failure : Error<
2517  "functional-style cast to %0 has incompatible initializer of type %1">;
2518def err_auto_new_deduction_failure : Error<
2519  "new expression for type %0 has incompatible constructor argument of type %1">;
2520def err_auto_inconsistent_deduction : Error<
2521  "deduced conflicting types %diff{($ vs $) |}0,1"
2522  "for initializer list element type">;
2523def err_auto_different_deductions : Error<
2524  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2525  "deduced as %1 in declaration of %2 and "
2526  "deduced as %3 in declaration of %4">;
2527def err_auto_non_deduced_not_alone : Error<
2528  "%select{function with deduced return type|"
2529  "declaration with trailing return type}0 "
2530  "must be the only declaration in its group">;
2531def err_implied_std_initializer_list_not_found : Error<
2532  "cannot deduce type of initializer list because std::initializer_list was "
2533  "not found; include <initializer_list>">;
2534def err_malformed_std_initializer_list : Error<
2535  "std::initializer_list must be a class template with a single type parameter">;
2536def err_auto_init_list_from_c : Error<
2537  "cannot use %select{'auto'|<ERROR>|'__auto_type'}0 with "
2538  "%select{initializer list|array}1 in C">;
2539def err_auto_bitfield : Error<
2540  "cannot pass bit-field as __auto_type initializer in C">;
2541
2542// C++1y decltype(auto) type
2543def err_decltype_auto_invalid : Error<
2544  "'decltype(auto)' not allowed here">;
2545def err_decltype_auto_cannot_be_combined : Error<
2546  "'decltype(auto)' cannot be combined with other type specifiers">;
2547def err_decltype_auto_function_declarator_not_declaration : Error<
2548  "'decltype(auto)' can only be used as a return type "
2549  "in a function declaration">;
2550def err_decltype_auto_compound_type : Error<
2551  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2552def err_decltype_auto_initializer_list : Error<
2553  "cannot deduce 'decltype(auto)' from initializer list">;
2554
2555// C++17 deduced class template specialization types
2556def err_deduced_class_template_compound_type : Error<
2557  "cannot %select{form pointer to|form reference to|form array of|"
2558  "form function returning|use parentheses when declaring variable with}0 "
2559  "deduced class template specialization type">;
2560def err_deduced_non_class_or_alias_template_specialization_type : Error<
2561  "%select{<error>|function template|variable template|alias template|"
2562  "template template parameter|concept|template}0 %1 requires template "
2563  "arguments; argument deduction only allowed for class templates or alias "
2564  "templates">;
2565def err_deduced_class_template_ctor_ambiguous : Error<
2566  "ambiguous deduction for template arguments of %0">;
2567def err_deduced_class_template_ctor_no_viable : Error<
2568  "no viable constructor or deduction guide for deduction of "
2569  "template arguments of %0">;
2570def err_deduced_class_template_incomplete : Error<
2571  "template %0 has no definition and no %select{|viable }1deduction guides "
2572  "for deduction of template arguments">;
2573def err_deduced_class_template_deleted : Error<
2574  "class template argument deduction for %0 selected a deleted constructor">;
2575def err_deduced_class_template_explicit : Error<
2576  "class template argument deduction for %0 selected an explicit "
2577  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2578def err_deduction_guide_no_trailing_return_type : Error<
2579  "deduction guide declaration without trailing return type">;
2580def err_deduction_guide_bad_trailing_return_type : Error<
2581  "deduced type %1 of deduction guide is not %select{|written as }2"
2582  "a specialization of template %0">;
2583def err_deduction_guide_with_complex_decl : Error<
2584  "cannot specify any part of a return type in the "
2585  "declaration of a deduction guide">;
2586def err_deduction_guide_invalid_specifier : Error<
2587  "deduction guide cannot be declared '%0'">;
2588def err_deduction_guide_name_not_class_template : Error<
2589  "cannot specify deduction guide for "
2590  "%select{<error>|function template|variable template|alias template|"
2591  "template template parameter|concept|dependent template name}0 %1">;
2592def err_deduction_guide_wrong_scope : Error<
2593  "deduction guide must be declared in the same scope as template %q0">;
2594def err_deduction_guide_defines_function : Error<
2595  "deduction guide cannot have a function definition">;
2596def err_deduction_guide_redeclared : Error<
2597  "redeclaration of deduction guide">;
2598def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2599  "%select{explicitly instantiated|explicitly specialized}0">;
2600def err_deduction_guide_template_not_deducible : Error<
2601  "deduction guide template contains "
2602  "%select{a template parameter|template parameters}0 that cannot be "
2603  "deduced">;
2604def err_deduction_guide_wrong_access : Error<
2605  "deduction guide has different access from the corresponding "
2606  "member template">;
2607def note_deduction_guide_template_access : Note<
2608  "member template declared %0 here">;
2609def note_deduction_guide_access : Note<
2610  "deduction guide declared %0 by intervening access specifier">;
2611def warn_cxx14_compat_class_template_argument_deduction : Warning<
2612  "class template argument deduction is incompatible with C++ standards "
2613  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2614  InGroup<CXXPre17Compat>, DefaultIgnore;
2615def warn_ctad_maybe_unsupported : Warning<
2616  "%0 may not intend to support class template argument deduction">,
2617  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2618def note_suppress_ctad_maybe_unsupported : Note<
2619  "add a deduction guide to suppress this warning">;
2620
2621
2622// C++14 deduced return types
2623def err_auto_fn_deduction_failure : Error<
2624  "cannot deduce return type %0 from returned value of type %1">;
2625def err_auto_fn_different_deductions : Error<
2626  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2627  "deduced as %2 in earlier return statement">;
2628def err_auto_fn_used_before_defined : Error<
2629  "function %0 with deduced return type cannot be used before it is defined">;
2630def err_auto_fn_no_return_but_not_auto : Error<
2631  "cannot deduce return type %0 for function with no return statements">;
2632def err_auto_fn_return_void_but_not_auto : Error<
2633  "cannot deduce return type %0 from omitted return expression">;
2634def err_auto_fn_return_init_list : Error<
2635  "cannot deduce return type from initializer list">;
2636def err_auto_fn_virtual : Error<
2637  "function with deduced return type cannot be virtual">;
2638def warn_cxx11_compat_deduced_return_type : Warning<
2639  "return type deduction is incompatible with C++ standards before C++14">,
2640  InGroup<CXXPre14Compat>, DefaultIgnore;
2641
2642// C++11 override control
2643def override_keyword_only_allowed_on_virtual_member_functions : Error<
2644  "only virtual member functions can be marked '%0'">;
2645def override_keyword_hides_virtual_member_function : Error<
2646  "non-virtual member function marked '%0' hides virtual member "
2647  "%select{function|functions}1">;
2648def err_function_marked_override_not_overriding : Error<
2649  "%0 marked 'override' but does not override any member functions">;
2650def warn_destructor_marked_not_override_overriding : TextSubstitution <
2651  "%0 overrides a destructor but is not marked 'override'">;
2652def warn_function_marked_not_override_overriding : TextSubstitution <
2653  "%0 overrides a member function but is not marked 'override'">;
2654def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2655  "%sub{warn_destructor_marked_not_override_overriding}0">,
2656  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2657def warn_inconsistent_function_marked_not_override_overriding : Warning <
2658  "%sub{warn_function_marked_not_override_overriding}0">,
2659  InGroup<CXX11WarnInconsistentOverrideMethod>;
2660def warn_suggest_destructor_marked_not_override_overriding : Warning <
2661  "%sub{warn_destructor_marked_not_override_overriding}0">,
2662  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2663def warn_suggest_function_marked_not_override_overriding : Warning <
2664  "%sub{warn_function_marked_not_override_overriding}0">,
2665  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2666def err_class_marked_final_used_as_base : Error<
2667  "base %0 is marked '%select{final|sealed}1'">;
2668def warn_abstract_final_class : Warning<
2669  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2670def warn_final_dtor_non_final_class : Warning<
2671  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2672  InGroup<FinalDtorNonFinalClass>;
2673def note_final_dtor_non_final_class_silence : Note<
2674  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2675
2676// C++11 attributes
2677def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2678
2679// C++11 final
2680def err_final_function_overridden : Error<
2681  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2682
2683// C++11 scoped enumerations
2684def err_enum_invalid_underlying : Error<
2685  "%select{non-integral type %0|%0}1 is an invalid underlying type">;
2686def err_enumerator_too_large : Error<
2687  "enumerator value is not representable in the underlying type %0">;
2688def ext_enumerator_too_large : Extension<
2689  "enumerator value is not representable in the underlying type %0">,
2690  InGroup<MicrosoftEnumValue>;
2691def err_enumerator_wrapped : Error<
2692  "enumerator value %0 is not representable in the underlying type %1">;
2693def err_enum_redeclare_type_mismatch : Error<
2694  "enumeration redeclared with different underlying type %0 (was %1)">;
2695def err_enum_redeclare_fixed_mismatch : Error<
2696  "enumeration previously declared with %select{non|}0fixed underlying type">;
2697def err_enum_redeclare_scoped_mismatch : Error<
2698  "enumeration previously declared as %select{un|}0scoped">;
2699def err_only_enums_have_underlying_types : Error<
2700  "only enumeration types have underlying types">;
2701def err_underlying_type_of_incomplete_enum : Error<
2702  "cannot determine underlying type of incomplete enumeration type %0">;
2703
2704// C++11 delegating constructors
2705def err_delegating_ctor : Error<
2706  "delegating constructors are permitted only in C++11">;
2707def warn_cxx98_compat_delegating_ctor : Warning<
2708  "delegating constructors are incompatible with C++98">,
2709  InGroup<CXX98Compat>, DefaultIgnore;
2710def err_delegating_initializer_alone : Error<
2711  "an initializer for a delegating constructor must appear alone">;
2712def warn_delegating_ctor_cycle : Warning<
2713  "constructor for %0 creates a delegation cycle">, DefaultError,
2714  InGroup<DelegatingCtorCycles>;
2715def note_it_delegates_to : Note<"it delegates to">;
2716def note_which_delegates_to : Note<"which delegates to">;
2717
2718// C++11 range-based for loop
2719def err_for_range_decl_must_be_var : Error<
2720  "for range declaration must declare a variable">;
2721def err_for_range_storage_class : Error<
2722  "loop variable %0 may not be declared %select{'extern'|'static'|"
2723  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2724def err_type_defined_in_for_range : Error<
2725  "types may not be defined in a for range declaration">;
2726def err_for_range_deduction_failure : Error<
2727  "cannot use type %0 as a range">;
2728def err_for_range_incomplete_type : Error<
2729  "cannot use incomplete type %0 as a range">;
2730def err_for_range_iter_deduction_failure : Error<
2731  "cannot use type %0 as an iterator">;
2732def ext_for_range_begin_end_types_differ : ExtWarn<
2733  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2734  InGroup<CXX17>;
2735def warn_for_range_begin_end_types_differ : Warning<
2736  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2737  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2738def note_in_for_range: Note<
2739  "when looking up '%select{begin|end}0' function for range expression "
2740  "of type %1">;
2741def err_for_range_invalid: Error<
2742  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2743  "function available">;
2744def note_for_range_member_begin_end_ignored : Note<
2745  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2746def err_range_on_array_parameter : Error<
2747  "cannot build range expression with array function parameter %0 since "
2748  "parameter with array type %1 is treated as pointer type %2">;
2749def err_for_range_dereference : Error<
2750  "invalid range expression of type %0; did you mean to dereference it "
2751  "with '*'?">;
2752def note_for_range_invalid_iterator : Note <
2753  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2754def note_for_range_begin_end : Note<
2755  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2756def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2757  "loop variable %0 "
2758  "%diff{of type $ binds to a temporary constructed from type $"
2759  "|binds to a temporary constructed from a different type}1,2">,
2760  InGroup<RangeLoopConstruct>, DefaultIgnore;
2761def note_use_type_or_non_reference : Note<
2762  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2763def warn_for_range_ref_binds_ret_temp : Warning<
2764  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2765  InGroup<RangeLoopBindReference>, DefaultIgnore;
2766def note_use_non_reference_type : Note<"use non-reference type %0">;
2767def warn_for_range_copy : Warning<
2768  "loop variable %0 creates a copy from type %1">,
2769  InGroup<RangeLoopConstruct>, DefaultIgnore;
2770def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2771def err_objc_for_range_init_stmt : Error<
2772  "initialization statement is not supported when iterating over Objective-C "
2773  "collection">;
2774
2775// C++11 constexpr
2776def warn_cxx98_compat_constexpr : Warning<
2777  "'constexpr' specifier is incompatible with C++98">,
2778  InGroup<CXX98Compat>, DefaultIgnore;
2779// FIXME: Maybe this should also go in -Wc++14-compat?
2780def warn_cxx14_compat_constexpr_not_const : Warning<
2781  "'constexpr' non-static member function will not be implicitly 'const' "
2782  "in C++14; add 'const' to avoid a change in behavior">,
2783  InGroup<DiagGroup<"constexpr-not-const">>;
2784def err_invalid_consteval_take_address : Error<
2785  "cannot take address of %select{immediate|consteval}2 "
2786  "%select{function|call operator of}1 %0 outside"
2787  " of an immediate invocation">;
2788def err_invalid_consteval_call : Error<
2789  "call to %select{immediate|consteval}1 function "
2790  "%q0 is not a constant expression">;
2791
2792def err_immediate_function_used_before_definition : Error<
2793  "immediate function %0 used before it is defined">;
2794
2795def note_immediate_function_reason : Note<
2796  "%0 is an immediate %select{function|constructor}5 because "
2797  "%select{its body|the%select{| default}7 initializer of %8}6 "
2798  "%select{evaluates the address of %select{an immediate|a consteval}2 "
2799  "function %1|contains a call to %select{an immediate|a consteval}2 "
2800  "%select{function|constructor}4 %1 and that call is not a constant "
2801  "expression}3">;
2802
2803def note_invalid_consteval_initializer : Note<
2804  "in the default initializer of %0">;
2805def note_invalid_consteval_initializer_here : Note<
2806  "initialized here %0">;
2807def err_invalid_consteval_decl_kind : Error<
2808  "%0 cannot be declared consteval">;
2809def err_invalid_constexpr : Error<
2810  "%select{function parameter|typedef}0 "
2811  "cannot be %sub{select_constexpr_spec_kind}1">;
2812def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2813  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2814def err_constexpr_tag : Error<
2815  "%select{class|struct|interface|union|enum|enum class|enum struct}0 "
2816  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2817def err_constexpr_dtor : Error<
2818  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2819def err_constexpr_dtor_subobject : Error<
2820  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2821  "%select{data member %2|base class %3}1 does not have a "
2822  "constexpr destructor">;
2823def note_constexpr_dtor_subobject : Note<
2824  "%select{data member %1|base class %2}0 declared here">;
2825def err_constexpr_wrong_decl_kind : Error<
2826  "%sub{select_constexpr_spec_kind}0 can only be used "
2827  "in %select{|variable and function|function|variable}0 declarations">;
2828def err_invalid_constexpr_var_decl : Error<
2829  "constexpr variable declaration must be a definition">;
2830def err_constexpr_static_mem_var_requires_init : Error<
2831  "declaration of constexpr static data member %0 requires an initializer">;
2832def err_constexpr_var_non_literal : Error<
2833  "constexpr variable cannot have non-literal type %0">;
2834def err_constexpr_var_requires_const_init : Error<
2835  "constexpr variable %0 must be initialized by a constant expression">;
2836def err_constexpr_var_requires_const_destruction : Error<
2837  "constexpr variable %0 must have constant destruction">;
2838def err_constexpr_redecl_mismatch : Error<
2839  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2840  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2841def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2842def warn_cxx17_compat_constexpr_virtual : Warning<
2843  "virtual constexpr functions are incompatible with "
2844  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2845def err_constexpr_virtual_base : Error<
2846  "constexpr %select{member function|constructor}0 not allowed in "
2847  "%select{struct|interface|class}1 with virtual base "
2848  "%plural{1:class|:classes}2">;
2849def note_non_literal_incomplete : Note<
2850  "incomplete type %0 is not a literal type">;
2851def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2852  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2853def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2854def err_constexpr_non_literal_return : Error<
2855  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2856def err_constexpr_non_literal_param : Error<
2857  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2858  "not a literal type">;
2859def err_constexpr_body_invalid_stmt : Error<
2860  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2861def ext_constexpr_body_invalid_stmt : ExtWarn<
2862  "use of this statement in a constexpr %select{function|constructor}0 "
2863  "is a C++14 extension">, InGroup<CXX14>;
2864def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2865  "use of this statement in a constexpr %select{function|constructor}0 "
2866  "is incompatible with C++ standards before C++14">,
2867  InGroup<CXXPre14Compat>, DefaultIgnore;
2868def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2869  "use of this statement in a constexpr %select{function|constructor}0 "
2870  "is a C++20 extension">, InGroup<CXX20>;
2871def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2872  "use of this statement in a constexpr %select{function|constructor}0 "
2873  "is incompatible with C++ standards before C++20">,
2874  InGroup<CXXPre20Compat>, DefaultIgnore;
2875def ext_constexpr_body_invalid_stmt_cxx23 : ExtWarn<
2876  "use of this statement in a constexpr %select{function|constructor}0 "
2877  "is a C++23 extension">, InGroup<CXX23>;
2878def warn_cxx20_compat_constexpr_body_invalid_stmt : Warning<
2879  "use of this statement in a constexpr %select{function|constructor}0 "
2880  "is incompatible with C++ standards before C++23">,
2881  InGroup<CXXPre23Compat>, DefaultIgnore;
2882def ext_constexpr_type_definition : ExtWarn<
2883  "type definition in a constexpr %select{function|constructor}0 "
2884  "is a C++14 extension">, InGroup<CXX14>;
2885def warn_cxx11_compat_constexpr_type_definition : Warning<
2886  "type definition in a constexpr %select{function|constructor}0 "
2887  "is incompatible with C++ standards before C++14">,
2888  InGroup<CXXPre14Compat>, DefaultIgnore;
2889def err_constexpr_vla : Error<
2890  "variably-modified type %0 cannot be used in a constexpr "
2891  "%select{function|constructor}1">;
2892def ext_constexpr_local_var : ExtWarn<
2893  "variable declaration in a constexpr %select{function|constructor}0 "
2894  "is a C++14 extension">, InGroup<CXX14>;
2895def warn_cxx11_compat_constexpr_local_var : Warning<
2896  "variable declaration in a constexpr %select{function|constructor}0 "
2897  "is incompatible with C++ standards before C++14">,
2898  InGroup<CXXPre14Compat>, DefaultIgnore;
2899def ext_constexpr_static_var : ExtWarn<
2900  "definition of a %select{static|thread_local}1 variable "
2901  "in a constexpr %select{function|constructor}0 "
2902  "is a C++23 extension">, InGroup<CXX23>;
2903def warn_cxx20_compat_constexpr_var : Warning<
2904  "definition of a %select{static variable|thread_local variable|variable "
2905  "of non-literal type}1 in a constexpr %select{function|constructor}0 "
2906  "is incompatible with C++ standards before C++23">,
2907  InGroup<CXXPre23Compat>, DefaultIgnore;
2908def err_constexpr_local_var_non_literal_type : Error<
2909  "variable of non-literal type %1 cannot be defined in a constexpr "
2910  "%select{function|constructor}0 before C++23">;
2911def ext_constexpr_local_var_no_init : ExtWarn<
2912  "uninitialized variable in a constexpr %select{function|constructor}0 "
2913  "is a C++20 extension">, InGroup<CXX20>;
2914def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2915  "uninitialized variable in a constexpr %select{function|constructor}0 "
2916  "is incompatible with C++ standards before C++20">,
2917  InGroup<CXXPre20Compat>, DefaultIgnore;
2918def ext_constexpr_function_never_constant_expr : ExtWarn<
2919  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2920  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2921def err_attr_cond_never_constant_expr : Error<
2922  "%0 attribute expression never produces a constant expression">;
2923def err_diagnose_if_invalid_diagnostic_type : Error<
2924  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2925  "instead">;
2926def err_constexpr_body_no_return : Error<
2927  "no return statement in %select{constexpr|consteval}0 function">;
2928def err_constexpr_return_missing_expr : Error<
2929  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2930def warn_cxx11_compat_constexpr_body_no_return : Warning<
2931  "constexpr function with no return statements is incompatible with C++ "
2932  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2933def ext_constexpr_body_multiple_return : ExtWarn<
2934  "multiple return statements in constexpr function is a C++14 extension">,
2935  InGroup<CXX14>;
2936def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2937  "multiple return statements in constexpr function "
2938  "is incompatible with C++ standards before C++14">,
2939  InGroup<CXXPre14Compat>, DefaultIgnore;
2940def note_constexpr_body_previous_return : Note<
2941  "previous return statement is here">;
2942def err_ms_constexpr_cannot_be_applied : Error<
2943  "attribute 'msvc::constexpr' cannot be applied to the %select{constexpr|consteval|virtual}0 function %1">;
2944
2945// C++20 function try blocks in constexpr
2946def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2947  "function try block in constexpr %select{function|constructor}0 is "
2948  "a C++20 extension">, InGroup<CXX20>;
2949def warn_cxx17_compat_constexpr_function_try_block : Warning<
2950  "function try block in constexpr %select{function|constructor}0 is "
2951  "incompatible with C++ standards before C++20">,
2952  InGroup<CXXPre20Compat>, DefaultIgnore;
2953
2954def ext_constexpr_union_ctor_no_init : ExtWarn<
2955  "constexpr union constructor that does not initialize any member "
2956  "is a C++20 extension">, InGroup<CXX20>;
2957def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2958  "constexpr union constructor that does not initialize any member "
2959  "is incompatible with C++ standards before C++20">,
2960  InGroup<CXXPre20Compat>, DefaultIgnore;
2961def ext_constexpr_ctor_missing_init : ExtWarn<
2962  "constexpr constructor that does not initialize all members "
2963  "is a C++20 extension">, InGroup<CXX20>;
2964def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2965  "constexpr constructor that does not initialize all members "
2966  "is incompatible with C++ standards before C++20">,
2967  InGroup<CXXPre20Compat>, DefaultIgnore;
2968def note_constexpr_ctor_missing_init : Note<
2969  "member not initialized by constructor">;
2970def note_non_literal_no_constexpr_ctors : Note<
2971  "%0 is not literal because it is not an aggregate and has no constexpr "
2972  "constructors other than copy or move constructors">;
2973def note_non_literal_base_class : Note<
2974  "%0 is not literal because it has base class %1 of non-literal type">;
2975def note_non_literal_field : Note<
2976  "%0 is not literal because it has data member %1 of "
2977  "%select{non-literal|volatile}3 type %2">;
2978def note_non_literal_user_provided_dtor : Note<
2979  "%0 is not literal because it has a user-provided destructor">;
2980def note_non_literal_nontrivial_dtor : Note<
2981  "%0 is not literal because it has a non-trivial destructor">;
2982def note_non_literal_non_constexpr_dtor : Note<
2983  "%0 is not literal because its destructor is not constexpr">;
2984def note_non_literal_lambda : Note<
2985  "lambda closure types are non-literal types before C++17">;
2986def warn_private_extern : Warning<
2987  "use of __private_extern__ on a declaration may not produce external symbol "
2988  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2989def note_private_extern : Note<
2990  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2991
2992// C23 constexpr
2993def err_c23_constexpr_not_variable : Error<
2994  "'constexpr' can only be used in variable declarations">;
2995def err_c23_constexpr_invalid_type : Error<
2996  "constexpr variable cannot have type %0">;
2997def err_c23_constexpr_init_not_representable : Error<
2998  "constexpr initializer evaluates to %0 which is not exactly representable in type %1">;
2999def err_c23_constexpr_init_type_mismatch : Error<
3000  "constexpr initializer for type %0 is of type %1">;
3001def err_c23_constexpr_pointer_not_null : Error<
3002  "constexpr pointer initializer is not null">;
3003
3004// C++ Concepts
3005def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
3006  "concept declarations may only appear in global or namespace scope">;
3007def err_concept_no_parameters : Error<
3008  "concept template parameter list must have at least one parameter; explicit "
3009  "specialization of concepts is not allowed">;
3010def err_concept_extra_headers : Error<
3011  "extraneous template parameter list in concept definition">;
3012def err_concept_no_associated_constraints : Error<
3013  "concept cannot have associated constraints">;
3014def err_non_constant_constraint_expression : Error<
3015  "substitution into constraint expression resulted in a non-constant "
3016  "expression">;
3017def err_non_bool_atomic_constraint : Error<
3018  "atomic constraint must be of type 'bool' (found %0)">;
3019def err_template_arg_list_constraints_not_satisfied : Error<
3020  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
3021  "template template parameter|template}0 %1%2">;
3022def note_substituted_constraint_expr_is_ill_formed : Note<
3023  "because substituted constraint expression is ill-formed%0">;
3024def note_constraint_references_error
3025    : Note<"constraint depends on a previously diagnosed expression">;
3026def note_atomic_constraint_evaluated_to_false : Note<
3027  "%select{and|because}0 '%1' evaluated to false">;
3028def note_concept_specialization_constraint_evaluated_to_false : Note<
3029  "%select{and|because}0 '%1' evaluated to false">;
3030def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
3031  "%select{and|because}0 %1 does not satisfy %2">;
3032def note_atomic_constraint_evaluated_to_false_elaborated : Note<
3033  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
3034def note_is_deducible_constraint_evaluated_to_false : Note<
3035  "cannot deduce template arguments for %0 from %1">;
3036def err_constrained_virtual_method : Error<
3037  "virtual function cannot have a requires clause">;
3038def err_trailing_requires_clause_on_deduction_guide : Error<
3039  "deduction guide cannot have a requires clause">;
3040def err_constrained_non_templated_function
3041    : Error<"non-templated function cannot have a requires clause">;
3042def err_non_temp_spec_requires_clause : Error<
3043  "%select{explicit|friend}0 specialization cannot have a trailing requires clause "
3044  "unless it declares a function template">;
3045def err_reference_to_function_with_unsatisfied_constraints : Error<
3046  "invalid reference to function %0: constraints not satisfied">;
3047def err_requires_expr_local_parameter_default_argument : Error<
3048  "default arguments not allowed for parameters of a requires expression">;
3049def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
3050  "constraint variable %0 cannot be used in an evaluated context">;
3051def note_expr_requirement_expr_substitution_error : Note<
3052  "%select{and|because}0 '%1' would be invalid: %2">;
3053def note_expr_requirement_expr_unknown_substitution_error : Note<
3054  "%select{and|because}0 '%1' would be invalid">;
3055def note_expr_requirement_noexcept_not_met : Note<
3056  "%select{and|because}0 '%1' may throw an exception">;
3057def note_expr_requirement_type_requirement_substitution_error : Note<
3058  "%select{and|because}0 '%1' would be invalid: %2">;
3059def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
3060  "%select{and|because}0 '%1' would be invalid">;
3061def note_expr_requirement_constraints_not_satisfied : Note<
3062  "%select{and|because}0 type constraint '%1' was not satisfied:">;
3063def note_expr_requirement_constraints_not_satisfied_simple : Note<
3064  "%select{and|because}0 %1 does not satisfy %2:">;
3065def note_type_requirement_substitution_error : Note<
3066  "%select{and|because}0 '%1' would be invalid: %2">;
3067def note_type_requirement_unknown_substitution_error : Note<
3068  "%select{and|because}0 '%1' would be invalid">;
3069def note_nested_requirement_substitution_error : Note<
3070  "%select{and|because}0 '%1' would be invalid%2">;
3071def note_nested_requirement_unknown_substitution_error : Note<
3072  "%select{and|because}0 '%1' would be invalid">;
3073def note_ambiguous_atomic_constraints : Note<
3074  "similar constraint expressions not considered equivalent; constraint "
3075  "expressions cannot be considered equivalent unless they originate from the "
3076  "same concept">;
3077def note_ambiguous_atomic_constraints_similar_expression : Note<
3078  "similar constraint expression here">;
3079def err_unsupported_placeholder_constraint : Error<
3080  "constrained placeholder types other than simple 'auto' on non-type template "
3081  "parameters not supported yet">;
3082
3083def err_template_different_requires_clause : Error<
3084  "requires clause differs in template redeclaration">;
3085def err_template_different_type_constraint : Error<
3086  "type constraint differs in template redeclaration">;
3087def err_template_template_parameter_not_at_least_as_constrained : Error<
3088  "template template argument %0 is more constrained than template template "
3089  "parameter %1">;
3090
3091def err_type_constraint_non_type_concept : Error<
3092  "concept named in type constraint is not a type concept">;
3093def err_type_constraint_missing_arguments : Error<
3094  "%0 requires more than 1 template argument; provide the remaining arguments "
3095  "explicitly to use it here">;
3096def err_placeholder_constraints_not_satisfied : Error<
3097  "deduced type %0 does not satisfy %1">;
3098
3099// C++11 char16_t/char32_t
3100def warn_cxx98_compat_unicode_type : Warning<
3101  "'%0' type specifier is incompatible with C++98">,
3102  InGroup<CXX98Compat>, DefaultIgnore;
3103def warn_cxx17_compat_unicode_type : Warning<
3104  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
3105  InGroup<CXXPre20Compat>, DefaultIgnore;
3106
3107// __make_integer_seq
3108def err_integer_sequence_negative_length : Error<
3109  "integer sequences must have non-negative sequence length">;
3110def err_integer_sequence_integral_element_type : Error<
3111  "integer sequences must have integral element type">;
3112
3113// __type_pack_element
3114def err_type_pack_element_out_of_bounds : Error<
3115  "a parameter pack may not be accessed at an out of bounds index">;
3116
3117// Objective-C++
3118def err_objc_decls_may_only_appear_in_global_scope : Error<
3119  "Objective-C declarations may only appear in global scope">;
3120def warn_auto_var_is_id : Warning<
3121  "'auto' deduced as 'id' in declaration of %0">,
3122  InGroup<DiagGroup<"auto-var-id">>;
3123
3124// Attributes
3125def warn_attribute_ignored_no_calls_in_stmt: Warning<
3126  "%0 attribute is ignored because there exists no call expression inside the "
3127  "statement">,
3128  InGroup<IgnoredAttributes>;
3129
3130def warn_attribute_ignored_non_function_pointer: Warning<
3131  "%0 attribute is ignored because %1 is not a function pointer">,
3132  InGroup<IgnoredAttributes>;
3133
3134def warn_function_attribute_ignored_in_stmt : Warning<
3135  "attribute is ignored on this statement as it only applies to functions; "
3136  "use '%0' on statements">,
3137  InGroup<IgnoredAttributes>;
3138
3139def err_musttail_needs_trivial_args : Error<
3140  "tail call requires that the return value, all parameters, and any "
3141  "temporaries created by the expression are trivially destructible">;
3142def err_musttail_needs_call : Error<
3143  "%0 attribute requires that the return value is the result of a function call"
3144  >;
3145def err_musttail_needs_prototype : Error<
3146  "%0 attribute requires that both caller and callee functions have a "
3147  "prototype">;
3148def note_musttail_fix_non_prototype : Note<
3149  "add 'void' to the parameter list to turn an old-style K&R function "
3150  "declaration into a prototype">;
3151def err_musttail_structors_forbidden : Error<"cannot perform a tail call "
3152  "%select{from|to}0 a %select{constructor|destructor}1">;
3153def note_musttail_structors_forbidden : Note<"target "
3154  "%select{constructor|destructor}0 is declared here">;
3155def err_musttail_forbidden_from_this_context : Error<
3156  "%0 attribute cannot be used from "
3157  "%select{a block|an Objective-C function|this context}1">;
3158def err_musttail_member_mismatch : Error<
3159  "%select{non-member|static member|non-static member}0 "
3160  "function cannot perform a tail call to "
3161  "%select{non-member|static member|non-static member|pointer-to-member}1 "
3162  "function%select{| %3}2">;
3163def note_musttail_callee_defined_here : Note<"%0 declared here">;
3164def note_tail_call_required : Note<"tail call required by %0 attribute here">;
3165def err_musttail_mismatch : Error<
3166  "cannot perform a tail call to function%select{| %1}0 because its signature "
3167  "is incompatible with the calling function">;
3168def note_musttail_mismatch : Note<
3169    "target function "
3170    "%select{is a member of different class%diff{ (expected $ but has $)|}1,2"
3171    "|has different number of parameters (expected %1 but has %2)"
3172    "|has type mismatch at %ordinal3 parameter"
3173    "%diff{ (expected $ but has $)|}1,2"
3174    "|has different return type%diff{ ($ expected but has $)|}1,2}0">;
3175def err_musttail_callconv_mismatch : Error<
3176  "cannot perform a tail call to function%select{| %1}0 because it uses an "
3177  "incompatible calling convention">;
3178def note_musttail_callconv_mismatch : Note<
3179  "target function has calling convention %1 (expected %0)">;
3180def err_musttail_scope : Error<
3181  "cannot perform a tail call from this return statement">;
3182def err_musttail_no_variadic : Error<
3183  "%0 attribute may not be used with variadic functions">;
3184def err_musttail_no_return : Error<
3185  "%0 attribute may not be used with no-return-attribute functions">;
3186
3187def err_nsobject_attribute : Error<
3188  "'NSObject' attribute is for pointer types only">;
3189def err_attributes_are_not_compatible : Error<
3190  "%0 and %1%select{ attributes|}2 are not compatible">;
3191def err_attribute_invalid_argument : Error<
3192  "%select{a reference type|an array type|a non-vector or "
3193  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
3194def err_attribute_wrong_number_arguments : Error<
3195  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
3196  ":requires exactly %1 arguments}1">;
3197def err_attribute_wrong_number_arguments_for : Error <
3198  "%0 attribute references function %1, which %plural{0:takes no arguments|1:takes one argument|"
3199  ":takes exactly %2 arguments}2">;
3200def err_attribute_bounds_for_function : Error<
3201  "%0 attribute references parameter %1, but the function %2 has only %3 parameters">;
3202def err_attribute_no_member_function : Error<
3203  "%0 attribute cannot be applied to non-static member functions">;
3204def err_attribute_parameter_types : Error<
3205  "%0 attribute parameter types do not match: parameter %1 of function %2 has type %3, "
3206  "but parameter %4 of function %5 has type %6">;
3207
3208def err_attribute_too_many_arguments : Error<
3209  "%0 attribute takes no more than %1 argument%s1">;
3210def err_attribute_too_few_arguments : Error<
3211  "%0 attribute takes at least %1 argument%s1">;
3212def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
3213def err_attribute_invalid_bitint_vector_type : Error<
3214  "'_BitInt' vector element width must be %select{a power of 2|"
3215  "at least as wide as 'CHAR_BIT'}0">;
3216def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
3217def err_attribute_bad_neon_vector_size : Error<
3218  "Neon vector size must be 64 or 128 bits">;
3219def err_attribute_invalid_sve_type : Error<
3220  "%0 attribute applied to non-SVE type %1">;
3221def err_attribute_bad_sve_vector_size : Error<
3222  "invalid SVE vector size '%0', must match value set by "
3223  "'-msve-vector-bits' ('%1')">;
3224def err_attribute_arm_feature_sve_bits_unsupported : Error<
3225  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
3226  "value of 128, 256, 512, 1024 or 2048">;
3227def err_attribute_arm_sm_incompat_builtin : Error<
3228  "builtin can only be called from a %0 function">;
3229def warn_attribute_arm_za_builtin_no_za_state : Warning<
3230  "builtin call is not valid when calling from a function without active ZA state">,
3231  InGroup<DiagGroup<"undefined-arm-za">>;
3232def warn_attribute_arm_zt0_builtin_no_zt0_state : Warning<
3233  "builtin call is not valid when calling from a function without active ZT0 state">,
3234  InGroup<DiagGroup<"undefined-arm-zt0">>;
3235def err_sve_vector_in_non_sve_target : Error<
3236  "SVE vector type %0 cannot be used in a target without sve">;
3237def err_sve_vector_in_non_streaming_function : Error<
3238  "SVE vector type %0 cannot be used in a non-streaming function">;
3239def err_attribute_riscv_rvv_bits_unsupported : Error<
3240  "%0 is only supported when '-mrvv-vector-bits=<bits>' is specified with a "
3241  "value of \"zvl\" or a power 2 in the range [64,65536]">;
3242def err_attribute_bad_rvv_vector_size : Error<
3243  "invalid RVV vector size '%0', expected size is '%1' based on LMUL of type "
3244  "and '-mrvv-vector-bits'">;
3245def err_attribute_invalid_rvv_type : Error<
3246  "%0 attribute applied to non-RVV type %1">;
3247def err_attribute_requires_positive_integer : Error<
3248  "%0 attribute requires a %select{positive|non-negative}1 "
3249  "integral compile time constant expression">;
3250def err_attribute_requires_opencl_version : Error<
3251  "attribute %0 is supported in the OpenCL version %1%select{| onwards}2">;
3252def err_invalid_branch_protection_spec : Error<
3253  "invalid or misplaced branch protection specification '%0'">;
3254def warn_unsupported_branch_protection_spec : Warning<
3255  "unsupported branch protection specification '%0'">, InGroup<BranchProtection>;
3256
3257def warn_unsupported_target_attribute
3258    : Warning<"%select{unsupported|duplicate|unknown}0%select{| CPU|"
3259              " tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' "
3260              "attribute string; '%select{target|target_clones|target_version}3' "
3261              "attribute ignored">,
3262      InGroup<IgnoredAttributes>;
3263def err_attribute_unsupported
3264    : Error<"%0 attribute is not supported on targets missing %1;"
3265            " specify an appropriate -march= or -mcpu=">;
3266def err_attribute_unsupported_m_profile
3267    : Error<"on M-profile architectures %0 attribute is not supported on targets missing %1;"
3268            " specify an appropriate -march= or -mcpu=">;
3269def err_duplicate_target_attribute
3270    : Error<"%select{unsupported|duplicate|unknown}0%select{| CPU|"
3271              " tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' "
3272              "attribute string; ">;
3273// The err_*_attribute_argument_not_int are separate because they're used by
3274// VerifyIntegerConstantExpression.
3275def err_aligned_attribute_argument_not_int : Error<
3276  "'aligned' attribute requires integer constant">;
3277def err_align_value_attribute_argument_not_int : Error<
3278  "'align_value' attribute requires integer constant">;
3279def err_alignas_attribute_wrong_decl_type : Error<
3280  "%0 attribute cannot be applied to %select{a function parameter|"
3281  "a variable with 'register' storage class|a 'catch' variable|a bit-field|"
3282  "an enumeration}1">;
3283def err_alignas_missing_on_definition : Error<
3284  "%0 must be specified on definition if it is specified on any declaration">;
3285def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
3286def err_alignas_mismatch : Error<
3287  "redeclaration has different alignment requirement (%1 vs %0)">;
3288def err_alignas_underaligned : Error<
3289  "requested alignment is less than minimum alignment of %1 for type %0">;
3290def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Summary>,
3291  InGroup<IgnoredAttributes>;
3292def err_attribute_sizeless_type : Error<
3293  "%0 attribute cannot be applied to sizeless type %1">;
3294def err_attribute_argument_n_type : Error<
3295  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
3296  "constant|a string|an identifier|a constant expression|a builtin function}2">;
3297def err_attribute_argument_type : Error<
3298  "%0 attribute requires %select{int or bool|an integer "
3299  "constant|a string|an identifier}1">;
3300def err_attribute_argument_out_of_range : Error<
3301  "%0 attribute requires integer constant between %1 and %2 inclusive">;
3302def err_init_priority_object_attr : Error<
3303  "can only use 'init_priority' attribute on file-scope definitions "
3304  "of objects of class type">;
3305def err_attribute_argument_out_of_bounds : Error<
3306  "%0 attribute parameter %1 is out of bounds">;
3307def err_attribute_only_once_per_parameter : Error<
3308  "%0 attribute can only be applied once per parameter">;
3309def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
3310def note_previous_uuid : Note<"previous uuid specified here">;
3311def warn_attribute_pointers_only : Warning<
3312  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
3313  InGroup<IgnoredAttributes>;
3314def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Summary>;
3315def err_attribute_integers_only : Error<
3316  "%0 attribute argument may only refer to a function parameter of integer "
3317  "type">;
3318def warn_attribute_return_pointers_only : Warning<
3319  "%0 attribute only applies to return values that are pointers">,
3320  InGroup<IgnoredAttributes>;
3321def warn_attribute_return_pointers_refs_only : Warning<
3322  "%0 attribute only applies to return values that are pointers or references">,
3323  InGroup<IgnoredAttributes>;
3324def warn_attribute_pointer_or_reference_only : Warning<
3325  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
3326  InGroup<IgnoredAttributes>;
3327def err_attribute_no_member_pointers : Error<
3328  "%0 attribute cannot be used with pointers to members">;
3329def err_attribute_invalid_implicit_this_argument : Error<
3330  "%0 attribute is invalid for the implicit this argument">;
3331def err_ownership_type : Error<
3332  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
3333def err_ownership_returns_index_mismatch : Error<
3334  "'ownership_returns' attribute index does not match; here it is %0">;
3335def note_ownership_returns_index_mismatch : Note<
3336  "declared with index %0 here">;
3337def err_format_strftime_third_parameter : Error<
3338  "strftime format attribute requires 3rd parameter to be 0">;
3339def err_format_attribute_not : Error<"format argument not a string type">;
3340def err_format_attribute_result_not : Error<"function does not return %0">;
3341def err_format_attribute_implicit_this_format_string : Error<
3342  "format attribute cannot specify the implicit this argument as the format "
3343  "string">;
3344def err_callback_attribute_no_callee : Error<
3345  "'callback' attribute specifies no callback callee">;
3346def err_callback_attribute_invalid_callee : Error<
3347  "'callback' attribute specifies invalid callback callee">;
3348def err_callback_attribute_multiple : Error<
3349  "multiple 'callback' attributes specified">;
3350def err_callback_attribute_argument_unknown : Error<
3351  "'callback' attribute argument %0 is not a known function parameter">;
3352def err_callback_callee_no_function_type : Error<
3353  "'callback' attribute callee does not have function type">;
3354def err_callback_callee_is_variadic : Error<
3355  "'callback' attribute callee may not be variadic">;
3356def err_callback_implicit_this_not_available : Error<
3357  "'callback' argument at position %0 references unavailable implicit 'this'">;
3358def err_init_method_bad_return_type : Error<
3359  "init methods must return an object pointer type, not %0">;
3360def err_attribute_invalid_size : Error<
3361  "vector size not an integral multiple of component size">;
3362def err_attribute_zero_size : Error<"zero %0 size">;
3363def err_attribute_size_too_large : Error<"%0 size too large">;
3364def err_typecheck_sve_rvv_ambiguous : Error<
3365  "cannot combine fixed-length and sizeless %select{SVE|RVV}0 vectors "
3366  "in expression, result is ambiguous (%1 and %2)">;
3367def err_typecheck_sve_rvv_gnu_ambiguous : Error<
3368  "cannot combine GNU and %select{SVE|RVV}0 vectors in expression, result is ambiguous (%1 and %2)">;
3369def err_typecheck_vector_not_convertable_implict_truncation : Error<
3370   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
3371   " %2 as implicit conversion would cause truncation">;
3372def err_typecheck_vector_not_convertable : Error<
3373  "cannot convert between vector values of different size (%0 and %1)">;
3374def err_typecheck_vector_not_convertable_non_scalar : Error<
3375  "cannot convert between vector and non-scalar values (%0 and %1)">;
3376def err_typecheck_vector_lengths_not_equal : Error<
3377  "vector operands do not have the same number of elements (%0 and %1)">;
3378def warn_typecheck_vector_element_sizes_not_equal : Warning<
3379  "vector operands do not have the same elements sizes (%0 and %1)">,
3380  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
3381def err_ext_vector_component_exceeds_length : Error<
3382  "vector component access exceeds type %0">;
3383def err_ext_vector_component_name_illegal : Error<
3384  "illegal vector component name '%0'">;
3385def err_attribute_address_space_negative : Error<
3386  "address space is negative">;
3387def err_attribute_address_space_too_high : Error<
3388  "address space is larger than the maximum supported (%0)">;
3389def err_attribute_address_multiple_qualifiers : Error<
3390  "multiple address spaces specified for type">;
3391def warn_attribute_address_multiple_identical_qualifiers : Warning<
3392  "multiple identical address spaces specified for type">,
3393  InGroup<DuplicateDeclSpecifier>;
3394def err_attribute_not_clinkage : Error<
3395  "function type with %0 attribute must have C linkage">;
3396def err_function_decl_cmse_ns_call : Error<
3397  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
3398def err_attribute_address_function_type : Error<
3399  "function type may not be qualified with an address space">;
3400def err_as_qualified_auto_decl : Error<
3401  "automatic variable qualified with an%select{| invalid}0 address space">;
3402def err_arg_with_address_space : Error<
3403  "parameter may not be qualified with an address space">;
3404def err_field_with_address_space : Error<
3405  "field may not be qualified with an address space">;
3406def err_compound_literal_with_address_space : Error<
3407  "compound literal in function scope may not be qualified with an address space">;
3408def err_compound_literal_with_vla_type : Error<
3409  "compound literal cannot be of variable-length array type">;
3410def err_address_space_mismatch_templ_inst : Error<
3411  "conflicting address space qualifiers are provided between types %0 and %1">;
3412def err_attr_objc_ownership_redundant : Error<
3413  "the type %0 is already explicitly ownership-qualified">;
3414def err_invalid_nsnumber_type : Error<
3415  "%0 is not a valid literal type for NSNumber">;
3416def err_objc_illegal_boxed_expression_type : Error<
3417  "illegal type %0 used in a boxed expression">;
3418def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3419  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3420def err_objc_incomplete_boxed_expression_type : Error<
3421  "incomplete type %0 used in a boxed expression">;
3422def err_undeclared_objc_literal_class : Error<
3423  "definition of class %0 must be available to use Objective-C "
3424  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3425  "string literals}1">;
3426def err_undeclared_boxing_method : Error<
3427  "declaration of %0 is missing in %1 class">;
3428def err_objc_literal_method_sig : Error<
3429  "literal construction method %0 has incompatible signature">;
3430def note_objc_literal_method_param : Note<
3431  "%select{first|second|third}0 parameter has unexpected type %1 "
3432  "(should be %2)">;
3433def note_objc_literal_method_return : Note<
3434  "method returns unexpected type %0 (should be an object type)">;
3435def err_invalid_collection_element : Error<
3436  "collection element of type %0 is not an Objective-C object">;
3437def err_box_literal_collection : Error<
3438  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3439  "in a collection">;
3440def warn_objc_literal_comparison : Warning<
3441  "direct comparison of %select{an array literal|a dictionary literal|"
3442  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3443  InGroup<ObjCLiteralComparison>;
3444def err_missing_atsign_prefix : Error<
3445  "%select{string|numeric}0 literal must be prefixed by '@'">;
3446def warn_objc_string_literal_comparison : Warning<
3447  "direct comparison of a string literal has undefined behavior">,
3448  InGroup<ObjCStringComparison>;
3449def warn_concatenated_literal_array_init : Warning<
3450  "suspicious concatenation of string literals in an array initialization; "
3451  "did you mean to separate the elements with a comma?">,
3452  InGroup<StringConcatation>, DefaultIgnore;
3453def warn_concatenated_nsarray_literal : Warning<
3454  "concatenated NSString literal for an NSArray expression - "
3455  "possibly missing a comma">,
3456  InGroup<ObjCStringConcatenation>;
3457def note_objc_literal_comparison_isequal : Note<
3458  "use 'isEqual:' instead">;
3459def warn_objc_collection_literal_element : Warning<
3460  "object of type %0 is not compatible with "
3461  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3462  InGroup<ObjCLiteralConversion>;
3463def warn_nsdictionary_duplicate_key : Warning<
3464  "duplicate key in dictionary literal">,
3465  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3466def note_nsdictionary_duplicate_key_here : Note<
3467  "previous equal key is here">;
3468def err_swift_param_attr_not_swiftcall : Error<
3469  "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 "
3470  "calling convention%select{|s}1">;
3471def err_swift_indirect_result_not_first : Error<
3472  "'swift_indirect_result' parameters must be first parameters of function">;
3473def err_swift_error_result_not_after_swift_context : Error<
3474  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3475def err_swift_abi_parameter_wrong_type : Error<
3476  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3477  "type here is %2">;
3478
3479def err_attribute_argument_invalid : Error<
3480  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3481  "min must not be greater than max}1">;
3482def err_attribute_argument_is_zero : Error<
3483  "%0 attribute must be greater than 0">;
3484def warn_attribute_argument_n_negative : Warning<
3485  "%0 attribute parameter %1 is negative and will be ignored">,
3486  InGroup<CudaCompat>;
3487def err_property_function_in_objc_container : Error<
3488  "use of Objective-C property in function nested in Objective-C "
3489  "container not supported, move function outside its container">;
3490
3491let CategoryName = "Cocoa API Issue" in {
3492def warn_objc_redundant_literal_use : Warning<
3493  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3494}
3495
3496def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3497  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3498
3499def err_attr_codemodel_arg : Error<"code model '%0' is not supported on this target">;
3500
3501def err_aix_attr_unsupported : Error<"%0 attribute is not yet supported on AIX">;
3502
3503def err_tls_var_aligned_over_maximum : Error<
3504  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3505  "alignment (%2) for a thread-local variable on this target">;
3506
3507def err_only_annotate_after_access_spec : Error<
3508  "access specifier can only have annotation attributes">;
3509
3510def err_attribute_section_invalid_for_target : Error<
3511  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3512def err_pragma_section_invalid_for_target : Error<
3513  "argument to #pragma section is not valid for this target: %0">;
3514def warn_attribute_section_drectve : Warning<
3515  "#pragma %0(\".drectve\") has undefined behavior, "
3516  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3517def warn_mismatched_section : Warning<
3518  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3519def warn_attribute_section_on_redeclaration : Warning<
3520  "section attribute is specified on redeclared variable">, InGroup<Section>;
3521def err_mismatched_code_seg_base : Error<
3522  "derived class must specify the same code segment as its base classes">;
3523def err_mismatched_code_seg_override : Error<
3524  "overriding virtual function must specify the same code segment as its overridden function">;
3525def err_conflicting_codeseg_attribute : Error<
3526  "conflicting code segment specifiers">;
3527def warn_duplicate_codeseg_attribute : Warning<
3528  "duplicate code segment specifiers">, InGroup<Section>;
3529
3530def err_anonymous_property: Error<
3531  "anonymous property is not supported">;
3532def err_property_is_variably_modified : Error<
3533  "property %0 has a variably modified type">;
3534def err_no_accessor_for_property : Error<
3535  "no %select{getter|setter}0 defined for property %1">;
3536def err_cannot_find_suitable_accessor : Error<
3537  "cannot find suitable %select{getter|setter}0 for property %1">;
3538
3539def warn_alloca : Warning<
3540  "use of function %0 is discouraged; there is no way to check for failure but "
3541  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3542  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3543
3544def warn_alloca_align_alignof : Warning<
3545  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3546  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3547
3548def err_alignment_too_small : Error<
3549  "requested alignment must be %0 or greater">;
3550def err_alignment_too_big : Error<
3551  "requested alignment must be %0 or smaller">;
3552def err_alignment_not_power_of_two : Error<
3553  "requested alignment is not a power of 2">;
3554def warn_alignment_not_power_of_two : Warning<
3555  err_alignment_not_power_of_two.Summary>,
3556  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3557def err_alignment_dependent_typedef_name : Error<
3558  "requested alignment is dependent but declaration is not dependent">;
3559def ext_c2y_alignof_incomplete_array : Extension<
3560  "'alignof' on an incomplete array type is a C2y extension">,
3561  InGroup<C2y>;
3562def warn_c2y_compat_alignof_incomplete_array : Warning<
3563  "'alignof' on an incomplete array type is incompatible with C standards "
3564  "before C2y">, InGroup<CPre2yCompat>, DefaultIgnore;
3565
3566def warn_alignment_builtin_useless : Warning<
3567  "%select{aligning a value|the result of checking whether a value is aligned}0"
3568  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3569def err_attribute_aligned_too_great : Error<
3570  "requested alignment must be %0 bytes or smaller">;
3571def warn_assume_aligned_too_great
3572    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3573              "alignment assumed">,
3574      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3575def warn_not_xl_compatible
3576    : Warning<"alignment of 16 bytes for a struct member is not binary "
3577              "compatible with IBM XL C/C++ for AIX 16.1.0 or older">,
3578      InGroup<AIXCompat>;
3579def note_misaligned_member_used_here : Note<
3580    "passing byval argument %0 with potentially incompatible alignment here">;
3581def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3582  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3583  InGroup<MicrosoftInconsistentDllImport>;
3584def warn_redeclaration_without_import_attribute : Warning<
3585  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3586  InGroup<MicrosoftInconsistentDllImport>;
3587def warn_dllimport_dropped_from_inline_function : Warning<
3588  "%q0 redeclared inline; %1 attribute ignored">,
3589  InGroup<IgnoredAttributes>;
3590def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3591  " exception specification; attribute ignored">,
3592  InGroup<IgnoredAttributes>;
3593def warn_attribute_ignored_on_non_definition :
3594  Warning<"%0 attribute ignored on a non-definition declaration">,
3595  InGroup<IgnoredAttributes>;
3596def warn_attribute_ignored_on_inline :
3597  Warning<"%0 attribute ignored on inline function">,
3598  InGroup<IgnoredAttributes>;
3599def warn_nocf_check_attribute_ignored :
3600  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3601  InGroup<IgnoredAttributes>;
3602def warn_attribute_after_definition_ignored : Warning<
3603  "attribute %0 after definition is ignored">,
3604   InGroup<IgnoredAttributes>;
3605def warn_attributes_likelihood_ifstmt_conflict
3606    : Warning<"conflicting attributes %0 are ignored">,
3607      InGroup<IgnoredAttributes>;
3608def warn_cxx11_gnu_attribute_on_type : Warning<
3609  "attribute %0 ignored, because it cannot be applied to a type">,
3610  InGroup<IgnoredAttributes>;
3611def warn_unhandled_ms_attribute_ignored : Warning<
3612  "__declspec attribute %0 is not supported">,
3613  InGroup<IgnoredAttributes>;
3614def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3615  "attribute %0 has no effect when annotating an infinite loop">,
3616   InGroup<IgnoredAttributes>;
3617def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3618  "annotating the infinite loop here">;
3619def warn_attribute_has_no_effect_on_compile_time_if : Warning<
3620  "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">,
3621   InGroup<IgnoredAttributes>;
3622def note_attribute_has_no_effect_on_compile_time_if_here : Note<
3623  "annotating the 'if %select{constexpr|consteval}0' statement here">;
3624def err_decl_attribute_invalid_on_stmt : Error<
3625  "%0%select{ attribute|}1 cannot be applied to a statement">;
3626def err_attribute_invalid_on_decl : Error<
3627  "%0%select{ attribute|}1 cannot be applied to a declaration">;
3628def warn_type_attribute_deprecated_on_decl : Warning<
3629  "applying attribute %0 to a declaration is deprecated; apply it to the type instead">,
3630  InGroup<DeprecatedAttributes>;
3631def warn_declspec_attribute_ignored : Warning<
3632  "attribute %0 is ignored, place it after "
3633  "\"%select{class|struct|interface|union|enum|enum class|enum struct}1\" to apply attribute to "
3634  "type declaration">, InGroup<IgnoredAttributes>;
3635def err_declspec_keyword_has_no_effect : Error<
3636  "%0 cannot appear here, place it after "
3637  "\"%select{class|struct|interface|union|enum}1\" to apply it to the "
3638  "type declaration">;
3639def warn_attribute_precede_definition : Warning<
3640  "attribute declaration must precede definition">,
3641  InGroup<IgnoredAttributes>;
3642def warn_attribute_void_function_method : Warning<
3643  "attribute %0 cannot be applied to "
3644  "%select{functions|Objective-C method}1 without return value">,
3645  InGroup<IgnoredAttributes>;
3646def warn_attribute_weak_on_field : Warning<
3647  "__weak attribute cannot be specified on a field declaration">,
3648  InGroup<IgnoredAttributes>;
3649def warn_gc_attribute_weak_on_local : Warning<
3650  "Objective-C GC does not allow weak variables on the stack">,
3651  InGroup<IgnoredAttributes>;
3652def warn_nsobject_attribute : Warning<
3653  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3654  InGroup<NSobjectAttribute>;
3655def warn_independentclass_attribute : Warning<
3656  "'objc_independent_class' attribute may be put on a typedef only; "
3657  "attribute is ignored">,
3658  InGroup<IndependentClassAttribute>;
3659def warn_ptr_independentclass_attribute : Warning<
3660  "'objc_independent_class' attribute may be put on Objective-C object "
3661  "pointer type only; attribute is ignored">,
3662  InGroup<IndependentClassAttribute>;
3663def warn_attribute_weak_on_local : Warning<
3664  "__weak attribute cannot be specified on an automatic variable when ARC "
3665  "is not enabled">,
3666  InGroup<IgnoredAttributes>;
3667def warn_weak_identifier_undeclared : Warning<
3668  "weak identifier %0 never declared">;
3669def warn_attribute_cmse_entry_static : Warning<
3670  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3671  InGroup<IgnoredAttributes>;
3672def warn_cmse_nonsecure_union : Warning<
3673  "passing union across security boundary via %select{parameter %1|return value}0 "
3674  "may leak information">,
3675  InGroup<DiagGroup<"cmse-union-leak">>;
3676def err_attribute_weak_static : Error<
3677  "weak declaration cannot have internal linkage">;
3678def err_attribute_selectany_non_extern_data : Error<
3679  "'selectany' can only be applied to data items with external linkage">;
3680def warn_attribute_hybrid_patchable_non_extern : Warning<
3681  "'hybrid_patchable' is ignored on functions without external linkage">,
3682  InGroup<IgnoredAttributes>;
3683def err_declspec_thread_on_thread_variable : Error<
3684  "'__declspec(thread)' applied to variable that already has a "
3685  "thread-local storage specifier">;
3686def err_attribute_dll_not_extern : Error<
3687  "%q0 must have external linkage when declared %q1">;
3688def err_attribute_dll_thread_local : Error<
3689  "%q0 cannot be thread local when declared %q1">;
3690def err_attribute_dll_lambda : Error<
3691  "lambda cannot be declared %0">;
3692def warn_attribute_invalid_on_definition : Warning<
3693  "'%0' attribute cannot be specified on a definition">,
3694  InGroup<IgnoredAttributes>;
3695def err_attribute_dll_redeclaration : Error<
3696  "redeclaration of %q0 cannot add %q1 attribute">;
3697def warn_attribute_dll_redeclaration : Warning<
3698  "redeclaration of %q0 should not add %q1 attribute">,
3699  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3700def err_attribute_dllimport_function_definition : Error<
3701  "dllimport cannot be applied to non-inline function definition">;
3702def err_attribute_dllimport_function_specialization_definition : Error<
3703  "cannot define non-inline dllimport template specialization">;
3704def err_attribute_dll_deleted : Error<
3705  "attribute %q0 cannot be applied to a deleted function">;
3706def err_attribute_dllimport_data_definition : Error<
3707  "definition of dllimport data">;
3708def err_attribute_dllimport_static_field_definition : Error<
3709  "definition of dllimport static field not allowed">;
3710def warn_attribute_dllimport_static_field_definition : Warning<
3711  "definition of dllimport static field">,
3712  InGroup<DiagGroup<"dllimport-static-field-def">>;
3713def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3714  "explicit instantiation declaration should not be 'dllexport'">,
3715  InGroup<DllexportExplicitInstantiationDecl>;
3716def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3717  "'dllexport' attribute ignored on explicit instantiation definition">,
3718  InGroup<IgnoredAttributes>;
3719def warn_attribute_exclude_from_explicit_instantiation_local_class : Warning<
3720  "%0 attribute ignored on local class%select{| member}1">,
3721  InGroup<IgnoredAttributes>;
3722def warn_invalid_initializer_from_system_header : Warning<
3723  "invalid constructor from class in system header, should not be explicit">,
3724  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3725def note_used_in_initialization_here : Note<"used in initialization here">;
3726def err_attribute_dll_member_of_dll_class : Error<
3727  "attribute %q0 cannot be applied to member of %q1 class">;
3728def warn_attribute_dll_instantiated_base_class : Warning<
3729  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3730  "base class template without dll attribute is not supported">,
3731  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3732def err_attribute_dll_ambiguous_default_ctor : Error<
3733  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3734def err_attribute_weakref_not_static : Error<
3735  "weakref declaration must have internal linkage">;
3736def err_attribute_weakref_not_global_context : Error<
3737  "weakref declaration of %0 must be in a global context">;
3738def err_attribute_weakref_without_alias : Error<
3739  "weakref declaration of %0 must also have an alias attribute">;
3740def err_alias_not_supported_on_darwin : Error <
3741  "aliases are not supported on darwin">;
3742def warn_attribute_wrong_decl_type_str : Warning<
3743  "%0%select{ attribute|}1 only applies to %2">, InGroup<IgnoredAttributes>;
3744def err_attribute_wrong_decl_type_str : Error<
3745  warn_attribute_wrong_decl_type_str.Summary>;
3746def warn_attribute_wrong_decl_type : Warning<
3747  "%0%select{ attribute|}1 only applies to %select{"
3748  "functions"
3749  "|unions"
3750  "|variables and functions"
3751  "|functions and methods"
3752  "|functions, methods and blocks"
3753  "|functions, methods, and parameters"
3754  "|variables"
3755  "|variables and fields"
3756  "|variables, data members and tag types"
3757  "|types and namespaces"
3758  "|variables, functions and classes"
3759  "|kernel functions"
3760  "|non-K&R-style functions}2">,
3761  InGroup<IgnoredAttributes>;
3762def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Summary>;
3763def warn_type_attribute_wrong_type : Warning<
3764  "'%0' only applies to %select{function|pointer|"
3765  "Objective-C object or block pointer}1 types; type here is %2">,
3766  InGroup<IgnoredAttributes>;
3767def err_type_attribute_wrong_type : Error<
3768  warn_type_attribute_wrong_type.Summary>;
3769def warn_incomplete_encoded_type : Warning<
3770  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3771  InGroup<DiagGroup<"encode-type">>;
3772def warn_gnu_inline_attribute_requires_inline : Warning<
3773  "'gnu_inline' attribute requires function to be marked 'inline',"
3774  " attribute ignored">,
3775  InGroup<IgnoredAttributes>;
3776def warn_gnu_inline_cplusplus_without_extern : Warning<
3777  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3778  " available, this changed in Clang 10">,
3779  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3780def err_attribute_vecreturn_only_vector_member : Error<
3781  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3782def err_attribute_vecreturn_only_pod_record : Error<
3783  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3784def err_sme_attr_mismatch : Error<
3785  "function declared %0 was previously declared %1, which has different SME function attributes">;
3786def err_sme_call_in_non_sme_target : Error<
3787  "call to a streaming function requires 'sme'">;
3788def err_sme_za_call_no_za_state : Error<
3789  "call to a shared ZA function requires the caller to have ZA state">;
3790def err_sme_zt0_call_no_zt0_state : Error<
3791  "call to a shared ZT0 function requires the caller to have ZT0 state">;
3792def err_sme_unimplemented_za_save_restore : Error<
3793  "call to a function that shares state other than 'za' from a "
3794  "function that has live 'za' state requires a spill/fill of ZA, which is not yet "
3795  "implemented">;
3796def note_sme_use_preserves_za : Note<
3797  "add '__arm_preserves(\"za\")' to the callee if it preserves ZA">;
3798def err_sme_definition_using_sm_in_non_sme_target : Error<
3799  "function executed in streaming-SVE mode requires 'sme'">;
3800def err_sme_definition_using_za_in_non_sme_target : Error<
3801  "function using ZA state requires 'sme'">;
3802def err_sme_definition_using_zt0_in_non_sme2_target : Error<
3803  "function using ZT0 state requires 'sme2'">;
3804def warn_sme_streaming_pass_return_vl_to_non_streaming : Warning<
3805  "%select{returning|passing}0 a VL-dependent argument %select{from|to}0 a function with a different"
3806  " streaming-mode is undefined behaviour when the streaming and non-streaming vector lengths are different at runtime">,
3807  InGroup<AArch64SMEAttributes>, DefaultIgnore;
3808def warn_sme_locally_streaming_has_vl_args_returns : Warning<
3809  "%select{returning|passing}0 a VL-dependent argument %select{from|to}0 a locally streaming function is undefined"
3810  " behaviour when the streaming and non-streaming vector lengths are different at runtime">,
3811  InGroup<AArch64SMEAttributes>, DefaultIgnore;
3812def err_conflicting_attributes_arm_state : Error<
3813  "conflicting attributes for state '%0'">;
3814def err_unknown_arm_state : Error<
3815  "unknown state '%0'">;
3816def err_missing_arm_state : Error<
3817  "missing state for %0">;
3818def err_cconv_change : Error<
3819  "function declared '%0' here was previously declared "
3820  "%select{'%2'|without calling convention}1">;
3821def warn_cconv_unsupported : Warning<
3822  "%0 calling convention is not supported %select{"
3823  // Use CallingConventionIgnoredReason Enum to specify these.
3824  "for this target"
3825  "|on variadic function"
3826  "|on constructor/destructor"
3827  "|on builtin function"
3828  "}1">,
3829  InGroup<IgnoredAttributes>;
3830def error_cconv_unsupported : Error<warn_cconv_unsupported.Summary>;
3831def err_cconv_knr : Error<
3832  "function with no prototype cannot use the %0 calling convention">;
3833def warn_cconv_knr : Warning<
3834  err_cconv_knr.Summary>,
3835  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3836def err_cconv_varargs : Error<
3837  "variadic function cannot use %0 calling convention">;
3838def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3839  "attribute was previously declared "
3840  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3841def err_function_attribute_mismatch : Error<
3842  "function declared with %0 attribute "
3843  "was previously declared without the %0 attribute">;
3844def err_objc_precise_lifetime_bad_type : Error<
3845  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3846def warn_objc_precise_lifetime_meaningless : Error<
3847  "objc_precise_lifetime is not meaningful for "
3848  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3849def err_invalid_pcs : Error<"invalid PCS type">;
3850def warn_attribute_not_on_decl : Warning<
3851  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3852def err_base_specifier_attribute : Error<
3853  "%0%select{ attribute|}1 cannot be applied to a base specifier">;
3854def warn_declspec_allocator_nonpointer : Warning<
3855  "ignoring __declspec(allocator) because the function return type %0 is not "
3856  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3857def err_cconv_incomplete_param_type : Error<
3858  "parameter %0 must have a complete type to use function %1 with the %2 "
3859  "calling convention">;
3860def err_attribute_output_parameter : Error<
3861  "attribute only applies to output parameters">;
3862
3863def ext_cannot_use_trivial_abi : ExtWarn<
3864  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3865def note_cannot_use_trivial_abi_reason : Note<
3866  "'trivial_abi' is disallowed on %0 because %select{"
3867  "its copy constructors and move constructors are all deleted|"
3868  "it is polymorphic|"
3869  "it has a base of a non-trivial class type|it has a virtual base|"
3870  "it has a __weak field|it has a field of a non-trivial class type}1">;
3871
3872// Availability attribute
3873def warn_availability_unknown_platform : Warning<
3874  "unknown platform %0 in availability macro">, InGroup<Availability>;
3875def warn_availability_unknown_environment : Warning<
3876  "unknown environment %0 in availability macro">, InGroup<Availability>;
3877
3878def warn_availability_version_ordering : Warning<
3879  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3880  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3881  "attribute ignored">, InGroup<Availability>;
3882def warn_mismatched_availability: Warning<
3883  "availability does not match previous declaration">, InGroup<Availability>;
3884def warn_mismatched_availability_override : Warning<
3885  "%select{|overriding }4method %select{introduced after|"
3886  "deprecated before|obsoleted before}0 "
3887  "%select{the protocol method it implements|overridden method}4 "
3888  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3889def warn_mismatched_availability_override_unavail : Warning<
3890  "%select{|overriding }1method cannot be unavailable on %0 when "
3891  "%select{the protocol method it implements|its overridden method}1 is "
3892  "available">,
3893  InGroup<Availability>;
3894def warn_availability_on_static_initializer : Warning<
3895  "ignoring availability attribute %select{on '+load' method|"
3896  "with constructor attribute|with destructor attribute}0">,
3897  InGroup<Availability>;
3898def note_overridden_method : Note<
3899  "overridden method is here">;
3900def warn_availability_swift_unavailable_deprecated_only : Warning<
3901  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3902  InGroup<Availability>;
3903def note_protocol_method : Note<
3904  "protocol method is here">;
3905def warn_availability_fuchsia_unavailable_minor : Warning<
3906  "Fuchsia API Level prohibits specifying a minor or sub-minor version">,
3907  InGroup<Availability>;
3908def err_availability_unexpected_parameter: Error<
3909  "unexpected parameter '%0' in availability attribute, not permitted in %select{HLSL|C/C++}1">;
3910
3911def warn_unguarded_availability :
3912  Warning<"%0 is only available %select{|in %4 environment }3on %1 %2 or newer">,
3913  InGroup<UnguardedAvailability>, DefaultIgnore;
3914def warn_unguarded_availability_unavailable :
3915  Warning<"%0 is unavailable">,
3916  InGroup<UnguardedAvailability>, DefaultIgnore;
3917def warn_unguarded_availability_new :
3918  Warning<warn_unguarded_availability.Summary>,
3919  InGroup<UnguardedAvailabilityNew>;
3920def warn_unguarded_availability_unavailable_new :
3921  Warning<warn_unguarded_availability_unavailable.Summary>,
3922  InGroup<UnguardedAvailabilityNew>;
3923def note_decl_unguarded_availability_silence : Note<
3924  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3925def note_unguarded_available_silence : Note<
3926  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3927  " this warning">;
3928def warn_at_available_unchecked_use : Warning<
3929  "%select{@available|__builtin_available}0 does not guard availability here; "
3930  "use if (%select{@available|__builtin_available}0) instead">,
3931  InGroup<DiagGroup<"unsupported-availability-guard">>;
3932
3933def warn_missing_sdksettings_for_availability_checking : Warning<
3934  "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
3935  InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
3936
3937// Thread Safety Attributes
3938def warn_thread_attribute_ignored : Warning<
3939  "ignoring %0 attribute because its argument is invalid">,
3940  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3941def warn_thread_attribute_not_on_non_static_member : Warning<
3942  "%0 attribute without capability arguments can only be applied to non-static "
3943  "methods of a class">,
3944  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3945def warn_thread_attribute_not_on_capability_member : Warning<
3946  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3947  "annotated with 'capability' or 'scoped_lockable' attribute">,
3948  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3949def warn_thread_attribute_argument_not_lockable : Warning<
3950  "%0 attribute requires arguments whose type is annotated "
3951  "with 'capability' attribute; type here is %1">,
3952  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3953def warn_thread_attribute_decl_not_lockable : Warning<
3954  "%0 attribute can only be applied in a context annotated "
3955  "with 'capability' attribute">,
3956  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3957def warn_thread_attribute_decl_not_pointer : Warning<
3958  "%0 only applies to pointer types; type here is %1">,
3959  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3960def err_attribute_argument_out_of_bounds_extra_info : Error<
3961  "%0 attribute parameter %1 is out of bounds: "
3962  "%plural{0:no parameters to index into|"
3963  "1:can only be 1, since there is one parameter|"
3964  ":must be between 1 and %2}2">;
3965
3966// Thread Safety Analysis
3967def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3968  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3969def warn_unlock_kind_mismatch : Warning<
3970  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3971  "%select{shared|exclusive}3 access">,
3972  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3973def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3974  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3975def warn_no_unlock : Warning<
3976  "%0 '%1' is still held at the end of function">,
3977  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3978def warn_expecting_locked : Warning<
3979  "expecting %0 '%1' to be held at the end of function">,
3980  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3981// FIXME: improve the error message about locks not in scope
3982def warn_lock_some_predecessors : Warning<
3983  "%0 '%1' is not held on every path through here">,
3984  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3985def warn_expecting_lock_held_on_loop : Warning<
3986  "expecting %0 '%1' to be held at start of each loop">,
3987  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3988def note_locked_here : Note<"%0 acquired here">;
3989def note_unlocked_here : Note<"%0 released here">;
3990def warn_lock_exclusive_and_shared : Warning<
3991  "%0 '%1' is acquired exclusively and shared in the same scope">,
3992  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3993def note_lock_exclusive_and_shared : Note<
3994  "the other acquisition of %0 '%1' is here">;
3995def warn_variable_requires_any_lock : Warning<
3996  "%select{reading|writing}1 variable %0 requires holding "
3997  "%select{any mutex|any mutex exclusively}1">,
3998  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3999def warn_var_deref_requires_any_lock : Warning<
4000  "%select{reading|writing}1 the value pointed to by %0 requires holding "
4001  "%select{any mutex|any mutex exclusively}1">,
4002  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4003def warn_fun_excludes_mutex : Warning<
4004  "cannot call function '%1' while %0 '%2' is held">,
4005  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4006def warn_cannot_resolve_lock : Warning<
4007  "cannot resolve lock expression">,
4008  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4009def warn_acquired_before : Warning<
4010  "%0 '%1' must be acquired before '%2'">,
4011  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4012def warn_acquired_before_after_cycle : Warning<
4013  "cycle in acquired_before/after dependencies, starting with '%0'">,
4014  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4015
4016
4017// Thread safety warnings negative capabilities
4018def warn_acquire_requires_negative_cap : Warning<
4019  "acquiring %0 '%1' requires negative capability '%2'">,
4020  InGroup<ThreadSafetyNegative>, DefaultIgnore;
4021def warn_fun_requires_negative_cap : Warning<
4022  "calling function %0 requires negative capability '%1'">,
4023  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4024
4025// Thread safety warnings on pass/return by reference
4026def warn_guarded_pass_by_reference : Warning<
4027  "passing variable %1 by reference requires holding %0 "
4028  "%select{'%2'|'%2' exclusively}3">,
4029  InGroup<ThreadSafetyReference>, DefaultIgnore;
4030def warn_pt_guarded_pass_by_reference : Warning<
4031  "passing the value that %1 points to by reference requires holding %0 "
4032  "%select{'%2'|'%2' exclusively}3">,
4033  InGroup<ThreadSafetyReference>, DefaultIgnore;
4034def warn_guarded_return_by_reference : Warning<
4035  "returning variable %1 by reference requires holding %0 "
4036  "%select{'%2'|'%2' exclusively}3">,
4037  InGroup<ThreadSafetyReferenceReturn>, DefaultIgnore;
4038def warn_pt_guarded_return_by_reference : Warning<
4039  "returning the value that %1 points to by reference requires holding %0 "
4040  "%select{'%2'|'%2' exclusively}3">,
4041  InGroup<ThreadSafetyReferenceReturn>, DefaultIgnore;
4042
4043// Imprecise thread safety warnings
4044def warn_variable_requires_lock : Warning<
4045  "%select{reading|writing}3 variable %1 requires holding %0 "
4046  "%select{'%2'|'%2' exclusively}3">,
4047  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4048def warn_var_deref_requires_lock : Warning<
4049  "%select{reading|writing}3 the value pointed to by %1 requires "
4050  "holding %0 %select{'%2'|'%2' exclusively}3">,
4051  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4052def warn_fun_requires_lock : Warning<
4053  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
4054  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
4055
4056// Precise thread safety warnings
4057def warn_variable_requires_lock_precise :
4058  Warning<warn_variable_requires_lock.Summary>,
4059  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
4060def warn_var_deref_requires_lock_precise :
4061  Warning<warn_var_deref_requires_lock.Summary>,
4062  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
4063def warn_fun_requires_lock_precise :
4064  Warning<warn_fun_requires_lock.Summary>,
4065  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
4066def note_found_mutex_near_match : Note<"found near match '%0'">;
4067
4068// Verbose thread safety warnings
4069def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
4070  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
4071def note_thread_warning_in_fun : Note<"thread warning in function %0">;
4072def note_guarded_by_declared_here : Note<"guarded_by declared here">;
4073
4074// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
4075def warn_thread_safety_beta : Warning<"thread safety beta warning">,
4076  InGroup<ThreadSafetyBeta>, DefaultIgnore;
4077
4078// Consumed warnings
4079def warn_use_in_invalid_state : Warning<
4080  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
4081  "state">, InGroup<Consumed>, DefaultIgnore;
4082def warn_use_of_temp_in_invalid_state : Warning<
4083  "invalid invocation of method '%0' on a temporary object while it is in the "
4084  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
4085def warn_attr_on_unconsumable_class : Warning<
4086  "consumed analysis attribute is attached to member of class %0 which isn't "
4087  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
4088def warn_return_typestate_for_unconsumable_type : Warning<
4089  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
4090  DefaultIgnore;
4091def warn_return_typestate_mismatch : Warning<
4092  "return value not in expected state; expected '%0', observed '%1'">,
4093  InGroup<Consumed>, DefaultIgnore;
4094def warn_loop_state_mismatch : Warning<
4095  "state of variable '%0' must match at the entry and exit of loop">,
4096  InGroup<Consumed>, DefaultIgnore;
4097def warn_param_return_typestate_mismatch : Warning<
4098  "parameter '%0' not in expected state when the function returns: expected "
4099  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
4100def warn_param_typestate_mismatch : Warning<
4101  "argument not in expected state; expected '%0', observed '%1'">,
4102  InGroup<Consumed>, DefaultIgnore;
4103
4104// no_sanitize attribute
4105def warn_unknown_sanitizer_ignored : Warning<
4106  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
4107
4108def warn_impcast_vector_scalar : Warning<
4109  "implicit conversion turns vector to scalar: %0 to %1">,
4110  InGroup<Conversion>, DefaultIgnore;
4111def warn_impcast_complex_scalar : Warning<
4112  "implicit conversion discards imaginary component: %0 to %1">,
4113  InGroup<Conversion>, DefaultIgnore;
4114def err_impcast_complex_scalar : Error<
4115  "implicit conversion from %0 to %1 is not permitted in C++">;
4116def warn_impcast_float_precision : Warning<
4117  "implicit conversion loses floating-point precision: %0 to %1">,
4118  InGroup<ImplicitFloatConversion>, DefaultIgnore;
4119def warn_impcast_float_result_precision : Warning<
4120  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
4121  InGroup<ImplicitFloatConversion>, DefaultIgnore;
4122def warn_impcast_double_promotion : Warning<
4123  "implicit conversion increases floating-point precision: %0 to %1">,
4124  InGroup<DoublePromotion>, DefaultIgnore;
4125def warn_impcast_integer_sign : Warning<
4126  "implicit conversion changes signedness: %0 to %1">,
4127  InGroup<SignConversion>, DefaultIgnore;
4128def warn_impcast_integer_sign_conditional : Warning<
4129  "operand of ? changes signedness: %0 to %1">,
4130  InGroup<SignConversion>, DefaultIgnore;
4131def warn_impcast_integer_precision : Warning<
4132  "implicit conversion loses integer precision: %0 to %1">,
4133  InGroup<ImplicitIntConversion>, DefaultIgnore;
4134def warn_impcast_high_order_zero_bits : Warning<
4135  "higher order bits are zeroes after implicit conversion">,
4136  InGroup<ImplicitIntConversion>, DefaultIgnore;
4137def warn_impcast_nonnegative_result : Warning<
4138  "the resulting value is always non-negative after implicit conversion">,
4139  InGroup<SignConversion>, DefaultIgnore;
4140def warn_impcast_integer_64_32 : Warning<
4141  "implicit conversion loses integer precision: %0 to %1">,
4142  InGroup<Shorten64To32>, DefaultIgnore;
4143def warn_impcast_integer_precision_constant : Warning<
4144  "implicit conversion from %2 to %3 changes value from %0 to %1">,
4145  InGroup<ConstantConversion>;
4146def warn_impcast_single_bit_bitield_precision_constant : Warning<
4147  "implicit truncation from %2 to a one-bit wide bit-field changes value from "
4148  "%0 to %1">, InGroup<SingleBitBitFieldConstantConversion>;
4149def warn_impcast_bitfield_precision_constant : Warning<
4150  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
4151  InGroup<BitFieldConstantConversion>;
4152def warn_impcast_constant_value_to_objc_bool : Warning<
4153  "implicit conversion from constant value %0 to 'BOOL'; "
4154  "the only well defined values for 'BOOL' are YES and NO">,
4155  InGroup<ObjCBoolConstantConversion>;
4156
4157def warn_impcast_fixed_point_range : Warning<
4158  "implicit conversion from %0 cannot fit within the range of values for %1">,
4159  InGroup<ImplicitFixedPointConversion>;
4160
4161def warn_impcast_literal_float_to_integer : Warning<
4162  "implicit conversion from %0 to %1 changes value from %2 to %3">,
4163  InGroup<LiteralConversion>;
4164def warn_impcast_literal_float_to_integer_out_of_range : Warning<
4165  "implicit conversion of out of range value from %0 to %1 is undefined">,
4166  InGroup<LiteralConversion>;
4167def warn_impcast_float_integer : Warning<
4168  "implicit conversion turns floating-point number into integer: %0 to %1">,
4169  InGroup<FloatConversion>, DefaultIgnore;
4170def warn_impcast_float_to_objc_signed_char_bool : Warning<
4171  "implicit conversion from floating-point type %0 to 'BOOL'">,
4172  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
4173def warn_impcast_int_to_objc_signed_char_bool : Warning<
4174  "implicit conversion from integral type %0 to 'BOOL'">,
4175  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
4176
4177// Implicit int -> float conversion precision loss warnings.
4178def warn_impcast_integer_float_precision : Warning<
4179  "implicit conversion from %0 to %1 may lose precision">,
4180  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
4181def warn_impcast_integer_float_precision_constant : Warning<
4182  "implicit conversion from %2 to %3 changes value from %0 to %1">,
4183  InGroup<ImplicitConstIntFloatConversion>;
4184
4185def warn_impcast_float_to_integer : Warning<
4186  "implicit conversion from %0 to %1 changes value from %2 to %3">,
4187  InGroup<FloatOverflowConversion>, DefaultIgnore;
4188def warn_impcast_float_to_integer_out_of_range : Warning<
4189  "implicit conversion of out of range value from %0 to %1 is undefined">,
4190  InGroup<FloatOverflowConversion>, DefaultIgnore;
4191def warn_impcast_float_to_integer_zero : Warning<
4192  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
4193  InGroup<FloatZeroConversion>, DefaultIgnore;
4194
4195def warn_impcast_string_literal_to_bool : Warning<
4196  "implicit conversion turns string literal into bool: %0 to %1">,
4197  InGroup<StringConversion>, DefaultIgnore;
4198def warn_impcast_different_enum_types : Warning<
4199  "implicit conversion from enumeration type %0 to different enumeration type "
4200  "%1">, InGroup<EnumConversion>;
4201def warn_impcast_bool_to_null_pointer : Warning<
4202    "initialization of pointer of type %0 to null from a constant boolean "
4203    "expression">, InGroup<BoolConversion>;
4204def warn_non_literal_null_pointer : Warning<
4205    "expression which evaluates to zero treated as a null pointer constant of "
4206    "type %0">, InGroup<NonLiteralNullConversion>;
4207def warn_pointer_compare : Warning<
4208    "comparing a pointer to a null character constant; did you mean "
4209    "to compare to %select{NULL|(void *)0}0?">,
4210    InGroup<DiagGroup<"pointer-compare">>;
4211def warn_impcast_null_pointer_to_integer : Warning<
4212    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
4213    InGroup<NullConversion>;
4214def warn_impcast_floating_point_to_bool : Warning<
4215    "implicit conversion turns floating-point number into bool: %0 to %1">,
4216    InGroup<ImplicitConversionFloatingPointToBool>;
4217def ext_ms_impcast_fn_obj : ExtWarn<
4218  "implicit conversion between pointer-to-function and pointer-to-object is a "
4219  "Microsoft extension">, InGroup<MicrosoftCast>;
4220
4221def warn_impcast_pointer_to_bool : Warning<
4222    "address of %select{'%1'|function '%1'|array '%1'|lambda function pointer "
4223    "conversion operator}0 will always evaluate to 'true'">,
4224    InGroup<PointerBoolConversion>;
4225def warn_cast_nonnull_to_bool : Warning<
4226    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
4227    "'true' on first encounter">,
4228    InGroup<PointerBoolConversion>;
4229def warn_this_bool_conversion : Warning<
4230  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
4231  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
4232def warn_address_of_reference_bool_conversion : Warning<
4233  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
4234  "code; pointer may be assumed to always convert to true">,
4235  InGroup<UndefinedBoolConversion>;
4236
4237def warn_xor_used_as_pow : Warning<
4238  "result of '%0' is %1; did you mean exponentiation?">,
4239  InGroup<XorUsedAsPow>;
4240def warn_xor_used_as_pow_base_extra : Warning<
4241  "result of '%0' is %1; did you mean '%2' (%3)?">,
4242  InGroup<XorUsedAsPow>;
4243def warn_xor_used_as_pow_base : Warning<
4244  "result of '%0' is %1; did you mean '%2'?">,
4245  InGroup<XorUsedAsPow>;
4246def note_xor_used_as_pow_silence : Note<
4247  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
4248
4249def warn_null_pointer_compare : Warning<
4250    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
4251    "equal to a null pointer is always %select{true|false}2">,
4252    InGroup<TautologicalPointerCompare>;
4253def warn_nonnull_expr_compare : Warning<
4254    "comparison of nonnull %select{function call|parameter}0 '%1' "
4255    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
4256    "encounter">,
4257    InGroup<TautologicalPointerCompare>;
4258def warn_this_null_compare : Warning<
4259  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
4260  "assumed to always evaluate to %select{true|false}0">,
4261  InGroup<TautologicalUndefinedCompare>;
4262def warn_address_of_reference_null_compare : Warning<
4263  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
4264  "code; comparison may be assumed to always evaluate to "
4265  "%select{true|false}0">,
4266  InGroup<TautologicalUndefinedCompare>;
4267def note_reference_is_return_value : Note<"%0 returns a reference">;
4268
4269def note_pointer_declared_here : Note<
4270  "pointer %0 declared here">;
4271def warn_division_sizeof_ptr : Warning<
4272  "'%0' will return the size of the pointer, not the array itself">,
4273  InGroup<DiagGroup<"sizeof-pointer-div">>;
4274def warn_division_sizeof_array : Warning<
4275  "expression does not compute the number of elements in this array; element "
4276  "type is %0, not %1">,
4277  InGroup<DiagGroup<"sizeof-array-div">>;
4278
4279def note_function_warning_silence : Note<
4280    "prefix with the address-of operator to silence this warning">;
4281def note_function_to_function_call : Note<
4282    "suffix with parentheses to turn this into a function call">;
4283def warn_impcast_objective_c_literal_to_bool : Warning<
4284    "implicit boolean conversion of Objective-C object literal always "
4285    "evaluates to true">,
4286    InGroup<ObjCLiteralConversion>;
4287
4288def warn_cast_align : Warning<
4289  "cast from %0 to %1 increases required alignment from %2 to %3">,
4290  InGroup<CastAlign>, DefaultIgnore;
4291def warn_old_style_cast : Warning<
4292  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore,
4293  SuppressInSystemMacro;
4294
4295// Separate between casts to void* and non-void* pointers.
4296// Some APIs use (abuse) void* for something like a user context,
4297// and often that value is an integer even if it isn't a pointer itself.
4298// Having a separate warning flag allows users to control the warning
4299// for their workflow.
4300def warn_int_to_pointer_cast : Warning<
4301  "cast to %1 from smaller integer type %0">,
4302  InGroup<IntToPointerCast>;
4303def warn_int_to_void_pointer_cast : Warning<
4304  "cast to %1 from smaller integer type %0">,
4305  InGroup<IntToVoidPointerCast>;
4306def warn_pointer_to_int_cast : Warning<
4307  "cast to smaller integer type %1 from %0">,
4308  InGroup<PointerToIntCast>;
4309def warn_pointer_to_enum_cast : Warning<
4310  warn_pointer_to_int_cast.Summary>,
4311  InGroup<PointerToEnumCast>;
4312def warn_void_pointer_to_int_cast : Warning<
4313  "cast to smaller integer type %1 from %0">,
4314  InGroup<VoidPointerToIntCast>;
4315def warn_void_pointer_to_enum_cast : Warning<
4316  warn_void_pointer_to_int_cast.Summary>,
4317  InGroup<VoidPointerToEnumCast>;
4318
4319def warn_attribute_ignored_for_field_of_type : Warning<
4320  "%0 attribute ignored for field of type %1">,
4321  InGroup<IgnoredAttributes>;
4322def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
4323  "enums in the Microsoft ABI are signed integers by default; consider giving "
4324  "the enum %0 an unsigned underlying type to make this code portable">,
4325  InGroup<SignedEnumBitfield>, DefaultIgnore;
4326def warn_attribute_packed_for_bitfield : Warning<
4327  "'packed' attribute was ignored on bit-fields with single-byte alignment "
4328  "in older versions of GCC and Clang">,
4329  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
4330def warn_transparent_union_attribute_field_size_align : Warning<
4331  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
4332  "%select{alignment|size}0 of the first field in transparent union; "
4333  "transparent_union attribute ignored">,
4334  InGroup<IgnoredAttributes>;
4335def note_transparent_union_first_field_size_align : Note<
4336  "%select{alignment|size}0 of first field is %1 bits">;
4337def warn_transparent_union_attribute_not_definition : Warning<
4338  "transparent_union attribute can only be applied to a union definition; "
4339  "attribute ignored">,
4340  InGroup<IgnoredAttributes>;
4341def warn_transparent_union_attribute_floating : Warning<
4342  "first field of a transparent union cannot have %select{floating point|"
4343  "vector}0 type %1; transparent_union attribute ignored">,
4344  InGroup<IgnoredAttributes>;
4345def warn_transparent_union_attribute_zero_fields : Warning<
4346  "transparent union definition must contain at least one field; "
4347  "transparent_union attribute ignored">,
4348  InGroup<IgnoredAttributes>;
4349def warn_attribute_type_not_supported : Warning<
4350  "%0 attribute argument not supported: %1">,
4351  InGroup<IgnoredAttributes>;
4352def warn_attribute_type_not_supported_global : Warning<
4353  "%0 attribute argument '%1' not supported on a global variable">,
4354  InGroup<IgnoredAttributes>;
4355def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
4356  InGroup<IgnoredAttributes>;
4357def warn_attribute_protected_visibility :
4358  Warning<"target does not support 'protected' visibility; using 'default'">,
4359  InGroup<DiagGroup<"unsupported-visibility">>;
4360def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
4361def note_previous_attribute : Note<"previous attribute is here">;
4362def note_conflicting_attribute : Note<"conflicting attribute is here">;
4363def note_attribute : Note<"attribute is here">;
4364def err_mismatched_ms_inheritance : Error<
4365  "inheritance model does not match %select{definition|previous declaration}0">;
4366def warn_ignored_ms_inheritance : Warning<
4367  "inheritance model ignored on %select{primary template|partial specialization}0">,
4368  InGroup<IgnoredAttributes>;
4369def note_previous_ms_inheritance : Note<
4370  "previous inheritance model specified here">;
4371def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
4372def err_mode_not_primitive : Error<
4373  "mode attribute only supported for integer and floating-point types">;
4374def err_mode_wrong_type : Error<
4375  "type of machine mode does not match type of base type">;
4376def warn_vector_mode_deprecated : Warning<
4377  "specifying vector types with the 'mode' attribute is deprecated; "
4378  "use the 'vector_size' attribute instead">,
4379  InGroup<DeprecatedAttributes>;
4380def warn_deprecated_noreturn_spelling : Warning<
4381  "the '[[_Noreturn]]' attribute spelling is deprecated in C23; use "
4382  "'[[noreturn]]' instead">, InGroup<DeprecatedAttributes>;
4383def err_complex_mode_vector_type : Error<
4384  "type of machine mode does not support base vector types">;
4385def err_enum_mode_vector_type : Error<
4386  "mode %0 is not supported for enumeration types">;
4387def warn_attribute_nonnull_no_pointers : Warning<
4388  "'nonnull' attribute applied to function with no pointer arguments">,
4389  InGroup<IgnoredAttributes>;
4390def warn_attribute_nonnull_parm_no_args : Warning<
4391  "'nonnull' attribute when used on parameters takes no arguments">,
4392  InGroup<IgnoredAttributes>;
4393def warn_function_stmt_attribute_precedence : Warning<
4394  "statement attribute %0 has higher precedence than function attribute "
4395  "'%select{always_inline|flatten|noinline}1'">,
4396  InGroup<IgnoredAttributes>;
4397def note_declared_nonnull : Note<
4398  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
4399def warn_attribute_sentinel_named_arguments : Warning<
4400  "'sentinel' attribute requires named arguments">,
4401  InGroup<IgnoredAttributes>;
4402def warn_attribute_sentinel_not_variadic : Warning<
4403  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
4404  InGroup<IgnoredAttributes>;
4405def warn_deprecated_ignored_on_using : Warning<
4406  "%0 currently has no effect on a using declaration">,
4407  InGroup<IgnoredAttributes>;
4408def err_attribute_sentinel_less_than_zero : Error<
4409  "'sentinel' parameter 1 less than zero">;
4410def err_attribute_sentinel_not_zero_or_one : Error<
4411  "'sentinel' parameter 2 not 0 or 1">;
4412def warn_cleanup_ext : Warning<
4413  "GCC does not allow the 'cleanup' attribute argument to be anything other "
4414  "than a simple identifier">,
4415  InGroup<GccCompat>;
4416def err_attribute_cleanup_arg_not_function : Error<
4417  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
4418def err_attribute_cleanup_func_must_take_one_arg : Error<
4419  "'cleanup' function %0 must take 1 parameter">;
4420def err_attribute_cleanup_func_arg_incompatible_type : Error<
4421  "'cleanup' function %0 parameter has "
4422  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
4423def err_attribute_regparm_wrong_platform : Error<
4424  "'regparm' is not valid on this platform">;
4425def err_attribute_regparm_invalid_number : Error<
4426  "'regparm' parameter must be between 0 and %0 inclusive">;
4427def err_attribute_not_supported_in_lang : Error<
4428  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
4429def err_attribute_not_supported_on_arch
4430    : Error<"%0 attribute is not supported on '%1'">;
4431def warn_gcc_ignores_type_attr : Warning<
4432  "GCC does not allow the %0 attribute to be written on a type">,
4433  InGroup<GccCompat>;
4434def warn_gcc_requires_variadic_function : Warning<
4435  "GCC requires a function with the %0 attribute to be variadic">,
4436  InGroup<GccCompat>;
4437
4438// Clang-Specific Attributes
4439def warn_attribute_iboutlet : Warning<
4440  "%0 attribute can only be applied to instance variables or properties">,
4441  InGroup<IgnoredAttributes>;
4442def err_iboutletcollection_type : Error<
4443  "invalid type %0 as argument of iboutletcollection attribute">;
4444def err_iboutletcollection_builtintype : Error<
4445  "type argument of iboutletcollection attribute cannot be a builtin type">;
4446def warn_iboutlet_object_type : Warning<
4447  "%select{instance variable|property}2 with %0 attribute must "
4448  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
4449def warn_iboutletcollection_property_assign : Warning<
4450  "IBOutletCollection properties should be copy/strong and not assign">,
4451  InGroup<ObjCInvalidIBOutletProperty>;
4452
4453def err_attribute_overloadable_mismatch : Error<
4454  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
4455def note_attribute_overloadable_prev_overload : Note<
4456  "previous %select{unmarked |}0overload of function is here">;
4457def err_attribute_overloadable_no_prototype : Error<
4458  "'overloadable' function %0 must have a prototype">;
4459def err_attribute_overloadable_multiple_unmarked_overloads : Error<
4460  "at most one overload for a given name may lack the 'overloadable' "
4461  "attribute">;
4462def warn_attribute_no_builtin_invalid_builtin_name : Warning<
4463  "'%0' is not a valid builtin name for %1">,
4464  InGroup<DiagGroup<"invalid-no-builtin-names">>;
4465def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
4466  "empty %0 cannot be composed with named ones">;
4467def err_attribute_no_builtin_on_non_definition : Error<
4468  "%0 attribute is permitted on definitions only">;
4469def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
4470  "%0 attribute has no effect on defaulted or deleted functions">;
4471def warn_ns_attribute_wrong_return_type : Warning<
4472  "%0 attribute only applies to %select{functions|methods|properties}1 that "
4473  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
4474  InGroup<IgnoredAttributes>;
4475def err_ns_attribute_wrong_parameter_type : Error<
4476  "%0 attribute only applies to "
4477  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
4478def warn_ns_attribute_wrong_parameter_type : Warning<
4479  "%0 attribute only applies to "
4480  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
4481  InGroup<IgnoredAttributes>;
4482def warn_objc_requires_super_protocol : Warning<
4483  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
4484  InGroup<DiagGroup<"requires-super-attribute">>;
4485def note_protocol_decl : Note<
4486  "protocol is declared here">;
4487def note_protocol_decl_undefined : Note<
4488  "protocol %0 has no definition">;
4489def err_attribute_preferred_name_arg_invalid : Error<
4490  "argument %0 to 'preferred_name' attribute is not a typedef for "
4491  "a specialization of %1">;
4492def err_attribute_builtin_alias : Error<
4493  "%0 attribute can only be applied to a ARM, HLSL or RISC-V builtin">;
4494
4495// called-once attribute diagnostics.
4496def err_called_once_attribute_wrong_type : Error<
4497  "'called_once' attribute only applies to function-like parameters">;
4498
4499def warn_completion_handler_never_called : Warning<
4500  "%select{|captured }1completion handler is never called">,
4501  InGroup<CompletionHandler>, DefaultIgnore;
4502def warn_called_once_never_called : Warning<
4503  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
4504  InGroup<CalledOnceParameter>;
4505
4506def warn_completion_handler_never_called_when : Warning<
4507  "completion handler is never %select{used|called}1 when "
4508  "%select{taking true branch|taking false branch|"
4509  "handling this case|none of the cases applies|"
4510  "entering the loop|skipping the loop|taking one of the branches}2">,
4511  InGroup<CompletionHandler>, DefaultIgnore;
4512def warn_called_once_never_called_when : Warning<
4513  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
4514  "%select{taking true branch|taking false branch|"
4515  "handling this case|none of the cases applies|"
4516  "entering the loop|skipping the loop|taking one of the branches}2">,
4517  InGroup<CalledOnceParameter>;
4518
4519def warn_completion_handler_called_twice : Warning<
4520  "completion handler is called twice">,
4521  InGroup<CompletionHandler>, DefaultIgnore;
4522def warn_called_once_gets_called_twice : Warning<
4523  "%0 parameter marked 'called_once' is called twice">,
4524  InGroup<CalledOnceParameter>;
4525def note_called_once_gets_called_twice : Note<
4526  "previous call is here%select{; set to nil to indicate "
4527  "it cannot be called afterwards|}0">;
4528
4529// objc_designated_initializer attribute diagnostics.
4530def warn_objc_designated_init_missing_super_call : Warning<
4531  "designated initializer missing a 'super' call to a designated initializer of the super class">,
4532  InGroup<ObjCDesignatedInit>;
4533def note_objc_designated_init_marked_here : Note<
4534  "method marked as designated initializer of the class here">;
4535def warn_objc_designated_init_non_super_designated_init_call : Warning<
4536  "designated initializer should only invoke a designated initializer on 'super'">,
4537  InGroup<ObjCDesignatedInit>;
4538def warn_objc_designated_init_non_designated_init_call : Warning<
4539  "designated initializer invoked a non-designated initializer">,
4540  InGroup<ObjCDesignatedInit>;
4541def warn_objc_secondary_init_super_init_call : Warning<
4542  "convenience initializer should not invoke an initializer on 'super'">,
4543  InGroup<ObjCDesignatedInit>;
4544def warn_objc_secondary_init_missing_init_call : Warning<
4545  "convenience initializer missing a 'self' call to another initializer">,
4546  InGroup<ObjCDesignatedInit>;
4547def warn_objc_implementation_missing_designated_init_override : Warning<
4548  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4549  InGroup<ObjCDesignatedInit>;
4550def err_designated_init_attr_non_init : Error<
4551  "'objc_designated_initializer' attribute only applies to init methods "
4552  "of interface or class extension declarations">;
4553
4554// objc_bridge attribute diagnostics.
4555def err_objc_attr_not_id : Error<
4556  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4557def err_objc_attr_typedef_not_id : Error<
4558  "parameter of %0 attribute must be 'id' when used on a typedef">;
4559def err_objc_attr_typedef_not_void_pointer : Error<
4560  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4561def err_objc_cf_bridged_not_interface : Error<
4562  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4563def err_objc_ns_bridged_invalid_cfobject : Error<
4564  "Objective-C object of type %0 is bridged to %1, which is not valid CF object">;
4565def warn_objc_invalid_bridge : Warning<
4566  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4567def warn_objc_invalid_bridge_to_cf : Warning<
4568  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4569
4570// objc_bridge_related attribute diagnostics.
4571def err_objc_bridged_related_invalid_class : Error<
4572  "could not find Objective-C class %0 to convert %1 to %2">;
4573def err_objc_bridged_related_invalid_class_name : Error<
4574  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4575def err_objc_bridged_related_known_method : Error<
4576 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4577 "method for this conversion">;
4578
4579def err_objc_attr_protocol_requires_definition : Error<
4580  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4581
4582// Swift attributes.
4583def warn_attr_swift_name_function
4584  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4585    InGroup<SwiftNameAttribute>;
4586def warn_attr_swift_name_invalid_identifier
4587  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4588    InGroup<SwiftNameAttribute>;
4589def warn_attr_swift_name_decl_kind
4590  : Warning<"%0 attribute cannot be applied to this declaration">,
4591    InGroup<SwiftNameAttribute>;
4592def warn_attr_swift_name_subscript_invalid_parameter
4593  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4594        "have at least one parameter|"
4595        "have a 'self:' parameter}1">,
4596    InGroup<SwiftNameAttribute>;
4597def warn_attr_swift_name_missing_parameters
4598  : Warning<"%0 attribute is missing parameter label clause">,
4599    InGroup<SwiftNameAttribute>;
4600def warn_attr_swift_name_setter_parameters
4601  : Warning<"%0 attribute for setter must have one parameter for new value">,
4602    InGroup<SwiftNameAttribute>;
4603def warn_attr_swift_name_multiple_selfs
4604  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4605    InGroup<SwiftNameAttribute>;
4606def warn_attr_swift_name_getter_parameters
4607  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4608    InGroup<SwiftNameAttribute>;
4609def warn_attr_swift_name_subscript_setter_no_newValue
4610  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4611    InGroup<SwiftNameAttribute>;
4612def warn_attr_swift_name_subscript_setter_multiple_newValues
4613  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4614    InGroup<SwiftNameAttribute>;
4615def warn_attr_swift_name_subscript_getter_newValue
4616  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4617    InGroup<SwiftNameAttribute>;
4618def warn_attr_swift_name_num_params
4619  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4620            "the %1 attribute (expected %2; got %3)">,
4621    InGroup<SwiftNameAttribute>;
4622def warn_attr_swift_name_decl_missing_params
4623  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4624            "with no parameters">,
4625    InGroup<SwiftNameAttribute>;
4626
4627def err_attr_swift_error_no_error_parameter : Error<
4628  "%0 attribute can only be applied to a %select{function|method}1 with an "
4629  "error parameter">;
4630def err_attr_swift_error_return_type : Error<
4631  "%0 attribute with '%1' convention can only be applied to a "
4632  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4633
4634def err_swift_async_no_access : Error<
4635  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4636  "'not_swift_private'">;
4637def err_swift_async_bad_block_type : Error<
4638  "'swift_async' completion handler parameter must have block type returning"
4639  " 'void', type here is %0">;
4640
4641def err_swift_async_error_without_swift_async : Error<
4642  "%0 attribute must be applied to a %select{function|method}1 annotated "
4643  "with non-'none' attribute 'swift_async'">;
4644def err_swift_async_error_no_error_parameter : Error<
4645  "%0 attribute with 'nonnull_error' convention can only be applied to a "
4646  "%select{function|method}1 with a completion handler with an error "
4647  "parameter">;
4648def err_swift_async_error_non_integral : Error<
4649  "%0 attribute with '%1' convention must have an integral-typed parameter "
4650  "in completion handler at index %2, type here is %3">;
4651
4652def warn_ignored_objc_externally_retained : Warning<
4653  "'objc_externally_retained' can only be applied to local variables "
4654  "%select{of retainable type|with strong ownership}0">,
4655  InGroup<IgnoredAttributes>;
4656
4657// Function Parameter Semantic Analysis.
4658def err_param_with_void_type : Error<"argument may not have 'void' type">;
4659def err_void_only_param : Error<
4660  "'void' must be the first and only parameter if specified">;
4661def err_void_param_qualified : Error<
4662  "'void' as parameter must not have type qualifiers">;
4663def err_ident_list_in_fn_declaration : Error<
4664  "a parameter list without types is only allowed in a function definition">;
4665def ext_param_not_declared : ExtWarn<
4666  "parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not "
4667  "support implicit int">, InGroup<ImplicitInt>;
4668def err_param_default_argument : Error<
4669  "C does not support default arguments">;
4670def err_param_default_argument_redefinition : Error<
4671  "redefinition of default argument">;
4672def ext_param_default_argument_redefinition : ExtWarn<
4673  err_param_default_argument_redefinition.Summary>,
4674  InGroup<MicrosoftDefaultArgRedefinition>;
4675def err_param_default_argument_missing : Error<
4676  "missing default argument on parameter">;
4677def err_param_default_argument_missing_name : Error<
4678  "missing default argument on parameter %0">;
4679def err_param_default_argument_references_param : Error<
4680  "default argument references parameter %0">;
4681def err_param_default_argument_references_local : Error<
4682  "default argument references local variable %0 of enclosing function">;
4683def err_param_default_argument_references_this : Error<
4684  "default argument references 'this'">;
4685def err_param_default_argument_nonfunc : Error<
4686  "default arguments can only be specified for parameters in a function "
4687  "declaration">;
4688def err_param_default_argument_template_redecl : Error<
4689  "default arguments cannot be added to a function template that has already "
4690  "been declared">;
4691def err_param_default_argument_member_template_redecl : Error<
4692  "default arguments cannot be added to an out-of-line definition of a member "
4693  "of a %select{class template|class template partial specialization|nested "
4694  "class in a template}0">;
4695def err_param_default_argument_on_parameter_pack : Error<
4696  "parameter pack cannot have a default argument">;
4697def err_uninitialized_member_for_assign : Error<
4698  "cannot define the implicit copy assignment operator for %0, because "
4699  "non-static %select{reference|const}1 member %2 cannot use copy "
4700  "assignment operator">;
4701def err_uninitialized_member_in_ctor : Error<
4702  "%select{constructor for %1|"
4703  "implicit default constructor for %1|"
4704  "cannot use constructor inherited from %1:}0 must explicitly "
4705  "initialize the %select{reference|const}2 member %3">;
4706def err_default_arg_makes_ctor_special : Error<
4707  "addition of default argument on redeclaration makes this constructor a "
4708  "%select{default|copy|move}0 constructor">;
4709def err_stmt_expr_in_default_arg : Error<
4710  "default %select{argument|non-type template argument}0 may not use a GNU "
4711  "statement expression">;
4712
4713def err_use_of_default_argument_to_function_declared_later : Error<
4714  "use of default argument to function %0 that is declared later in class %1">;
4715def note_default_argument_declared_here : Note<
4716  "default argument declared here">;
4717def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4718def note_recursive_default_argument_used_here : Note<
4719  "default argument used here">;
4720
4721def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4722  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4723  "parameter type $|promoted type of K&R function parameter is not compatible "
4724  "with parameter type}0,1 declared in a previous prototype">,
4725  InGroup<KNRPromotedParameter>;
4726
4727
4728// C++ Overloading Semantic Analysis.
4729def err_ovl_diff_return_type : Error<
4730  "functions that differ only in their return type cannot be overloaded">;
4731def err_ovl_static_nonstatic_member : Error<
4732  "static and non-static member functions with the same parameter types "
4733  "cannot be overloaded">;
4734
4735let Deferrable = 1 in {
4736
4737def err_ovl_no_viable_function_in_call : Error<
4738  "no matching function for call to %0">;
4739def err_ovl_no_viable_member_function_in_call : Error<
4740  "no matching member function for call to %0">;
4741def err_ovl_ambiguous_call : Error<
4742  "call to %0 is ambiguous">;
4743def err_ovl_deleted_call : Error<"call to deleted"
4744  "%select{| member}0 function %1%select{|: %3}2">;
4745def err_ovl_ambiguous_member_call : Error<
4746  "call to member function %0 is ambiguous">;
4747def note_ovl_too_many_candidates : Note<
4748    "remaining %0 candidate%s0 omitted; "
4749    "pass -fshow-overloads=all to show them">;
4750
4751def select_ovl_candidate_kind : TextSubstitution<
4752  "%select{function|function|function (with reversed parameter order)|"
4753    "constructor|"
4754    "constructor (the implicit default constructor)|"
4755    "constructor (the implicit copy constructor)|"
4756    "constructor (the implicit move constructor)|"
4757    "function (the implicit copy assignment operator)|"
4758    "function (the implicit move assignment operator)|"
4759    "function (the implicit 'operator==' for this 'operator<=>)'|"
4760    "inherited constructor}0%select{| template| %2}1">;
4761
4762def note_ovl_candidate : Note<
4763    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4764    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4765    "| has different number of parameters (expected %5 but has %6)"
4766    "| has type mismatch at %ordinal5 parameter"
4767    "%diff{ (expected $ but has $)|}6,7"
4768    "| has different return type%diff{ ($ expected but has $)|}5,6"
4769    "| has different qualifiers (expected %5 but found %6)"
4770    "| has different exception specification}4">;
4771
4772def note_ovl_candidate_explicit : Note<
4773    "explicit %select{constructor|conversion function|deduction guide}0 "
4774    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4775def note_ovl_candidate_inherited_constructor : Note<
4776    "constructor from base class %0 inherited here">;
4777def note_ovl_candidate_inherited_constructor_slice : Note<
4778    "candidate %select{constructor|template}0 ignored: "
4779    "inherited constructor cannot be used to %select{copy|move}1 object">;
4780def note_ovl_candidate_illegal_constructor : Note<
4781    "candidate %select{constructor|template}0 ignored: "
4782    "instantiation %select{takes|would take}0 its own class type by value">;
4783def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4784    "candidate constructor ignored: cannot be used to construct an object "
4785    "in address space %0">;
4786def note_ovl_candidate_bad_deduction : Note<
4787    "candidate template ignored: failed template argument deduction">;
4788def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4789    "couldn't infer template argument %0">;
4790def note_ovl_candidate_incomplete_deduction_pack : Note<
4791    "candidate template ignored: "
4792    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4793    "expanded parameter in deduced argument pack %2">;
4794def note_ovl_candidate_inconsistent_deduction : Note<
4795    "candidate template ignored: deduced %select{conflicting types|"
4796    "conflicting values|conflicting templates|packs of different lengths}0 "
4797    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4798def note_ovl_candidate_inconsistent_deduction_types : Note<
4799    "candidate template ignored: deduced values %diff{"
4800    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4801    "%1 and %3 of conflicting types for parameter %0}2,4">;
4802def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4803    "candidate template ignored: invalid explicitly-specified argument "
4804    "for template parameter %0">;
4805def note_ovl_candidate_unsatisfied_constraints : Note<
4806    "candidate template ignored: constraints not satisfied%0">;
4807def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4808    "candidate template ignored: invalid explicitly-specified argument "
4809    "for %ordinal0 template parameter">;
4810def note_ovl_candidate_instantiation_depth : Note<
4811    "candidate template ignored: substitution exceeded maximum template "
4812    "instantiation depth">;
4813def note_ovl_candidate_underqualified : Note<
4814    "candidate template ignored: cannot deduce a type for %0 that would "
4815    "make %2 equal %1">;
4816def note_ovl_candidate_substitution_failure : Note<
4817    "candidate template ignored: substitution failure%0%1">;
4818def note_ovl_candidate_disabled_by_enable_if : Note<
4819    "candidate template ignored: disabled by %0%1">;
4820def note_ovl_candidate_disabled_by_requirement : Note<
4821    "candidate template ignored: requirement '%0' was not satisfied%1">;
4822def note_ovl_candidate_has_pass_object_size_params: Note<
4823    "candidate address cannot be taken because parameter %0 has "
4824    "pass_object_size attribute">;
4825def err_diagnose_if_succeeded : Error<"%0">;
4826def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4827    ShowInSystemHeader;
4828def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4829    "candidate disabled: %0">;
4830def err_addrof_function_disabled_by_enable_if_attr : Error<
4831    "cannot take address of function %0 because it has one or more "
4832    "non-tautological enable_if conditions">;
4833def err_addrof_function_constraints_not_satisfied : Error<
4834    "cannot take address of function %0 because its constraints are not "
4835    "satisfied">;
4836def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4837    "candidate function made ineligible by enable_if">;
4838def note_ovl_candidate_deduced_mismatch : Note<
4839    "candidate template ignored: deduced type "
4840    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4841    "adjusted type $ of %select{|element of }4argument"
4842    "|of %select{|element of }4%ordinal0 parameter does not match "
4843    "adjusted type of %select{|element of }4argument}1,2%3">;
4844def note_ovl_candidate_non_deduced_mismatch : Note<
4845    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4846// This note is needed because the above note would sometimes print two
4847// different types with the same name.  Remove this note when the above note
4848// can handle that case properly.
4849def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4850    "candidate template ignored: could not match %q0 against %q1">;
4851
4852// Note that we don't treat templates differently for this diagnostic.
4853def note_ovl_candidate_arity : Note<"candidate "
4854    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4855    "requires%select{ at least| at most|}3 %4 "
4856    "%select{|non-object }6argument%s4, but %5 "
4857    "%plural{1:was|:were}5 provided">;
4858
4859def note_ovl_candidate_arity_one : Note<"candidate "
4860    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4861    "%select{requires at least|allows at most single|requires single}3 "
4862    "%select{|non-object }6"
4863    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4864
4865def note_ovl_candidate_deleted : Note<
4866    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4867    "%select{explicitly made unavailable|explicitly deleted|"
4868    "implicitly deleted}3">;
4869
4870// Giving the index of the bad argument really clutters this message, and
4871// it's relatively unimportant because 1) it's generally obvious which
4872// argument(s) are of the given object type and 2) the fix is usually
4873// to complete the type, which doesn't involve changes to the call line
4874// anyway.  If people complain, we can change it.
4875def note_ovl_candidate_bad_conv_incomplete : Note<
4876    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4877    "cannot convert argument of incomplete type "
4878    "%diff{$ to $|to parameter type}3,4 for "
4879    "%select{%ordinal6 argument|object argument}5"
4880    "%select{|; dereference the argument with *|"
4881    "; take the address of the argument with &|"
4882    "; remove *|"
4883    "; remove &}7">;
4884def note_ovl_candidate_bad_list_argument : Note<
4885    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4886    "%select{cannot convert initializer list|too few initializers in list"
4887    "|too many initializers in list}7 argument to %4">;
4888def note_ovl_candidate_bad_overload : Note<
4889    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4890    "no overload of %4 matching %3 for %ordinal5 argument">;
4891def note_ovl_candidate_bad_conv : Note<
4892    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4893    "no known conversion "
4894    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4895    "%select{%ordinal6 argument|object argument}5"
4896    "%select{|; dereference the argument with *|"
4897    "; take the address of the argument with &|"
4898    "; remove *|"
4899    "; remove &}7">;
4900def note_ovl_candidate_bad_arc_conv : Note<
4901    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4902    "cannot implicitly convert argument "
4903    "%diff{of type $ to $|type to parameter type}3,4 for "
4904    "%select{%ordinal6 argument|object argument}5 under ARC">;
4905def note_ovl_candidate_bad_value_category : Note<
4906    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4907    "expects an %select{lvalue|rvalue}5 for "
4908    "%select{%ordinal4 argument|object argument}3">;
4909def note_ovl_candidate_bad_addrspace : Note<
4910    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4911    "cannot %select{pass pointer to|bind reference in}5 %3 "
4912    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4913    "argument">;
4914def note_ovl_candidate_bad_addrspace_this : Note<
4915    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4916    "'this' object is in %3, but method expects object in %4">;
4917def note_ovl_candidate_bad_gc : Note<
4918    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4919    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4920    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4921def note_ovl_candidate_bad_ownership : Note<
4922    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4923    "%select{%ordinal7|'this'}6 argument (%3) has "
4924    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4925    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4926    "__autoreleasing}5 ownership">;
4927def note_ovl_candidate_bad_cvr_this : Note<
4928    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4929    "'this' argument has type %3, but method is not marked "
4930    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4931    "volatile or restrict|const, volatile, or restrict}4">;
4932def note_ovl_candidate_bad_cvr : Note<
4933    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4934    "%ordinal5 argument (%3) would lose "
4935    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4936    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4937    "%select{||s||s|s|s}4">;
4938def note_ovl_candidate_bad_base_to_derived_conv : Note<
4939    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4940    "cannot %select{convert from|convert from|bind}3 "
4941    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4942    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4943    "%ordinal6 argument">;
4944def note_ovl_candidate_bad_target : Note<
4945    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4946    "call to "
4947    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4948    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4949def note_ovl_candidate_constraints_not_satisfied : Note<
4950    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4951    "not satisfied">;
4952def note_ovl_surrogate_constraints_not_satisfied : Note<
4953    "conversion candidate %0 not viable: constraints not satisfied">;
4954def note_implicit_member_target_infer_collision : Note<
4955    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4956    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4957    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4958
4959def note_ambiguous_type_conversion: Note<
4960    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4961def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4962def err_ovl_no_viable_function_in_init : Error<
4963  "no matching constructor for initialization of %0">;
4964def err_ovl_no_conversion_in_cast : Error<
4965  "cannot convert %1 to %2 without a conversion operator">;
4966def err_ovl_no_viable_conversion_in_cast : Error<
4967  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4968  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4969def err_ovl_ambiguous_conversion_in_cast : Error<
4970  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4971  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4972def err_ovl_deleted_conversion_in_cast : Error<
4973  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4974  "functional-style cast|}0 from %1 to %2 uses deleted function%select{|: %4}3">;
4975def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4976def err_ref_init_ambiguous : Error<
4977  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4978def err_ovl_deleted_init : Error<
4979  "call to deleted constructor of %0%select{|: %2}1">;
4980def err_ovl_deleted_special_init : Error<
4981  "call to implicitly-deleted %select{default constructor|copy constructor|"
4982  "move constructor|copy assignment operator|move assignment operator|"
4983  "destructor|function}0 of %1">;
4984def err_ovl_ambiguous_oper_unary : Error<
4985  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4986def err_ovl_ambiguous_oper_binary : Error<
4987  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4988def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4989  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4990  "and %2) to be ambiguous despite there being a unique best viable function"
4991  "%select{ with non-reversed arguments|}3">,
4992  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4993def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4994  "ambiguity is between a regular call to this operator and a call with the "
4995  "argument order reversed">;
4996def note_ovl_ambiguous_eqeq_reversed_self_non_const : Note<
4997  "mark 'operator==' as const or add a matching 'operator!=' to resolve the ambiguity">;
4998def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4999  "candidate function with non-reversed arguments">;
5000def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
5001  "ambiguous candidate function with reversed arguments">;
5002def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
5003def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
5004def err_ovl_deleted_oper : Error<
5005  "overload resolution selected deleted operator '%0'%select{|: %2}1">;
5006def err_ovl_deleted_special_oper : Error<
5007  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
5008  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
5009  "implicitly deleted">;
5010def err_ovl_deleted_comparison : Error<
5011  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
5012def err_ovl_rewrite_equalequal_not_bool : Error<
5013  "return type %0 of selected 'operator==' function for rewritten "
5014  "'%1' comparison is not 'bool'">;
5015def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
5016  "ISO C++20 requires return type of selected 'operator==' function for "
5017  "rewritten '%1' comparison to be 'bool', not %0">,
5018  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
5019def err_ovl_no_viable_subscript :
5020    Error<"no viable overloaded operator[] for type %0">;
5021def err_ovl_no_oper :
5022    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
5023def err_ovl_unresolvable : Error<
5024  "reference to %select{overloaded|multiversioned}1 function could not be "
5025  "resolved; did you mean to call it%select{| with no arguments}0?">;
5026def err_bound_member_function : Error<
5027  "reference to non-static member function must be called"
5028  "%select{|; did you mean to call it with no arguments?}0">;
5029def note_possible_target_of_call : Note<"possible target for call">;
5030def err_no_viable_destructor : Error<
5031  "no viable destructor found for class %0">;
5032def err_ambiguous_destructor : Error<
5033  "destructor of class %0 is ambiguous">;
5034
5035def err_ovl_no_viable_object_call : Error<
5036  "no matching function for call to object of type %0">;
5037def err_ovl_ambiguous_object_call : Error<
5038  "call to object of type %0 is ambiguous">;
5039def err_ovl_ambiguous_subscript_call : Error<
5040  "call to subscript operator of type %0 is ambiguous">;
5041def err_ovl_deleted_object_call : Error<
5042  "call to deleted function call operator in type %0%select{|: %2}1">;
5043def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
5044def err_member_call_without_object : Error<
5045  "call to %select{non-static|explicit}0 member function without an object argument">;
5046
5047// C++ Address of Overloaded Function
5048def err_addr_ovl_no_viable : Error<
5049  "address of overloaded function %0 does not match required type %1">;
5050def err_addr_ovl_ambiguous : Error<
5051  "address of overloaded function %0 is ambiguous">;
5052def err_addr_ovl_not_func_ptrref : Error<
5053  "address of overloaded function %0 cannot be converted to type %1">;
5054def err_addr_ovl_no_qualifier : Error<
5055  "cannot form member pointer of type %0 without '&' and class name">;
5056
5057} // let Deferrable
5058
5059// C++11 Literal Operators
5060def err_ovl_no_viable_literal_operator : Error<
5061  "no matching literal operator for call to %0"
5062  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
5063  "%select{| or 'const char *'}4"
5064  "%select{|, and no matching literal operator template}5">;
5065
5066// C++ Template Declarations
5067def err_template_param_shadow : Error<
5068  "declaration of %0 shadows template parameter">;
5069def ext_template_param_shadow : ExtWarn<
5070  err_template_param_shadow.Summary>, InGroup<MicrosoftTemplateShadow>;
5071def ext_compat_template_param_shadow : ExtWarn<
5072  err_template_param_shadow.Summary>, InGroup<
5073  DiagGroup<"strict-primary-template-shadow">>, DefaultError;
5074def note_template_param_here : Note<"template parameter is declared here">;
5075def note_template_param_external : Note<
5076  "template parameter from hidden source: %0">;
5077def warn_template_export_unsupported : Warning<
5078  "exported templates are unsupported">;
5079def err_template_outside_namespace_or_class_scope : Error<
5080  "templates can only be declared in namespace or class scope">;
5081def err_template_inside_local_class : Error<
5082  "templates cannot be declared inside of a local class">;
5083def err_template_linkage : Error<"templates must have C++ linkage">;
5084def err_template_typedef : Error<"a typedef cannot be a template">;
5085def err_template_unnamed_class : Error<
5086  "cannot declare a class template with no name">;
5087def err_template_param_list_different_arity : Error<
5088  "%select{too few|too many}0 template parameters in template "
5089  "%select{|template parameter }1redeclaration">;
5090def note_template_param_list_different_arity : Note<
5091  "%select{too few|too many}0 template parameters in template template "
5092  "argument">;
5093def note_template_prev_declaration : Note<
5094  "previous template %select{declaration|template parameter}0 is here">;
5095def err_template_param_different_kind : Error<
5096  "template parameter has a different kind in template "
5097  "%select{|template parameter }0redeclaration">;
5098def note_template_param_different_kind : Note<
5099  "template parameter has a different kind in template argument">;
5100
5101def err_invalid_decl_specifier_in_nontype_parm : Error<
5102  "invalid declaration specifier in template non-type parameter">;
5103
5104def err_template_nontype_parm_different_type : Error<
5105  "template non-type parameter has a different type %0 in template "
5106  "%select{|template parameter }1redeclaration">;
5107
5108def note_template_nontype_parm_different_type : Note<
5109  "template non-type parameter has a different type %0 in template argument">;
5110def note_template_nontype_parm_prev_declaration : Note<
5111  "previous non-type template parameter with type %0 is here">;
5112def err_template_nontype_parm_bad_type : Error<
5113  "a non-type template parameter cannot have type %0">;
5114def err_template_nontype_parm_bad_structural_type : Error<
5115  "a non-type template parameter cannot have type %0 before C++20">;
5116def err_template_nontype_parm_incomplete : Error<
5117  "non-type template parameter has incomplete type %0">;
5118def err_template_nontype_parm_not_literal : Error<
5119  "non-type template parameter has non-literal type %0">;
5120def err_template_nontype_parm_rvalue_ref : Error<
5121  "non-type template parameter has rvalue reference type %0">;
5122def err_template_nontype_parm_not_structural : Error<
5123  "type %0 of non-type template parameter is not a structural type">;
5124def note_not_structural_non_public : Note<
5125  "%0 is not a structural type because it has a "
5126  "%select{non-static data member|base class}1 that is not public">;
5127def note_not_structural_mutable_field : Note<
5128  "%0 is not a structural type because it has a mutable "
5129  "non-static data member">;
5130def note_not_structural_rvalue_ref_field : Note<
5131  "%0 is not a structural type because it has a non-static data member "
5132  "of rvalue reference type">;
5133def note_not_structural_subobject : Note<
5134  "%0 is not a structural type because it has a "
5135  "%select{non-static data member|base class}1 of non-structural type %2">;
5136def warn_cxx17_compat_template_nontype_parm_type : Warning<
5137  "non-type template parameter of type %0 is incompatible with "
5138  "C++ standards before C++20">,
5139  DefaultIgnore, InGroup<CXXPre20Compat>;
5140def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
5141  "non-type template parameters declared with %0 are incompatible with C++ "
5142  "standards before C++17">,
5143  DefaultIgnore, InGroup<CXXPre17Compat>;
5144def err_template_param_default_arg_redefinition : Error<
5145  "template parameter redefines default argument">;
5146def err_template_param_default_arg_inconsistent_redefinition : Error<
5147  "template parameter default argument is inconsistent with previous definition">;
5148def note_template_param_prev_default_arg : Note<
5149  "previous default template argument defined here">;
5150def note_template_param_prev_default_arg_in_other_module : Note<
5151  "previous default template argument defined in module %0">;
5152def err_template_param_default_arg_missing : Error<
5153  "template parameter missing a default argument">;
5154def ext_template_parameter_default_in_function_template : ExtWarn<
5155  "default template arguments for a function template are a C++11 extension">,
5156  InGroup<CXX11>;
5157def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
5158  "default template arguments for a function template are incompatible with C++98">,
5159  InGroup<CXX98Compat>, DefaultIgnore;
5160def err_template_parameter_default_template_member : Error<
5161  "cannot add a default template argument to the definition of a member of a "
5162  "class template">;
5163def err_template_parameter_default_friend_template : Error<
5164  "default template argument not permitted on a friend template">;
5165def err_template_template_parm_no_parms : Error<
5166  "template template parameter must have its own template parameters">;
5167
5168def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
5169  InGroup<CXX14>;
5170def warn_cxx11_compat_variable_template : Warning<
5171  "variable templates are incompatible with C++ standards before C++14">,
5172  InGroup<CXXPre14Compat>, DefaultIgnore;
5173def err_template_variable_noparams : Error<
5174  "extraneous 'template<>' in declaration of variable %0">;
5175def err_template_member : Error<"member %0 declared as a template">;
5176def err_member_with_template_arguments : Error<"member %0 cannot have template arguments">;
5177def err_template_member_noparams : Error<
5178  "extraneous 'template<>' in declaration of member %0">;
5179def err_template_tag_noparams : Error<
5180  "extraneous 'template<>' in declaration of %0 %1">;
5181
5182def warn_cxx17_compat_adl_only_template_id : Warning<
5183  "use of function template name with no prior function template "
5184  "declaration in function call with explicit template arguments "
5185  "is incompatible with C++ standards before C++20">,
5186  InGroup<CXXPre20Compat>, DefaultIgnore;
5187def ext_adl_only_template_id : ExtWarn<
5188  "use of function template name with no prior declaration in function call "
5189  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
5190
5191def warn_unqualified_call_to_std_cast_function : Warning<
5192  "unqualified call to '%0'">, InGroup<DiagGroup<"unqualified-std-cast-call">>;
5193
5194// C++ Template Argument Lists
5195def err_template_missing_args : Error<
5196  "use of "
5197  "%select{class template|function template|variable template|alias template|"
5198  "template template parameter|concept|template}0 %1 requires template "
5199  "arguments">;
5200def err_template_arg_list_different_arity : Error<
5201  "%select{too few|too many}0 template arguments for "
5202  "%select{class template|function template|variable template|alias template|"
5203  "template template parameter|concept|template}1 %2">;
5204def note_template_decl_here : Note<"template is declared here">;
5205def note_template_decl_external : Note<
5206  "template declaration from hidden source: %0">;
5207def err_template_arg_must_be_type : Error<
5208  "template argument for template type parameter must be a type">;
5209def err_template_arg_must_be_type_suggest : Error<
5210  "template argument for template type parameter must be a type; "
5211  "did you forget 'typename'?">;
5212def ext_ms_template_type_arg_missing_typename : ExtWarn<
5213  "template argument for template type parameter must be a type; "
5214  "omitted 'typename' is a Microsoft extension">,
5215  InGroup<MicrosoftTemplate>;
5216def err_template_arg_must_be_expr : Error<
5217  "template argument for non-type template parameter must be an expression">;
5218def err_template_arg_nontype_ambig : Error<
5219  "template argument for non-type template parameter is treated as function type %0">;
5220def err_template_arg_must_be_template : Error<
5221  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
5222def ext_template_arg_local_type : ExtWarn<
5223  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
5224def ext_template_arg_unnamed_type : ExtWarn<
5225  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
5226def warn_cxx98_compat_template_arg_local_type : Warning<
5227  "local type %0 as template argument is incompatible with C++98">,
5228  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
5229def warn_cxx98_compat_template_arg_unnamed_type : Warning<
5230  "unnamed type as template argument is incompatible with C++98">,
5231  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
5232def note_template_unnamed_type_here : Note<
5233  "unnamed type used in template argument was declared here">;
5234def err_template_arg_overload_type : Error<
5235  "template argument is the type of an unresolved overloaded function">;
5236def err_template_arg_not_valid_template : Error<
5237  "template argument does not refer to a class or alias template, or template "
5238  "template parameter">;
5239def note_template_arg_refers_here_func : Note<
5240  "template argument refers to function template %0, here">;
5241def err_template_arg_template_params_mismatch : Error<
5242  "template template argument has different template parameters than its "
5243  "corresponding template template parameter">;
5244def err_template_arg_not_integral_or_enumeral : Error<
5245  "non-type template argument of type %0 must have an integral or enumeration"
5246  " type">;
5247def err_template_arg_not_ice : Error<
5248  "non-type template argument of type %0 is not an integral constant "
5249  "expression">;
5250def err_template_arg_not_address_constant : Error<
5251  "non-type template argument of type %0 is not a constant expression">;
5252def warn_cxx98_compat_template_arg_null : Warning<
5253  "use of null pointer as non-type template argument is incompatible with "
5254  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5255def err_template_arg_untyped_null_constant : Error<
5256  "null non-type template argument must be cast to template parameter type %0">;
5257def err_template_arg_wrongtype_null_constant : Error<
5258  "null non-type template argument of type %0 does not match template parameter "
5259  "of type %1">;
5260def err_non_type_template_parm_type_deduction_failure : Error<
5261  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
5262def err_deduced_non_type_template_arg_type_mismatch : Error<
5263  "deduced non-type template argument does not have the same type as the "
5264  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
5265def err_non_type_template_arg_subobject : Error<
5266  "non-type template argument refers to subobject '%0'">;
5267def err_non_type_template_arg_addr_label_diff : Error<
5268  "template argument / label address difference / what did you expect?">;
5269def err_template_arg_not_convertible : Error<
5270  "non-type template argument of type %0 cannot be converted to a value "
5271  "of type %1">;
5272def warn_template_arg_negative : Warning<
5273  "non-type template argument with value '%0' converted to '%1' for unsigned "
5274  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
5275def warn_template_arg_too_large : Warning<
5276  "non-type template argument value '%0' truncated to '%1' for "
5277  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
5278def err_template_arg_no_ref_bind : Error<
5279  "non-type template parameter of reference type "
5280  "%diff{$ cannot bind to template argument of type $"
5281  "|cannot bind to template of incompatible argument type}0,1">;
5282def err_template_arg_ref_bind_ignores_quals : Error<
5283  "reference binding of non-type template parameter "
5284  "%diff{of type $ to template argument of type $|to template argument}0,1 "
5285  "ignores qualifiers">;
5286def err_template_arg_not_decl_ref : Error<
5287  "non-type template argument does not refer to any declaration">;
5288def err_template_arg_not_address_of : Error<
5289  "non-type template argument for template parameter of pointer type %0 must "
5290  "have its address taken">;
5291def err_template_arg_address_of_non_pointer : Error<
5292  "address taken in non-type template argument for template parameter of "
5293  "reference type %0">;
5294def err_template_arg_reference_var : Error<
5295  "non-type template argument of reference type %0 is not an object">;
5296def err_template_arg_field : Error<
5297  "non-type template argument refers to non-static data member %0">;
5298def err_template_arg_method : Error<
5299  "non-type template argument refers to non-static member function %0">;
5300def err_template_arg_object_no_linkage : Error<
5301  "non-type template argument refers to %select{function|object}0 %1 that "
5302  "does not have linkage">;
5303def warn_cxx98_compat_template_arg_object_internal : Warning<
5304  "non-type template argument referring to %select{function|object}0 %1 with "
5305  "internal linkage is incompatible with C++98">,
5306  InGroup<CXX98Compat>, DefaultIgnore;
5307def ext_template_arg_object_internal : ExtWarn<
5308  "non-type template argument referring to %select{function|object}0 %1 with "
5309  "internal linkage is a C++11 extension">, InGroup<CXX11>;
5310def err_template_arg_thread_local : Error<
5311  "non-type template argument refers to thread-local object">;
5312def note_template_arg_internal_object : Note<
5313  "non-type template argument refers to %select{function|object}0 here">;
5314def note_template_arg_refers_here : Note<
5315  "non-type template argument refers here">;
5316def err_template_arg_not_object_or_func : Error<
5317  "non-type template argument does not refer to an object or function">;
5318def err_template_arg_not_pointer_to_member_form : Error<
5319  "non-type template argument is not a pointer to member constant">;
5320def err_template_arg_invalid : Error<
5321  "non-type template argument '%0' is invalid">;
5322def ext_template_arg_extra_parens : ExtWarn<
5323  "address non-type template argument cannot be surrounded by parentheses">;
5324def warn_cxx98_compat_template_arg_extra_parens : Warning<
5325  "redundant parentheses surrounding address non-type template argument are "
5326  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5327def err_pointer_to_member_type : Error<
5328  "invalid use of pointer to member type after %select{.*|->*}0">;
5329def err_pointer_to_member_call_drops_quals : Error<
5330  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
5331def err_pointer_to_member_oper_value_classify: Error<
5332  "pointer-to-member function type %0 can only be called on an "
5333  "%select{rvalue|lvalue}1">;
5334def ext_pointer_to_const_ref_member_on_rvalue : Extension<
5335  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
5336  InGroup<CXX20>, SFINAEFailure;
5337def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
5338  "invoking a pointer to a 'const &' member function on an rvalue is "
5339  "incompatible with C++ standards before C++20">,
5340  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
5341def ext_ms_deref_template_argument: ExtWarn<
5342  "non-type template argument containing a dereference operation is a "
5343  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5344def ext_ms_delayed_template_argument: ExtWarn<
5345  "using the undeclared type %0 as a default template argument is a "
5346  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5347def err_template_arg_deduced_incomplete_pack : Error<
5348  "deduced incomplete pack %0 for template parameter %1">;
5349
5350// C++ template specialization
5351def err_template_spec_unknown_kind : Error<
5352  "can only provide an explicit specialization for a class template, function "
5353  "template, variable template, or a member function, static data member, "
5354  "%select{or member class|member class, or member enumeration}0 of a "
5355  "class template">;
5356def note_specialized_entity : Note<
5357  "explicitly specialized declaration is here">;
5358def err_template_spec_decl_function_scope : Error<
5359  "explicit specialization of %0 in function scope">;
5360def err_template_spec_decl_friend : Error<
5361  "cannot declare an explicit specialization in a friend">;
5362def err_template_spec_redecl_out_of_scope : Error<
5363  "%select{class template|class template partial|variable template|"
5364  "variable template partial|function template|member "
5365  "function|static data member|member class|member enumeration}0 "
5366  "specialization of %1 not in %select{a namespace enclosing %2|"
5367  "class %2 or an enclosing namespace}3">;
5368def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
5369  "%select{class template|class template partial|variable template|"
5370  "variable template partial|function template|member "
5371  "function|static data member|member class|member enumeration}0 "
5372  "specialization of %1 not in %select{a namespace enclosing %2|"
5373  "class %2 or an enclosing namespace}3 "
5374  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
5375def err_template_spec_redecl_global_scope : Error<
5376  "%select{class template|class template partial|variable template|"
5377  "variable template partial|function template|member "
5378  "function|static data member|member class|member enumeration}0 "
5379  "specialization of %1 must occur at global scope">;
5380def err_spec_member_not_instantiated : Error<
5381  "specialization of member %q0 does not specialize an instantiated member">;
5382def note_specialized_decl : Note<"attempt to specialize declaration here">;
5383def err_specialization_after_instantiation : Error<
5384  "explicit specialization of %0 after instantiation">;
5385def note_instantiation_required_here : Note<
5386  "%select{implicit|explicit}0 instantiation first required here">;
5387def err_template_spec_friend : Error<
5388  "template specialization declaration cannot be a friend">;
5389def err_template_spec_default_arg : Error<
5390  "default argument not permitted on an explicit "
5391  "%select{instantiation|specialization}0 of function %1">;
5392def err_not_class_template_specialization : Error<
5393  "cannot specialize a %select{dependent template|template template "
5394  "parameter}0">;
5395def ext_explicit_specialization_storage_class : ExtWarn<
5396  "explicit specialization cannot have a storage class">, InGroup<ExplicitSpecializationStorageClass>;
5397def err_dependent_function_template_spec_no_match : Error<
5398  "no candidate function template was found for dependent"
5399  " %select{member|friend}0 function template specialization">;
5400def note_dependent_function_template_spec_discard_reason : Note<
5401  "candidate ignored: %select{not a function template|"
5402  "not a member of the enclosing %select{class template|"
5403  "namespace; did you mean to explicitly qualify the specialization?}1}0">;
5404
5405// C++ class template specializations and out-of-line definitions
5406def err_template_spec_needs_header : Error<
5407  "template specialization requires 'template<>'">;
5408def err_template_spec_needs_template_parameters : Error<
5409  "template specialization or definition requires a template parameter list "
5410  "corresponding to the nested type %0">;
5411def err_template_param_list_matches_nontemplate : Error<
5412  "template parameter list matching the non-templated nested type %0 should "
5413  "be empty ('template<>')">;
5414def err_alias_template_extra_headers : Error<
5415  "extraneous template parameter list in alias template declaration">;
5416def err_template_spec_extra_headers : Error<
5417  "extraneous template parameter list in template specialization or "
5418  "out-of-line template definition">;
5419def ext_template_spec_extra_headers : ExtWarn<
5420  "extraneous template parameter list in template specialization">;
5421def note_explicit_template_spec_does_not_need_header : Note<
5422  "'template<>' header not required for explicitly-specialized class %0 "
5423  "declared here">;
5424def err_template_qualified_declarator_no_match : Error<
5425  "nested name specifier '%0' for declaration does not refer into a class, "
5426  "class template or class template partial specialization">;
5427def err_specialize_member_of_template : Error<
5428  "cannot specialize %select{|(with 'template<>') }0a member of an "
5429  "unspecialized template">;
5430
5431// C++ Class Template Partial Specialization
5432def err_default_arg_in_partial_spec : Error<
5433    "default template argument in a class template partial specialization">;
5434def err_dependent_non_type_arg_in_partial_spec : Error<
5435    "type of specialized non-type template argument depends on a template "
5436    "parameter of the partial specialization">;
5437def note_dependent_non_type_default_arg_in_partial_spec : Note<
5438    "template parameter is used in default argument declared here">;
5439def err_dependent_typed_non_type_arg_in_partial_spec : Error<
5440    "non-type template argument specializes a template parameter with "
5441    "dependent type %0">;
5442def err_partial_spec_args_match_primary_template : Error<
5443    "%select{class|variable}0 template partial specialization does not "
5444    "specialize any template argument; to %select{declare|define}1 the "
5445    "primary template, remove the template argument list">;
5446def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
5447    "%select{class|variable}0 template partial specialization is not "
5448    "more specialized than the primary template">, DefaultError,
5449    InGroup<DiagGroup<"invalid-partial-specialization">>;
5450def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
5451def ext_partial_specs_not_deducible : ExtWarn<
5452    "%select{class|variable}0 template partial specialization contains "
5453    "%select{a template parameter|template parameters}1 that cannot be "
5454    "deduced; this partial specialization will never be used">,
5455    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
5456def note_non_deducible_parameter : Note<
5457    "non-deducible template parameter %0">;
5458def err_partial_spec_ordering_ambiguous : Error<
5459    "ambiguous partial specializations of %0">;
5460def note_partial_spec_match : Note<"partial specialization matches %0">;
5461def err_partial_spec_redeclared : Error<
5462  "class template partial specialization %0 cannot be redeclared">;
5463def note_prev_partial_spec_here : Note<
5464  "previous declaration of class template partial specialization %0 is here">;
5465def err_partial_spec_fully_specialized : Error<
5466  "partial specialization of %0 does not use any of its template parameters">;
5467
5468// C++ Variable Template Partial Specialization
5469def err_var_partial_spec_redeclared : Error<
5470  "variable template partial specialization %0 cannot be redefined">;
5471def note_var_prev_partial_spec_here : Note<
5472  "previous declaration of variable template partial specialization is here">;
5473def err_var_spec_no_template : Error<
5474  "no variable template matches%select{| partial}0 specialization">;
5475def err_var_spec_no_template_but_method : Error<
5476  "no variable template matches specialization; "
5477  "did you mean to use %0 as function template instead?">;
5478
5479// C++ Function template specializations
5480def err_function_template_spec_no_match : Error<
5481    "no function template matches function template specialization %0">;
5482def err_function_template_spec_ambiguous : Error<
5483    "function template specialization %0 ambiguously refers to more than one "
5484    "function template; explicitly specify%select{| additional}1 template "
5485    "arguments to identify a particular function template">;
5486def note_function_template_spec_matched : Note<
5487    "function template %q0 matches specialization %1">;
5488def err_function_template_partial_spec : Error<
5489    "function template partial specialization is not allowed">;
5490
5491def err_function_member_spec_ambiguous : Error<
5492    "ambiguous member function specialization %q0 of %q1">;
5493def note_function_member_spec_matched : Note<
5494    "member function specialization matches %0">;
5495
5496// C++ Template Instantiation
5497def err_template_recursion_depth_exceeded : Error<
5498  "recursive template instantiation exceeded maximum depth of %0">,
5499  DefaultFatal, NoSFINAE;
5500def err_constraint_depends_on_self : Error<
5501  "satisfaction of constraint '%0' depends on itself">, NoSFINAE;
5502def note_template_recursion_depth : Note<
5503  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
5504
5505def err_template_instantiate_within_definition : Error<
5506  "%select{implicit|explicit}0 instantiation of template %1 within its"
5507  " own definition">;
5508def err_template_instantiate_undefined : Error<
5509  "%select{implicit|explicit}0 instantiation of undefined template %1">;
5510def err_implicit_instantiate_member_undefined : Error<
5511  "implicit instantiation of undefined member %0">;
5512def note_template_class_instantiation_was_here : Note<
5513  "class template %0 was instantiated here">;
5514def note_template_class_explicit_specialization_was_here : Note<
5515  "class template %0 was explicitly specialized here">;
5516def note_template_class_instantiation_here : Note<
5517  "in instantiation of template class %q0 requested here">;
5518def note_template_member_class_here : Note<
5519  "in instantiation of member class %q0 requested here">;
5520def note_template_member_function_here : Note<
5521  "in instantiation of member function %q0 requested here">;
5522def note_function_template_spec_here : Note<
5523  "in instantiation of function template specialization %q0 requested here">;
5524def note_template_static_data_member_def_here : Note<
5525  "in instantiation of static data member %q0 requested here">;
5526def note_template_variable_def_here : Note<
5527  "in instantiation of variable template specialization %q0 requested here">;
5528def note_template_enum_def_here : Note<
5529  "in instantiation of enumeration %q0 requested here">;
5530def note_template_nsdmi_here : Note<
5531  "in instantiation of default member initializer %q0 requested here">;
5532def note_template_type_alias_instantiation_here : Note<
5533  "in instantiation of template type alias %0 requested here">;
5534def note_template_exception_spec_instantiation_here : Note<
5535  "in instantiation of exception specification for %0 requested here">;
5536def note_template_requirement_instantiation_here : Note<
5537  "in instantiation of requirement here">;
5538def note_template_requirement_params_instantiation_here : Note<
5539  "in instantiation of requirement parameters here">;
5540def warn_var_template_missing : Warning<"instantiation of variable %q0 "
5541  "required here, but no definition is available">,
5542  InGroup<UndefinedVarTemplate>;
5543def warn_func_template_missing : Warning<"instantiation of function %q0 "
5544  "required here, but no definition is available">,
5545  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
5546def note_forward_template_decl : Note<
5547  "forward declaration of template entity is here">;
5548def note_inst_declaration_hint : Note<"add an explicit instantiation "
5549  "declaration to suppress this warning if %q0 is explicitly instantiated in "
5550  "another translation unit">;
5551def note_evaluating_exception_spec_here : Note<
5552  "in evaluation of exception specification for %q0 needed here">;
5553
5554def note_default_arg_instantiation_here : Note<
5555  "in instantiation of default argument for '%0' required here">;
5556def note_default_function_arg_instantiation_here : Note<
5557  "in instantiation of default function argument expression "
5558  "for '%0' required here">;
5559def note_explicit_template_arg_substitution_here : Note<
5560  "while substituting explicitly-specified template arguments into function "
5561  "template %0 %1">;
5562def note_function_template_deduction_instantiation_here : Note<
5563  "while substituting deduced template arguments into function template %0 "
5564  "%1">;
5565def note_deduced_template_arg_substitution_here : Note<
5566  "during template argument deduction for %select{class|variable}0 template "
5567  "%select{partial specialization |}1%2 %3">;
5568def note_prior_template_arg_substitution : Note<
5569  "while substituting prior template arguments into %select{non-type|template}0"
5570  " template parameter%1 %2">;
5571def note_template_default_arg_checking : Note<
5572  "while checking a default template argument used here">;
5573def note_concept_specialization_here : Note<
5574  "while checking the satisfaction of concept '%0' requested here">;
5575def note_nested_requirement_here : Note<
5576  "while checking the satisfaction of nested requirement requested here">;
5577def note_checking_constraints_for_template_id_here : Note<
5578  "while checking constraint satisfaction for template '%0' required here">;
5579def note_checking_constraints_for_var_spec_id_here : Note<
5580  "while checking constraint satisfaction for variable template "
5581  "partial specialization '%0' required here">;
5582def note_checking_constraints_for_class_spec_id_here : Note<
5583  "while checking constraint satisfaction for class template partial "
5584  "specialization '%0' required here">;
5585def note_checking_constraints_for_function_here : Note<
5586  "while checking constraint satisfaction for function '%0' required here">;
5587def note_constraint_substitution_here : Note<
5588  "while substituting template arguments into constraint expression here">;
5589def note_constraint_normalization_here : Note<
5590  "while calculating associated constraint of template '%0' here">;
5591def note_parameter_mapping_substitution_here : Note<
5592  "while substituting into concept arguments here; substitution failures not "
5593  "allowed in concept arguments">;
5594def note_building_deduction_guide_here : Note<
5595  "while building implicit deduction guide first needed here">;
5596def note_lambda_substitution_here : Note<
5597  "while substituting into a lambda expression here">;
5598def note_instantiation_contexts_suppressed : Note<
5599  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5600  "see all)">;
5601
5602def err_field_instantiates_to_function : Error<
5603  "data member instantiated with function type %0">;
5604def err_variable_instantiates_to_function : Error<
5605  "%select{variable|static data member}0 instantiated with function type %1">;
5606def err_nested_name_spec_non_tag : Error<
5607  "type %0 cannot be used prior to '::' because it has no members">;
5608
5609def err_using_pack_expansion_empty : Error<
5610  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5611
5612// C++ Explicit Instantiation
5613def err_explicit_instantiation_duplicate : Error<
5614    "duplicate explicit instantiation of %0">;
5615def ext_explicit_instantiation_duplicate : ExtWarn<
5616    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5617    InGroup<MicrosoftTemplate>;
5618def note_previous_explicit_instantiation : Note<
5619    "previous explicit instantiation is here">;
5620def warn_explicit_instantiation_after_specialization : Warning<
5621  "explicit instantiation of %0 that occurs after an explicit "
5622  "specialization has no effect">,
5623  InGroup<DiagGroup<"instantiation-after-specialization">>;
5624def note_previous_template_specialization : Note<
5625    "previous template specialization is here">;
5626def err_explicit_instantiation_nontemplate_type : Error<
5627    "explicit instantiation of non-templated type %0">;
5628def note_nontemplate_decl_here : Note<
5629    "non-templated declaration is here">;
5630def err_explicit_instantiation_in_class : Error<
5631  "explicit instantiation of %0 in class scope">;
5632def err_explicit_instantiation_out_of_scope : Error<
5633  "explicit instantiation of %0 not in a namespace enclosing %1">;
5634def err_explicit_instantiation_must_be_global : Error<
5635  "explicit instantiation of %0 must occur at global scope">;
5636def warn_explicit_instantiation_out_of_scope_0x : Warning<
5637  "explicit instantiation of %0 not in a namespace enclosing %1">,
5638  InGroup<CXX11Compat>, DefaultIgnore;
5639def warn_explicit_instantiation_must_be_global_0x : Warning<
5640  "explicit instantiation of %0 must occur at global scope">,
5641  InGroup<CXX11Compat>, DefaultIgnore;
5642
5643def err_explicit_instantiation_requires_name : Error<
5644  "explicit instantiation declaration requires a name">;
5645def err_explicit_instantiation_of_typedef : Error<
5646  "explicit instantiation of typedef %0">;
5647def err_explicit_instantiation_storage_class : Error<
5648  "explicit instantiation cannot have a storage class">;
5649def err_explicit_instantiation_internal_linkage : Error<
5650  "explicit instantiation declaration of %0 with internal linkage">;
5651def err_explicit_instantiation_not_known : Error<
5652  "explicit instantiation of %0 does not refer to a function template, "
5653  "variable template, member function, member class, or static data member">;
5654def note_explicit_instantiation_here : Note<
5655  "explicit instantiation refers here">;
5656def err_explicit_instantiation_data_member_not_instantiated : Error<
5657  "explicit instantiation refers to static data member %q0 that is not an "
5658  "instantiation">;
5659def err_explicit_instantiation_member_function_not_instantiated : Error<
5660  "explicit instantiation refers to member function %q0 that is not an "
5661  "instantiation">;
5662def err_explicit_instantiation_ambiguous : Error<
5663  "partial ordering for explicit instantiation of %0 is ambiguous">;
5664def note_explicit_instantiation_candidate : Note<
5665  "explicit instantiation candidate function %q0 template here %1">;
5666def err_explicit_instantiation_inline : Error<
5667  "explicit instantiation cannot be 'inline'">;
5668def warn_explicit_instantiation_inline_0x : Warning<
5669  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5670  DefaultIgnore;
5671def err_explicit_instantiation_constexpr : Error<
5672  "explicit instantiation cannot be 'constexpr'">;
5673def ext_explicit_instantiation_without_qualified_id : Extension<
5674  "qualifier in explicit instantiation of %q0 requires a template-id "
5675  "(a typedef is not permitted)">;
5676def err_explicit_instantiation_without_template_id : Error<
5677  "explicit instantiation of %q0 must specify a template argument list">;
5678def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5679  "explicit instantiation of %q0 must occur in namespace %1">;
5680def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5681  "explicit instantiation of %q0 must occur in namespace %1">,
5682  InGroup<CXX11Compat>, DefaultIgnore;
5683def err_explicit_instantiation_undefined_member : Error<
5684  "explicit instantiation of undefined %select{member class|member function|"
5685  "static data member}0 %1 of class template %2">;
5686def err_explicit_instantiation_undefined_func_template : Error<
5687  "explicit instantiation of undefined function template %0">;
5688def err_explicit_instantiation_undefined_var_template : Error<
5689  "explicit instantiation of undefined variable template %q0">;
5690def err_explicit_instantiation_declaration_after_definition : Error<
5691  "explicit instantiation declaration (with 'extern') follows explicit "
5692  "instantiation definition (without 'extern')">;
5693def note_explicit_instantiation_definition_here : Note<
5694  "explicit instantiation definition is here">;
5695def err_invalid_var_template_spec_type : Error<"type %2 "
5696  "of %select{explicit instantiation|explicit specialization|"
5697  "partial specialization|redeclaration}0 of %1 does not match"
5698  " expected type %3">;
5699def err_mismatched_exception_spec_explicit_instantiation : Error<
5700  "exception specification in explicit instantiation does not match "
5701  "instantiated one">;
5702def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5703  err_mismatched_exception_spec_explicit_instantiation.Summary>,
5704  InGroup<MicrosoftExceptionSpec>;
5705def err_explicit_instantiation_dependent : Error<
5706  "explicit instantiation has dependent template arguments">;
5707
5708// C++ typename-specifiers
5709def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5710def err_typename_nested_not_found_enable_if : Error<
5711  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5712  "this declaration">;
5713def err_typename_nested_not_found_requirement : Error<
5714  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5715  "declaration">;
5716def err_typename_nested_not_type : Error<
5717    "typename specifier refers to non-type member %0 in %1">;
5718def err_typename_not_type : Error<
5719    "typename specifier refers to non-type %0">;
5720def note_typename_member_refers_here : Note<
5721    "referenced member %0 is declared here">;
5722def note_typename_refers_here : Note<
5723    "referenced %0 is declared here">;
5724def err_typename_missing : Error<
5725  "missing 'typename' prior to dependent type name '%0%1'">;
5726def err_typename_missing_template : Error<
5727  "missing 'typename' prior to dependent type template name '%0%1'">;
5728def ext_typename_missing : ExtWarn<
5729  "missing 'typename' prior to dependent type name '%0%1'">,
5730  InGroup<DiagGroup<"typename-missing">>;
5731def ext_typename_outside_of_template : ExtWarn<
5732  "'typename' occurs outside of a template">, InGroup<CXX11>;
5733def warn_cxx98_compat_typename_outside_of_template : Warning<
5734  "use of 'typename' outside of a template is incompatible with C++98">,
5735  InGroup<CXX98Compat>, DefaultIgnore;
5736def err_typename_refers_to_using_value_decl : Error<
5737  "typename specifier refers to a dependent using declaration for a value "
5738  "%0 in %1">;
5739def note_using_value_decl_missing_typename : Note<
5740  "add 'typename' to treat this using declaration as a type">;
5741def warn_cxx17_compat_implicit_typename : Warning<"use of implicit 'typename' is "
5742  "incompatible with C++ standards before C++20">, InGroup<CXX20Compat>,
5743  DefaultIgnore;
5744def ext_implicit_typename : ExtWarn<"missing 'typename' prior to dependent "
5745  "type name %0%1; implicit 'typename' is a C++20 extension">,
5746  InGroup<CXX20>;
5747
5748def err_template_kw_refers_to_non_template : Error<
5749  "%0%select{| following the 'template' keyword}1 "
5750  "does not refer to a template">;
5751def note_template_kw_refers_to_non_template : Note<
5752  "declared as a non-template here">;
5753def err_template_kw_refers_to_dependent_non_template : Error<
5754  "%0%select{| following the 'template' keyword}1 "
5755  "cannot refer to a dependent template">;
5756def err_template_kw_refers_to_type_template : Error<
5757  "'%0%1' is expected to be a non-type template, but instantiated to a %select{class|type alias}2 template">;
5758def note_referenced_type_template : Note<
5759  "%select{class|type alias}0 template declared here">;
5760def err_template_kw_missing : Error<
5761  "missing 'template' keyword prior to dependent template name '%0%1'">;
5762def ext_template_outside_of_template : ExtWarn<
5763  "'template' keyword outside of a template">, InGroup<CXX11>;
5764def warn_cxx98_compat_template_outside_of_template : Warning<
5765  "use of 'template' keyword outside of a template is incompatible with C++98">,
5766  InGroup<CXX98Compat>, DefaultIgnore;
5767
5768def err_non_type_template_in_nested_name_specifier : Error<
5769  "qualified name refers into a specialization of %select{function|variable}0 "
5770  "template %1">;
5771def err_template_id_not_a_type : Error<
5772  "template name refers to non-type template %0">;
5773def note_template_declared_here : Note<
5774  "%select{function template|class template|variable template"
5775  "|type alias template|template template parameter}0 "
5776  "%1 declared here">;
5777def err_template_expansion_into_fixed_list : Error<
5778  "pack expansion used as argument for non-pack parameter of %select{alias "
5779  "template|concept}0">;
5780def note_parameter_type : Note<
5781  "parameter of type %0 is declared here">;
5782
5783// C++11 Variadic Templates
5784def err_template_param_pack_default_arg : Error<
5785  "template parameter pack cannot have a default argument">;
5786def err_template_param_pack_must_be_last_template_parameter : Error<
5787  "template parameter pack must be the last template parameter">;
5788
5789def err_template_parameter_pack_non_pack : Error<
5790  "%select{template type|non-type template|template template}0 parameter"
5791  "%select{| pack}1 conflicts with previous %select{template type|"
5792  "non-type template|template template}0 parameter%select{ pack|}1">;
5793def note_template_parameter_pack_non_pack : Note<
5794  "%select{template type|non-type template|template template}0 parameter"
5795  "%select{| pack}1 does not match %select{template type|non-type template"
5796  "|template template}0 parameter%select{ pack|}1 in template argument">;
5797def note_template_parameter_pack_here : Note<
5798  "previous %select{template type|non-type template|template template}0 "
5799  "parameter%select{| pack}1 declared here">;
5800
5801def err_unexpanded_parameter_pack : Error<
5802  "%select{expression|base type|declaration type|data member type|bit-field "
5803  "size|static assertion|fixed underlying type|enumerator value|"
5804  "using declaration|friend declaration|qualifier|initializer|default argument|"
5805  "non-type template parameter type|exception type|explicit specialization|"
5806  "partial specialization|__if_exists name|__if_not_exists name|lambda|block|"
5807  "type constraint|requirement|requires clause}0 "
5808  "contains%plural{0: an|:}1 unexpanded parameter pack"
5809  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5810
5811def err_pack_expansion_without_parameter_packs : Error<
5812  "pack expansion does not contain any unexpanded parameter packs">;
5813def err_pack_expansion_length_conflict : Error<
5814  "pack expansion contains parameter packs %0 and %1 that have different "
5815  "lengths (%2 vs. %3)">;
5816def err_pack_expansion_length_conflict_multilevel : Error<
5817  "pack expansion contains parameter pack %0 that has a different "
5818  "length (%1 vs. %2) from outer parameter packs">;
5819def err_pack_expansion_length_conflict_partial : Error<
5820  "pack expansion contains parameter pack %0 that has a different "
5821  "length (at least %1 vs. %2) from outer parameter packs">;
5822def err_pack_expansion_member_init : Error<
5823  "pack expansion for initialization of member %0">;
5824
5825def err_function_parameter_pack_without_parameter_packs : Error<
5826  "type %0 of function parameter pack does not contain any unexpanded "
5827  "parameter packs">;
5828def err_ellipsis_in_declarator_not_parameter : Error<
5829  "only function and template parameters can be parameter packs">;
5830
5831def err_expected_name_of_pack : Error<
5832  "%0 does not refer to the name of a parameter pack">;
5833
5834def err_pack_index_out_of_bound : Error<
5835  "invalid index %0 for pack %1 of size %2">;
5836
5837def ext_pack_indexing : ExtWarn<
5838  "pack indexing is a C++2c extension">, InGroup<CXX26>;
5839def warn_cxx23_pack_indexing : Warning<
5840  "pack indexing is incompatible with C++ standards before C++2c">,
5841  DefaultIgnore, InGroup<CXXPre26Compat>;
5842
5843def err_fold_expression_packs_both_sides : Error<
5844  "binary fold expression has unexpanded parameter packs in both operands">;
5845def err_fold_expression_empty : Error<
5846  "unary fold expression has empty expansion for operator '%0' "
5847  "with no fallback value">;
5848def err_fold_expression_bad_operand : Error<
5849  "expression not permitted as operand of fold expression">;
5850def err_fold_expression_limit_exceeded: Error<
5851  "instantiating fold expression with %0 arguments exceeded expression nesting "
5852  "limit of %1">, DefaultFatal, NoSFINAE;
5853
5854def err_unexpected_typedef : Error<
5855  "unexpected type name %0: expected expression">;
5856def err_unexpected_namespace : Error<
5857  "unexpected namespace name %0: expected expression">;
5858def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5859def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5860  "use of undeclared identifier %0; "
5861  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5862  InGroup<MicrosoftTemplate>;
5863def err_found_in_dependent_base : Error<
5864  "explicit qualification required to use member %0 from dependent base class">;
5865def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5866  "found via unqualified lookup into dependent bases of class templates is a "
5867  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5868def err_found_later_in_class : Error<"member %0 used before its declaration">;
5869def ext_found_later_in_class : ExtWarn<
5870  "use of member %0 before its declaration is a Microsoft extension">,
5871  InGroup<MicrosoftTemplate>;
5872def ext_unqualified_base_class : ExtWarn<
5873  "unqualified base initializer of class templates is a Microsoft extension">,
5874  InGroup<MicrosoftTemplate>;
5875def note_dependent_member_use : Note<
5876  "must qualify identifier to find this declaration in dependent base class">;
5877def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5878    "visible in the template definition nor found by argument-dependent lookup">;
5879def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5880    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5881def err_undeclared_use : Error<"use of undeclared %0">;
5882def warn_deprecated : Warning<"%0 is deprecated">,
5883    InGroup<DeprecatedDeclarations>;
5884def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5885def warn_property_method_deprecated :
5886    Warning<"property access is using %0 method which is deprecated">,
5887    InGroup<DeprecatedDeclarations>;
5888def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5889    InGroup<DeprecatedDeclarations>;
5890def warn_deprecated_anonymous_namespace : Warning<
5891  "'deprecated' attribute on anonymous namespace ignored">,
5892  InGroup<IgnoredAttributes>;
5893def warn_deprecated_fwdclass_message : Warning<
5894    "%0 may be deprecated because the receiver type is unknown">,
5895    InGroup<DeprecatedDeclarations>;
5896def warn_deprecated_def : Warning<
5897  "implementing deprecated %select{method|class|category}0">,
5898  InGroup<DeprecatedImplementations>, DefaultIgnore;
5899def warn_unavailable_def : Warning<
5900  "implementing unavailable method">,
5901  InGroup<DeprecatedImplementations>, DefaultIgnore;
5902def warn_deprecated_builtin : Warning<
5903  "builtin %0 is deprecated; use %1 instead">,
5904  InGroup<DeprecatedBuiltins>;
5905def err_unavailable : Error<"%0 is unavailable">;
5906def err_property_method_unavailable :
5907    Error<"property access is using %0 method which is unavailable">;
5908def err_unavailable_message : Error<"%0 is unavailable: %1">;
5909def warn_unavailable_fwdclass_message : Warning<
5910    "%0 may be unavailable because the receiver type is unknown">,
5911    InGroup<UnavailableDeclarations>;
5912def note_availability_specified_here : Note<
5913  "%0 has been explicitly marked "
5914  "%select{unavailable|deleted|deprecated}1 here">;
5915def note_partial_availability_specified_here : Note<
5916  "%0 has been marked as being introduced in %1 %2 %select{|in %5 environment }4here, "
5917  "but the deployment target is %1 %3%select{| %6 environment }4">;
5918def note_implicitly_deleted : Note<
5919  "explicitly defaulted function was implicitly deleted here">;
5920def warn_not_enough_argument : Warning<
5921  "not enough variable arguments in %0 declaration to fit a sentinel">,
5922  InGroup<Sentinel>;
5923def warn_missing_sentinel : Warning <
5924  "missing sentinel in %select{function call|method dispatch|block call}0">,
5925  InGroup<Sentinel>;
5926def note_sentinel_here : Note<
5927  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5928def warn_strict_uses_without_prototype : Warning<
5929  "passing arguments to %select{a function|%1}0 without a prototype is "
5930  "deprecated in all versions of C and is not supported in C23">,
5931  InGroup<DeprecatedNonPrototype>;
5932def warn_missing_prototype : Warning<
5933  "no previous prototype for function %0">,
5934  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5935def note_declaration_not_a_prototype : Note<
5936  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5937  "to make it %select{a prototype for a zero-parameter function|one}0">;
5938// This is not actually an extension, but we only want it to be enabled in
5939// -pedantic mode and this is the most direct way of accomplishing that.
5940def warn_strict_prototypes : Extension<
5941  "a %select{function|block}0 declaration without a prototype is deprecated "
5942  "%select{in all versions of C|}0">, InGroup<StrictPrototypes>;
5943def warn_non_prototype_changes_behavior : Warning<
5944  "a function %select{declaration|definition}0 without a prototype is "
5945  "deprecated in all versions of C %select{and is not supported in C23|and is "
5946  "treated as a zero-parameter prototype in C23, conflicting with a "
5947  "%select{previous|subsequent}2 %select{declaration|definition}3}1">,
5948  InGroup<DeprecatedNonPrototype>;
5949def note_conflicting_prototype : Note<"conflicting prototype is here">;
5950def warn_missing_variable_declarations : Warning<
5951  "no previous extern declaration for non-static variable %0">,
5952  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5953def note_static_for_internal_linkage : Note<
5954  "declare 'static' if the %select{variable|function}0 is not intended to be "
5955  "used outside of this translation unit">;
5956def err_static_data_member_reinitialization :
5957  Error<"static data member %0 already has an initializer">;
5958def err_redefinition : Error<"redefinition of %0">;
5959def err_alias_after_tentative :
5960  Error<"alias definition of %0 after tentative definition">;
5961def err_alias_is_definition :
5962  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5963def err_definition_of_implicitly_declared_member : Error<
5964  "definition of implicitly declared %select{default constructor|copy "
5965  "constructor|move constructor|copy assignment operator|move assignment "
5966  "operator|destructor|function}1">;
5967def err_definition_of_explicitly_defaulted_member : Error<
5968  "definition of explicitly defaulted %select{default constructor|copy "
5969  "constructor|move constructor|copy assignment operator|move assignment "
5970  "operator|destructor|function}0">;
5971def err_redefinition_extern_inline : Error<
5972  "redefinition of a 'extern inline' function %0 is not supported in "
5973  "%select{C99 mode|C++}1">;
5974def warn_attr_abi_tag_namespace : Warning<
5975  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5976  InGroup<IgnoredAttributes>;
5977def err_abi_tag_on_redeclaration : Error<
5978  "cannot add 'abi_tag' attribute in a redeclaration">;
5979def err_new_abi_tag_on_redeclaration : Error<
5980  "'abi_tag' %0 missing in original declaration">;
5981def note_use_ifdef_guards : Note<
5982  "unguarded header; consider using #ifdef guards or #pragma once">;
5983
5984def warn_var_decl_not_read_only : Warning<
5985  "object of type %0 cannot be placed in read-only memory">,
5986  InGroup<ReadOnlyPlacementChecks>;
5987def note_enforce_read_only_placement : Note<"type was declared read-only here">;
5988
5989
5990def note_deleted_dtor_no_operator_delete : Note<
5991  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5992def note_deleted_special_member_class_subobject : Note<
5993  "%select{default constructor of|copy constructor of|move constructor of|"
5994  "copy assignment operator of|move assignment operator of|destructor of|"
5995  "constructor inherited by}0 "
5996  "%1 is implicitly deleted because "
5997  "%select{base class %3|%select{||||variant }4field %3}2 "
5998  "%select{has "
5999  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
6000  "%select{%select{default constructor|copy constructor|move constructor|copy "
6001  "assignment operator|move assignment operator|destructor|"
6002  "%select{default|corresponding|default|default|default}4 constructor}0|"
6003  "destructor}5"
6004  "%select{||s||}4"
6005  "|is an ObjC pointer}6">;
6006def note_deleted_default_ctor_uninit_field : Note<
6007  "%select{default constructor of|constructor inherited by}0 "
6008  "%1 is implicitly deleted because field %2 of "
6009  "%select{reference|const-qualified}4 type %3 would not be initialized">;
6010def note_deleted_default_ctor_all_const : Note<
6011  "%select{default constructor of|constructor inherited by}0 "
6012  "%1 is implicitly deleted because all "
6013  "%select{data members|data members of an anonymous union member}2"
6014  " are const-qualified">;
6015def note_deleted_copy_ctor_rvalue_reference : Note<
6016  "copy constructor of %0 is implicitly deleted because field %1 is of "
6017  "rvalue reference type %2">;
6018def note_deleted_copy_user_declared_move : Note<
6019  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
6020  " %1 has a user-declared move %select{constructor|assignment operator}2">;
6021def note_deleted_assign_field : Note<
6022  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
6023  "because field %2 is of %select{reference|const-qualified}4 type %3">;
6024
6025// These should be errors.
6026def warn_undefined_internal : ExtWarn<
6027  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
6028  InGroup<DiagGroup<"undefined-internal">>;
6029def err_undefined_internal_type : Error<
6030  "%select{function|variable}0 %q1 is used but not defined in this "
6031  "translation unit, and cannot be defined in any other translation unit "
6032  "because its type does not have linkage">;
6033def ext_undefined_internal_type : Extension<
6034  "ISO C++ requires a definition in this translation unit for "
6035  "%select{function|variable}0 %q1 because its type does not have linkage">,
6036  InGroup<DiagGroup<"undefined-internal-type">>;
6037def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
6038  InGroup<DiagGroup<"undefined-inline">>;
6039def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
6040def note_used_here : Note<"used here">;
6041
6042def err_attribute_missing_on_first_decl : Error<
6043  "%0 attribute does not appear on the first declaration">;
6044def warn_internal_linkage_local_storage : Warning<
6045  "'internal_linkage' attribute on a non-static local variable is ignored">,
6046  InGroup<IgnoredAttributes>;
6047
6048def ext_internal_in_extern_inline : ExtWarn<
6049  "static %select{function|variable}0 %1 is used in an inline function with "
6050  "external linkage">, InGroup<StaticInInline>;
6051def ext_internal_in_extern_inline_quiet : Extension<
6052  "static %select{function|variable}0 %1 is used in an inline function with "
6053  "external linkage">, InGroup<StaticInInline>;
6054def warn_static_local_in_extern_inline : Warning<
6055  "non-constant static local variable in inline function may be different "
6056  "in different files">, InGroup<StaticLocalInInline>;
6057def note_convert_inline_to_static : Note<
6058  "use 'static' to give inline function %0 internal linkage">;
6059
6060def ext_redefinition_of_typedef : ExtWarn<
6061  "redefinition of typedef %0 is a C11 feature">,
6062  InGroup<DiagGroup<"typedef-redefinition"> >;
6063def err_redefinition_variably_modified_typedef : Error<
6064  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
6065
6066def err_inline_decl_follows_def : Error<
6067  "inline declaration of %0 follows non-inline definition">;
6068def err_inline_declaration_block_scope : Error<
6069  "inline declaration of %0 not allowed in block scope">;
6070def err_static_non_static : Error<
6071  "static declaration of %0 follows non-static declaration">;
6072def err_different_language_linkage : Error<
6073  "declaration of %0 has a different language linkage">;
6074def ext_retained_language_linkage : Extension<
6075  "friend function %0 retaining previous language linkage is an extension">,
6076  InGroup<DiagGroup<"retained-language-linkage">>;
6077def err_extern_c_global_conflict : Error<
6078  "declaration of %1 %select{with C language linkage|in global scope}0 "
6079  "conflicts with declaration %select{in global scope|with C language linkage}0">;
6080def note_extern_c_global_conflict : Note<
6081  "declared %select{in global scope|with C language linkage}0 here">;
6082def note_extern_c_begins_here : Note<
6083  "extern \"C\" language linkage specification begins here">;
6084def warn_weak_import : Warning <
6085  "%0 cannot be declared 'weak_import' because its definition has been provided">;
6086def ext_static_non_static : Extension<
6087  "redeclaring non-static %0 as static is a Microsoft extension">,
6088  InGroup<MicrosoftRedeclareStatic>;
6089def err_non_static_static : Error<
6090  "non-static declaration of %0 follows static declaration">;
6091def err_extern_non_extern : Error<
6092  "extern declaration of %0 follows non-extern declaration">;
6093def err_non_extern_extern : Error<
6094  "non-extern declaration of %0 follows extern declaration">;
6095def err_non_thread_thread : Error<
6096  "non-thread-local declaration of %0 follows thread-local declaration">;
6097def err_thread_non_thread : Error<
6098  "thread-local declaration of %0 follows non-thread-local declaration">;
6099def err_thread_thread_different_kind : Error<
6100  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
6101  "follows declaration with %select{dynamic|static}1 initialization">;
6102def err_mismatched_owning_module : Error<
6103  "declaration of %0 in %select{the global module|module %2}1 follows "
6104  "declaration in %select{the global module|module %4}3">;
6105def err_multiple_decl_in_different_modules : Error<
6106  "declaration %0 attached to named module '%1' can't be attached to "
6107  "other modules">;
6108def err_redefinition_different_type : Error<
6109  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
6110def err_redefinition_different_kind : Error<
6111  "redefinition of %0 as different kind of symbol">;
6112def err_redefinition_different_namespace_alias : Error<
6113  "redefinition of %0 as an alias for a different namespace">;
6114def note_previous_namespace_alias : Note<
6115  "previously defined as an alias for %0">;
6116def warn_forward_class_redefinition : Warning<
6117  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
6118  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
6119def err_redefinition_different_typedef : Error<
6120  "%select{typedef|type alias|type alias template}0 "
6121  "redefinition with different types%diff{ ($ vs $)|}1,2">;
6122def err_redefinition_different_concept : Error<
6123  "redefinition of concept %0 with different template parameters or requirements">;
6124def err_tag_reference_non_tag : Error<
6125  "%select{non-struct type|non-class type|non-union type|non-enum "
6126  "type|typedef|type alias|template|alias template|template "
6127  "template argument}1 %0 cannot be referenced with the '"
6128  "%select{struct|interface|union|class|enum}2' specifier">;
6129def err_tag_reference_conflict : Error<
6130  "implicit declaration introduced by elaborated type conflicts with a "
6131  "%select{non-struct type|non-class type|non-union type|non-enum "
6132  "type|typedef|type alias|template|type alias template|template "
6133  "template argument}0 of the same name">;
6134def err_dependent_tag_decl : Error<
6135  "%select{declaration|definition}0 of "
6136  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
6137def err_tag_definition_of_typedef : Error<
6138  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
6139def err_conflicting_types : Error<"conflicting types for %0">;
6140def err_different_pass_object_size_params : Error<
6141  "conflicting pass_object_size attributes on parameters">;
6142def err_late_asm_label_name : Error<
6143  "cannot apply asm label to %select{variable|function}0 after its first use">;
6144def err_different_asm_label : Error<"conflicting asm label">;
6145def err_nested_redefinition : Error<"nested redefinition of %0">;
6146def err_use_with_wrong_tag : Error<
6147  "use of %0 with tag type that does not match previous declaration">;
6148def warn_struct_class_tag_mismatch : Warning<
6149  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
6150  "declared as a %select{struct|interface|class}3%select{| template}1; "
6151  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
6152  InGroup<MismatchedTags>, DefaultIgnore;
6153def warn_struct_class_previous_tag_mismatch : Warning<
6154  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
6155  "here but previously declared as "
6156  "%select{a struct|an interface|a class}3%select{| template}1; "
6157  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
6158  InGroup<MismatchedTags>, DefaultIgnore;
6159def note_struct_class_suggestion : Note<
6160  "did you mean %select{struct|interface|class}0 here?">;
6161def ext_forward_ref_enum : Extension<
6162  "ISO C forbids forward references to 'enum' types">;
6163def err_forward_ref_enum : Error<
6164  "ISO C++ forbids forward references to 'enum' types">;
6165def ext_ms_forward_ref_enum : ExtWarn<
6166  "forward references to 'enum' types are a Microsoft extension">,
6167  InGroup<MicrosoftEnumForwardReference>;
6168def ext_forward_ref_enum_def : Extension<
6169  "redeclaration of already-defined enum %0 is a GNU extension">,
6170  InGroup<GNURedeclaredEnum>;
6171
6172def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
6173def err_duplicate_member : Error<"duplicate member %0">;
6174def err_misplaced_ivar : Error<
6175  "instance variables may not be placed in %select{categories|class extension}0">;
6176def warn_ivars_in_interface : Warning<
6177  "declaration of instance variables in the interface is deprecated">,
6178  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
6179def ext_enum_value_not_int : Extension<
6180  "ISO C restricts enumerator values to range of 'int' (%0 is too "
6181  "%select{small|large}1)">;
6182def ext_enum_too_large : ExtWarn<
6183  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
6184def ext_enumerator_increment_too_large : ExtWarn<
6185  "incremented enumerator value %0 is not representable in the "
6186  "largest integer type">, InGroup<EnumTooLarge>;
6187def warn_flag_enum_constant_out_of_range : Warning<
6188  "enumeration value %0 is out of range of flags in enumeration type %1">,
6189  InGroup<FlagEnum>;
6190
6191def err_vm_decl_in_file_scope : Error<
6192  "variably modified type declaration not allowed at file scope">;
6193def err_vm_decl_has_extern_linkage : Error<
6194  "variably modified type declaration cannot have 'extern' linkage">;
6195def err_typecheck_field_variable_size : Error<
6196  "fields must have a constant size: 'variable length array in structure' "
6197  "extension will never be supported">;
6198def err_vm_func_decl : Error<
6199  "function declaration cannot have variably modified type">;
6200def err_array_too_large : Error<
6201  "array is too large (%0 elements)">;
6202
6203def err_typecheck_negative_array_size : Error<"array size is negative">;
6204def warn_typecheck_function_qualifiers_ignored : Warning<
6205  "'%0' qualifier on function type %1 has no effect">,
6206  InGroup<IgnoredQualifiers>;
6207def warn_typecheck_function_qualifiers_unspecified : Warning<
6208  "'%0' qualifier on function type %1 has unspecified behavior">;
6209def warn_typecheck_reference_qualifiers : Warning<
6210  "'%0' qualifier on reference type %1 has no effect">,
6211  InGroup<IgnoredReferenceQualifiers>;
6212def err_typecheck_invalid_restrict_not_pointer : Error<
6213  "restrict requires a pointer or reference (%0 is invalid)">;
6214def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
6215  "restrict requires a pointer or reference">;
6216def err_typecheck_invalid_restrict_invalid_pointee : Error<
6217  "pointer to function type %0 may not be 'restrict' qualified">;
6218def ext_typecheck_zero_array_size : Extension<
6219  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
6220def err_typecheck_zero_array_size : Error<
6221  "zero-length arrays are not permitted in %select{C++|SYCL device code}0">;
6222def err_array_size_non_int : Error<"size of array has non-integer type %0">;
6223def err_init_element_not_constant : Error<
6224  "initializer element is not a compile-time constant">;
6225def ext_aggregate_init_not_constant : Extension<
6226  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
6227def err_local_cant_init : Error<
6228  "'__local' variable cannot have an initializer">;
6229def err_loader_uninitialized_cant_init
6230    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
6231            "initializer">;
6232def err_loader_uninitialized_trivial_ctor
6233    : Error<"variable with 'loader_uninitialized' attribute must have a "
6234            "trivial default constructor">;
6235def err_loader_uninitialized_redeclaration
6236    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
6237def err_loader_uninitialized_extern_decl
6238    : Error<"variable %0 cannot be declared both 'extern' and with the "
6239            "'loader_uninitialized' attribute">;
6240def err_block_extern_cant_init : Error<
6241  "declaration of block scope identifier with linkage cannot have an initializer">;
6242def warn_extern_init : Warning<"'extern' variable has an initializer">,
6243  InGroup<DiagGroup<"extern-initializer">>;
6244def err_variable_object_no_init : Error<
6245  "variable-sized object may not be initialized">;
6246def err_excess_initializers : Error<
6247  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
6248def ext_excess_initializers : ExtWarn<
6249  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
6250  InGroup<ExcessInitializers>;
6251def err_excess_initializers_for_sizeless_type : Error<
6252  "excess elements in initializer for indivisible sizeless type %0">;
6253def ext_excess_initializers_for_sizeless_type : ExtWarn<
6254  "excess elements in initializer for indivisible sizeless type %0">,
6255  InGroup<ExcessInitializers>;
6256def err_excess_initializers_in_char_array_initializer : Error<
6257  "excess elements in char array initializer">;
6258def ext_excess_initializers_in_char_array_initializer : ExtWarn<
6259  "excess elements in char array initializer">,
6260  InGroup<ExcessInitializers>;
6261def err_initializer_string_for_char_array_too_long : Error<
6262  "initializer-string for char array is too long, array size is %0 but initializer has size %1 (including the null terminating character)">;
6263def ext_initializer_string_for_char_array_too_long : ExtWarn<
6264  "initializer-string for char array is too long">,
6265  InGroup<ExcessInitializers>;
6266def warn_missing_field_initializers : Warning<
6267  "missing field %0 initializer">,
6268  InGroup<MissingFieldInitializers>, DefaultIgnore;
6269// The same warning, but another group is needed to disable it separately.
6270def warn_missing_designated_field_initializers : Warning<
6271  warn_missing_field_initializers.Summary>,
6272  InGroup<MissingDesignatedFieldInitializers>, DefaultIgnore;
6273def warn_braces_around_init : Warning<
6274  "braces around %select{scalar |}0initializer">,
6275  InGroup<DiagGroup<"braced-scalar-init">>;
6276def ext_many_braces_around_init : ExtWarn<
6277  "too many braces around %select{scalar |}0initializer">,
6278  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
6279def ext_complex_component_init : Extension<
6280  "complex initialization specifying real and imaginary components "
6281  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
6282def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
6283def err_empty_sizeless_initializer : Error<
6284  "initializer for sizeless type %0 cannot be empty">;
6285def warn_cxx98_compat_empty_scalar_initializer : Warning<
6286  "scalar initialized from empty initializer list is incompatible with C++98">,
6287  InGroup<CXX98Compat>, DefaultIgnore;
6288def warn_cxx98_compat_empty_sizeless_initializer : Warning<
6289  "initializing %0 from an empty initializer list is incompatible with C++98">,
6290  InGroup<CXX98Compat>, DefaultIgnore;
6291def warn_cxx98_compat_reference_list_init : Warning<
6292  "reference initialized from initializer list is incompatible with C++98">,
6293  InGroup<CXX98Compat>, DefaultIgnore;
6294def warn_cxx98_compat_initializer_list_init : Warning<
6295  "initialization of initializer_list object is incompatible with C++98">,
6296  InGroup<CXX98Compat>, DefaultIgnore;
6297def warn_cxx98_compat_ctor_list_init : Warning<
6298  "constructor call from initializer list is incompatible with C++98">,
6299  InGroup<CXX98Compat>, DefaultIgnore;
6300def err_illegal_initializer : Error<
6301  "illegal initializer (only variables can be initialized)">;
6302def err_illegal_initializer_type : Error<"illegal initializer type %0">;
6303def ext_init_list_type_narrowing : ExtWarn<
6304  "type %0 cannot be narrowed to %1 in initializer list">,
6305  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6306def ext_init_list_type_narrowing_const_reference : ExtWarn<
6307  ext_init_list_type_narrowing.Summary>,
6308  InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
6309def ext_init_list_variable_narrowing : ExtWarn<
6310  "non-constant-expression cannot be narrowed from type %0 to %1 in "
6311  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6312def ext_init_list_variable_narrowing_const_reference : ExtWarn<
6313  ext_init_list_variable_narrowing.Summary>, InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
6314def ext_init_list_constant_narrowing : ExtWarn<
6315  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
6316  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6317def ext_init_list_constant_narrowing_const_reference : ExtWarn<
6318  ext_init_list_constant_narrowing.Summary>,
6319  InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
6320def warn_init_list_type_narrowing : Warning<
6321  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
6322  InGroup<CXX11Narrowing>, DefaultIgnore;
6323def warn_init_list_variable_narrowing : Warning<
6324  "non-constant-expression cannot be narrowed from type %0 to %1 in "
6325  "initializer list in C++11">,
6326  InGroup<CXX11Narrowing>, DefaultIgnore;
6327def warn_init_list_constant_narrowing : Warning<
6328  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
6329  "C++11">,
6330  InGroup<CXX11Narrowing>, DefaultIgnore;
6331def note_init_list_narrowing_silence : Note<
6332  "insert an explicit cast to silence this issue">;
6333def err_init_objc_class : Error<
6334  "cannot initialize Objective-C class type %0">;
6335def err_implicit_empty_initializer : Error<
6336  "initializer for aggregate with no elements requires explicit braces">;
6337def err_bitfield_has_negative_width : Error<
6338  "bit-field %0 has negative width (%1)">;
6339def err_anon_bitfield_has_negative_width : Error<
6340  "anonymous bit-field has negative width (%0)">;
6341def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
6342def err_bitfield_width_exceeds_type_width : Error<
6343  "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the "
6344  "%select{width|size}3 of its type (%4 bit%s4)">;
6345def err_incorrect_number_of_vector_initializers : Error<
6346  "number of elements must be either one or match the size of the vector">;
6347
6348// Used by C++ which allows bit-fields that are wider than the type.
6349def warn_bitfield_width_exceeds_type_width: Warning<
6350  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
6351  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
6352def err_bitfield_too_wide : Error<
6353  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
6354def warn_bitfield_too_small_for_enum : Warning<
6355  "bit-field %0 is not wide enough to store all enumerators of %1">,
6356  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6357def note_widen_bitfield : Note<
6358  "widen this field to %0 bits to store all values of %1">;
6359def warn_unsigned_bitfield_assigned_signed_enum : Warning<
6360  "assigning value of signed enum type %1 to unsigned bit-field %0; "
6361  "negative enumerators of enum %1 will be converted to positive values">,
6362  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6363def warn_signed_bitfield_enum_conversion : Warning<
6364  "signed bit-field %0 needs an extra bit to represent the largest positive "
6365  "enumerators of %1">,
6366  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6367def note_change_bitfield_sign : Note<
6368  "consider making the bitfield type %select{unsigned|signed}0">;
6369
6370def warn_missing_braces : Warning<
6371  "suggest braces around initialization of subobject">,
6372  InGroup<MissingBraces>, DefaultIgnore;
6373
6374def err_redefinition_of_label : Error<"redefinition of label %0">;
6375def err_undeclared_label_use : Error<"use of undeclared label %0">;
6376def err_goto_ms_asm_label : Error<
6377  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
6378def note_goto_ms_asm_label : Note<
6379  "inline assembly label %0 declared here">;
6380def warn_unused_label : Warning<"unused label %0">,
6381  InGroup<UnusedLabel>, DefaultIgnore;
6382
6383def err_continue_from_cond_var_init : Error<
6384  "cannot jump from this continue statement to the loop increment; "
6385  "jump bypasses initialization of loop condition variable">;
6386def err_goto_into_protected_scope : Error<
6387  "cannot jump from this goto statement to its label">;
6388def ext_goto_into_protected_scope : ExtWarn<
6389  "jump from this goto statement to its label is a Microsoft extension">,
6390  InGroup<MicrosoftGoto>;
6391def warn_cxx98_compat_goto_into_protected_scope : Warning<
6392  "jump from this goto statement to its label is incompatible with C++98">,
6393  InGroup<CXX98Compat>, DefaultIgnore;
6394def err_switch_into_protected_scope : Error<
6395  "cannot jump from switch statement to this case label">;
6396def warn_cxx98_compat_switch_into_protected_scope : Warning<
6397  "jump from switch statement to this case label is incompatible with C++98">,
6398  InGroup<CXX98Compat>, DefaultIgnore;
6399def err_indirect_goto_without_addrlabel : Error<
6400  "indirect goto in function with no address-of-label expressions">;
6401def err_indirect_goto_in_protected_scope : Error<
6402  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
6403def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
6404  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
6405  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6406def note_indirect_goto_target : Note<
6407  "possible target of %select{indirect|asm}0 goto statement">;
6408def note_protected_by_variable_init : Note<
6409  "jump bypasses variable initialization">;
6410def note_protected_by_variable_nontriv_destructor : Note<
6411  "jump bypasses variable with a non-trivial destructor">;
6412def note_protected_by_variable_non_pod : Note<
6413  "jump bypasses initialization of non-POD variable">;
6414def note_protected_by_cleanup : Note<
6415  "jump bypasses initialization of variable with __attribute__((cleanup))">;
6416def note_protected_by_vla_typedef : Note<
6417  "jump bypasses initialization of VLA typedef">;
6418def note_protected_by_vla_type_alias : Note<
6419  "jump bypasses initialization of VLA type alias">;
6420def note_protected_by_constexpr_if : Note<
6421  "jump enters controlled statement of constexpr if">;
6422def note_protected_by_consteval_if : Note<
6423  "jump enters controlled statement of consteval if">;
6424def note_protected_by_if_available : Note<
6425  "jump enters controlled statement of if available">;
6426def note_protected_by_vla : Note<
6427  "jump bypasses initialization of variable length array">;
6428def note_protected_by_objc_fast_enumeration : Note<
6429  "jump enters Objective-C fast enumeration loop">;
6430def note_protected_by_objc_try : Note<
6431  "jump bypasses initialization of @try block">;
6432def note_protected_by_objc_catch : Note<
6433  "jump bypasses initialization of @catch block">;
6434def note_protected_by_objc_finally : Note<
6435  "jump bypasses initialization of @finally block">;
6436def note_protected_by_objc_synchronized : Note<
6437  "jump bypasses initialization of @synchronized block">;
6438def note_protected_by_objc_autoreleasepool : Note<
6439  "jump bypasses auto release push of @autoreleasepool block">;
6440def note_protected_by_cxx_try : Note<
6441  "jump bypasses initialization of try block">;
6442def note_protected_by_cxx_catch : Note<
6443  "jump bypasses initialization of catch block">;
6444def note_protected_by_seh_try : Note<
6445  "jump bypasses initialization of __try block">;
6446def note_protected_by_seh_except : Note<
6447  "jump bypasses initialization of __except block">;
6448def note_protected_by_seh_finally : Note<
6449  "jump bypasses initialization of __finally block">;
6450def note_protected_by___block : Note<
6451  "jump bypasses setup of __block variable">;
6452def note_protected_by_objc_strong_init : Note<
6453  "jump bypasses initialization of __strong variable">;
6454def note_protected_by_objc_weak_init : Note<
6455  "jump bypasses initialization of __weak variable">;
6456def note_protected_by_non_trivial_c_struct_init : Note<
6457  "jump bypasses initialization of variable of non-trivial C struct type">;
6458def note_enters_block_captures_cxx_obj : Note<
6459  "jump enters lifetime of block which captures a destructible C++ object">;
6460def note_enters_block_captures_strong : Note<
6461  "jump enters lifetime of block which strongly captures a variable">;
6462def note_enters_block_captures_weak : Note<
6463  "jump enters lifetime of block which weakly captures a variable">;
6464def note_enters_block_captures_non_trivial_c_struct : Note<
6465  "jump enters lifetime of block which captures a C struct that is non-trivial "
6466  "to destroy">;
6467def note_enters_compound_literal_scope : Note<
6468  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
6469def note_enters_statement_expression : Note<
6470  "jump enters a statement expression">;
6471
6472def note_exits_cleanup : Note<
6473  "jump exits scope of variable with __attribute__((cleanup))">;
6474def note_exits_dtor : Note<
6475  "jump exits scope of variable with non-trivial destructor">;
6476def note_exits_temporary_dtor : Note<
6477  "jump exits scope of lifetime-extended temporary with non-trivial "
6478  "destructor">;
6479def note_exits___block : Note<
6480  "jump exits scope of __block variable">;
6481def note_exits_objc_try : Note<
6482  "jump exits @try block">;
6483def note_exits_objc_catch : Note<
6484  "jump exits @catch block">;
6485def note_exits_objc_finally : Note<
6486  "jump exits @finally block">;
6487def note_exits_objc_synchronized : Note<
6488  "jump exits @synchronized block">;
6489def note_exits_cxx_try : Note<
6490  "jump exits try block">;
6491def note_exits_cxx_catch : Note<
6492  "jump exits catch block">;
6493def note_exits_seh_try : Note<
6494  "jump exits __try block">;
6495def note_exits_seh_except : Note<
6496  "jump exits __except block">;
6497def note_exits_seh_finally : Note<
6498  "jump exits __finally block">;
6499def note_exits_objc_autoreleasepool : Note<
6500  "jump exits autoreleasepool block">;
6501def note_exits_objc_strong : Note<
6502  "jump exits scope of __strong variable">;
6503def note_exits_objc_weak : Note<
6504  "jump exits scope of __weak variable">;
6505def note_exits_block_captures_cxx_obj : Note<
6506  "jump exits lifetime of block which captures a destructible C++ object">;
6507def note_exits_block_captures_strong : Note<
6508  "jump exits lifetime of block which strongly captures a variable">;
6509def note_exits_block_captures_weak : Note<
6510  "jump exits lifetime of block which weakly captures a variable">;
6511def note_exits_block_captures_non_trivial_c_struct : Note<
6512  "jump exits lifetime of block which captures a C struct that is non-trivial "
6513  "to destroy">;
6514def note_exits_compound_literal_scope : Note<
6515  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
6516
6517def err_func_returning_qualified_void : ExtWarn<
6518  "function cannot return qualified void type %0">,
6519  InGroup<DiagGroup<"qualified-void-return-type">>;
6520def err_func_returning_array_function : Error<
6521  "function cannot return %select{array|function}0 type %1">;
6522def err_field_declared_as_function : Error<"field %0 declared as a function">;
6523def err_field_incomplete_or_sizeless : Error<
6524  "field has %select{incomplete|sizeless}0 type %1">;
6525def ext_variable_sized_type_in_struct : ExtWarn<
6526  "field %0 with variable sized type %1 not at the end of a struct or class is"
6527  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
6528
6529def ext_c99_flexible_array_member : Extension<
6530  "flexible array members are a C99 feature">, InGroup<C99>;
6531def err_flexible_array_virtual_base : Error<
6532  "flexible array member %0 not allowed in "
6533  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
6534def err_flexible_array_has_nontrivial_dtor : Error<
6535  "flexible array member %0 of type %1 with non-trivial destruction">;
6536def ext_flexible_array_in_struct : Extension<
6537  "%0 may not be nested in a struct due to flexible array member">,
6538  InGroup<FlexibleArrayExtensions>;
6539def ext_flexible_array_in_array : Extension<
6540  "%0 may not be used as an array element due to flexible array member">,
6541  InGroup<FlexibleArrayExtensions>;
6542def err_flexible_array_init : Error<
6543  "initialization of flexible array member is not allowed">;
6544def ext_flexible_array_empty_aggregate_ms : Extension<
6545  "flexible array member %0 in otherwise empty "
6546  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
6547  InGroup<MicrosoftFlexibleArray>;
6548def ext_flexible_array_union_ms : Extension<
6549  "flexible array member %0 in a union is a Microsoft extension">,
6550  InGroup<MicrosoftFlexibleArray>;
6551def ext_flexible_array_empty_aggregate_gnu : Extension<
6552  "flexible array member %0 in otherwise empty "
6553  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
6554  InGroup<GNUEmptyStruct>;
6555def ext_flexible_array_union_gnu : Extension<
6556  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
6557
6558def err_flexible_array_not_at_end : Error<
6559  "flexible array member %0 with type %1 is not at the end of"
6560  " %select{struct|interface|union|class|enum}2">;
6561def err_objc_variable_sized_type_not_at_end : Error<
6562  "field %0 with variable sized type %1 is not at the end of class">;
6563def note_next_field_declaration : Note<
6564  "next field declaration is here">;
6565def note_next_ivar_declaration : Note<
6566  "next %select{instance variable declaration|synthesized instance variable}0"
6567  " is here">;
6568def err_synthesize_variable_sized_ivar : Error<
6569  "synthesized property with variable size type %0"
6570  " requires an existing instance variable">;
6571def err_flexible_array_arc_retainable : Error<
6572  "ARC forbids flexible array members with retainable object type">;
6573def warn_variable_sized_ivar_visibility : Warning<
6574  "field %0 with variable sized type %1 is not visible to subclasses and"
6575  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
6576def warn_superclass_variable_sized_type_not_at_end : Warning<
6577  "field %0 can overwrite instance variable %1 with variable sized type %2"
6578  " in superclass %3">, InGroup<ObjCFlexibleArray>;
6579
6580def err_count_attr_param_not_in_same_struct : Error<
6581  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}1' field %0 isn't within the same struct as the annotated %select{pointer|flexible array}2">;
6582def err_count_attr_not_on_ptr_or_flexible_array_member : Error<
6583  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}0' only applies to pointers%select{ or C99 flexible array members|||}0%select{|; did you mean to use 'counted_by'?}1">;
6584def err_counted_by_attr_on_array_not_flexible_array_member : Error<
6585  "'counted_by' on arrays only applies to C99 flexible array members">;
6586def err_counted_by_attr_refer_to_itself : Error<
6587  "'counted_by' cannot refer to the flexible array member %0">;
6588def err_count_attr_must_be_in_structure : Error<
6589  "field %0 in '%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}1' not inside structure">;
6590def err_count_attr_argument_not_integer : Error<
6591  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}0' requires a non-boolean integer type argument">;
6592def err_count_attr_only_support_simple_decl_reference : Error<
6593  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}0' argument must be a simple declaration reference">;
6594def err_count_attr_in_union : Error<
6595  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}0' cannot be applied to a union member">;
6596def err_count_attr_refer_to_union : Error<
6597  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}0' argument cannot refer to a union member">;
6598def note_flexible_array_counted_by_attr_field : Note<
6599  "field %0 declared here">;
6600def err_counted_by_attr_pointee_unknown_size : Error<
6601  "'%select{counted_by|sized_by|counted_by_or_null|sized_by_or_null}4' %select{cannot|should not}3 be applied to %select{"
6602    "a pointer with pointee|" // pointer
6603    "an array with element}0" // array
6604  " of unknown size because %1 is %select{"
6605    "an incomplete type|"  // CountedByInvalidPointeeTypeKind::INCOMPLETE
6606    "a sizeless type|"     // CountedByInvalidPointeeTypeKind::SIZELESS
6607    "a function type|"     // CountedByInvalidPointeeTypeKind::FUNCTION
6608    // CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER
6609    "a struct type with a flexible array member"
6610    "%select{|. This will be an error in a future compiler version}3"
6611    ""
6612  "}2">;
6613
6614def warn_counted_by_attr_elt_type_unknown_size :
6615  Warning<err_counted_by_attr_pointee_unknown_size.Summary>,
6616  InGroup<BoundsSafetyCountedByEltTyUnknownSize>;
6617
6618let CategoryName = "ARC Semantic Issue" in {
6619
6620// ARC-mode diagnostics.
6621
6622let CategoryName = "ARC Weak References" in {
6623
6624def err_arc_weak_no_runtime : Error<
6625  "cannot create __weak reference because the current deployment target "
6626  "does not support weak references">;
6627def err_arc_weak_disabled : Error<
6628  "cannot create __weak reference in file using manual reference counting">;
6629def err_synthesizing_arc_weak_property_disabled : Error<
6630  "cannot synthesize weak property in file using manual reference counting">;
6631def err_synthesizing_arc_weak_property_no_runtime : Error<
6632  "cannot synthesize weak property because the current deployment target "
6633  "does not support weak references">;
6634def err_arc_unsupported_weak_class : Error<
6635  "class is incompatible with __weak references">;
6636def err_arc_weak_unavailable_assign : Error<
6637  "assignment of a weak-unavailable object to a __weak object">;
6638def err_arc_weak_unavailable_property : Error<
6639  "synthesizing __weak instance variable of type %0, which does not "
6640  "support weak references">;
6641def note_implemented_by_class : Note<
6642  "when implemented by class %0">;
6643def err_arc_convesion_of_weak_unavailable : Error<
6644  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
6645  " a __weak object of type %2">;
6646
6647} // end "ARC Weak References" category
6648
6649let CategoryName = "ARC Restrictions" in {
6650
6651def err_unavailable_in_arc : Error<
6652  "%0 is unavailable in ARC">;
6653def note_arc_forbidden_type : Note<
6654  "declaration uses type that is ill-formed in ARC">;
6655def note_performs_forbidden_arc_conversion : Note<
6656  "inline function performs a conversion which is forbidden in ARC">;
6657def note_arc_init_returns_unrelated : Note<
6658  "init method must return a type related to its receiver type">;
6659def note_arc_weak_disabled : Note<
6660  "declaration uses __weak, but ARC is disabled">;
6661def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
6662  "the current deployment target does not support">;
6663def note_arc_field_with_ownership : Note<
6664  "field has non-trivial ownership qualification">;
6665
6666def err_arc_illegal_explicit_message : Error<
6667  "ARC forbids explicit message send of %0">;
6668def err_arc_unused_init_message : Error<
6669  "the result of a delegate init call must be immediately returned "
6670  "or assigned to 'self'">;
6671def err_arc_mismatched_cast : Error<
6672  "%select{implicit conversion|cast}0 of "
6673  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6674  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6675  " to %3 is disallowed with ARC">;
6676def err_arc_nolifetime_behavior : Error<
6677  "explicit ownership qualifier on cast result has no effect">;
6678def err_arc_objc_property_default_assign_on_object : Error<
6679  "ARC forbids synthesizing a property of an Objective-C object "
6680  "with unspecified ownership or storage attribute">;
6681def err_arc_illegal_selector : Error<
6682  "ARC forbids use of %0 in a @selector">;
6683def err_arc_illegal_method_def : Error<
6684  "ARC forbids %select{implementation|synthesis}0 of %1">;
6685def warn_arc_strong_pointer_objc_pointer : Warning<
6686  "method parameter of type %0 with no explicit ownership">,
6687  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6688
6689} // end "ARC Restrictions" category
6690
6691def err_arc_lost_method_convention : Error<
6692  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6693  "method, but its implementation doesn't match because %select{"
6694  "its result type is not an object pointer|"
6695  "its result type is unrelated to its receiver type}1">;
6696def note_arc_lost_method_convention : Note<"declaration in interface">;
6697def err_arc_gained_method_convention : Error<
6698  "method implementation does not match its declaration">;
6699def note_arc_gained_method_convention : Note<
6700  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6701  "family because %select{its result type is not an object pointer|"
6702  "its result type is unrelated to its receiver type}1">;
6703def err_typecheck_arc_assign_self : Error<
6704  "cannot assign to 'self' outside of a method in the init family">;
6705def err_typecheck_arc_assign_self_class_method : Error<
6706  "cannot assign to 'self' in a class method">;
6707def err_typecheck_arr_assign_enumeration : Error<
6708  "fast enumeration variables cannot be modified in ARC by default; "
6709  "declare the variable __strong to allow this">;
6710def err_typecheck_arc_assign_externally_retained : Error<
6711  "variable declared with 'objc_externally_retained' "
6712  "cannot be modified in ARC">;
6713def warn_arc_retained_assign : Warning<
6714  "assigning retained object to %select{weak|unsafe_unretained}0 "
6715  "%select{property|variable}1"
6716  "; object will be released after assignment">,
6717  InGroup<ARCUnsafeRetainedAssign>;
6718def warn_arc_retained_property_assign : Warning<
6719  "assigning retained object to unsafe property"
6720  "; object will be released after assignment">,
6721  InGroup<ARCUnsafeRetainedAssign>;
6722def warn_arc_literal_assign : Warning<
6723  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6724  " to a weak %select{property|variable}1"
6725  "; object will be released after assignment">,
6726  InGroup<ARCUnsafeRetainedAssign>;
6727def err_arc_new_array_without_ownership : Error<
6728  "'new' cannot allocate an array of %0 with no explicit ownership">;
6729def err_arc_autoreleasing_var : Error<
6730  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6731  "__autoreleasing ownership">;
6732def err_arc_autoreleasing_capture : Error<
6733  "cannot capture __autoreleasing variable in a "
6734  "%select{block|lambda by copy}0">;
6735def err_arc_thread_ownership : Error<
6736  "thread-local variable has non-trivial ownership: type is %0">;
6737def err_arc_indirect_no_ownership : Error<
6738  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6739def err_arc_array_param_no_ownership : Error<
6740  "must explicitly describe intended ownership of an object array parameter">;
6741def err_arc_pseudo_dtor_inconstant_quals : Error<
6742  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6743  "type %1">;
6744def err_arc_init_method_unrelated_result_type : Error<
6745  "init methods must return a type related to the receiver type">;
6746def err_arc_nonlocal_writeback : Error<
6747  "passing address of %select{non-local|non-scalar}0 object to "
6748  "__autoreleasing parameter for write-back">;
6749def err_arc_method_not_found : Error<
6750  "no known %select{instance|class}1 method for selector %0">;
6751def err_arc_receiver_forward_class : Error<
6752  "receiver %0 for class message is a forward declaration">;
6753def err_arc_may_not_respond : Error<
6754  "no visible @interface for %0 declares the selector %1">;
6755def err_arc_receiver_forward_instance : Error<
6756  "receiver type %0 for instance message is a forward declaration">;
6757def warn_receiver_forward_instance : Warning<
6758  "receiver type %0 for instance message is a forward declaration">,
6759  InGroup<ForwardClassReceiver>, DefaultIgnore;
6760def err_arc_collection_forward : Error<
6761  "collection expression type %0 is a forward declaration">;
6762def err_arc_multiple_method_decl : Error<
6763  "multiple methods named %0 found with mismatched result, "
6764  "parameter type or attributes">;
6765def warn_arc_lifetime_result_type : Warning<
6766  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6767  "lifetime qualifier on return type is ignored">,
6768  InGroup<IgnoredQualifiers>;
6769
6770let CategoryName = "ARC Retain Cycle" in {
6771
6772def warn_arc_retain_cycle : Warning<
6773  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6774  InGroup<ARCRetainCycles>;
6775def note_arc_retain_cycle_owner : Note<
6776  "block will be retained by %select{the captured object|an object strongly "
6777  "retained by the captured object}0">;
6778
6779} // end "ARC Retain Cycle" category
6780
6781def warn_arc_object_memaccess : Warning<
6782  "%select{destination for|source of}0 this %1 call is a pointer to "
6783  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6784
6785let CategoryName = "ARC and @properties" in {
6786
6787def err_arc_strong_property_ownership : Error<
6788  "existing instance variable %1 for strong property %0 may not be "
6789  "%select{|__unsafe_unretained||__weak}2">;
6790def err_arc_assign_property_ownership : Error<
6791  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6792  "attribute must be __unsafe_unretained">;
6793def err_arc_inconsistent_property_ownership : Error<
6794  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6795  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6796
6797} // end "ARC and @properties" category
6798
6799def warn_block_capture_autoreleasing : Warning<
6800  "block captures an autoreleasing out-parameter, which may result in "
6801  "use-after-free bugs">,
6802  InGroup<BlockCaptureAutoReleasing>;
6803def note_declare_parameter_strong : Note<
6804  "declare the parameter __strong or capture a __block __strong variable to "
6805  "keep values alive across autorelease pools">;
6806
6807def err_arc_atomic_ownership : Error<
6808  "cannot perform atomic operation on a pointer to type %0: type has "
6809  "non-trivial ownership">;
6810
6811let CategoryName = "ARC Casting Rules" in {
6812
6813def err_arc_bridge_cast_incompatible : Error<
6814  "incompatible types casting %0 to %1 with a %select{__bridge|"
6815  "__bridge_transfer|__bridge_retained}2 cast">;
6816def err_arc_bridge_cast_wrong_kind : Error<
6817  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6818  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6819  "__bridge_transfer|__bridge_retained}4">;
6820def err_arc_cast_requires_bridge : Error<
6821  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6822  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6823  "requires a bridged cast">;
6824def note_arc_bridge : Note<
6825  "use __bridge to convert directly (no change in ownership)">;
6826def note_arc_cstyle_bridge : Note<
6827  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6828def note_arc_bridge_transfer : Note<
6829  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6830  "ownership of a +1 %0 into ARC">;
6831def note_arc_cstyle_bridge_transfer : Note<
6832  "use __bridge_transfer with C-style cast to transfer "
6833  "ownership of a +1 %0 into ARC">;
6834def note_arc_bridge_retained : Note<
6835  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6836  "ARC object available as a +1 %0">;
6837def note_arc_cstyle_bridge_retained : Note<
6838  "use __bridge_retained with C-style cast to make an "
6839  "ARC object available as a +1 %0">;
6840
6841} // ARC Casting category
6842
6843} // ARC category name
6844
6845def err_flexible_array_init_needs_braces : Error<
6846  "flexible array requires brace-enclosed initializer">;
6847def err_illegal_decl_array_of_functions : Error<
6848  "'%0' declared as array of functions of type %1">;
6849def err_array_incomplete_or_sizeless_type : Error<
6850  "array has %select{incomplete|sizeless}0 element type %1">;
6851def err_illegal_message_expr_incomplete_type : Error<
6852  "Objective-C message has incomplete result type %0">;
6853def err_illegal_decl_array_of_references : Error<
6854  "'%0' declared as array of references of type %1">;
6855def err_decl_negative_array_size : Error<
6856  "'%0' declared as an array with a negative size">;
6857def err_array_static_outside_prototype : Error<
6858  "%0 used in array declarator outside of function prototype">;
6859def err_array_static_not_outermost : Error<
6860  "%0 used in non-outermost array type derivation">;
6861def err_array_star_outside_prototype : Error<
6862  "star modifier used outside of function prototype">;
6863def err_illegal_decl_pointer_to_reference : Error<
6864  "'%0' declared as a pointer to a reference of type %1">;
6865def err_illegal_decl_mempointer_to_reference : Error<
6866  "'%0' declared as a member pointer to a reference of type %1">;
6867def err_illegal_decl_mempointer_to_void : Error<
6868  "'%0' declared as a member pointer to void">;
6869def err_illegal_decl_mempointer_in_nonclass : Error<
6870  "'%0' does not point into a class">;
6871def err_mempointer_in_nonclass_type : Error<
6872  "member pointer refers into non-class type %0">;
6873def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6874def err_nonfunction_block_type : Error<
6875  "block pointer to non-function type is invalid">;
6876def err_return_block_has_expr : Error<"void block should not return a value">;
6877def err_block_return_missing_expr : Error<
6878  "non-void block should return a value">;
6879def err_func_def_incomplete_result : Error<
6880  "incomplete result type %0 in function definition">;
6881def err_atomic_specifier_bad_type
6882    : Error<"_Atomic cannot be applied to "
6883            "%select{incomplete |array |function |reference |atomic |qualified "
6884            "|sizeless ||integer |}0type "
6885            "%1 %select{|||||||which is not trivially copyable||in C23}0">;
6886def warn_atomic_member_access : Warning<
6887  "accessing a member of an atomic structure or union is undefined behavior">,
6888  InGroup<DiagGroup<"atomic-access">>, DefaultError;
6889
6890// Expressions.
6891def err_using_placeholder_variable : Error<
6892  "ambiguous reference to placeholder '_', which is defined multiple times">;
6893def note_reference_placeholder : Note<
6894  "placeholder declared here">;
6895def ext_placeholder_var_definition : ExtWarn<
6896  "placeholder variables are a C++2c extension">, InGroup<CXX26>;
6897def warn_cxx23_placeholder_var_definition : Warning<
6898  "placeholder variables are incompatible with C++ standards before C++2c">,
6899  DefaultIgnore, InGroup<CXXPre26Compat>;
6900
6901def ext_sizeof_alignof_function_type : Extension<
6902  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6903def ext_sizeof_alignof_void_type : Extension<
6904  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6905def err_opencl_sizeof_alignof_type : Error<
6906  "invalid application of '%0' to a void type">;
6907def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6908  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6909def err_sizeof_alignof_function_type : Error<
6910  "invalid application of '%0' to a function type">;
6911def err_openmp_default_simd_align_expr : Error<
6912  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6913def err_sizeof_alignof_typeof_bitfield : Error<
6914  "invalid application of '%select{sizeof|alignof|typeof|typeof_unqual}0' to "
6915  "bit-field">;
6916def err_alignof_member_of_incomplete_type : Error<
6917  "invalid application of 'alignof' to a field of a class still being defined">;
6918def err_vecstep_non_scalar_vector_type : Error<
6919  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6920def err_offsetof_incomplete_type : Error<
6921  "offsetof of incomplete type %0">;
6922def err_offsetof_record_type : Error<
6923  "offsetof requires struct, union, or class type, %0 invalid">;
6924def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6925def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6926  InGroup<InvalidOffsetof>;
6927def ext_offsetof_non_standardlayout_type : ExtWarn<
6928  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6929def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6930def err_offsetof_field_of_virtual_base : Error<
6931  "invalid application of 'offsetof' to a field of a virtual base">;
6932def warn_sub_ptr_zero_size_types : Warning<
6933  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6934  InGroup<PointerArith>;
6935def warn_pointer_arith_null_ptr : Warning<
6936  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6937  InGroup<NullPointerArithmetic>, DefaultIgnore;
6938def warn_gnu_null_ptr_arith : Extension<
6939  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6940  InGroup<GNUNullPointerArithmetic>;
6941def warn_pointer_sub_null_ptr : Warning<
6942  "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
6943  InGroup<NullPointerSubtraction>, DefaultIgnore;
6944
6945def warn_floatingpoint_eq : Warning<
6946  "comparing floating point with == or != is unsafe">,
6947  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6948
6949def err_setting_eval_method_used_in_unsafe_context : Error <
6950  "%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used with "
6951  "%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'|'#pragma clang fp reciprocal'}1">;
6952
6953def warn_remainder_division_by_zero : Warning<
6954  "%select{remainder|division}0 by zero is undefined">,
6955  InGroup<DivZero>;
6956def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6957  InGroup<DiagGroup<"shift-negative-value">>;
6958def warn_shift_negative : Warning<"shift count is negative">,
6959  InGroup<DiagGroup<"shift-count-negative">>;
6960def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6961  InGroup<DiagGroup<"shift-count-overflow">>;
6962def warn_shift_result_gt_typewidth : Warning<
6963  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6964  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6965def warn_shift_result_sets_sign_bit : Warning<
6966  "signed shift result (%0) sets the sign bit of the shift expression's "
6967  "type (%1) and becomes negative">,
6968  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6969
6970def warn_precedence_bitwise_rel : Warning<
6971  "%0 has lower precedence than %1; %1 will be evaluated first">,
6972  InGroup<Parentheses>;
6973def note_precedence_bitwise_first : Note<
6974  "place parentheses around the %0 expression to evaluate it first">;
6975def note_precedence_silence : Note<
6976  "place parentheses around the '%0' expression to silence this warning">;
6977
6978def warn_precedence_conditional : Warning<
6979  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6980  InGroup<Parentheses>;
6981def warn_precedence_bitwise_conditional : Warning<
6982  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6983  InGroup<BitwiseConditionalParentheses>;
6984def note_precedence_conditional_first : Note<
6985  "place parentheses around the '?:' expression to evaluate it first">;
6986
6987def warn_consecutive_comparison : Warning<
6988  "comparisons like 'X<=Y<=Z' don't have their mathematical meaning">,
6989  InGroup<Parentheses>;
6990
6991def warn_enum_constant_in_bool_context : Warning<
6992  "converting the enum constant to a boolean">,
6993  InGroup<IntInBoolContext>, DefaultIgnore;
6994def warn_left_shift_in_bool_context : Warning<
6995  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6996  InGroup<IntInBoolContext>, DefaultIgnore;
6997def warn_logical_instead_of_bitwise : Warning<
6998  "use of logical '%0' with constant operand">,
6999  InGroup<DiagGroup<"constant-logical-operand">>;
7000def note_logical_instead_of_bitwise_change_operator : Note<
7001  "use '%0' for a bitwise operation">;
7002def note_logical_instead_of_bitwise_remove_constant : Note<
7003  "remove constant to silence this warning">;
7004
7005def warn_bitwise_op_in_bitwise_op : Warning<
7006  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
7007
7008def warn_logical_and_in_logical_or : Warning<
7009  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
7010
7011def warn_overloaded_shift_in_comparison :Warning<
7012  "overloaded operator %select{>>|<<}0 has higher precedence than "
7013  "comparison operator">,
7014  InGroup<OverloadedShiftOpParentheses>;
7015def note_evaluate_comparison_first :Note<
7016  "place parentheses around comparison expression to evaluate it first">;
7017
7018def note_concatenated_string_literal_silence :Note<
7019  "place parentheses around the string literal to silence warning">;
7020
7021def warn_addition_in_bitshift : Warning<
7022  "operator '%0' has lower precedence than '%1'; "
7023  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
7024
7025def warn_self_assignment_builtin : Warning<
7026  "explicitly assigning value of variable of type %0 to itself%select{|; did "
7027  "you mean to assign to member %2?}1">,
7028  InGroup<SelfAssignment>, DefaultIgnore;
7029def warn_self_assignment_overloaded : Warning<
7030  "explicitly assigning value of variable of type %0 to itself%select{|; did "
7031  "you mean to assign to member %2?}1">,
7032  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
7033def warn_self_move : Warning<
7034  "explicitly moving variable of type %0 to itself%select{|; did you mean to "
7035  "move to member %2?}1">,
7036  InGroup<SelfMove>, DefaultIgnore;
7037
7038def err_builtin_move_forward_unsupported : Error<
7039  "unsupported signature for %q0">;
7040def err_use_of_unaddressable_function : Error<
7041  "taking address of non-addressable standard library function">;
7042// FIXME: This should also be in -Wc++23-compat once we have it.
7043def warn_cxx20_compat_use_of_unaddressable_function : Warning<
7044  "taking address of non-addressable standard library function "
7045  "is incompatible with C++20">, InGroup<CXX20Compat>;
7046
7047def warn_redundant_move_on_return : Warning<
7048  "redundant move in return statement">,
7049  InGroup<RedundantMove>, DefaultIgnore;
7050def warn_pessimizing_move_on_return : Warning<
7051  "moving a local object in a return statement prevents copy elision">,
7052  InGroup<PessimizingMove>, DefaultIgnore;
7053def warn_pessimizing_move_on_initialization : Warning<
7054  "moving a temporary object prevents copy elision">,
7055  InGroup<PessimizingMove>, DefaultIgnore;
7056def note_remove_move : Note<"remove std::move call here">;
7057
7058def warn_string_plus_int : Warning<
7059  "adding %0 to a string does not append to the string">,
7060  InGroup<StringPlusInt>;
7061def warn_string_plus_char : Warning<
7062  "adding %0 to a string pointer does not append to the string">,
7063  InGroup<StringPlusChar>;
7064def note_string_plus_scalar_silence : Note<
7065  "use array indexing to silence this warning">;
7066
7067def warn_sizeof_array_param : Warning<
7068  "sizeof on array function parameter will return size of %0 instead of %1">,
7069  InGroup<SizeofArrayArgument>;
7070
7071def warn_sizeof_array_decay : Warning<
7072  "sizeof on pointer operation will return size of %0 instead of %1">,
7073  InGroup<SizeofArrayDecay>;
7074
7075def err_sizeof_nonfragile_interface : Error<
7076  "application of '%select{alignof|sizeof}1' to interface %0 is "
7077  "not supported on this architecture and platform">;
7078def err_atdef_nonfragile_interface : Error<
7079  "use of @defs is not supported on this architecture and platform">;
7080def err_subscript_nonfragile_interface : Error<
7081  "subscript requires size of interface %0, which is not constant for "
7082  "this architecture and platform">;
7083
7084def err_arithmetic_nonfragile_interface : Error<
7085  "arithmetic on pointer to interface %0, which is not a constant size for "
7086  "this architecture and platform">;
7087
7088def warn_deprecated_comma_subscript : Warning<
7089  "top-level comma expression in array subscript is deprecated "
7090  "in C++20 and unsupported in C++23">,
7091  InGroup<DeprecatedCommaSubscript>;
7092
7093def ext_subscript_non_lvalue : Extension<
7094  "ISO C90 does not allow subscripting non-lvalue array">;
7095def err_typecheck_subscript_value : Error<
7096  "subscripted value is not an array, pointer, or vector">;
7097def err_typecheck_subscript_not_integer : Error<
7098  "array subscript is not an integer">;
7099def err_subscript_function_type : Error<
7100  "subscript of pointer to function type %0">;
7101def err_subscript_incomplete_or_sizeless_type : Error<
7102  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
7103def err_subscript_svbool_t : Error<
7104  "subscript of svbool_t is not allowed">;
7105def err_dereference_incomplete_type : Error<
7106  "dereference of pointer to incomplete type %0">;
7107def ext_gnu_subscript_void_type : Extension<
7108  "subscript of a pointer to void is a GNU extension">,
7109  InGroup<GNUPointerArith>;
7110def err_typecheck_member_reference_struct_union : Error<
7111  "member reference base type %0 is not a structure or union">;
7112def err_typecheck_member_reference_ivar : Error<
7113  "%0 does not have a member named %1">;
7114def err_arc_weak_ivar_access : Error<
7115  "dereferencing a __weak pointer is not allowed due to possible "
7116  "null value caused by race condition, assign it to strong variable first">;
7117def err_typecheck_member_reference_arrow : Error<
7118  "member reference type %0 is not a pointer">;
7119def err_typecheck_member_reference_suggestion : Error<
7120  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
7121def note_typecheck_member_reference_suggestion : Note<
7122  "did you mean to use '.' instead?">;
7123def note_member_reference_arrow_from_operator_arrow : Note<
7124  "'->' applied to return value of the operator->() declared here">;
7125def err_typecheck_member_reference_type : Error<
7126  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
7127def err_typecheck_member_reference_unknown : Error<
7128  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
7129def err_member_reference_needs_call : Error<
7130  "base of member reference is a function; perhaps you meant to call "
7131  "it%select{| with no arguments}0?">;
7132def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
7133  InGroup<CharSubscript>, DefaultIgnore;
7134
7135def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
7136def err_no_member : Error<"no member named %0 in %1">;
7137def err_no_member_overloaded_arrow : Error<
7138  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
7139
7140def err_member_not_yet_instantiated : Error<
7141  "no member %0 in %1; it has not yet been instantiated">;
7142def note_non_instantiated_member_here : Note<
7143  "not-yet-instantiated member is declared here">;
7144
7145def err_enumerator_does_not_exist : Error<
7146  "enumerator %0 does not exist in instantiation of %1">;
7147def note_enum_specialized_here : Note<
7148  "enum %0 was explicitly specialized here">;
7149
7150def err_specialization_not_primary_template : Error<
7151  "cannot reference member of primary template because deduced class "
7152  "template specialization %0 is %select{instantiated from a partial|"
7153  "an explicit}1 specialization">;
7154
7155def err_member_redeclared : Error<"class member cannot be redeclared">;
7156def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
7157  InGroup<RedeclaredClassMember>;
7158def err_member_redeclared_in_instantiation : Error<
7159  "multiple overloads of %0 instantiate to the same signature %1">;
7160def err_member_name_of_class : Error<"member %0 has the same name as its class">;
7161def err_member_def_undefined_record : Error<
7162  "out-of-line definition of %0 from class %1 without definition">;
7163def err_member_decl_does_not_match : Error<
7164  "out-of-line %select{declaration|definition}2 of %0 "
7165  "does not match any declaration in %1">;
7166def err_friend_decl_with_def_arg_must_be_def : Error<
7167  "friend declaration specifying a default argument must be a definition">;
7168def err_friend_decl_with_enclosing_temp_constraint_must_be_def : Error<
7169  "friend declaration with a constraint that depends on an enclosing "
7170  "template parameter must be a definition">;
7171def err_non_temp_friend_decl_with_requires_clause_must_be_def : Error<
7172  "non-template friend declaration with a requires clause must be a definition">;
7173def err_friend_decl_with_def_arg_redeclared : Error<
7174  "friend declaration specifying a default argument must be the only declaration">;
7175def err_friend_decl_does_not_match : Error<
7176  "friend declaration of %0 does not match any declaration in %1">;
7177def err_member_decl_does_not_match_suggest : Error<
7178  "out-of-line %select{declaration|definition}2 of %0 "
7179  "does not match any declaration in %1; did you mean %3?">;
7180def err_member_def_does_not_match_ret_type : Error<
7181  "return type of out-of-line definition of %q0 differs from "
7182  "that in the declaration">;
7183def err_nonstatic_member_out_of_line : Error<
7184  "non-static data member defined out-of-line">;
7185def err_qualified_typedef_declarator : Error<
7186  "typedef declarator cannot be qualified">;
7187def err_qualified_param_declarator : Error<
7188  "parameter declarator cannot be qualified">;
7189def ext_out_of_line_declaration : ExtWarn<
7190  "out-of-line declaration of a member must be a definition">,
7191  InGroup<OutOfLineDeclaration>, DefaultError;
7192def err_member_extra_qualification : Error<
7193  "extra qualification on member %0">;
7194def warn_member_extra_qualification : Warning<
7195  err_member_extra_qualification.Summary>, InGroup<MicrosoftExtraQualification>;
7196def warn_namespace_member_extra_qualification : Warning<
7197  "extra qualification on member %0">,
7198  InGroup<DiagGroup<"extra-qualification">>;
7199def err_member_qualification : Error<
7200  "non-friend class member %0 cannot have a qualified name">;
7201def note_member_def_close_match : Note<"member declaration nearly matches">;
7202def note_member_def_close_const_match : Note<
7203  "member declaration does not match because "
7204  "it %select{is|is not}0 const qualified">;
7205def note_member_def_close_param_match : Note<
7206  "type of %ordinal0 parameter of member declaration does not match definition"
7207  "%diff{ ($ vs $)|}1,2">;
7208def note_local_decl_close_match : Note<"local declaration nearly matches">;
7209def note_local_decl_close_param_match : Note<
7210  "type of %ordinal0 parameter of local declaration does not match definition"
7211  "%diff{ ($ vs $)|}1,2">;
7212def err_typecheck_ivar_variable_size : Error<
7213  "instance variables must have a constant size">;
7214def err_ivar_reference_type : Error<
7215  "instance variables cannot be of reference type">;
7216def err_typecheck_illegal_increment_decrement : Error<
7217  "cannot %select{decrement|increment}1 value of type %0">;
7218def err_typecheck_expect_int : Error<
7219  "used type %0 where integer is required">;
7220def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
7221  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
7222def err_typecheck_pointer_arith_function_type : Error<
7223  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
7224  "function type%select{|s}2 %1%select{| and %3}2">;
7225def err_typecheck_pointer_arith_void_type : Error<
7226  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
7227def err_typecheck_decl_incomplete_type : Error<
7228  "variable has incomplete type %0">;
7229def ext_typecheck_decl_incomplete_type : ExtWarn<
7230  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
7231  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
7232def err_tentative_def_incomplete_type : Error<
7233  "tentative definition has type %0 that is never completed">;
7234def warn_tentative_incomplete_array : Warning<
7235  "tentative array definition assumed to have one element">,
7236  InGroup<DiagGroup<"tentative-definition-array">>;
7237def err_typecheck_incomplete_array_needs_initializer : Error<
7238  "definition of variable with array type needs an explicit size "
7239  "or an initializer">;
7240def err_array_init_not_init_list : Error<
7241  "array initializer must be an initializer "
7242  "list%select{| or string literal| or wide string literal}0">;
7243def err_array_init_narrow_string_into_wchar : Error<
7244  "initializing wide char array with non-wide string literal">;
7245def err_array_init_wide_string_into_char : Error<
7246  "initializing char array with wide string literal">;
7247def err_array_init_incompat_wide_string_into_wchar : Error<
7248  "initializing wide char array with incompatible wide string literal">;
7249def err_array_init_plain_string_into_char8_t : Error<
7250  "initializing 'char8_t' array with plain string literal">;
7251def note_array_init_plain_string_into_char8_t : Note<
7252  "add 'u8' prefix to form a 'char8_t' string literal">;
7253def err_array_init_utf8_string_into_char : Error<
7254  "initialization of %select{|signed }0char array with "
7255  "UTF-8 string literal is not permitted by %select{'-fchar8_t'|C++20}1">;
7256def warn_cxx20_compat_utf8_string : Warning<
7257  "type of UTF-8 string literal will change from array of const char to "
7258  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
7259def warn_c23_compat_utf8_string : Warning<
7260  "type of UTF-8 string literal will change from array of char to "
7261  "array of char8_t in C23">, InGroup<C23Compat>, DefaultIgnore;
7262def note_cxx20_c23_compat_utf8_string_remove_u8 : Note<
7263  "remove 'u8' prefix to avoid a change of behavior; "
7264  "Clang encodes unprefixed narrow string literals as UTF-8">;
7265def err_array_init_different_type : Error<
7266  "cannot initialize array %diff{of type $ with array of type $|"
7267  "with different type of array}0,1">;
7268def err_array_init_non_constant_array : Error<
7269  "cannot initialize array %diff{of type $ with non-constant array of type $|"
7270  "with different type of array}0,1">;
7271def ext_array_init_copy : Extension<
7272  "initialization of an array "
7273  "%diff{of type $ from a compound literal of type $|"
7274  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
7275// This is intentionally not disabled by -Wno-gnu.
7276def ext_array_init_parens : ExtWarn<
7277  "parenthesized initialization of a member array is a GNU extension">,
7278  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
7279def warn_deprecated_string_literal_conversion : Warning<
7280  "conversion from string literal to %0 is deprecated">,
7281  InGroup<CXX11CompatDeprecatedWritableStr>;
7282def ext_deprecated_string_literal_conversion : ExtWarn<
7283  "ISO C++11 does not allow conversion from string literal to %0">,
7284  InGroup<WritableStrings>, SFINAEFailure;
7285def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
7286def err_typecheck_sclass_fscope : Error<
7287  "illegal storage class on file-scoped variable">;
7288def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
7289  InGroup<MissingDeclarations>;
7290def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
7291  "of a type">, InGroup<MissingDeclarations>;
7292def err_standalone_class_nested_name_specifier : Error<
7293  "forward declaration of %0 cannot have a nested name specifier">;
7294def err_typecheck_sclass_func : Error<"illegal storage class on function">;
7295def err_static_block_func : Error<
7296  "function declared in block scope cannot have 'static' storage class">;
7297def err_typecheck_address_of : Error<"address of %select{bit-field"
7298  "|vector element|property expression|register variable|matrix element}0 requested">;
7299def ext_typecheck_addrof_void : Extension<
7300  "ISO C forbids taking the address of an expression of type 'void'">;
7301def err_unqualified_pointer_member_function : Error<
7302  "must explicitly qualify name of member function when taking its address">;
7303def err_invalid_form_pointer_member_function : Error<
7304  "cannot create a non-constant pointer to member function">;
7305def err_address_of_function_with_pass_object_size_params: Error<
7306  "cannot take address of function %0 because parameter %1 has "
7307  "pass_object_size attribute">;
7308def err_parens_pointer_member_function : Error<
7309  "cannot parenthesize the name of a method when forming a member pointer">;
7310def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
7311  "extra '&' taking address of overloaded function">;
7312def err_typecheck_invalid_lvalue_addrof : Error<
7313  "cannot take the address of an rvalue of type %0">;
7314def ext_typecheck_addrof_temporary : ExtWarn<
7315  "taking the address of a temporary object of type %0">,
7316  InGroup<AddressOfTemporary>, DefaultError;
7317def err_typecheck_addrof_temporary : Error<
7318  "taking the address of a temporary object of type %0">;
7319def err_typecheck_addrof_dtor : Error<
7320  "taking the address of a destructor">;
7321def err_typecheck_unary_expr : Error<
7322  "invalid argument type %0 to unary expression">;
7323def err_typecheck_indirection_requires_pointer : Error<
7324  "indirection requires pointer operand (%0 invalid)">;
7325def ext_typecheck_indirection_through_void_pointer : ExtWarn<
7326  "ISO C does not allow indirection on operand of type %0">,
7327  InGroup<VoidPointerDeref>;
7328def err_typecheck_indirection_through_void_pointer_cpp
7329    : Error<"indirection not permitted on operand of type %0">;
7330def warn_indirection_through_null : Warning<
7331  "indirection of non-volatile null pointer will be deleted, not trap">,
7332  InGroup<NullDereference>;
7333def warn_binding_null_to_reference : Warning<
7334  "binding dereferenced null pointer to reference has undefined behavior">,
7335  InGroup<NullDereference>;
7336def note_indirection_through_null : Note<
7337  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
7338def warn_pointer_indirection_from_incompatible_type : Warning<
7339  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
7340  "behavior">,
7341  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7342def warn_taking_address_of_packed_member : Warning<
7343  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
7344  InGroup<DiagGroup<"address-of-packed-member">>;
7345def warn_param_mismatched_alignment : Warning<
7346  "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">,
7347  InGroup<DiagGroup<"align-mismatch">>;
7348
7349def err_objc_object_assignment : Error<
7350  "cannot assign to class object (%0 invalid)">;
7351def err_typecheck_invalid_operands : Error<
7352  "invalid operands to binary expression (%0 and %1)">, Deferrable;
7353def note_typecheck_invalid_operands_converted : Note<
7354  "%select{first|second}0 operand was implicitly converted to type %1">;
7355def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
7356  "logical expression with vector %select{type %1 and non-vector type %2|types"
7357  " %1 and %2}0 is only supported in C++">;
7358def err_typecheck_sub_ptr_compatible : Error<
7359  "%diff{$ and $ are not pointers to compatible types|"
7360  "pointers to incompatible types}0,1">;
7361def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
7362  "ordered comparison between pointer and integer (%0 and %1)">;
7363def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
7364  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
7365def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
7366  "ordered comparison between pointer and zero (%0 and %1)">;
7367def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
7368  "three-way comparison between pointer and zero">;
7369def ext_typecheck_compare_complete_incomplete_pointers : Extension<
7370  "pointer comparisons before C11 "
7371  "need to be between two complete or two incomplete types; "
7372  "%0 is %select{|in}2complete and "
7373  "%1 is %select{|in}3complete">,
7374  InGroup<C11>;
7375def warn_typecheck_ordered_comparison_of_function_pointers : Warning<
7376  "ordered comparison of function pointers (%0 and %1)">,
7377  InGroup<OrderedCompareFunctionPointers>;
7378def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
7379  "ordered comparison of function pointers (%0 and %1)">,
7380  InGroup<OrderedCompareFunctionPointers>;
7381def err_typecheck_ordered_comparison_of_function_pointers : Error<
7382  "ordered comparison of function pointers (%0 and %1)">;
7383def ext_typecheck_comparison_of_fptr_to_void : Extension<
7384  "equality comparison between function pointer and void pointer (%0 and %1)">;
7385def err_typecheck_comparison_of_fptr_to_void : Error<
7386  "equality comparison between function pointer and void pointer (%0 and %1)">;
7387def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
7388  "comparison between pointer and integer (%0 and %1)">,
7389  InGroup<DiagGroup<"pointer-integer-compare">>;
7390def err_typecheck_comparison_of_pointer_integer : Error<
7391  "comparison between pointer and integer (%0 and %1)">;
7392def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
7393  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
7394  InGroup<CompareDistinctPointerType>;
7395def ext_typecheck_cond_incompatible_operands : ExtWarn<
7396  "incompatible operand types (%0 and %1)">;
7397def err_cond_voidptr_arc : Error <
7398  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
7399  "in ARC mode">;
7400def err_typecheck_comparison_of_distinct_pointers : Error<
7401  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
7402def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
7403  "%select{comparison between %diff{ ($ and $)|}0,1"
7404  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
7405  "|conditional operator with the second and third operands of type "
7406  "%diff{ ($ and $)|}0,1}2"
7407  " which are pointers to non-overlapping address spaces">;
7408
7409def select_arith_conv_kind : TextSubstitution<
7410  "%select{arithmetic between|bitwise operation between|comparison of|"
7411  "conditional expression between|compound assignment of}0">;
7412def warn_arith_conv_enum_float : Warning<
7413  "%sub{select_arith_conv_kind}0 "
7414  "%select{floating-point|enumeration}1 type %2 "
7415  "%plural{2:with|4:from|:and}0 "
7416  "%select{enumeration|floating-point}1 type %3">,
7417  InGroup<EnumFloatConversion>, DefaultIgnore;
7418def warn_arith_conv_enum_float_cxx20 : Warning<
7419  "%sub{select_arith_conv_kind}0 "
7420  "%select{floating-point|enumeration}1 type %2 "
7421  "%plural{2:with|4:from|:and}0 "
7422  "%select{enumeration|floating-point}1 type %3 is deprecated">,
7423  InGroup<DeprecatedEnumFloatConversion>;
7424def err_arith_conv_enum_float_cxx26 : Error<
7425  "invalid %sub{select_arith_conv_kind}0 "
7426  "%select{floating-point|enumeration}1 type %2 "
7427  "%plural{2:with|4:from|:and}0 "
7428  "%select{enumeration|floating-point}1 type %3">;
7429def warn_arith_conv_mixed_enum_types : Warning<
7430  "%sub{select_arith_conv_kind}0 "
7431  "different enumeration types%diff{ ($ and $)|}1,2">,
7432  InGroup<EnumEnumConversion>, DefaultIgnore;
7433def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
7434  "%sub{select_arith_conv_kind}0 "
7435  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
7436  InGroup<DeprecatedEnumEnumConversion>;
7437def err_conv_mixed_enum_types_cxx26 : Error<
7438  "invalid %sub{select_arith_conv_kind}0 "
7439  "different enumeration types%diff{ ($ and $)|}1,2">;
7440
7441def warn_arith_conv_mixed_anon_enum_types : Warning<
7442  warn_arith_conv_mixed_enum_types.Summary>,
7443  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
7444def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
7445  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7446  InGroup<DeprecatedAnonEnumEnumConversion>;
7447def warn_conditional_mixed_enum_types : Warning<
7448  warn_arith_conv_mixed_enum_types.Summary>,
7449  InGroup<EnumCompareConditional>, DefaultIgnore;
7450def warn_conditional_mixed_enum_types_cxx20 : Warning<
7451  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7452  InGroup<DeprecatedEnumCompareConditional>;
7453def warn_comparison_mixed_enum_types : Warning<
7454  warn_arith_conv_mixed_enum_types.Summary>,
7455  InGroup<EnumCompare>;
7456def warn_comparison_mixed_enum_types_cxx20 : Warning<
7457  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7458  InGroup<DeprecatedEnumCompare>;
7459def warn_comparison_of_mixed_enum_types_switch : Warning<
7460  "comparison of different enumeration types in switch statement"
7461  "%diff{ ($ and $)|}0,1">,
7462  InGroup<EnumCompareSwitch>;
7463
7464def err_typecheck_assign_const : Error<
7465  "%select{"
7466  "cannot assign to return value because function %1 returns a const value|"
7467  "cannot assign to variable %1 with const-qualified type %2|"
7468  "cannot assign to %select{non-|}1static data member %2 "
7469  "with const-qualified type %3|"
7470  "cannot assign to non-static data member within const member function %1|"
7471  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
7472  "with %select{|nested }3const-qualified data member %4|"
7473  "read-only variable is not assignable}0">;
7474
7475def note_typecheck_assign_const : Note<
7476  "%select{"
7477  "function %1 which returns const-qualified type %2 declared here|"
7478  "variable %1 declared const here|"
7479  "%select{non-|}1static data member %2 declared const here|"
7480  "member function %q1 is declared const here|"
7481  "%select{|nested }1data member %2 declared const here}0">;
7482
7483def warn_unsigned_always_true_comparison : Warning<
7484  "result of comparison of %select{%3|unsigned expression}0 %2 "
7485  "%select{unsigned expression|%3}0 is always %4">,
7486  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
7487def warn_unsigned_char_always_true_comparison : Warning<
7488  "result of comparison of %select{%3|char expression}0 %2 "
7489  "%select{char expression|%3}0 is always %4, since char is interpreted as "
7490  "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore;
7491def warn_unsigned_enum_always_true_comparison : Warning<
7492  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
7493  "%select{unsigned enum expression|%3}0 is always %4">,
7494  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
7495def warn_tautological_constant_compare : Warning<
7496  "result of comparison %select{%3|%1}0 %2 "
7497  "%select{%1|%3}0 is always %4">,
7498  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
7499def warn_tautological_compare_objc_bool : Warning<
7500  "result of comparison of constant %0 with expression of type 'BOOL'"
7501  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
7502  InGroup<TautologicalObjCBoolCompare>;
7503def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
7504def warn_tautological_compare_value_range : Warning<
7505  "result of comparison of "
7506  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
7507  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
7508  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
7509
7510def warn_mixed_sign_comparison : Warning<
7511  "comparison of integers of different signs: %0 and %1">,
7512  InGroup<SignCompare>, DefaultIgnore;
7513def warn_out_of_range_compare : Warning<
7514  "result of comparison of %select{constant %0|true|false}1 with "
7515  "%select{expression of type %2|boolean expression}3 is always %4">,
7516  InGroup<TautologicalOutOfRangeCompare>;
7517def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Summary>,
7518  InGroup<TautologicalConstantCompare>;
7519def warn_integer_constants_in_conditional_always_true : Warning<
7520  "converting the result of '?:' with integer constants to a boolean always "
7521  "evaluates to 'true'">,
7522  InGroup<TautologicalConstantCompare>;
7523def warn_left_shift_always : Warning<
7524  "converting the result of '<<' to a boolean always evaluates "
7525  "to %select{false|true}0">,
7526  InGroup<TautologicalConstantCompare>;
7527def warn_null_in_arithmetic_operation : Warning<
7528  "use of NULL in arithmetic operation">,
7529  InGroup<NullArithmetic>;
7530def warn_null_in_comparison_operation : Warning<
7531  "comparison between NULL and non-pointer "
7532  "%select{(%1 and NULL)|(NULL and %1)}0">,
7533  InGroup<NullArithmetic>;
7534def err_shift_rhs_only_vector : Error<
7535  "requested shift is a vector of type %0 but the first operand is not a "
7536  "vector (%1)">;
7537
7538def warn_logical_not_on_lhs_of_check : Warning<
7539  "logical not is only applied to the left hand side of this "
7540  "%select{comparison|bitwise operator}0">,
7541  InGroup<LogicalNotParentheses>;
7542def note_logical_not_fix : Note<
7543  "add parentheses after the '!' to evaluate the "
7544  "%select{comparison|bitwise operator}0 first">;
7545def note_logical_not_silence_with_parens : Note<
7546  "add parentheses around left hand side expression to silence this warning">;
7547
7548def err_invalid_this_use : Error<
7549  "invalid use of 'this' %select{outside of a non-static member function"
7550  "|in a function with an explicit object parameter}0">;
7551def err_this_static_member_func : Error<
7552  "'this' cannot be%select{| implicitly}0 used in a static member function "
7553  "declaration">;
7554def err_invalid_member_use_in_method : Error<
7555  "invalid use of member %0 in %select{static|explicit object}1 member function">;
7556
7557def err_invalid_qualified_function_type : Error<
7558  "%select{non-member function|static member function|explicit object member function|deduction guide}0 "
7559  "%select{of type %2 |}1cannot have '%3' qualifier">;
7560def err_compound_qualified_function_type : Error<
7561  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
7562  "cannot have '%3' qualifier">;
7563def err_qualified_function_typeid : Error<
7564  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
7565
7566def err_cxx20_deducing_this  : Error<
7567  "explicit object parameters are incompatible with C++ standards before C++2b">;
7568def err_explicit_object_default_arg: Error<
7569  "the explicit object parameter cannot have a default argument">;
7570def err_explicit_object_parameter_pack: Error<
7571  "the explicit object parameter cannot be a function parameter pack">;
7572def err_explicit_object_parameter_must_be_first: Error<
7573  "an explicit object parameter can only appear as the first parameter "
7574  "of the %select{function|lambda}0">;
7575def err_explicit_object_parameter_nonmember: Error<
7576  "an explicit object parameter cannot appear in a "
7577  "%select{static|virtual|non-member}0 %select{function|lambda}1">;
7578def err_explicit_object_parameter_constructor: Error<
7579  "an explicit object parameter cannot appear in a %select{constructor|destructor}0">;
7580def err_explicit_object_parameter_mutable: Error<
7581  "a lambda with an explicit object parameter cannot be mutable">;
7582def err_invalid_explicit_object_type_in_lambda: Error<
7583  "invalid explicit object parameter type %0 in lambda with capture; "
7584  "the type must be the same as, or derived from, the lambda">;
7585def err_explicit_object_lambda_ambiguous_base : Error<
7586  "lambda %0 is inaccessible due to ambiguity:%1">;
7587def err_explicit_object_lambda_inaccessible_base : Error<
7588  "invalid explicit object parameter type %0 in lambda with capture; "
7589  "the type must derive publicly from the lambda">;
7590def err_explicit_object_parameter_invalid: Error<
7591  "an explicit object parameter can only appear as the first parameter of a member function">;
7592
7593def err_ref_qualifier_overload : Error<
7594  "cannot overload a member function %select{without a ref-qualifier|with "
7595  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
7596  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
7597
7598def err_invalid_non_static_member_use : Error<
7599  "invalid use of non-static data member %0">;
7600def err_nested_non_static_member_use : Error<
7601  "%select{call to non-static member function|use of non-static data member}0 "
7602  "%2 of %1 from nested type %3">;
7603def warn_cxx98_compat_non_static_member_use : Warning<
7604  "use of non-static data member %0 in an unevaluated context is "
7605  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
7606def err_invalid_incomplete_type_use : Error<
7607  "invalid use of incomplete type %0">;
7608def err_builtin_func_cast_more_than_one_arg : Error<
7609  "function-style cast to a builtin type can only take one argument">;
7610def err_value_init_for_array_type : Error<
7611  "array types cannot be value-initialized">;
7612def err_init_for_function_type : Error<
7613  "cannot create object of function type %0">;
7614def warn_format_nonliteral_noargs : Warning<
7615  "format string is not a string literal (potentially insecure)">,
7616  InGroup<FormatSecurity>;
7617def warn_format_nonliteral : Warning<
7618  "format string is not a string literal">,
7619  InGroup<FormatNonLiteral>, DefaultIgnore;
7620
7621def err_unexpected_interface : Error<
7622  "unexpected interface name %0: expected expression">;
7623def err_ref_non_value : Error<"%0 does not refer to a value">;
7624def err_ref_vm_type : Error<
7625  "cannot refer to declaration with a variably modified type inside block">;
7626def err_ref_flexarray_type : Error<
7627  "cannot refer to declaration of structure variable with flexible array member "
7628  "inside block">;
7629def err_ref_array_type : Error<
7630  "cannot refer to declaration with an array type inside block">;
7631def err_property_not_found : Error<
7632  "property %0 not found on object of type %1">;
7633def err_invalid_property_name : Error<
7634  "%0 is not a valid property name (accessing an object of type %1)">;
7635def err_getter_not_found : Error<
7636  "no getter method for read from property">;
7637def err_objc_subscript_method_not_found : Error<
7638  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
7639  "found on object of type %0">;
7640def err_objc_subscript_index_type : Error<
7641  "method index parameter type %0 is not integral type">;
7642def err_objc_subscript_key_type : Error<
7643  "method key parameter type %0 is not object type">;
7644def err_objc_subscript_dic_object_type : Error<
7645  "method object parameter type %0 is not object type">;
7646def err_objc_subscript_object_type : Error<
7647  "cannot assign to this %select{dictionary|array}1 because assigning method's "
7648  "2nd parameter of type %0 is not an Objective-C pointer type">;
7649def err_objc_subscript_base_type : Error<
7650  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
7651def err_objc_multiple_subscript_type_conversion : Error<
7652  "indexing expression is invalid because subscript type %0 has "
7653  "multiple type conversion functions">;
7654def err_objc_subscript_type_conversion : Error<
7655  "indexing expression is invalid because subscript type %0 is not an integral"
7656  " or Objective-C pointer type">;
7657def err_objc_subscript_pointer : Error<
7658  "indexing expression is invalid because subscript type %0 is not an"
7659  " Objective-C pointer">;
7660def err_objc_indexing_method_result_type : Error<
7661  "method for accessing %select{dictionary|array}1 element must have Objective-C"
7662  " object return type instead of %0">;
7663def err_objc_index_incomplete_class_type : Error<
7664  "Objective-C index expression has incomplete class type %0">;
7665def err_illegal_container_subscripting_op : Error<
7666  "illegal operation on Objective-C container subscripting">;
7667def err_property_not_found_forward_class : Error<
7668  "property %0 cannot be found in forward class object %1">;
7669def err_property_not_as_forward_class : Error<
7670  "property %0 refers to an incomplete Objective-C class %1 "
7671  "(with no @interface available)">;
7672def note_forward_class : Note<
7673  "forward declaration of class here">;
7674def err_duplicate_property : Error<
7675  "property has a previous declaration">;
7676def ext_gnu_void_ptr : Extension<
7677  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
7678  InGroup<GNUPointerArith>;
7679def ext_gnu_ptr_func_arith : Extension<
7680  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
7681  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
7682  InGroup<GNUPointerArith>;
7683def err_readonly_message_assignment : Error<
7684  "assigning to 'readonly' return result of an Objective-C message not allowed">;
7685def ext_c2y_increment_complex : Extension<
7686  "'%select{--|++}0' on an object of complex type is a C2y extension">,
7687  InGroup<C2y>;
7688def warn_c2y_compat_increment_complex : Warning<
7689  "'%select{--|++}0' on an object of complex type is incompatible with C "
7690  "standards before C2y">, InGroup<CPre2yCompat>, DefaultIgnore;
7691def ext_integer_complement_complex : Extension<
7692  "ISO C does not support '~' for complex conjugation of %0">;
7693def err_nosetter_property_assignment : Error<
7694  "%select{assignment to readonly property|"
7695  "no setter method %1 for assignment to property}0">;
7696def err_nosetter_property_incdec : Error<
7697  "%select{%select{increment|decrement}1 of readonly property|"
7698  "no setter method %2 for %select{increment|decrement}1 of property}0">;
7699def err_nogetter_property_compound_assignment : Error<
7700  "a getter method is needed to perform a compound assignment on a property">;
7701def err_nogetter_property_incdec : Error<
7702  "no getter method %1 for %select{increment|decrement}0 of property">;
7703def err_no_subobject_property_setting : Error<
7704  "expression is not assignable">;
7705def err_qualified_objc_access : Error<
7706  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
7707
7708def ext_freestanding_complex : Extension<
7709  "complex numbers are an extension in a freestanding C99 implementation">;
7710
7711def err_imaginary_not_supported : Error<"imaginary types are not supported">;
7712
7713// Obj-c expressions
7714def warn_root_inst_method_not_found : Warning<
7715  "instance method %0 is being used on 'Class' which is not in the root class">,
7716  InGroup<MethodAccess>;
7717def warn_class_method_not_found : Warning<
7718  "class method %objcclass0 not found (return type defaults to 'id')">,
7719  InGroup<MethodAccess>;
7720def warn_instance_method_on_class_found : Warning<
7721  "instance method %0 found instead of class method %1">,
7722  InGroup<MethodAccess>;
7723def warn_inst_method_not_found : Warning<
7724  "instance method %objcinstance0 not found (return type defaults to 'id')">,
7725  InGroup<MethodAccess>;
7726def warn_instance_method_not_found_with_typo : Warning<
7727  "instance method %objcinstance0 not found (return type defaults to 'id')"
7728  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
7729def warn_class_method_not_found_with_typo : Warning<
7730  "class method %objcclass0 not found (return type defaults to 'id')"
7731  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
7732def err_method_not_found_with_typo : Error<
7733  "%select{instance|class}1 method %0 not found "
7734  "; did you mean %2?">;
7735def err_no_super_class_message : Error<
7736  "no @interface declaration found in class messaging of %0">;
7737def err_root_class_cannot_use_super : Error<
7738  "%0 cannot use 'super' because it is a root class">;
7739def err_invalid_receiver_to_message_super : Error<
7740  "'super' is only valid in a method body">;
7741def err_invalid_receiver_class_message : Error<
7742  "receiver type %0 is not an Objective-C class">;
7743def err_missing_open_square_message_send : Error<
7744  "missing '[' at start of message send expression">;
7745def warn_bad_receiver_type : Warning<
7746  "receiver type %0 is not 'id' or interface pointer, consider "
7747  "casting it to 'id'">,InGroup<ObjCReceiver>;
7748def err_bad_receiver_type : Error<"bad receiver type %0">;
7749def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
7750def err_unknown_receiver_suggest : Error<
7751  "unknown receiver %0; did you mean %1?">;
7752def err_objc_throw_expects_object : Error<
7753  "@throw requires an Objective-C object type (%0 invalid)">;
7754def err_objc_synchronized_expects_object : Error<
7755  "@synchronized requires an Objective-C object type (%0 invalid)">;
7756def err_rethrow_used_outside_catch : Error<
7757  "@throw (rethrow) used outside of a @catch block">;
7758def err_attribute_multiple_objc_gc : Error<
7759  "multiple garbage collection attributes specified for type">;
7760def err_catch_param_not_objc_type : Error<
7761  "@catch parameter is not a pointer to an interface type">;
7762def err_illegal_qualifiers_on_catch_parm : Error<
7763  "illegal qualifiers on @catch parameter">;
7764def err_storage_spec_on_catch_parm : Error<
7765  "@catch parameter cannot have storage specifier '%0'">;
7766def warn_register_objc_catch_parm : Warning<
7767  "'register' storage specifier on @catch parameter will be ignored">;
7768def err_qualified_objc_catch_parm : Error<
7769  "@catch parameter declarator cannot be qualified">;
7770def warn_objc_pointer_cxx_catch_fragile : Warning<
7771  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7772  "exception model">, InGroup<ObjCNonUnifiedException>;
7773def err_objc_object_catch : Error<
7774  "cannot catch an Objective-C object by value">;
7775def err_incomplete_type_objc_at_encode : Error<
7776  "'@encode' of incomplete type %0">;
7777def warn_objc_circular_container : Warning<
7778  "adding %0 to %1 might cause circular dependency in container">,
7779  InGroup<DiagGroup<"objc-circular-container">>;
7780def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7781def warn_objc_unsafe_perform_selector : Warning<
7782  "%0 is incompatible with selectors that return a "
7783  "%select{struct|union|vector}1 type">,
7784  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7785def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7786  "method %0 that returns %1 declared here">;
7787def err_attribute_arm_builtin_alias : Error<
7788  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7789def err_attribute_arm_mve_polymorphism : Error<
7790  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7791def err_attribute_webassembly_funcref : Error<
7792  "'__funcref' attribute can only be applied to a function pointer type">;
7793
7794def warn_setter_getter_impl_required : Warning<
7795  "property %0 requires method %1 to be defined - "
7796  "use @synthesize, @dynamic or provide a method implementation "
7797  "in this class implementation">,
7798  InGroup<ObjCPropertyImpl>;
7799def warn_setter_getter_impl_required_in_category : Warning<
7800  "property %0 requires method %1 to be defined - "
7801  "use @dynamic or provide a method implementation in this category">,
7802  InGroup<ObjCPropertyImpl>;
7803def note_parameter_named_here : Note<
7804  "passing argument to parameter %0 here">;
7805def note_parameter_here : Note<
7806  "passing argument to parameter here">;
7807def note_method_return_type_change : Note<
7808  "compiler has implicitly changed method %0 return type">;
7809
7810def warn_impl_required_for_class_property : Warning<
7811  "class property %0 requires method %1 to be defined - "
7812  "use @dynamic or provide a method implementation "
7813  "in this class implementation">,
7814  InGroup<ObjCPropertyImpl>;
7815def warn_impl_required_in_category_for_class_property : Warning<
7816  "class property %0 requires method %1 to be defined - "
7817  "use @dynamic or provide a method implementation in this category">,
7818  InGroup<ObjCPropertyImpl>;
7819
7820// C++ casts
7821// These messages adhere to the TryCast pattern: %0 is an int specifying the
7822// cast type, %1 is the source type, %2 is the destination type.
7823def err_bad_reinterpret_cast_overload : Error<
7824  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7825
7826def warn_reinterpret_different_from_static : Warning<
7827  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7828  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7829  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7830def note_reinterpret_updowncast_use_static: Note<
7831  "use 'static_cast' to adjust the pointer correctly while "
7832  "%select{upcasting|downcasting}0">;
7833
7834def err_bad_static_cast_overload : Error<
7835  "address of overloaded function %0 cannot be static_cast to type %1">;
7836
7837def err_bad_cstyle_cast_overload : Error<
7838  "address of overloaded function %0 cannot be cast to type %1">;
7839
7840
7841def err_bad_cxx_cast_generic : Error<
7842  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7843  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7844def err_bad_cxx_cast_unrelated_class : Error<
7845  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7846  "functional-style cast|}0 from %1 to %2, which are not related by "
7847  "inheritance, is not allowed">;
7848def note_type_incomplete : Note<"%0 is incomplete">;
7849def err_bad_cxx_cast_rvalue : Error<
7850  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7851  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7852def err_bad_cxx_cast_bitfield : Error<
7853  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7854  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7855def err_bad_cxx_cast_qualifiers_away : Error<
7856  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7857  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7858def err_bad_cxx_cast_addr_space_mismatch : Error<
7859  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7860  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7861  " spaces">;
7862def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7863  "ISO C++ does not allow "
7864  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7865  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7866  "even though the source and destination types are unrelated">,
7867  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7868def err_bad_const_cast_dest : Error<
7869  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7870  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7871def ext_cast_fn_obj : Extension<
7872  "cast between pointer-to-function and pointer-to-object is an extension">;
7873def ext_ms_cast_fn_obj : ExtWarn<
7874  "static_cast between pointer-to-function and pointer-to-object is a "
7875  "Microsoft extension">, InGroup<MicrosoftCast>;
7876def warn_cxx98_compat_cast_fn_obj : Warning<
7877  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7878  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7879def err_bad_reinterpret_cast_small_int : Error<
7880  "cast from pointer to smaller type %2 loses information">;
7881def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7882  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7883  "to scalar %2 of different size">;
7884def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7885  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7886  "to vector %2 of different size">;
7887def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7888  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7889  "to vector %2 of different size">;
7890def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7891  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7892  "changes address space of nested pointers">,
7893  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7894def err_bad_lvalue_to_rvalue_cast : Error<
7895  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7896  "not compatible">;
7897def err_bad_rvalue_to_rvalue_cast : Error<
7898  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7899  "not compatible">;
7900def err_bad_static_cast_pointer_nonpointer : Error<
7901  "cannot cast from type %1 to pointer type %2">;
7902def err_bad_static_cast_member_pointer_nonmp : Error<
7903  "cannot cast from type %1 to member pointer type %2">;
7904def err_bad_cxx_cast_member_pointer_size : Error<
7905  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7906  "type %1 to member pointer type %2 of different size">;
7907def err_bad_reinterpret_cast_reference : Error<
7908  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7909def warn_undefined_reinterpret_cast : Warning<
7910  "reinterpret_cast from %0 to %1 has undefined behavior">,
7911  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7912
7913// These messages don't adhere to the pattern.
7914// FIXME: Display the path somehow better.
7915def err_ambiguous_base_to_derived_cast : Error<
7916  "ambiguous cast from base %0 to derived %1:%2">;
7917def err_static_downcast_via_virtual : Error<
7918  "cannot cast %0 to %1 via virtual base %2">;
7919def err_downcast_from_inaccessible_base : Error<
7920  "cannot cast %select{private|protected}2 base class %1 to %0">;
7921def err_upcast_to_inaccessible_base : Error<
7922  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7923def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7924  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7925def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7926def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7927def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7928def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7929
7930// Other C++ expressions
7931def err_need_header_before_typeid : Error<
7932  "you need to include <typeinfo> before using the 'typeid' operator">;
7933def err_need_header_before_placement_new : Error<
7934  "no matching %0 function for non-allocating placement new expression; "
7935  "include <new>">;
7936def err_ms___leave_not_in___try : Error<
7937  "'__leave' statement not in __try block">;
7938def err_uuidof_without_guid : Error<
7939  "cannot call operator __uuidof on a type with no GUID">;
7940def err_uuidof_with_multiple_guids : Error<
7941  "cannot call operator __uuidof on a type with multiple GUIDs">;
7942def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7943def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7944def err_static_illegal_in_new : Error<
7945  "the 'static' modifier for the array size is not legal in new expressions">;
7946def err_array_new_needs_size : Error<
7947  "array size must be specified in new expression with no initializer">;
7948def err_bad_new_type : Error<
7949  "cannot allocate %select{function|reference}1 type %0 with new">;
7950def err_new_incomplete_or_sizeless_type : Error<
7951  "allocation of %select{incomplete|sizeless}0 type %1">;
7952def err_new_array_nonconst : Error<
7953  "only the first dimension of an allocated array may have dynamic size">;
7954def err_new_array_size_unknown_from_init : Error<
7955  "cannot determine allocated array size from initializer">;
7956def err_new_array_init_args : Error<
7957  "array 'new' cannot have initialization arguments">;
7958def ext_new_paren_array_nonconst : ExtWarn<
7959  "when type is in parentheses, array cannot have dynamic size">;
7960def err_placement_new_non_placement_delete : Error<
7961  "'new' expression with placement arguments refers to non-placement "
7962  "'operator delete'">;
7963def err_array_size_not_integral : Error<
7964  "array size expression must have integral or %select{|unscoped }0"
7965  "enumeration type, not %1">;
7966def err_array_size_incomplete_type : Error<
7967  "array size expression has incomplete class type %0">;
7968def err_array_size_explicit_conversion : Error<
7969  "array size expression of type %0 requires explicit conversion to type %1">;
7970def note_array_size_conversion : Note<
7971  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7972def err_array_size_ambiguous_conversion : Error<
7973  "ambiguous conversion of array size expression of type %0 to an integral or "
7974  "enumeration type">;
7975def ext_array_size_conversion : Extension<
7976  "implicit conversion from array size expression of type %0 to "
7977  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7978  InGroup<CXX11>;
7979def warn_cxx98_compat_array_size_conversion : Warning<
7980  "implicit conversion from array size expression of type %0 to "
7981  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7982  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7983def err_address_space_qualified_new : Error<
7984  "'new' cannot allocate objects of type %0 in address space '%1'">;
7985def err_address_space_qualified_delete : Error<
7986  "'delete' cannot delete objects of type %0 in address space '%1'">;
7987
7988def err_default_init_const : Error<
7989  "default initialization of an object of const type %0"
7990  "%select{| without a user-provided default constructor}1">;
7991def ext_default_init_const : ExtWarn<
7992  "default initialization of an object of const type %0"
7993  "%select{| without a user-provided default constructor}1 "
7994  "is a Microsoft extension">,
7995  InGroup<MicrosoftConstInit>;
7996def err_delete_operand : Error<"cannot delete expression of type %0">;
7997def ext_delete_void_ptr_operand : ExtWarn<
7998  "cannot delete expression with pointer-to-'void' type %0">,
7999  InGroup<DeleteIncomplete>;
8000def err_ambiguous_delete_operand : Error<
8001  "ambiguous conversion of delete expression of type %0 to a pointer">;
8002def warn_delete_incomplete : Warning<
8003  "deleting pointer to incomplete type %0 is incompatible with C++2c"
8004  " and may cause undefined behavior">,
8005  InGroup<DeleteIncomplete>;
8006def err_delete_incomplete : Error<
8007  "cannot delete pointer to incomplete type %0">;
8008def err_delete_incomplete_class_type : Error<
8009  "deleting incomplete class type %0; no conversions to pointer type">;
8010def err_delete_explicit_conversion : Error<
8011  "converting delete expression from type %0 to type %1 invokes an explicit "
8012  "conversion function">;
8013def note_delete_conversion : Note<"conversion to pointer type %0">;
8014def warn_delete_array_type : Warning<
8015  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
8016def warn_mismatched_delete_new : Warning<
8017  "'delete%select{|[]}0' applied to a pointer that was allocated with "
8018  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
8019  InGroup<DiagGroup<"mismatched-new-delete">>;
8020def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
8021def err_no_suitable_delete_member_function_found : Error<
8022  "no suitable member %0 in %1">;
8023def err_ambiguous_suitable_delete_member_function_found : Error<
8024  "multiple suitable %0 functions in %1">;
8025def warn_ambiguous_suitable_delete_function_found : Warning<
8026  "multiple suitable %0 functions for %1; no 'operator delete' function "
8027  "will be invoked if initialization throws an exception">,
8028  InGroup<DiagGroup<"ambiguous-delete">>;
8029def note_member_declared_here : Note<
8030  "member %0 declared here">;
8031def note_member_first_declared_here : Note<
8032  "member %0 first declared here">;
8033def warn_bitwise_instead_of_logical : Warning<
8034  "use of bitwise '%0' with boolean operands">,
8035  InGroup<BitwiseInsteadOfLogical>, DefaultIgnore;
8036def warn_bitwise_negation_bool : Warning<
8037  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
8038  "did you mean logical negation?">,
8039  InGroup<BoolOperation>, DefaultIgnore;
8040def err_decrement_bool : Error<"cannot decrement expression of type bool">;
8041def warn_increment_bool : Warning<
8042  "incrementing expression of type bool is deprecated and "
8043  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
8044def ext_increment_bool : ExtWarn<
8045  "ISO C++17 does not allow incrementing expression of type bool">,
8046  DefaultError, SFINAEFailure, InGroup<IncrementBool>;
8047def err_increment_decrement_enum : Error<
8048  "cannot %select{decrement|increment}0 expression of enum type %1">;
8049
8050def warn_deprecated_increment_decrement_volatile : Warning<
8051  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
8052  "is deprecated">, InGroup<DeprecatedVolatile>;
8053def warn_deprecated_simple_assign_volatile : Warning<
8054  "use of result of assignment to object of volatile-qualified type %0 "
8055  "is deprecated">, InGroup<DeprecatedVolatile>;
8056def warn_deprecated_volatile_return : Warning<
8057  "volatile-qualified return type %0 is deprecated">,
8058  InGroup<DeprecatedVolatile>;
8059def warn_deprecated_volatile_param : Warning<
8060  "volatile-qualified parameter type %0 is deprecated">,
8061  InGroup<DeprecatedVolatile>;
8062def warn_deprecated_volatile_structured_binding : Warning<
8063  "volatile qualifier in structured binding declaration is deprecated">,
8064  InGroup<DeprecatedVolatile>;
8065
8066def warn_deprecated_altivec_src_compat : Warning<
8067  "current handling of vector bool and vector pixel types in this context are "
8068  "deprecated; the default behaviour will soon change to that implied by the "
8069  "'-altivec-compat=xl' option">,
8070  InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
8071
8072def warn_deprecated_lax_vec_conv_all : Warning<
8073  "implicit conversion between vector types ('%0' and '%1') is deprecated; "
8074  "in the future, the behavior implied by '-fno-lax-vector-conversions' "
8075  "will be the default">,
8076  InGroup<DiagGroup<"deprecate-lax-vec-conv-all">>;
8077
8078def err_catch_incomplete_ptr : Error<
8079  "cannot catch pointer to incomplete type %0">;
8080def err_catch_incomplete_ref : Error<
8081  "cannot catch reference to incomplete type %0">;
8082def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
8083def err_catch_sizeless : Error<
8084  "cannot catch %select{|reference to }0sizeless type %1">;
8085def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
8086def err_catch_variably_modified : Error<
8087  "cannot catch variably modified type %0">;
8088def err_qualified_catch_declarator : Error<
8089  "exception declarator cannot be qualified">;
8090def err_early_catch_all : Error<"catch-all handler must come last">;
8091def err_bad_memptr_rhs : Error<
8092  "right hand operand to %0 has non-pointer-to-member type %1">;
8093def err_bad_memptr_lhs : Error<
8094  "left hand operand to %0 must be a %select{|pointer to }1class "
8095  "compatible with the right hand operand, but is %2">;
8096def err_memptr_incomplete : Error<
8097  "member pointer has incomplete base type %0">;
8098def warn_exception_caught_by_earlier_handler : Warning<
8099  "exception of type %0 will be caught by earlier handler">,
8100  InGroup<Exceptions>;
8101def note_previous_exception_handler : Note<"for type %0">;
8102def err_exceptions_disabled : Error<
8103  "cannot use '%0' with exceptions disabled">;
8104def err_objc_exceptions_disabled : Error<
8105  "cannot use '%0' with Objective-C exceptions disabled">;
8106def warn_throw_in_noexcept_func : Warning<
8107  "%0 has a non-throwing exception specification but can still throw">,
8108  InGroup<Exceptions>;
8109def note_throw_in_dtor : Note<
8110  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
8111  "non-throwing}1 exception specification">;
8112def note_throw_in_function : Note<"function declared non-throwing here">;
8113def err_seh_try_outside_functions : Error<
8114  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
8115def err_mixing_cxx_try_seh_try : Error<
8116  "cannot use %select{C++ 'try'|Objective-C '@try'}0 "
8117  "in the same function as SEH '__try'">;
8118def err_seh_try_unsupported : Error<
8119  "SEH '__try' is not supported on this target">;
8120def note_conflicting_try_here : Note<
8121  "conflicting %0 here">;
8122def warn_jump_out_of_seh_finally : Warning<
8123  "jump out of __finally block has undefined behavior">,
8124  InGroup<DiagGroup<"jump-seh-finally">>;
8125def warn_non_virtual_dtor : Warning<
8126  "%0 has virtual functions but non-virtual destructor">,
8127  InGroup<NonVirtualDtor>, DefaultIgnore;
8128def warn_delete_non_virtual_dtor : Warning<
8129  "%select{delete|destructor}0 called on non-final %1 that has "
8130  "virtual functions but non-virtual destructor">,
8131  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
8132def note_delete_non_virtual : Note<
8133  "qualify call to silence this warning">;
8134def warn_delete_abstract_non_virtual_dtor : Warning<
8135  "%select{delete|destructor}0 called on %1 that is abstract but has "
8136  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
8137def warn_overloaded_virtual : Warning<
8138  "%q0 hides overloaded virtual %select{function|functions}1">,
8139  InGroup<OverloadedVirtual>, DefaultIgnore;
8140def note_hidden_overloaded_virtual_declared_here : Note<
8141  "hidden overloaded virtual function %q0 declared here"
8142  "%select{|: different classes%diff{ ($ vs $)|}2,3"
8143  "|: different number of parameters (%2 vs %3)"
8144  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
8145  "|: different return type%diff{ ($ vs $)|}2,3"
8146  "|: different qualifiers (%2 vs %3)"
8147  "|: different exception specifications}1">;
8148def warn_using_directive_in_header : Warning<
8149  "using namespace directive in global context in header">,
8150  InGroup<HeaderHygiene>, DefaultIgnore;
8151def warn_overaligned_type : Warning<
8152  "type %0 requires %1 bytes of alignment and the default allocator only "
8153  "guarantees %2 bytes">,
8154  InGroup<OveralignedType>, DefaultIgnore;
8155def err_array_element_alignment : Error<
8156  "size of array element of type %0 (%1 bytes) isn't a multiple of its alignment (%2 bytes)">;
8157def err_aligned_allocation_unavailable : Error<
8158  "aligned %select{allocation|deallocation}0 function of type '%1' is "
8159  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
8160def note_silence_aligned_allocation_unavailable : Note<
8161  "if you supply your own aligned allocation functions, use "
8162  "-faligned-allocation to silence this diagnostic">;
8163
8164def err_conditional_void_nonvoid : Error<
8165  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
8166  "is of type %0">;
8167def err_conditional_ambiguous : Error<
8168  "conditional expression is ambiguous; "
8169  "%diff{$ can be converted to $ and vice versa|"
8170  "types can be convert to each other}0,1">;
8171def err_conditional_ambiguous_ovl : Error<
8172  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
8173  "can be converted to several common types">;
8174def err_conditional_vector_size : Error<
8175  "vector condition type %0 and result type %1 do not have the same number "
8176  "of elements">;
8177def err_conditional_vector_element_size : Error<
8178  "vector condition type %0 and result type %1 do not have elements of the "
8179  "same size">;
8180def err_conditional_vector_has_void : Error<
8181  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
8182def err_conditional_vector_operand_type
8183    : Error<"enumeration type %0 is not allowed in a vector conditional">;
8184def err_conditional_vector_cond_result_mismatch
8185    : Error<"cannot mix vectors and extended vectors in a vector conditional">;
8186def err_conditional_vector_mismatched
8187    : Error<"vector operands to the vector conditional must be the same type "
8188            "%diff{($ and $)|}0,1}">;
8189
8190def err_throw_incomplete : Error<
8191  "cannot throw object of incomplete type %0">;
8192def err_throw_incomplete_ptr : Error<
8193  "cannot throw pointer to object of incomplete type %0">;
8194def err_throw_sizeless : Error<
8195  "cannot throw object of sizeless type %0">;
8196def warn_throw_underaligned_obj : Warning<
8197  "underaligned exception object thrown">,
8198  InGroup<UnderalignedExceptionObject>;
8199def note_throw_underaligned_obj : Note<
8200  "required alignment of type %0 (%1 bytes) is larger than the supported "
8201  "alignment of C++ exception objects on this target (%2 bytes)">;
8202def err_return_in_constructor_handler : Error<
8203  "return in the catch of a function try block of a constructor is illegal">;
8204def warn_cdtor_function_try_handler_mem_expr : Warning<
8205  "cannot refer to a non-static member from the handler of a "
8206  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
8207def err_throw_object_throwing_dtor : Error<
8208  "cannot throw object of type %0 with a potentially-throwing destructor">;
8209
8210let CategoryName = "Lambda Issue" in {
8211  def err_capture_more_than_once : Error<
8212    "%0 can appear only once in a capture list">;
8213  def err_reference_capture_with_reference_default : Error<
8214    "'&' cannot precede a capture when the capture default is '&'">;
8215  def err_copy_capture_with_copy_default : Error<
8216    "'&' must precede a capture when the capture default is '='">;
8217  def err_capture_does_not_name_variable : Error<
8218    "%0 in capture list does not name a variable">;
8219  def err_capture_class_member_does_not_name_variable : Error<
8220    "class member %0 cannot appear in capture list as it is not a variable">;
8221  def err_capture_non_automatic_variable : Error<
8222    "%0 cannot be captured because it does not have automatic storage "
8223    "duration">;
8224  def err_this_capture : Error<
8225    "'this' cannot be %select{implicitly |}0captured in this context">;
8226  def note_lambda_this_capture_fixit : Note<
8227    "explicitly capture 'this'">;
8228  def err_lambda_capture_anonymous_var : Error<
8229    "unnamed variable cannot be implicitly captured in a lambda expression">;
8230  def err_lambda_capture_flexarray_type : Error<
8231    "variable %0 with flexible array member cannot be captured in "
8232    "a lambda expression">;
8233  def err_lambda_impcap : Error<
8234    "variable %0 cannot be implicitly captured in a lambda with no "
8235    "capture-default specified">;
8236  def note_lambda_variable_capture_fixit : Note<
8237    "capture %0 by %select{value|reference}1">;
8238  def note_lambda_default_capture_fixit : Note<
8239    "default capture by %select{value|reference}0">;
8240  def note_lambda_decl : Note<"lambda expression begins here">;
8241  def err_lambda_unevaluated_operand : Error<
8242    "lambda expression in an unevaluated operand">;
8243  def err_lambda_in_constant_expression : Error<
8244    "a lambda expression may not appear inside of a constant expression">;
8245  def err_lambda_in_invalid_context : Error<
8246    "a lambda expression cannot appear in this context">;
8247  def err_lambda_return_init_list : Error<
8248    "cannot deduce lambda return type from initializer list">;
8249  def err_lambda_capture_default_arg : Error<
8250    "lambda expression in default argument cannot capture any entity">;
8251  def err_lambda_incomplete_result : Error<
8252    "incomplete result type %0 in lambda expression">;
8253  def err_noreturn_lambda_has_return_expr : Error<
8254    "lambda declared 'noreturn' should not return">;
8255  def warn_maybe_falloff_nonvoid_lambda : Warning<
8256    "non-void lambda does not return a value in all control paths">,
8257    InGroup<ReturnType>;
8258  def warn_falloff_nonvoid_lambda : Warning<
8259    "non-void lambda does not return a value">,
8260    InGroup<ReturnType>;
8261  def err_access_lambda_capture : Error<
8262    // The ERRORs represent other special members that aren't constructors, in
8263    // hopes that someone will bother noticing and reporting if they appear
8264    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
8265    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
8266    AccessControl;
8267  def note_lambda_to_block_conv : Note<
8268    "implicit capture of lambda object due to conversion to block pointer "
8269    "here">;
8270  def note_var_explicitly_captured_here : Note<"variable %0 is"
8271    "%select{| explicitly}1 captured here">;
8272
8273  // C++14 lambda init-captures.
8274  def warn_cxx11_compat_init_capture : Warning<
8275    "initialized lambda captures are incompatible with C++ standards "
8276    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
8277  def ext_init_capture : ExtWarn<
8278    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
8279  def err_init_capture_no_expression : Error<
8280    "initializer missing for lambda capture %0">;
8281  def err_init_capture_multiple_expressions : Error<
8282    "initializer for lambda capture %0 contains multiple expressions">;
8283  def err_init_capture_paren_braces : Error<
8284    "cannot deduce type for lambda capture %1 from "
8285    "%select{parenthesized|nested}0 initializer list">;
8286  def err_init_capture_deduction_failure : Error<
8287    "cannot deduce type for lambda capture %0 from initializer of type %2">;
8288  def err_init_capture_deduction_failure_from_init_list : Error<
8289    "cannot deduce type for lambda capture %0 from initializer list">;
8290  def warn_cxx17_compat_init_capture_pack : Warning<
8291    "initialized lambda capture packs are incompatible with C++ standards "
8292    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8293  def ext_init_capture_pack : ExtWarn<
8294    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
8295
8296  // C++14 generic lambdas.
8297  def warn_cxx11_compat_generic_lambda : Warning<
8298    "generic lambdas are incompatible with C++11">,
8299    InGroup<CXXPre14Compat>, DefaultIgnore;
8300  def err_lambda_explicit_spec : Error<
8301    "lambda call operator should not be explicitly specialized or instantiated">;
8302
8303  // C++17 '*this' captures.
8304  def warn_cxx14_compat_star_this_lambda_capture : Warning<
8305    "by value capture of '*this' is incompatible with C++ standards before C++17">,
8306     InGroup<CXXPre17Compat>, DefaultIgnore;
8307  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
8308    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
8309
8310  // C++17 parameter shadows capture
8311  def err_parameter_shadow_capture : Error<
8312    "a lambda parameter cannot shadow an explicitly captured entity">;
8313
8314  // C++20 [=, this] captures.
8315  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
8316    "explicit capture of 'this' with a capture default of '=' is incompatible "
8317    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8318  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
8319    "explicit capture of 'this' with a capture default of '=' "
8320    "is a C++20 extension">, InGroup<CXX20>;
8321  def warn_deprecated_this_capture : Warning<
8322    "implicit capture of 'this' with a capture default of '=' is deprecated">,
8323    InGroup<DeprecatedThisCapture>;
8324  def note_deprecated_this_capture : Note<
8325    "add an explicit capture of 'this' to capture '*this' by reference">;
8326
8327  // C++20 default constructible / assignable lambdas.
8328  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
8329    "%select{default construction|assignment}0 of lambda is incompatible with "
8330    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8331
8332  // C++20 class template argument deduction for alias templates.
8333  def warn_cxx17_compat_ctad_for_alias_templates : Warning<
8334  "class template argument deduction for alias templates is incompatible with "
8335  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8336}
8337
8338def err_return_in_captured_stmt : Error<
8339  "cannot return from %0">;
8340def err_capture_block_variable : Error<
8341  "__block variable %0 cannot be captured in a "
8342  "%select{lambda expression|captured statement}1">;
8343
8344def err_operator_arrow_circular : Error<
8345  "circular pointer delegation detected">;
8346def err_operator_arrow_depth_exceeded : Error<
8347  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
8348  "'operator->' calls">;
8349def note_operator_arrow_here : Note<
8350  "'operator->' declared here produces an object of type %0">;
8351def note_operator_arrows_suppressed : Note<
8352  "(skipping %0 'operator->'%s0 in backtrace)">;
8353def note_operator_arrow_depth : Note<
8354  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
8355
8356def err_pseudo_dtor_base_not_scalar : Error<
8357  "object expression of non-scalar type %0 cannot be used in a "
8358  "pseudo-destructor expression">;
8359def ext_pseudo_dtor_on_void : ExtWarn<
8360  "pseudo-destructors on type void are a Microsoft extension">,
8361  InGroup<MicrosoftVoidPseudoDtor>;
8362def err_pseudo_dtor_type_mismatch : Error<
8363  "the type of object expression "
8364  "%diff{($) does not match the type being destroyed ($)|"
8365  "does not match the type being destroyed}0,1 "
8366  "in pseudo-destructor expression">;
8367def err_pseudo_dtor_call_with_args : Error<
8368  "call to pseudo-destructor cannot have any arguments">;
8369def err_dtor_expr_without_call : Error<
8370  "reference to %select{destructor|pseudo-destructor}0 must be called"
8371  "%select{|; did you mean to call it with no arguments?}1">;
8372def err_pseudo_dtor_destructor_non_type : Error<
8373  "%0 does not refer to a type name in pseudo-destructor expression; expected "
8374  "the name of type %1">;
8375def err_invalid_use_of_function_type : Error<
8376  "a function type is not allowed here">;
8377def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
8378def err_typecheck_bool_condition : Error<
8379  "value of type %0 is not contextually convertible to 'bool'">;
8380def err_typecheck_ambiguous_condition : Error<
8381  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
8382def err_typecheck_nonviable_condition : Error<
8383  "no viable conversion%select{%diff{ from $ to $|}1,2|"
8384  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
8385def err_typecheck_nonviable_condition_incomplete : Error<
8386  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
8387def err_typecheck_deleted_function : Error<
8388  "conversion function %diff{from $ to $|between types}0,1 "
8389  "invokes a deleted function%select{|: %3}2">;
8390
8391def err_expected_class_or_namespace : Error<"%0 is not a class"
8392  "%select{ or namespace|, namespace, or enumeration}1">;
8393def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
8394  "because namespace %1 does not enclose namespace %2">;
8395def err_export_non_namespace_scope_name : Error<
8396  "cannot export %0 as it is not at namespace scope">;
8397def err_redeclaration_non_exported : Error <
8398  "cannot export redeclaration %0 here since the previous declaration "
8399  "%select{is not exported|has internal linkage|has module linkage}1">;
8400def err_invalid_declarator_global_scope : Error<
8401  "definition or redeclaration of %0 cannot name the global scope">;
8402def err_invalid_declarator_in_function : Error<
8403  "definition or redeclaration of %0 not allowed inside a function">;
8404def err_invalid_declarator_in_block : Error<
8405  "definition or redeclaration of %0 not allowed inside a block">;
8406def err_not_tag_in_scope : Error<
8407  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
8408def ext_template_after_declarative_nns : ExtWarn<
8409    "'template' cannot be used after a declarative nested name specifier">,
8410    InGroup<DiagGroup<"template-in-declaration-name">>;
8411def ext_alias_template_in_declarative_nns : ExtWarn<
8412  "a declarative nested name specifier cannot name an alias template">,
8413  InGroup<DiagGroup<"alias-template-in-declaration-name">>;
8414def err_computed_type_in_declarative_nns  : Error<
8415  "a %select{pack indexing|'decltype'}0 specifier cannot be used in "
8416  "a declarative nested name specifier">;
8417
8418def err_no_typeid_with_fno_rtti : Error<
8419  "use of typeid requires -frtti">;
8420def err_no_dynamic_cast_with_fno_rtti : Error<
8421  "use of dynamic_cast requires -frtti">;
8422def warn_no_dynamic_cast_with_rtti_disabled: Warning<
8423  "dynamic_cast will not work since RTTI data is disabled by "
8424  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
8425def warn_no_typeid_with_rtti_disabled: Warning<
8426  "typeid will not work since RTTI data is disabled by "
8427  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
8428
8429def err_cannot_form_pointer_to_member_of_reference_type : Error<
8430  "cannot form a pointer-to-member to member %0 of reference type %1">;
8431def err_incomplete_object_call : Error<
8432  "incomplete type in call to object of type %0">;
8433
8434def warn_condition_is_assignment : Warning<"using the result of an "
8435  "assignment as a condition without parentheses">,
8436  InGroup<Parentheses>;
8437def warn_free_nonheap_object
8438  : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">,
8439    InGroup<FreeNonHeapObject>;
8440
8441// Completely identical except off by default.
8442def warn_condition_is_idiomatic_assignment : Warning<"using the result "
8443  "of an assignment as a condition without parentheses">,
8444  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
8445def note_condition_assign_to_comparison : Note<
8446  "use '==' to turn this assignment into an equality comparison">;
8447def note_condition_or_assign_to_comparison : Note<
8448  "use '!=' to turn this compound assignment into an inequality comparison">;
8449def note_condition_assign_silence : Note<
8450  "place parentheses around the assignment to silence this warning">;
8451
8452def warn_equality_with_extra_parens : Warning<"equality comparison with "
8453  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
8454def note_equality_comparison_to_assign : Note<
8455  "use '=' to turn this equality comparison into an assignment">;
8456def note_equality_comparison_silence : Note<
8457  "remove extraneous parentheses around the comparison to silence this warning">;
8458
8459// assignment related diagnostics (also for argument passing, returning, etc).
8460// In most of these diagnostics the %2 is a value from the
8461// Sema::AssignmentAction enumeration
8462def err_typecheck_convert_incompatible : Error<
8463  "%select{%diff{assigning to $ from incompatible type $|"
8464  "assigning to type from incompatible type}0,1"
8465  "|%diff{passing $ to parameter of incompatible type $|"
8466  "passing type to parameter of incompatible type}0,1"
8467  "|%diff{returning $ from a function with incompatible result type $|"
8468  "returning type from a function with incompatible result type}0,1"
8469  "|%diff{converting $ to incompatible type $|"
8470  "converting type to incompatible type}0,1"
8471  "|%diff{initializing $ with an expression of incompatible type $|"
8472  "initializing type with an expression of incompatible type}0,1"
8473  "|%diff{sending $ to parameter of incompatible type $|"
8474  "sending type to parameter of incompatible type}0,1"
8475  "|%diff{casting $ to incompatible type $|"
8476  "casting type to incompatible type}0,1}2"
8477  "%select{|; dereference with *|"
8478  "; take the address with &|"
8479  "; remove *|"
8480  "; remove &}3"
8481  "%select{|: different classes%diff{ ($ vs $)|}5,6"
8482  "|: different number of parameters (%5 vs %6)"
8483  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
8484  "|: different return type%diff{ ($ vs $)|}5,6"
8485  "|: different qualifiers (%5 vs %6)"
8486  "|: different exception specifications}4">;
8487def err_typecheck_missing_return_type_incompatible : Error<
8488  "%diff{return type $ must match previous return type $|"
8489  "return type must match previous return type}0,1 when %select{block "
8490  "literal|lambda expression}2 has unspecified explicit return type">;
8491
8492def note_incomplete_class_and_qualified_id : Note<
8493  "conformance of forward class %0 to protocol %1 can not be confirmed">;
8494def warn_incompatible_qualified_id : Warning<
8495  "%select{%diff{assigning to $ from incompatible type $|"
8496  "assigning to type from incompatible type}0,1"
8497  "|%diff{passing $ to parameter of incompatible type $|"
8498  "passing type to parameter of incompatible type}0,1"
8499  "|%diff{returning $ from a function with incompatible result type $|"
8500  "returning type from a function with incompatible result type}0,1"
8501  "|%diff{converting $ to incompatible type $|"
8502  "converting type to incompatible type}0,1"
8503  "|%diff{initializing $ with an expression of incompatible type $|"
8504  "initializing type with an expression of incompatible type}0,1"
8505  "|%diff{sending $ to parameter of incompatible type $|"
8506  "sending type to parameter of incompatible type}0,1"
8507  "|%diff{casting $ to incompatible type $|"
8508  "casting type to incompatible type}0,1}2">;
8509def err_incompatible_qualified_id : Error<
8510  "%select{%diff{assigning to $ from incompatible type $|"
8511  "assigning to type from incompatible type}0,1"
8512  "|%diff{passing $ to parameter of incompatible type $|"
8513  "passing type to parameter of incompatible type}0,1"
8514  "|%diff{returning $ from a function with incompatible result type $|"
8515  "returning type from a function with incompatible result type}0,1"
8516  "|%diff{converting $ to incompatible type $|"
8517  "converting type to incompatible type}0,1"
8518  "|%diff{initializing $ with an expression of incompatible type $|"
8519  "initializing type with an expression of incompatible type}0,1"
8520  "|%diff{sending $ to parameter of incompatible type $|"
8521  "sending type to parameter of incompatible type}0,1"
8522  "|%diff{casting $ to incompatible type $|"
8523  "casting type to incompatible type}0,1}2">;
8524def err_typecheck_convert_pointer_int : Error<
8525  "incompatible pointer to integer conversion "
8526  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8527  "|%diff{passing $ to parameter of type $|"
8528  "passing to parameter of different type}0,1"
8529  "|%diff{returning $ from a function with result type $|"
8530  "returning from function with different return type}0,1"
8531  "|%diff{converting $ to type $|converting between types}0,1"
8532  "|%diff{initializing $ with an expression of type $|"
8533  "initializing with expression of different type}0,1"
8534  "|%diff{sending $ to parameter of type $|"
8535  "sending to parameter of different type}0,1"
8536  "|%diff{casting $ to type $|casting between types}0,1}2"
8537  "%select{|; dereference with *|"
8538  "; take the address with &|"
8539  "; remove *|"
8540  "; remove &}3">;
8541def ext_typecheck_convert_pointer_int : ExtWarn<
8542  err_typecheck_convert_pointer_int.Summary>,
8543  InGroup<IntConversion>, DefaultError;
8544def err_typecheck_convert_int_pointer : Error<
8545  "incompatible integer to pointer conversion "
8546  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8547  "|%diff{passing $ to parameter of type $|"
8548  "passing to parameter of different type}0,1"
8549  "|%diff{returning $ from a function with result type $|"
8550  "returning from function with different return type}0,1"
8551  "|%diff{converting $ to type $|converting between types}0,1"
8552  "|%diff{initializing $ with an expression of type $|"
8553  "initializing with expression of different type}0,1"
8554  "|%diff{sending $ to parameter of type $|"
8555  "sending to parameter of different type}0,1"
8556  "|%diff{casting $ to type $|casting between types}0,1}2"
8557  "%select{|; dereference with *|"
8558  "; take the address with &|"
8559  "; remove *|"
8560  "; remove &}3">;
8561def ext_typecheck_convert_int_pointer : ExtWarn<
8562  err_typecheck_convert_int_pointer.Summary>,
8563  InGroup<IntConversion>, DefaultError;
8564def ext_typecheck_convert_pointer_void_func : Extension<
8565  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8566  "|%diff{passing $ to parameter of type $|"
8567  "passing to parameter of different type}0,1"
8568  "|%diff{returning $ from a function with result type $|"
8569  "returning from function with different return type}0,1"
8570  "|%diff{converting $ to type $|converting between types}0,1"
8571  "|%diff{initializing $ with an expression of type $|"
8572  "initializing with expression of different type}0,1"
8573  "|%diff{sending $ to parameter of type $|"
8574  "sending to parameter of different type}0,1"
8575  "|%diff{casting $ to type $|casting between types}0,1}2"
8576  " converts between void pointer and function pointer">;
8577def err_typecheck_convert_pointer_void_func : Error<
8578  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8579  "|%diff{passing $ to parameter of type $|"
8580  "passing to parameter of different type}0,1"
8581  "|%diff{returning $ from a function with result type $|"
8582  "returning from function with different return type}0,1"
8583  "|%diff{converting $ to type $|converting between types}0,1"
8584  "|%diff{initializing $ with an expression of type $|"
8585  "initializing with expression of different type}0,1"
8586  "|%diff{sending $ to parameter of type $|"
8587  "sending to parameter of different type}0,1"
8588  "|%diff{casting $ to type $|casting between types}0,1}2"
8589  " converts between void pointer and function pointer">;
8590def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
8591  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8592  "|%diff{passing $ to parameter of type $|"
8593  "passing to parameter of different type}0,1"
8594  "|%diff{returning $ from a function with result type $|"
8595  "returning from function with different return type}0,1"
8596  "|%diff{converting $ to type $|converting between types}0,1"
8597  "|%diff{initializing $ with an expression of type $|"
8598  "initializing with expression of different type}0,1"
8599  "|%diff{sending $ to parameter of type $|"
8600  "sending to parameter of different type}0,1"
8601  "|%diff{casting $ to type $|casting between types}0,1}2"
8602  " converts between pointers to integer types %select{with different sign|"
8603  "where one is of the unique plain 'char' type and the other is not}3">,
8604  InGroup<DiagGroup<"pointer-sign">>;
8605def err_typecheck_convert_incompatible_pointer_sign :
8606  Error<ext_typecheck_convert_incompatible_pointer_sign.Summary>;
8607def ext_typecheck_convert_incompatible_pointer : ExtWarn<
8608  "incompatible pointer types "
8609  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8610  "|%diff{passing $ to parameter of type $|"
8611  "passing to parameter of different type}0,1"
8612  "|%diff{returning $ from a function with result type $|"
8613  "returning from function with different return type}0,1"
8614  "|%diff{converting $ to type $|converting between types}0,1"
8615  "|%diff{initializing $ with an expression of type $|"
8616  "initializing with expression of different type}0,1"
8617  "|%diff{sending $ to parameter of type $|"
8618  "sending to parameter of different type}0,1"
8619  "|%diff{casting $ to type $|casting between types}0,1}2"
8620  "%select{|; dereference with *|"
8621  "; take the address with &|"
8622  "; remove *|"
8623  "; remove &}3">,
8624  InGroup<IncompatiblePointerTypes>;
8625def err_typecheck_convert_incompatible_pointer : Error<
8626  "incompatible pointer types "
8627  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8628  "|%diff{passing $ to parameter of type $|"
8629  "passing to parameter of different type}0,1"
8630  "|%diff{returning $ from a function with result type $|"
8631  "returning from function with different return type}0,1"
8632  "|%diff{converting $ to type $|converting between types}0,1"
8633  "|%diff{initializing $ with an expression of type $|"
8634  "initializing with expression of different type}0,1"
8635  "|%diff{sending $ to parameter of type $|"
8636  "sending to parameter of different type}0,1"
8637  "|%diff{casting $ to type $|casting between types}0,1}2"
8638  "%select{|; dereference with *|"
8639  "; take the address with &|"
8640  "; remove *|"
8641  "; remove &}3">;
8642def err_typecheck_convert_incompatible_function_pointer : Error<
8643  "incompatible function pointer types "
8644  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8645  "|%diff{passing $ to parameter of type $|"
8646  "passing to parameter of different type}0,1"
8647  "|%diff{returning $ from a function with result type $|"
8648  "returning from function with different return type}0,1"
8649  "|%diff{converting $ to type $|converting between types}0,1"
8650  "|%diff{initializing $ with an expression of type $|"
8651  "initializing with expression of different type}0,1"
8652  "|%diff{sending $ to parameter of type $|"
8653  "sending to parameter of different type}0,1"
8654  "|%diff{casting $ to type $|casting between types}0,1}2"
8655  "%select{|; dereference with *|"
8656  "; take the address with &|"
8657  "; remove *|"
8658  "; remove &}3">;
8659def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
8660  err_typecheck_convert_incompatible_function_pointer.Summary>,
8661  InGroup<IncompatibleFunctionPointerTypes>, DefaultError;
8662def warn_typecheck_convert_incompatible_function_pointer_strict : Warning<
8663  err_typecheck_convert_incompatible_function_pointer.Summary>,
8664  InGroup<DiagGroup<"incompatible-function-pointer-types-strict">>, DefaultIgnore;
8665def ext_typecheck_convert_discards_qualifiers : ExtWarn<
8666  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8667  "|%diff{passing $ to parameter of type $|"
8668  "passing to parameter of different type}0,1"
8669  "|%diff{returning $ from a function with result type $|"
8670  "returning from function with different return type}0,1"
8671  "|%diff{converting $ to type $|converting between types}0,1"
8672  "|%diff{initializing $ with an expression of type $|"
8673  "initializing with expression of different type}0,1"
8674  "|%diff{sending $ to parameter of type $|"
8675  "sending to parameter of different type}0,1"
8676  "|%diff{casting $ to type $|casting between types}0,1}2"
8677  " discards qualifiers">,
8678  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8679def err_typecheck_convert_discards_qualifiers : Error<
8680  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8681  "|%diff{passing $ to parameter of type $|"
8682  "passing to parameter of different type}0,1"
8683  "|%diff{returning $ from a function with result type $|"
8684  "returning from function with different return type}0,1"
8685  "|%diff{converting $ to type $|converting between types}0,1"
8686  "|%diff{initializing $ with an expression of type $|"
8687  "initializing with expression of different type}0,1"
8688  "|%diff{sending $ to parameter of type $|"
8689  "sending to parameter of different type}0,1"
8690  "|%diff{casting $ to type $|casting between types}0,1}2"
8691  " discards qualifiers">;
8692def ext_nested_pointer_qualifier_mismatch : ExtWarn<
8693  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8694  "|%diff{passing $ to parameter of type $|"
8695  "passing to parameter of different type}0,1"
8696  "|%diff{returning $ from a function with result type $|"
8697  "returning from function with different return type}0,1"
8698  "|%diff{converting $ to type $|converting between types}0,1"
8699  "|%diff{initializing $ with an expression of type $|"
8700  "initializing with expression of different type}0,1"
8701  "|%diff{sending $ to parameter of type $|"
8702  "sending to parameter of different type}0,1"
8703  "|%diff{casting $ to type $|casting between types}0,1}2"
8704  " discards qualifiers in nested pointer types">,
8705  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8706def err_nested_pointer_qualifier_mismatch : Error<
8707  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8708  "|%diff{passing $ to parameter of type $|"
8709  "passing to parameter of different type}0,1"
8710  "|%diff{returning $ from a function with result type $|"
8711  "returning from function with different return type}0,1"
8712  "|%diff{converting $ to type $|converting between types}0,1"
8713  "|%diff{initializing $ with an expression of type $|"
8714  "initializing with expression of different type}0,1"
8715  "|%diff{sending $ to parameter of type $|"
8716  "sending to parameter of different type}0,1"
8717  "|%diff{casting $ to type $|casting between types}0,1}2"
8718  " discards qualifiers in nested pointer types">;
8719def warn_incompatible_vectors : Warning<
8720  "incompatible vector types "
8721  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8722  "|%diff{passing $ to parameter of type $|"
8723  "passing to parameter of different type}0,1"
8724  "|%diff{returning $ from a function with result type $|"
8725  "returning from function with different return type}0,1"
8726  "|%diff{converting $ to type $|converting between types}0,1"
8727  "|%diff{initializing $ with an expression of type $|"
8728  "initializing with expression of different type}0,1"
8729  "|%diff{sending $ to parameter of type $|"
8730  "sending to parameter of different type}0,1"
8731  "|%diff{casting $ to type $|casting between types}0,1}2">,
8732  InGroup<VectorConversion>, DefaultIgnore;
8733def err_incompatible_vectors : Error<
8734  "incompatible vector types "
8735  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8736  "|%diff{passing $ to parameter of type $|"
8737  "passing to parameter of different type}0,1"
8738  "|%diff{returning $ from a function with result type $|"
8739  "returning from function with different return type}0,1"
8740  "|%diff{converting $ to type $|converting between types}0,1"
8741  "|%diff{initializing $ with an expression of type $|"
8742  "initializing with expression of different type}0,1"
8743  "|%diff{sending $ to parameter of type $|"
8744  "sending to parameter of different type}0,1"
8745  "|%diff{casting $ to type $|casting between types}0,1}2">;
8746def err_int_to_block_pointer : Error<
8747  "invalid block pointer conversion "
8748  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8749  "|%diff{passing $ to parameter of type $|"
8750  "passing to parameter of different type}0,1"
8751  "|%diff{returning $ from a function with result type $|"
8752  "returning from function with different return type}0,1"
8753  "|%diff{converting $ to type $|converting between types}0,1"
8754  "|%diff{initializing $ with an expression of type $|"
8755  "initializing with expression of different type}0,1"
8756  "|%diff{sending $ to parameter of type $|"
8757  "sending to parameter of different type}0,1"
8758  "|%diff{casting $ to type $|casting between types}0,1}2">;
8759def err_typecheck_convert_incompatible_block_pointer : Error<
8760  "incompatible block pointer types "
8761  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8762  "|%diff{passing $ to parameter of type $|"
8763  "passing to parameter of different type}0,1"
8764  "|%diff{returning $ from a function with result type $|"
8765  "returning from function with different return type}0,1"
8766  "|%diff{converting $ to type $|converting between types}0,1"
8767  "|%diff{initializing $ with an expression of type $|"
8768  "initializing with expression of different type}0,1"
8769  "|%diff{sending $ to parameter of type $|"
8770  "sending to parameter of different type}0,1"
8771  "|%diff{casting $ to type $|casting between types}0,1}2">;
8772def err_typecheck_incompatible_address_space : Error<
8773  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8774  "|%diff{passing $ to parameter of type $|"
8775  "passing to parameter of different type}0,1"
8776  "|%diff{returning $ from a function with result type $|"
8777  "returning from function with different return type}0,1"
8778  "|%diff{converting $ to type $|converting between types}0,1"
8779  "|%diff{initializing $ with an expression of type $|"
8780  "initializing with expression of different type}0,1"
8781  "|%diff{sending $ to parameter of type $|"
8782  "sending to parameter of different type}0,1"
8783  "|%diff{casting $ to type $|casting between types}0,1}2"
8784  " changes address space of pointer">;
8785def err_typecheck_incompatible_nested_address_space : Error<
8786  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8787  "|%diff{passing $ to parameter of type $|"
8788  "passing to parameter of different type}0,1"
8789  "|%diff{returning $ from a function with result type $|"
8790  "returning from function with different return type}0,1"
8791  "|%diff{converting $ to type $|converting between types}0,1"
8792  "|%diff{initializing $ with an expression of type $|"
8793  "initializing with expression of different type}0,1"
8794  "|%diff{sending $ to parameter of type $|"
8795  "sending to parameter of different type}0,1"
8796  "|%diff{casting $ to type $|casting between types}0,1}2"
8797  " changes address space of nested pointer">;
8798def err_typecheck_incompatible_ownership : Error<
8799  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8800  "|%diff{passing $ to parameter of type $|"
8801  "passing to parameter of different type}0,1"
8802  "|%diff{returning $ from a function with result type $|"
8803  "returning from function with different return type}0,1"
8804  "|%diff{converting $ to type $|converting between types}0,1"
8805  "|%diff{initializing $ with an expression of type $|"
8806  "initializing with expression of different type}0,1"
8807  "|%diff{sending $ to parameter of type $|"
8808  "sending to parameter of different type}0,1"
8809  "|%diff{casting $ to type $|casting between types}0,1}2"
8810  " changes retain/release properties of pointer">;
8811def err_typecheck_comparison_of_distinct_blocks : Error<
8812  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8813
8814def err_typecheck_array_not_modifiable_lvalue : Error<
8815  "array type %0 is not assignable">;
8816def err_typecheck_non_object_not_modifiable_lvalue : Error<
8817  "non-object type %0 is not assignable">;
8818def err_typecheck_expression_not_modifiable_lvalue : Error<
8819  "expression is not assignable">;
8820def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8821  "incomplete type %0 is not assignable">;
8822def err_typecheck_lvalue_casts_not_supported : Error<
8823  "assignment to cast is illegal, lvalue casts are not supported">;
8824
8825def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8826  "vector is not assignable (contains duplicate components)">;
8827def err_block_decl_ref_not_modifiable_lvalue : Error<
8828  "variable is not assignable (missing __block type specifier)">;
8829def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8830  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8831def err_typecheck_call_not_function : Error<
8832  "called object type %0 is not a function or function pointer">;
8833def err_call_incomplete_return : Error<
8834  "calling function with incomplete return type %0">;
8835def err_call_function_incomplete_return : Error<
8836  "calling %0 with incomplete return type %1">;
8837def err_call_incomplete_argument : Error<
8838  "argument type %0 is incomplete">;
8839def err_typecheck_call_too_few_args : Error<
8840  "too few %select{|||execution configuration }0"
8841  "%select{|non-object }3arguments to "
8842  "%select{function|block|method|kernel function}0 call, "
8843  "expected %1, have %2">;
8844def err_typecheck_call_too_few_args_one : Error<
8845  "too few %select{|||execution configuration }0"
8846  "%select{|non-object }2arguments to "
8847  "%select{function|block|method|kernel function}0 call, "
8848  "single argument %1 was not specified">;
8849def err_typecheck_call_too_few_args_at_least : Error<
8850  "too few %select{|||execution configuration }0"
8851  "%select{|non-object }3arguments to "
8852  "%select{function|block|method|kernel function}0 call, "
8853  "expected at least %1, have %2">;
8854def err_typecheck_call_too_few_args_at_least_one : Error<
8855  "too few %select{|||execution configuration }0"
8856  "%select{|non-object }2arguments to "
8857  "%select{function|block|method|kernel function}0 call, "
8858  "at least argument %1 must be specified">;
8859def err_typecheck_call_too_few_args_suggest : Error<
8860  "too few %select{|||execution configuration }0"
8861  "%select{|non-object }3arguments to "
8862  "%select{function|block|method|kernel function}0 call, "
8863  "expected %1, have %2; did you mean %4?">;
8864def err_typecheck_call_too_few_args_at_least_suggest : Error<
8865  "too few %select{|||execution configuration }0"
8866  "%select{|non-object }3arguments to "
8867  "%select{function|block|method|kernel function}0 call, "
8868  "expected at least %1, have %2; did you mean %4?">;
8869def err_typecheck_call_too_many_args : Error<
8870  "too many %select{|||execution configuration }0"
8871  "%select{|non-object }3arguments to "
8872  "%select{function|block|method|kernel function}0 call, "
8873  "expected %1, have %2">;
8874def err_typecheck_call_too_many_args_one : Error<
8875  "too many %select{|||execution configuration }0"
8876  "%select{|non-object }3arguments to "
8877  "%select{function|block|method|kernel function}0 call, "
8878  "expected single argument %1, have %2 arguments">;
8879def err_typecheck_call_too_many_args_at_most : Error<
8880  "too many %select{|||execution configuration }0"
8881  "%select{|non-object }3arguments to "
8882  "%select{function|block|method|kernel function}0 call, "
8883  "expected at most %1, have %2">;
8884def err_typecheck_call_too_many_args_at_most_one : Error<
8885  "too many %select{|||execution configuration }0arguments to "
8886  "%select{function|block|method|kernel function}0 call, "
8887  "expected at most single %select{|non-object }3argument %1, "
8888  "have %2%select{|non-object}3 arguments">;
8889def err_typecheck_call_too_many_args_suggest : Error<
8890  "too many %select{|||execution configuration }0"
8891  "%select{|non-object }3arguments to "
8892  "%select{function|block|method|kernel function}0 call, "
8893  "expected %1, have %2; did you mean %4?">;
8894def err_typecheck_call_too_many_args_at_most_suggest : Error<
8895  "too many %select{|||execution configuration }0"
8896  "%select{|non-object }3arguments to "
8897  "%select{function|block|method|kernel function}0 call, "
8898  "expected at most %1, have %2; did you mean %4?">;
8899
8900def err_arc_typecheck_convert_incompatible_pointer : Error<
8901  "incompatible pointer types passing retainable parameter of type %0"
8902  "to a CF function expecting %1 type">;
8903
8904def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8905
8906def warn_call_wrong_number_of_arguments : Warning<
8907  "too %select{few|many}0 arguments in call to %1">;
8908
8909def err_atomic_builtin_must_be_pointer : Error<
8910  "address argument to atomic builtin must be a pointer %select{|to a non-zero-sized object }1(%0 invalid)">;
8911
8912def err_atomic_builtin_must_be_pointer_intptr : Error<
8913  "address argument to atomic builtin must be a pointer to integer or pointer"
8914  " (%0 invalid)">;
8915def err_atomic_builtin_cannot_be_const : Error<
8916  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8917def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8918  "address argument to atomic builtin must be a pointer to integer,"
8919  " floating-point or pointer (%0 invalid)">;
8920def err_atomic_builtin_pointer_size : Error<
8921  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8922  "type (%0 invalid)">;
8923def err_atomic_exclusive_builtin_pointer_size : Error<
8924  "address argument to load or store exclusive builtin must be a pointer to"
8925  " 1,2,4 or 8 byte type (%0 invalid)">;
8926def err_atomic_builtin_ext_int_size : Error<
8927  "atomic memory operand must have a power-of-two size">;
8928def err_atomic_builtin_bit_int_prohibit : Error<
8929  "argument to atomic builtin of type '_BitInt' is not supported">;
8930def err_atomic_op_needs_atomic : Error<
8931  "address argument to atomic operation must be a pointer to _Atomic "
8932  "type (%0 invalid)">;
8933def err_atomic_op_needs_non_const_atomic : Error<
8934  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8935  "type (%1 invalid)">;
8936def err_atomic_op_needs_non_const_pointer : Error<
8937  "address argument to atomic operation must be a pointer to non-const "
8938  "type (%0 invalid)">;
8939def err_atomic_op_needs_trivial_copy : Error<
8940  "address argument to atomic operation must be a pointer to a "
8941  "trivially-copyable type (%0 invalid)">;
8942def err_atomic_op_needs_atomic_int_ptr_or_fp : Error<
8943  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8944  "integer, pointer or supported floating point type (%1 invalid)">;
8945def err_atomic_op_needs_atomic_int_or_ptr : Error<
8946  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8947  "integer or pointer (%1 invalid)">;
8948def err_atomic_op_needs_atomic_int_or_fp : Error<
8949  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8950  "integer or supported floating point type (%1 invalid)">;
8951def err_atomic_op_needs_atomic_int : Error<
8952  "address argument to atomic operation must be a pointer to "
8953  "%select{|atomic }0integer (%1 invalid)">;
8954def warn_atomic_op_has_invalid_memory_order : Warning<
8955  "%select{|success |failure }0memory order argument to atomic operation is invalid">,
8956  InGroup<DiagGroup<"atomic-memory-ordering">>;
8957def err_atomic_op_has_invalid_synch_scope : Error<
8958  "synchronization scope argument to atomic operation is invalid">;
8959def warn_atomic_implicit_seq_cst : Warning<
8960  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8961  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8962
8963def err_overflow_builtin_must_be_int : Error<
8964  "operand argument to %select{overflow builtin|checked integer operation}0 "
8965  "must be an integer type %select{|other than plain 'char', 'bool', bit-precise, "
8966  "or an enumeration }0(%1 invalid)">;
8967def err_overflow_builtin_must_be_ptr_int : Error<
8968  "result argument to %select{overflow builtin|checked integer operation}0 "
8969  "must be a pointer to a non-const integer type %select{|other than plain 'char', "
8970  "'bool', bit-precise, or an enumeration }0(%1 invalid)">;
8971def err_overflow_builtin_bit_int_max_size : Error<
8972  "__builtin_mul_overflow does not support 'signed _BitInt' operands of more "
8973  "than %0 bits">;
8974def err_expected_struct_pointer_argument : Error<
8975  "expected pointer to struct as %ordinal0 argument to %1, found %2">;
8976def err_expected_callable_argument : Error<
8977  "expected a callable expression as %ordinal0 argument to %1, found %2">;
8978def note_building_builtin_dump_struct_call : Note<
8979  "in call to printing function with arguments '(%0)' while dumping struct">;
8980def err_builtin_verbose_trap_arg : Error<
8981  "argument to __builtin_verbose_trap must %select{be a pointer to a constant string|not contain $}0">;
8982
8983def err_atomic_load_store_uses_lib : Error<
8984  "atomic %select{load|store}0 requires runtime support that is not "
8985  "available for this target">;
8986
8987def err_nontemporal_builtin_must_be_pointer : Error<
8988  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8989def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8990  "address argument to nontemporal builtin must be a pointer to integer, float, "
8991  "pointer, or a vector of such types (%0 invalid)">;
8992
8993def err_deleted_function_use : Error<"attempt to use a deleted function%select{|: %1}0">;
8994def err_deleted_inherited_ctor_use : Error<
8995  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8996
8997def note_called_by : Note<"called by %0">;
8998def err_kern_type_not_void_return : Error<
8999  "kernel function type %0 must have void return type">;
9000def err_kern_is_nonstatic_method : Error<
9001  "kernel function %0 must be a free function or static member function">;
9002def err_config_scalar_return : Error<
9003  "CUDA special function '%0' must have scalar return type">;
9004def err_kern_call_not_global_function : Error<
9005  "kernel call to non-global function %0">;
9006def err_global_call_not_config : Error<
9007  "call to global function %0 not configured">;
9008def err_ref_bad_target : Error<
9009  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
9010  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
9011def note_cuda_const_var_unpromoted : Note<
9012  "const variable cannot be emitted on device side due to dynamic initialization">;
9013def note_cuda_host_var : Note<
9014  "host variable declared here">;
9015def err_ref_bad_target_global_initializer : Error<
9016  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
9017  "function %1 in global initializer">;
9018def err_capture_bad_target : Error<
9019  "capture host variable %0 by reference in device or host device lambda function">;
9020def warn_maybe_capture_bad_target_this_ptr : Warning<
9021  "capture host side class data member by this pointer in device or host device lambda function "
9022  "may result in invalid memory access if this pointer is not accessible on device side">,
9023  InGroup<DiagGroup<"gpu-maybe-wrong-side">>;
9024def warn_kern_is_method : Extension<
9025  "kernel function %0 is a member function; this may not be accepted by nvcc">,
9026  InGroup<CudaCompat>;
9027def warn_kern_is_inline : Warning<
9028  "ignored 'inline' attribute on kernel function %0">,
9029  InGroup<CudaCompat>;
9030def err_variadic_device_fn : Error<
9031  "CUDA device code does not support variadic functions">;
9032def err_va_arg_in_device : Error<
9033"CUDA device code does not support va_arg">;
9034def err_alias_not_supported_on_nvptx : Error<"CUDA older than 10.0 does not support .alias">;
9035def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
9036  "constexpr function %0 without __host__ or __device__ attributes cannot "
9037  "overload __device__ function with the same signature; add a __host__ "
9038  "attribute, or build with -fno-cuda-host-device-constexpr">;
9039def note_cuda_conflicting_device_function_declared_here : Note<
9040  "conflicting __device__ function declared here">;
9041def err_cuda_device_exceptions : Error<
9042  "cannot use '%0' in "
9043  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
9044def err_dynamic_var_init : Error<
9045    "dynamic initialization is not supported for "
9046    "__device__, __constant__, __shared__, and __managed__ variables">;
9047def err_shared_var_init : Error<
9048    "initialization is not supported for __shared__ variables">;
9049def err_cuda_vla : Error<
9050    "cannot use variable-length arrays in "
9051    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
9052def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
9053def err_cuda_host_shared : Error<
9054    "__shared__ local variables not allowed in "
9055    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
9056def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
9057    "__managed__ are not allowed on non-static local variables">;
9058def err_cuda_ovl_target : Error<
9059  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
9060  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
9061def note_cuda_ovl_candidate_target_mismatch : Note<
9062    "candidate template ignored: target attributes do not match">;
9063def warn_offload_incompatible_redeclare : Warning<
9064  "target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:"
9065  "new declaration is %select{__device__|__global__|__host__|__host__ __device__}0 function, "
9066  "old declaration is %select{__device__|__global__|__host__|__host__ __device__}1 function">,
9067  InGroup<DiagGroup<"nvcc-compat">>, DefaultIgnore;
9068
9069def err_cuda_device_builtin_surftex_cls_template : Error<
9070    "illegal device builtin %select{surface|texture}0 reference "
9071    "class template %1 declared here">;
9072def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
9073    "%0 needs to have exactly %1 template parameters">;
9074def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
9075    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
9076    "%select{a type|an integer or enum value}2">;
9077
9078def err_cuda_device_builtin_surftex_ref_decl : Error<
9079    "illegal device builtin %select{surface|texture}0 reference "
9080    "type %1 declared here">;
9081def note_cuda_device_builtin_surftex_should_be_template_class : Note<
9082    "%0 needs to be instantiated from a class template with proper "
9083    "template arguments">;
9084
9085def err_hip_invalid_args_builtin_mangled_name : Error<
9086    "invalid argument: symbol must be a device-side function or global variable">;
9087
9088def warn_hip_omp_target_directives : Warning<
9089  "HIP does not support OpenMP target directives; directive has been ignored">,
9090  InGroup<HIPOpenMPOffloading>, DefaultError;
9091
9092def warn_non_pod_vararg_with_format_string : Warning<
9093  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
9094  "%select{function|block|method|constructor}2; expected type from format "
9095  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
9096// The arguments to this diagnostic should match the warning above.
9097def err_cannot_pass_objc_interface_to_vararg_format : Error<
9098  "cannot pass object with interface type %1 by value to variadic "
9099  "%select{function|block|method|constructor}2; expected type from format "
9100  "string was %3">;
9101def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
9102  "cannot pass non-trivial C object of type %0 by value to variadic "
9103  "%select{function|block|method|constructor}1">;
9104
9105
9106def err_cannot_pass_objc_interface_to_vararg : Error<
9107  "cannot pass object with interface type %0 by value through variadic "
9108  "%select{function|block|method|constructor}1">;
9109def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
9110  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
9111  " %select{function|block|method|constructor}2; call will abort at runtime">,
9112  InGroup<NonPODVarargs>, DefaultError;
9113def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
9114  "passing object of trivial but non-POD type %0 through variadic"
9115  " %select{function|block|method|constructor}1 is incompatible with C++98">,
9116  InGroup<CXX98Compat>, DefaultIgnore;
9117def warn_pass_class_arg_to_vararg : Warning<
9118  "passing object of class type %0 through variadic "
9119  "%select{function|block|method|constructor}1"
9120  "%select{|; did you mean to call '%3'?}2">,
9121  InGroup<ClassVarargs>, DefaultIgnore;
9122def err_cannot_pass_to_vararg : Error<
9123  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
9124  "%select{function|block|method|constructor}2">;
9125def err_cannot_pass_to_vararg_format : Error<
9126  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
9127  "%select{function|block|method|constructor}2; expected type from format "
9128  "string was %3">;
9129
9130def err_typecheck_call_invalid_ordered_compare : Error<
9131  "ordered compare requires two args of floating point type"
9132  "%diff{ ($ and $)|}0,1">;
9133def err_typecheck_call_invalid_unary_fp : Error<
9134  "floating point classification requires argument of floating point type "
9135  "(passed in %0)">;
9136def err_typecheck_cond_expect_int_float : Error<
9137  "used type %0 where integer or floating point type is required">;
9138def err_typecheck_cond_expect_scalar : Error<
9139  "used type %0 where arithmetic or pointer type is required">;
9140def err_typecheck_cond_expect_nonfloat : Error<
9141  "used type %0 where floating point type is not allowed">;
9142def ext_typecheck_cond_one_void : Extension<
9143  "C99 forbids conditional expressions with only one void side">;
9144def err_typecheck_cast_to_incomplete : Error<
9145  "cast to incomplete type %0">;
9146def ext_typecheck_cast_nonscalar : Extension<
9147  "C99 forbids casting nonscalar type %0 to the same type">;
9148def ext_typecheck_cast_to_union : Extension<
9149  "cast to union type is a GNU extension">,
9150  InGroup<GNUUnionCast>;
9151def err_typecheck_cast_to_union_no_type : Error<
9152  "cast to union type from type %0 not present in union">;
9153def err_cast_pointer_from_non_pointer_int : Error<
9154  "operand of type %0 cannot be cast to a pointer type">;
9155def warn_cast_pointer_from_sel : Warning<
9156  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
9157  InGroup<SelTypeCast>;
9158def warn_function_def_in_objc_container : Warning<
9159  "function definition inside an Objective-C container is deprecated">,
9160  InGroup<FunctionDefInObjCContainer>;
9161def err_typecheck_call_requires_real_fp : Error<
9162  "argument type %0 is not a real floating point type">;
9163def err_typecheck_call_different_arg_types : Error<
9164  "arguments are of different types%diff{ ($ vs $)|}0,1">;
9165
9166def warn_cast_calling_conv : Warning<
9167  "cast between incompatible calling conventions '%0' and '%1'; "
9168  "calls through this pointer may abort at runtime">,
9169  InGroup<DiagGroup<"cast-calling-convention">>;
9170def note_change_calling_conv_fixit : Note<
9171  "consider defining %0 with the '%1' calling convention">;
9172def warn_bad_function_cast : Warning<
9173  "cast from function call of type %0 to non-matching type %1">,
9174  InGroup<BadFunctionCast>, DefaultIgnore;
9175def warn_cast_function_type : Warning<
9176  "cast %diff{from $ to $ |}0,1converts to incompatible function type">,
9177  InGroup<CastFunctionTypeMismatch>, DefaultIgnore;
9178def warn_cast_function_type_strict : Warning<warn_cast_function_type.Summary>,
9179  InGroup<CastFunctionTypeStrict>, DefaultIgnore;
9180def err_cast_pointer_to_non_pointer_int : Error<
9181  "pointer cannot be cast to type %0">;
9182def err_nullptr_cast : Error<
9183  "cannot cast an object of type %select{'nullptr_t' to %1|%1 to 'nullptr_t'}0"
9184>;
9185def err_typecheck_expect_scalar_operand : Error<
9186  "operand of type %0 where arithmetic or pointer type is required">;
9187def err_typecheck_cond_incompatible_operands : Error<
9188  "incompatible operand types%diff{ ($ and $)|}0,1">;
9189def err_typecheck_expect_flt_or_vector : Error<
9190  "invalid operand of type %0 where floating, complex or "
9191  "a vector of such types is required">;
9192def err_cast_selector_expr : Error<
9193  "cannot type cast @selector expression">;
9194def err_make_signed_integral_only : Error<
9195  "'%select{make_unsigned|make_signed}0' is only compatible with "
9196  "non-%select{bool|_BitInt(1)}1 integers and enum types, but was given "
9197  "%2%select{| whose underlying type is %4}3">;
9198def ext_typecheck_cond_incompatible_pointers : ExtWarn<
9199  "pointer type mismatch%diff{ ($ and $)|}0,1">,
9200  InGroup<DiagGroup<"pointer-type-mismatch">>;
9201def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
9202  "pointer/integer type mismatch in conditional expression"
9203  "%diff{ ($ and $)|}0,1">,
9204  InGroup<DiagGroup<"conditional-type-mismatch">>;
9205def err_typecheck_choose_expr_requires_constant : Error<
9206  "'__builtin_choose_expr' requires a constant expression">;
9207def warn_unused_expr : Warning<"expression result unused">,
9208  InGroup<UnusedValue>;
9209def warn_unused_comma_left_operand : Warning<
9210  "left operand of comma operator has no effect">,
9211  InGroup<UnusedValue>;
9212def warn_unused_voidptr : Warning<
9213  "expression result unused; should this cast be to 'void'?">,
9214  InGroup<UnusedValue>;
9215def warn_unused_property_expr : Warning<
9216 "property access result unused - getters should not be used for side effects">,
9217  InGroup<UnusedGetterReturnValue>;
9218def warn_unused_container_subscript_expr : Warning<
9219 "container access result unused - container access should not be used for side effects">,
9220  InGroup<UnusedValue>;
9221def warn_unused_call : Warning<
9222  "ignoring return value of function declared with %0 attribute">,
9223  InGroup<UnusedValue>;
9224def warn_unused_constructor : Warning<
9225  "ignoring temporary created by a constructor declared with %0 attribute">,
9226  InGroup<UnusedValue>;
9227def warn_unused_constructor_msg : Warning<
9228  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
9229  InGroup<UnusedValue>;
9230def warn_side_effects_unevaluated_context : Warning<
9231  "expression with side effects has no effect in an unevaluated context">,
9232  InGroup<UnevaluatedExpression>;
9233def warn_side_effects_typeid : Warning<
9234  "expression with side effects will be evaluated despite being used as an "
9235  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
9236def warn_unused_result : Warning<
9237  "ignoring return value of function declared with %0 attribute">,
9238  InGroup<UnusedResult>;
9239def warn_unused_result_msg : Warning<
9240  "ignoring return value of function declared with %0 attribute: %1">,
9241  InGroup<UnusedResult>;
9242def warn_unused_result_typedef_unsupported_spelling : Warning<
9243  "'[[%select{nodiscard|gnu::warn_unused_result}0]]' attribute ignored when "
9244  "applied to a typedef; consider using '__attribute__((warn_unused_result))' "
9245  "or '[[clang::warn_unused_result]]' instead">, InGroup<IgnoredAttributes>;
9246def warn_unused_volatile : Warning<
9247  "expression result unused; assign into a variable to force a volatile load">,
9248  InGroup<DiagGroup<"unused-volatile-lvalue">>;
9249
9250def ext_cxx14_attr : Extension<
9251  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14Attrs>;
9252def ext_cxx17_attr : Extension<
9253  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17Attrs>;
9254def ext_cxx20_attr : Extension<
9255  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20Attrs>;
9256def ext_cxx23_attr : Extension<
9257  "use of the %0 attribute is a C++23 extension">, InGroup<CXX23Attrs>;
9258
9259def warn_unused_comparison : Warning<
9260  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
9261  InGroup<UnusedComparison>;
9262def note_inequality_comparison_to_or_assign : Note<
9263  "use '|=' to turn this inequality comparison into an or-assignment">;
9264
9265def err_incomplete_type_used_in_type_trait_expr : Error<
9266  "incomplete type %0 used in type trait expression">;
9267
9268// C++20 constinit and require_constant_initialization attribute
9269def warn_cxx20_compat_constinit : Warning<
9270  "'constinit' specifier is incompatible with C++ standards before C++20">,
9271  InGroup<CXX20Compat>, DefaultIgnore;
9272def err_constinit_local_variable : Error<
9273  "local variable cannot be declared 'constinit'">;
9274def err_require_constant_init_failed : Error<
9275  "variable does not have a constant initializer">;
9276def note_declared_required_constant_init_here : Note<
9277  "required by %select{'require_constant_initialization' attribute|"
9278  "'constinit' specifier}0 here">;
9279def ext_constinit_missing : ExtWarn<
9280  "'constinit' specifier missing on initializing declaration of %0">,
9281  InGroup<DiagGroup<"missing-constinit">>;
9282def note_constinit_specified_here : Note<"variable declared constinit here">;
9283def err_constinit_added_too_late : Error<
9284  "'constinit' specifier added after initialization of variable">;
9285def warn_require_const_init_added_too_late : Warning<
9286  "'require_constant_initialization' attribute added after initialization "
9287  "of variable">, InGroup<IgnoredAttributes>;
9288def note_constinit_missing_here : Note<
9289  "add the "
9290  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
9291  "to the initializing declaration here">;
9292
9293def err_dimension_expr_not_constant_integer : Error<
9294  "dimension expression does not evaluate to a constant unsigned int">;
9295
9296def err_typecheck_cond_incompatible_operands_null : Error<
9297  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
9298def ext_empty_struct_union : Extension<
9299  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
9300def ext_no_named_members_in_struct_union : Extension<
9301  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
9302def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
9303  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
9304  InGroup<CXXCompat>, DefaultIgnore;
9305def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
9306  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
9307  InGroup<ExternCCompat>;
9308def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
9309  "volatile qualifiers|const qualifier|volatile qualifier}2">,
9310  InGroup<CastQual>, DefaultIgnore;
9311def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
9312  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
9313def warn_redefine_extname_not_applied : Warning<
9314  "#pragma redefine_extname is applicable to external C declarations only; "
9315  "not applied to %select{function|variable}0 %1">,
9316  InGroup<Pragmas>;
9317} // End of general sema category.
9318
9319// inline asm.
9320let CategoryName = "Inline Assembly Issue" in {
9321  def err_asm_pmf_through_constraint_not_permitted
9322    : Error<"cannot pass a pointer-to-member through register-constrained "
9323            "inline assembly parameter">;
9324  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
9325  def err_asm_invalid_output_constraint : Error<
9326    "invalid output constraint '%0' in asm">;
9327  def err_asm_invalid_lvalue_in_input : Error<
9328    "invalid lvalue in asm input for constraint '%0'">;
9329  def err_asm_invalid_input_constraint : Error<
9330    "invalid input constraint '%0' in asm">;
9331  def err_asm_tying_incompatible_types : Error<
9332    "unsupported inline asm: input with type "
9333    "%diff{$ matching output with type $|}0,1">;
9334  def err_asm_unexpected_constraint_alternatives : Error<
9335    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
9336  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
9337  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
9338  def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">;
9339  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
9340    "global register variables on this target">;
9341  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
9342    "match variable size">;
9343  def err_asm_bad_register_type : Error<"bad type for named register variable">;
9344  def err_asm_invalid_input_size : Error<
9345    "invalid input size for constraint '%0'">;
9346  def err_asm_invalid_output_size : Error<
9347    "invalid output size for constraint '%0'">;
9348  def err_invalid_asm_cast_lvalue : Error<
9349    "invalid use of a cast in a inline asm context requiring an lvalue: "
9350    "remove the cast or build with -fheinous-gnu-extensions">;
9351  def err_invalid_asm_value_for_constraint
9352      : Error <"value '%0' out of range for constraint '%1'">;
9353  def err_asm_non_addr_value_in_memory_constraint : Error <
9354    "reference to a %select{bit-field|vector element|global register variable}0"
9355    " in asm %select{input|output}1 with a memory constraint '%2'">;
9356  def err_asm_input_duplicate_match : Error<
9357    "more than one input constraint matches the same output '%0'">;
9358  def err_store_value_to_reg : Error<
9359    "impossible constraint in asm: can't store value into a register">;
9360
9361  def warn_asm_label_on_auto_decl : Warning<
9362    "ignored asm label '%0' on automatic variable">;
9363  def warn_invalid_asm_cast_lvalue : Warning<
9364    "invalid use of a cast in an inline asm context requiring an lvalue: "
9365    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
9366    "for this in the future">;
9367  def warn_asm_mismatched_size_modifier : Warning<
9368    "value size does not match register size specified by the constraint "
9369    "and modifier">,
9370    InGroup<ASMOperandWidths>;
9371
9372  def note_asm_missing_constraint_modifier : Note<
9373    "use constraint modifier \"%0\"">;
9374  def note_asm_input_duplicate_first : Note<
9375    "constraint '%0' is already present here">;
9376 def error_duplicate_asm_operand_name : Error<
9377    "duplicate use of asm operand name \"%0\"">;
9378 def note_duplicate_asm_operand_name : Note<
9379    "asm operand name \"%0\" first referenced here">;
9380}
9381
9382  def error_inoutput_conflict_with_clobber : Error<
9383    "asm-specifier for input or output variable conflicts with asm"
9384    " clobber list">;
9385
9386let CategoryName = "Semantic Issue" in {
9387
9388def err_invalid_conversion_between_matrixes : Error<
9389  "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">;
9390
9391def err_invalid_conversion_between_matrix_and_type : Error<
9392  "conversion between matrix type %0 and incompatible type %1 is not allowed">;
9393
9394def err_invalid_conversion_between_vectors : Error<
9395  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
9396  "size">;
9397def err_invalid_conversion_between_vector_and_integer : Error<
9398  "invalid conversion between vector type %0 and integer type %1 "
9399  "of different size">;
9400
9401def err_opencl_function_pointer : Error<
9402  "%select{pointers|references}0 to functions are not allowed">;
9403
9404def err_opencl_taking_address_capture : Error<
9405  "taking address of a capture is not allowed">;
9406
9407def err_invalid_conversion_between_vector_and_scalar : Error<
9408  "invalid conversion between vector type %0 and scalar type %1">;
9409
9410// C++ member initializers.
9411def err_only_constructors_take_base_inits : Error<
9412  "only constructors take base initializers">;
9413
9414def err_multiple_mem_initialization : Error <
9415  "multiple initializations given for non-static member %0">;
9416def err_multiple_mem_union_initialization : Error <
9417  "initializing multiple members of union">;
9418def err_multiple_base_initialization : Error <
9419  "multiple initializations given for base %0">;
9420
9421def err_mem_init_not_member_or_class : Error<
9422  "member initializer %0 does not name a non-static data member or base "
9423  "class">;
9424
9425def warn_initializer_out_of_order : Warning<
9426  "%select{field|base class}0 %1 will be initialized after "
9427  "%select{field|base}2 %3">,
9428  InGroup<ReorderCtor>, DefaultIgnore;
9429
9430def warn_some_initializers_out_of_order : Warning<
9431  "initializer order does not match the declaration order">,
9432  InGroup<ReorderCtor>, DefaultIgnore;
9433
9434def note_initializer_out_of_order : Note<
9435  "%select{field|base class}0 %1 will be initialized after "
9436  "%select{field|base}2 %3">;
9437
9438def warn_abstract_vbase_init_ignored : Warning<
9439  "initializer for virtual base class %0 of abstract class %1 "
9440  "will never be used">,
9441  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
9442
9443def err_base_init_does_not_name_class : Error<
9444  "constructor initializer %0 does not name a class">;
9445def err_base_init_direct_and_virtual : Error<
9446  "base class initializer %0 names both a direct base class and an "
9447  "inherited virtual base class">;
9448def err_not_direct_base_or_virtual : Error<
9449  "type %0 is not a direct or virtual base of %1">;
9450
9451def err_in_class_initializer_non_const : Error<
9452  "non-const static data member must be initialized out of line">;
9453def err_in_class_initializer_volatile : Error<
9454  "static const volatile data member must be initialized out of line">;
9455def err_in_class_initializer_bad_type : Error<
9456  "static data member of type %0 must be initialized out of line">;
9457def ext_in_class_initializer_float_type : ExtWarn<
9458  "in-class initializer for static data member of type %0 is a GNU extension">,
9459  InGroup<GNUStaticFloatInit>;
9460def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
9461  "in-class initializer for static data member of type %0 requires "
9462  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
9463def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
9464def err_in_class_initializer_literal_type : Error<
9465  "in-class initializer for static data member of type %0 requires "
9466  "'constexpr' specifier">;
9467def err_in_class_initializer_non_constant : Error<
9468  "in-class initializer for static data member is not a constant expression">;
9469def err_default_member_initializer_not_yet_parsed : Error<
9470  "default member initializer for %1 needed within definition of enclosing "
9471  "class %0 outside of member functions">;
9472def note_default_member_initializer_not_yet_parsed : Note<
9473  "default member initializer declared here">;
9474def err_default_member_initializer_cycle
9475    : Error<"default member initializer for %0 uses itself">;
9476
9477def ext_in_class_initializer_non_constant : Extension<
9478  "in-class initializer for static data member is not a constant expression; "
9479  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
9480
9481def err_thread_dynamic_init : Error<
9482  "initializer for thread-local variable must be a constant expression">;
9483def err_thread_nontrivial_dtor : Error<
9484  "type of thread-local variable has non-trivial destruction">;
9485def note_use_thread_local : Note<
9486  "use 'thread_local' to allow this">;
9487
9488// C++ anonymous unions and GNU anonymous structs/unions
9489def ext_anonymous_union : Extension<
9490  "anonymous unions are a C11 extension">, InGroup<C11>;
9491def ext_gnu_anonymous_struct : Extension<
9492  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
9493def ext_c11_anonymous_struct : Extension<
9494  "anonymous structs are a C11 extension">, InGroup<C11>;
9495def err_anonymous_union_not_static : Error<
9496  "anonymous unions at namespace or global scope must be declared 'static'">;
9497def err_anonymous_union_with_storage_spec : Error<
9498  "anonymous union at class scope must not have a storage specifier">;
9499def err_anonymous_struct_not_member : Error<
9500  "anonymous %select{structs|structs and classes}0 must be "
9501  "%select{struct or union|class}0 members">;
9502def err_anonymous_record_member_redecl : Error<
9503  "member of anonymous %select{struct|union}0 redeclares %1">;
9504def err_anonymous_record_with_type : Error<
9505  "types cannot be declared in an anonymous %select{struct|union}0">;
9506def ext_anonymous_record_with_type : Extension<
9507  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
9508  "extension">, InGroup<MicrosoftAnonTag>;
9509def ext_anonymous_record_with_anonymous_type : Extension<
9510  "anonymous types declared in an anonymous %select{struct|union}0 "
9511  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
9512def err_anonymous_record_with_function : Error<
9513  "functions cannot be declared in an anonymous %select{struct|union}0">;
9514def err_anonymous_record_with_static : Error<
9515  "static members cannot be declared in an anonymous %select{struct|union}0">;
9516def err_anonymous_record_bad_member : Error<
9517  "anonymous %select{struct|union}0 can only contain non-static data members">;
9518def err_anonymous_record_nonpublic_member : Error<
9519  "anonymous %select{struct|union}0 cannot contain a "
9520  "%select{private|protected}1 data member">;
9521def ext_ms_anonymous_record : ExtWarn<
9522  "anonymous %select{structs|unions}0 are a Microsoft extension">,
9523  InGroup<MicrosoftAnonTag>;
9524
9525// C++ local classes
9526def err_reference_to_local_in_enclosing_context : Error<
9527  "reference to local %select{variable|binding}1 %0 declared in enclosing "
9528  "%select{%3|block literal|lambda expression|context}2">;
9529def err_capture_binding_openmp : Error<
9530  "capturing a structured binding is not yet supported in OpenMP">;
9531def ext_capture_binding : ExtWarn<
9532  "captured structured bindings are a C++20 extension">, InGroup<CXX20>;
9533def warn_cxx17_compat_capture_binding : Warning<
9534  "captured structured bindings are incompatible with "
9535  "C++ standards before C++20">,
9536  InGroup<CXXPre20Compat>, DefaultIgnore;
9537
9538def err_static_data_member_not_allowed_in_local_class : Error<
9539  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
9540
9541// C++ derived classes
9542def err_base_clause_on_union : Error<"unions cannot have base classes">;
9543def err_base_must_be_class : Error<"base specifier must name a class">;
9544def err_union_as_base_class : Error<"unions cannot be base classes">;
9545def err_base_class_has_flexible_array_member : Error<
9546  "base class %0 has a flexible array member">;
9547def err_incomplete_base_class : Error<"base class has incomplete type">;
9548def err_duplicate_base_class : Error<
9549  "base class %0 specified more than once as a direct base class">;
9550def warn_inaccessible_base_class : Warning<
9551  "direct base %0 is inaccessible due to ambiguity:%1">,
9552  InGroup<DiagGroup<"inaccessible-base">>;
9553// FIXME: better way to display derivation?  Pass entire thing into diagclient?
9554def err_ambiguous_derived_to_base_conv : Error<
9555  "ambiguous conversion from derived class %0 to base class %1:%2">;
9556def err_ambiguous_memptr_conv : Error<
9557  "ambiguous conversion from pointer to member of %select{base|derived}0 "
9558  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
9559def ext_ms_ambiguous_direct_base : ExtWarn<
9560  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
9561  InGroup<MicrosoftInaccessibleBase>;
9562
9563def err_memptr_conv_via_virtual : Error<
9564  "conversion from pointer to member of class %0 to pointer to member "
9565  "of class %1 via virtual base %2 is not allowed">;
9566
9567// C++ member name lookup
9568def err_ambiguous_member_multiple_subobjects : Error<
9569  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
9570def err_ambiguous_member_multiple_subobject_types : Error<
9571  "member %0 found in multiple base classes of different types">;
9572def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
9573def note_ambiguous_member_type_found : Note<
9574  "member type %0 found by ambiguous name lookup">;
9575def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
9576def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
9577def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
9578  "declaration in a different namespace">;
9579def note_hidden_tag : Note<"type declaration hidden">;
9580def note_hiding_object : Note<"declaration hides type">;
9581
9582// C++ operator overloading
9583def err_operator_overload_needs_class_or_enum : Error<
9584  "overloaded %0 must have at least one parameter of class "
9585  "or enumeration type">;
9586
9587def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
9588def warn_cxx20_compat_operator_overload_static : Warning<
9589  "declaring overloaded %0 as 'static' is incompatible with C++ standards "
9590  "before C++23">, InGroup<CXXPre23Compat>, DefaultIgnore;
9591def ext_operator_overload_static : ExtWarn<
9592  "declaring overloaded %0 as 'static' is a C++23 extension">, InGroup<CXX23>;
9593def err_operator_overload_static : Error<
9594  "overloaded %0 cannot be a static member function">;
9595def err_operator_overload_default_arg : Error<
9596  "parameter of overloaded %0 cannot have a default argument">;
9597
9598def ext_subscript_overload : Warning<
9599  "overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a "
9600  "C++23 extension">, InGroup<CXXPre23Compat>, DefaultIgnore;
9601def error_subscript_overload : Error<
9602  "overloaded %0 cannot have %select{no|a defaulted|more than one}1 parameter before C++23">;
9603
9604def err_operator_overload_must_be : Error<
9605  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
9606  "(has %1 parameter%s1)">;
9607
9608def err_operator_overload_must_be_member : Error<
9609  "overloaded %0 must be a non-static member function">;
9610def err_operator_overload_post_incdec_must_be_int : Error<
9611  "parameter of overloaded post-%select{increment|decrement}1 operator must "
9612  "have type 'int' (not %0)">;
9613
9614// C++ allocation and deallocation functions.
9615def err_operator_new_delete_declared_in_namespace : Error<
9616  "%0 cannot be declared inside a namespace">;
9617def err_operator_new_delete_declared_static : Error<
9618  "%0 cannot be declared static in global scope">;
9619def ext_operator_new_delete_declared_inline : ExtWarn<
9620  "replacement function %0 cannot be declared 'inline'">,
9621  InGroup<DiagGroup<"inline-new-delete">>;
9622def err_operator_new_delete_invalid_result_type : Error<
9623  "%0 must return type %1">;
9624def err_operator_new_delete_dependent_result_type : Error<
9625  "%0 cannot have a dependent return type; use %1 instead">;
9626def err_operator_new_delete_too_few_parameters : Error<
9627  "%0 must have at least one parameter">;
9628def err_operator_new_delete_template_too_few_parameters : Error<
9629  "%0 template must have at least two parameters">;
9630def warn_operator_new_returns_null : Warning<
9631  "%0 should not return a null pointer unless it is declared 'throw()'"
9632  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
9633
9634def err_operator_new_dependent_param_type : Error<
9635  "%0 cannot take a dependent type as first parameter; "
9636  "use size_t (%1) instead">;
9637def err_operator_new_param_type : Error<
9638  "%0 takes type size_t (%1) as first parameter">;
9639def err_operator_new_default_arg: Error<
9640  "parameter of %0 cannot have a default argument">;
9641def err_operator_delete_dependent_param_type : Error<
9642  "%0 cannot take a dependent type as first parameter; use %1 instead">;
9643def err_operator_delete_param_type : Error<
9644  "first parameter of %0 must have type %1">;
9645def err_destroying_operator_delete_not_usual : Error<
9646  "destroying operator delete can have only an optional size and optional "
9647  "alignment parameter">;
9648def note_implicit_delete_this_in_destructor_here : Note<
9649  "while checking implicit 'delete this' for virtual destructor">;
9650def err_builtin_operator_new_delete_not_usual : Error<
9651  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
9652  "selects non-usual %select{allocation|deallocation}0 function">;
9653def note_non_usual_function_declared_here : Note<
9654  "non-usual %0 declared here">;
9655
9656// C++ literal operators
9657def err_literal_operator_outside_namespace : Error<
9658  "literal operator %0 must be in a namespace or global scope">;
9659def err_literal_operator_id_outside_namespace : Error<
9660  "non-namespace scope '%0' cannot have a literal operator member">;
9661def err_literal_operator_default_argument : Error<
9662  "literal operator cannot have a default argument">;
9663def err_literal_operator_bad_param_count : Error<
9664  "non-template literal operator must have one or two parameters">;
9665def err_literal_operator_invalid_param : Error<
9666  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
9667def err_literal_operator_param : Error<
9668  "invalid literal operator parameter type %0, did you mean %1?">;
9669def err_literal_operator_template_with_params : Error<
9670  "literal operator template cannot have any parameters">;
9671def err_literal_operator_template : Error<
9672  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
9673def err_literal_operator_extern_c : Error<
9674  "literal operator must have C++ linkage">;
9675def ext_string_literal_operator_template : ExtWarn<
9676  "string literal operator templates are a GNU extension">,
9677  InGroup<GNUStringLiteralOperatorTemplate>;
9678def warn_user_literal_reserved : Warning<
9679  "user-defined literal suffixes %select{<ERROR>|not starting with '_'|containing '__'}0 are reserved"
9680  "%select{; no literal will invoke this operator|}1">,
9681  InGroup<UserDefinedLiterals>;
9682
9683// C++ conversion functions
9684def err_conv_function_not_member : Error<
9685  "conversion function must be a non-static member function">;
9686def err_conv_function_return_type : Error<
9687  "conversion function cannot have a return type">;
9688def err_conv_function_with_params : Error<
9689  "conversion function cannot have any parameters">;
9690def err_conv_function_variadic : Error<
9691  "conversion function cannot be variadic">;
9692def err_conv_function_to_array : Error<
9693  "conversion function cannot convert to an array type">;
9694def err_conv_function_to_function : Error<
9695  "conversion function cannot convert to a function type">;
9696def err_conv_function_with_complex_decl : Error<
9697  "cannot specify any part of a return type in the "
9698  "declaration of a conversion function"
9699  "%select{"
9700  "; put the complete type after 'operator'|"
9701  "; use a typedef to declare a conversion to %1|"
9702  "; use an alias template to declare a conversion to %1|"
9703  "}0">;
9704def err_conv_function_redeclared : Error<
9705  "conversion function cannot be redeclared">;
9706def warn_conv_to_self_not_used : Warning<
9707  "conversion function converting %0 to itself will never be used">,
9708  InGroup<ClassConversion>;
9709def warn_conv_to_base_not_used : Warning<
9710  "conversion function converting %0 to its base class %1 will never be used">,
9711  InGroup<ClassConversion>;
9712def warn_conv_to_void_not_used : Warning<
9713  "conversion function converting %0 to %1 will never be used">,
9714  InGroup<ClassConversion>;
9715
9716def warn_not_compound_assign : Warning<
9717  "use of unary operator that may be intended as compound assignment (%0=)">;
9718
9719// C++11 explicit conversion operators
9720def ext_explicit_conversion_functions : ExtWarn<
9721  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
9722def warn_cxx98_compat_explicit_conversion_functions : Warning<
9723  "explicit conversion functions are incompatible with C++98">,
9724  InGroup<CXX98Compat>, DefaultIgnore;
9725
9726// C++11 defaulted functions
9727def err_defaulted_special_member_params : Error<
9728  "an explicitly-defaulted %sub{select_special_member_kind}0 cannot "
9729  "have default arguments">;
9730def err_defaulted_special_member_variadic : Error<
9731  "an explicitly-defaulted %sub{select_special_member_kind}0 cannot "
9732  "be variadic">;
9733def err_defaulted_special_member_return_type : Error<
9734  "explicitly-defaulted %select{copy|move}0 assignment operator must "
9735  "return %1">;
9736def err_defaulted_special_member_quals : Error<
9737  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
9738  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
9739def err_defaulted_special_member_explicit_object_mismatch : Error<
9740  "the type of the explicit object parameter of an explicitly-defaulted "
9741  "%select{copy|move}0 assignment operator should match the type of the class %1">;
9742def err_defaulted_special_member_volatile_param : Error<
9743  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
9744  "may not be volatile">;
9745def err_defaulted_special_member_move_const_param : Error<
9746  "the parameter for an explicitly-defaulted move "
9747  "%select{constructor|assignment operator}0 may not be const">;
9748def err_defaulted_special_member_copy_const_param : Error<
9749  "the parameter for this explicitly-defaulted copy "
9750  "%select{constructor|assignment operator}0 is const, but a member or base "
9751  "requires it to be non-const">;
9752def err_defaulted_copy_assign_not_ref : Error<
9753  "the parameter for an explicitly-defaulted copy assignment operator must be an "
9754  "lvalue reference type">;
9755def err_incorrect_defaulted_constexpr : Error<
9756  "defaulted definition of %sub{select_special_member_kind}0 cannot be marked %select{constexpr|consteval}1 "
9757  "before C++23">;
9758def err_incorrect_defaulted_constexpr_with_vb: Error<
9759  "%sub{select_special_member_kind}0 cannot be 'constexpr' in a class with virtual base class">;
9760def warn_defaulted_method_deleted : Warning<
9761  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
9762  "deleted">, InGroup<DefaultedFunctionDeleted>;
9763def note_replace_equals_default_to_delete : Note<
9764  "replace 'default' with 'delete'">;
9765def err_out_of_line_default_deletes : Error<
9766  "defaulting this %sub{select_special_member_kind}0 "
9767  "would delete it after its first declaration">;
9768def note_deleted_type_mismatch : Note<
9769  "function is implicitly deleted because its declared type does not match "
9770  "the type of an implicit %sub{select_special_member_kind}0">;
9771def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
9772  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
9773  "different from the implicit type is incompatible with C++ standards before "
9774  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9775def warn_vbase_moved_multiple_times : Warning<
9776  "defaulted move assignment operator of %0 will move assign virtual base "
9777  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
9778def note_vbase_moved_here : Note<
9779  "%select{%1 is a virtual base class of base class %2 declared here|"
9780  "virtual base class %1 declared here}0">;
9781
9782// C++20 defaulted comparisons
9783// This corresponds to values of Sema::DefaultedComparisonKind.
9784def select_defaulted_comparison_kind : TextSubstitution<
9785  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
9786  "operator">;
9787def ext_defaulted_comparison : ExtWarn<
9788  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
9789def warn_cxx17_compat_defaulted_comparison : Warning<
9790  "defaulted comparison operators are incompatible with C++ standards "
9791  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9792def err_defaulted_comparison_template : Error<
9793  "comparison operator template cannot be defaulted">;
9794def err_defaulted_comparison_num_args : Error<
9795  "%select{non-member|member}0 %sub{select_defaulted_comparison_kind}1"
9796  " must have %select{2|1}0 parameters">;
9797def err_defaulted_comparison_param : Error<
9798  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
9799  "; found %1, expected %2%select{| or %4}3">;
9800def err_defaulted_comparison_param_unknown : Error<
9801  "invalid parameter type for non-member defaulted"
9802  " %sub{select_defaulted_comparison_kind}0"
9803  "; found %1, expected class or reference to a constant class">;
9804def err_defaulted_comparison_param_mismatch : Error<
9805  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
9806  "must have the same type%diff{ (found $ vs $)|}1,2">;
9807def err_defaulted_comparison_not_friend : Error<
9808  "%sub{select_defaulted_comparison_kind}0 is not a friend of"
9809  " %select{|incomplete class }1%2">;
9810def err_defaulted_comparison_non_const : Error<
9811  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
9812  "const-qualified">;
9813def err_defaulted_comparison_return_type_not_bool : Error<
9814  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9815  "must be 'bool', not %1">;
9816def err_defaulted_comparison_deduced_return_type_not_auto : Error<
9817  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9818  "must be 'auto', not %1">;
9819def warn_defaulted_comparison_deleted : Warning<
9820  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
9821  "deleted">, InGroup<DefaultedFunctionDeleted>;
9822def err_non_first_default_compare_deletes : Error<
9823  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
9824  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
9825  "would delete it after its first declaration">;
9826def err_non_first_default_compare_in_class : Error<
9827  "defaulting this %sub{select_defaulted_comparison_kind}0 "
9828  "is not allowed because it was already declared outside the class">;
9829def note_defaulted_comparison_union : Note<
9830  "defaulted %0 is implicitly deleted because "
9831  "%2 is a %select{union-like class|union}1 with variant members">;
9832def note_defaulted_comparison_reference_member : Note<
9833  "defaulted %0 is implicitly deleted because "
9834  "class %1 has a reference member">;
9835def note_defaulted_comparison_ambiguous : Note<
9836  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
9837  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
9838def note_defaulted_comparison_inaccessible : Note<
9839  "defaulted %0 is implicitly deleted because it would invoke a "
9840  "%select{private|protected}3 %4%select{ member of %6|"
9841  " member of %6 to compare member %2| to compare base class %2}1">;
9842def note_defaulted_comparison_calls_deleted : Note<
9843  "defaulted %0 is implicitly deleted because it would invoke a deleted "
9844  "comparison function%select{| for member %2| for base class %2}1">;
9845def note_defaulted_comparison_no_viable_function : Note<
9846  "defaulted %0 is implicitly deleted because there is no viable "
9847  "%select{three-way comparison function|'operator=='}1 for "
9848  "%select{|member |base class }2%3">;
9849def note_defaulted_comparison_no_viable_function_synthesized : Note<
9850  "three-way comparison cannot be synthesized because there is no viable "
9851  "function for %select{'=='|'<'}0 comparison">;
9852def note_defaulted_comparison_not_rewritten_callee : Note<
9853  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
9854  "function would be the best match for the comparison">;
9855def note_defaulted_comparison_not_rewritten_conversion : Note<
9856  "defaulted %0 is implicitly deleted because a builtin comparison function "
9857  "using this conversion would be the best match for the comparison">;
9858def note_defaulted_comparison_cannot_deduce : Note<
9859  "return type of defaulted 'operator<=>' cannot be deduced because "
9860  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
9861  "is not a standard comparison category type">;
9862def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
9863  "return type of defaulted 'operator<=>' cannot be deduced because "
9864  "three-way comparison for %select{|member|base class}0 %1 "
9865  "has a deduced return type and is not yet defined">;
9866def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
9867  "%select{|member|base class}0 %1 declared here">;
9868def note_defaulted_comparison_cannot_deduce_callee : Note<
9869  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
9870def err_defaulted_comparison_constexpr_mismatch : Error<
9871  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
9872  "three-way comparison operator}0 cannot be "
9873  "declared %select{constexpr|consteval}2 because "
9874  "%select{it|for which the corresponding implicit 'operator==' }0 "
9875  "invokes a non-constexpr comparison function ">;
9876def note_defaulted_comparison_not_constexpr : Note<
9877  "non-constexpr comparison function would be used to compare "
9878  "%select{|member %1|base class %1}0">;
9879def note_defaulted_comparison_not_constexpr_here : Note<
9880  "non-constexpr comparison function declared here">;
9881def note_in_declaration_of_implicit_equality_comparison : Note<
9882  "while declaring the corresponding implicit 'operator==' "
9883  "for this defaulted 'operator<=>'">;
9884def err_volatile_comparison_operator : Error<
9885  "defaulted comparison function must not be volatile">;
9886def err_ref_qualifier_comparison_operator : Error<
9887  "ref-qualifier '&&' is not allowed on a defaulted comparison operator">;
9888
9889def ext_implicit_exception_spec_mismatch : ExtWarn<
9890  "function previously declared with an %select{explicit|implicit}0 exception "
9891  "specification redeclared with an %select{implicit|explicit}0 exception "
9892  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
9893
9894def warn_ptr_arith_precedes_bounds : Warning<
9895  "the pointer decremented by %0 refers before the beginning of the array">,
9896  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9897def warn_ptr_arith_exceeds_bounds : Warning<
9898  "the pointer incremented by %0 refers past the end of the array (that has type %1)">,
9899  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9900def warn_array_index_precedes_bounds : Warning<
9901  "array index %0 is before the beginning of the array">,
9902  InGroup<ArrayBounds>;
9903def warn_array_index_exceeds_bounds : Warning<
9904  "array index %0 is past the end of the array (that has type %1%select{|, cast to %3}2)">,
9905  InGroup<ArrayBounds>;
9906def warn_ptr_arith_exceeds_max_addressable_bounds : Warning<
9907  "the pointer incremented by %0 refers past the last possible element for an array in %1-bit "
9908  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9909  InGroup<ArrayBounds>;
9910def warn_array_index_exceeds_max_addressable_bounds : Warning<
9911  "array index %0 refers past the last possible element for an array in %1-bit "
9912  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9913  InGroup<ArrayBounds>;
9914def note_array_declared_here : Note<
9915  "array %0 declared here">;
9916
9917def warn_inconsistent_array_form : Warning<
9918  "argument %0 of type %1 with mismatched bound">,
9919  InGroup<ArrayParameter>, DefaultIgnore;
9920def note_previous_declaration_as : Note<
9921  "previously declared as %0 here">;
9922
9923def warn_printf_insufficient_data_args : Warning<
9924  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9925def warn_printf_data_arg_not_used : Warning<
9926  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9927def warn_format_invalid_conversion : Warning<
9928  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9929def warn_printf_incomplete_specifier : Warning<
9930  "incomplete format specifier">, InGroup<Format>;
9931def warn_missing_format_string : Warning<
9932  "format string missing">, InGroup<Format>;
9933def warn_scanf_nonzero_width : Warning<
9934  "zero field width in scanf format string is unused">,
9935  InGroup<Format>;
9936def warn_format_conversion_argument_type_mismatch : Warning<
9937  "format specifies type %0 but the argument has "
9938  "%select{type|underlying type}2 %1">,
9939  InGroup<Format>;
9940def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9941  warn_format_conversion_argument_type_mismatch.Summary>,
9942  InGroup<FormatPedantic>;
9943def warn_format_conversion_argument_type_mismatch_signedness : Warning<
9944  warn_format_conversion_argument_type_mismatch.Summary>,
9945  InGroup<FormatSignedness>, DefaultIgnore;
9946def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9947  warn_format_conversion_argument_type_mismatch.Summary>,
9948  InGroup<FormatTypeConfusion>, DefaultIgnore;
9949def warn_format_argument_needs_cast : Warning<
9950  "%select{values of type|enum values with underlying type}2 '%0' should not "
9951  "be used as format arguments; add an explicit cast to %1 instead">,
9952  InGroup<Format>;
9953def warn_format_argument_needs_cast_pedantic : Warning<
9954  warn_format_argument_needs_cast.Summary>,
9955  InGroup<FormatPedantic>, DefaultIgnore;
9956def warn_printf_positional_arg_exceeds_data_args : Warning <
9957  "data argument position '%0' exceeds the number of data arguments (%1)">,
9958  InGroup<Format>;
9959def warn_format_zero_positional_specifier : Warning<
9960  "position arguments in format strings start counting at 1 (not 0)">,
9961  InGroup<Format>;
9962def warn_format_invalid_positional_specifier : Warning<
9963  "invalid position specified for %select{field width|field precision}0">,
9964  InGroup<Format>;
9965def warn_format_mix_positional_nonpositional_args : Warning<
9966  "cannot mix positional and non-positional arguments in format string">,
9967  InGroup<Format>;
9968def warn_static_array_too_small : Warning<
9969  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9970  " callee requires at least %1">,
9971  InGroup<ArrayBounds>;
9972def note_callee_static_array : Note<
9973  "callee declares array parameter as static here">;
9974def warn_empty_format_string : Warning<
9975  "format string is empty">, InGroup<FormatZeroLength>;
9976def warn_format_string_is_wide_literal : Warning<
9977  "format string should not be a wide string">, InGroup<Format>;
9978def warn_printf_format_string_contains_null_char : Warning<
9979  "format string contains '\\0' within the string body">, InGroup<Format>;
9980def warn_printf_format_string_not_null_terminated : Warning<
9981  "format string is not null-terminated">, InGroup<Format>;
9982def warn_printf_asterisk_missing_arg : Warning<
9983  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9984  InGroup<Format>;
9985def warn_printf_asterisk_wrong_type : Warning<
9986  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9987  InGroup<Format>;
9988def warn_printf_nonsensical_optional_amount: Warning<
9989  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9990  InGroup<Format>;
9991def warn_printf_nonsensical_flag: Warning<
9992  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9993  InGroup<Format>;
9994def warn_format_nonsensical_length: Warning<
9995  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9996  InGroup<Format>;
9997def warn_format_non_standard_positional_arg: Warning<
9998  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9999def warn_format_non_standard: Warning<
10000  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
10001  InGroup<FormatNonStandard>, DefaultIgnore;
10002def warn_format_non_standard_conversion_spec: Warning<
10003  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
10004  InGroup<FormatNonStandard>, DefaultIgnore;
10005def err_invalid_mask_type_size : Error<
10006  "mask type size must be between 1-byte and 8-bytes">;
10007def warn_format_invalid_annotation : Warning<
10008  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
10009  InGroup<Format>;
10010def warn_format_P_no_precision : Warning<
10011  "using '%%P' format specifier without precision">,
10012  InGroup<Format>;
10013def warn_format_P_with_objc_pointer : Warning<
10014  "using '%%P' format specifier with an Objective-C pointer results in dumping runtime object structure, not object value">,
10015  InGroup<Format>;
10016def warn_printf_ignored_flag: Warning<
10017  "flag '%0' is ignored when flag '%1' is present">,
10018  InGroup<Format>;
10019def warn_printf_empty_objc_flag: Warning<
10020  "missing object format flag">,
10021  InGroup<Format>;
10022def warn_printf_ObjCflags_without_ObjCConversion: Warning<
10023  "object format flags cannot be used with '%0' conversion specifier">,
10024  InGroup<Format>;
10025def warn_printf_invalid_objc_flag: Warning<
10026    "'%0' is not a valid object format flag">,
10027    InGroup<Format>;
10028def warn_printf_narg_not_supported : Warning<
10029    "'%%n' specifier not supported on this platform">,
10030    InGroup<Format>;
10031def warn_scanf_scanlist_incomplete : Warning<
10032  "no closing ']' for '%%[' in scanf format string">,
10033  InGroup<Format>;
10034def warn_format_bool_as_character : Warning<
10035  "using '%0' format specifier, but argument has boolean value">,
10036  InGroup<Format>;
10037def note_format_string_defined : Note<"format string is defined here">;
10038def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
10039def note_printf_c_str: Note<"did you mean to call the %0 method?">;
10040def note_format_security_fixit: Note<
10041  "treat the string as an argument to avoid this">;
10042
10043def warn_null_arg : Warning<
10044  "null passed to a callee that requires a non-null argument">,
10045  InGroup<NonNull>;
10046def warn_null_ret : Warning<
10047  "null returned from %select{function|method}0 that requires a non-null return value">,
10048  InGroup<NonNull>;
10049
10050def err_lifetimebound_no_object_param : Error<
10051  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
10052  "function has no implicit object parameter">;
10053def err_lifetimebound_ctor_dtor : Error<
10054  "'lifetimebound' attribute cannot be applied to a "
10055  "%select{constructor|destructor}0">;
10056
10057// CHECK: returning address/reference of stack memory
10058def warn_ret_stack_addr_ref : Warning<
10059  "%select{address of|reference to}0 stack memory associated with "
10060  "%select{local variable|parameter|compound literal}2 %1 returned">,
10061  InGroup<ReturnStackAddress>;
10062def warn_ret_local_temp_addr_ref : Warning<
10063  "returning %select{address of|reference to}0 local temporary object">,
10064  InGroup<ReturnStackAddress>;
10065def err_ret_local_temp_ref : Error<
10066  "returning reference to local temporary object">;
10067def warn_ret_addr_label : Warning<
10068  "returning address of label, which is local">,
10069  InGroup<ReturnStackAddress>;
10070def err_ret_local_block : Error<
10071  "returning block that lives on the local stack">;
10072def note_local_var_initializer : Note<
10073  "%select{via initialization of|binding reference}0 variable "
10074  "%select{%2 |}1here">;
10075def note_lambda_capture_initializer : Note<
10076  "%select{implicitly |}2captured%select{| by reference}3"
10077  "%select{%select{ due to use|}2 here|"
10078  " via initialization of lambda capture %0}1">;
10079def note_init_with_default_member_initializer : Note<
10080  "initializing field %0 with default member initializer">;
10081
10082// Check for initializing a member variable with the address or a reference to
10083// a constructor parameter.
10084def warn_bind_ref_member_to_parameter : Warning<
10085  "binding reference member %0 to stack allocated "
10086  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
10087def warn_init_ptr_member_to_parameter_addr : Warning<
10088  "initializing pointer member %0 with the stack address of "
10089  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
10090def note_ref_or_ptr_member_declared_here : Note<
10091  "%select{reference|pointer}0 member declared here">;
10092
10093def err_dangling_member : Error<
10094  "%select{reference|backing array for 'std::initializer_list'}2 "
10095  "%select{|subobject of }1member %0 "
10096  "%select{binds to|is}2 a temporary object "
10097  "whose lifetime would be shorter than the lifetime of "
10098  "the constructed object">;
10099def warn_dangling_member : Warning<
10100  "%select{reference|backing array for 'std::initializer_list'}2 "
10101  "%select{|subobject of }1member %0 "
10102  "%select{binds to|is}2 a temporary object "
10103  "whose lifetime is shorter than the lifetime of the constructed object">,
10104  InGroup<DanglingField>;
10105def warn_dangling_lifetime_pointer_member : Warning<
10106  "initializing pointer member %0 to point to a temporary object "
10107  "whose lifetime is shorter than the lifetime of the constructed object">,
10108  InGroup<DanglingGsl>;
10109def note_lifetime_extending_member_declared_here : Note<
10110  "%select{%select{reference|'std::initializer_list'}0 member|"
10111  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
10112  "declared here">;
10113def warn_dangling_variable : Warning<
10114  "%select{temporary %select{whose address is used as value of|"
10115  "%select{|implicitly }2bound to}4 "
10116  "%select{%select{|reference }4member of local variable|"
10117  "local %select{variable|reference}4}1|"
10118  "array backing "
10119  "%select{initializer list subobject of local variable|"
10120  "local initializer list}1}0 "
10121  "%select{%3 |}2will be destroyed at the end of the full-expression">,
10122  InGroup<Dangling>;
10123def warn_new_dangling_reference : Warning<
10124  "temporary bound to reference member of allocated object "
10125  "will be destroyed at the end of the full-expression">,
10126  InGroup<DanglingField>;
10127def warn_dangling_lifetime_pointer : Warning<
10128  "object backing the pointer "
10129  "will be destroyed at the end of the full-expression">,
10130  InGroup<DanglingGsl>;
10131def warn_dangling_lifetime_pointer_assignment : Warning<"object backing the "
10132  "pointer %0 will be destroyed at the end of the full-expression">,
10133  InGroup<DanglingAssignmentGsl>, DefaultIgnore;
10134def warn_new_dangling_initializer_list : Warning<
10135  "array backing "
10136  "%select{initializer list subobject of the allocated object|"
10137  "the allocated initializer list}0 "
10138  "will be destroyed at the end of the full-expression">,
10139  InGroup<DanglingInitializerList>;
10140def warn_dangling_pointer_assignment : Warning<
10141   "object backing the pointer %0 "
10142   "will be destroyed at the end of the full-expression">,
10143   InGroup<DanglingAssignment>;
10144
10145def warn_unsupported_lifetime_extension : Warning<
10146  "lifetime extension of "
10147  "%select{temporary|backing array of initializer list}0 created "
10148  "by aggregate initialization using a default member initializer "
10149  "is not yet supported; lifetime of %select{temporary|backing array}0 "
10150  "will end at the end of the full-expression">, InGroup<Dangling>;
10151
10152// For non-floating point, expressions of the form x == x or x != x
10153// should result in a warning, since these always evaluate to a constant.
10154// Array comparisons have similar warnings
10155def warn_comparison_always : Warning<
10156  "%select{self-|array }0comparison always evaluates to "
10157  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
10158  InGroup<TautologicalCompare>;
10159def warn_comparison_bitwise_always : Warning<
10160  "bitwise comparison always evaluates to %select{false|true}0">,
10161  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
10162def warn_comparison_bitwise_or : Warning<
10163  "bitwise or with non-zero value always evaluates to true">,
10164  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
10165def warn_tautological_negation_and_compare: Warning<
10166  "'&&' of a value and its negation always evaluates to false">,
10167  InGroup<TautologicalNegationCompare>, DefaultIgnore;
10168def warn_tautological_negation_or_compare: Warning<
10169  "'||' of a value and its negation always evaluates to true">,
10170  InGroup<TautologicalNegationCompare>, DefaultIgnore;
10171def warn_tautological_overlap_comparison : Warning<
10172  "overlapping comparisons always evaluate to %select{false|true}0">,
10173  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
10174def warn_depr_array_comparison : Warning<
10175  "comparison between two arrays is deprecated; "
10176  "to compare array addresses, use unary '+' to decay operands to pointers">,
10177  InGroup<DeprecatedArrayCompare>;
10178
10179def warn_stringcompare : Warning<
10180  "result of comparison against %select{a string literal|@encode}0 is "
10181  "unspecified (use an explicit string comparison function instead)">,
10182  InGroup<StringCompare>;
10183
10184def warn_identity_field_assign : Warning<
10185  "assigning %select{field|instance variable}0 to itself">,
10186  InGroup<SelfAssignmentField>;
10187
10188// Type safety attributes
10189def err_type_tag_for_datatype_not_ice : Error<
10190  "'type_tag_for_datatype' attribute requires the initializer to be "
10191  "an %select{integer|integral}0 constant expression">;
10192def err_type_tag_for_datatype_too_large : Error<
10193  "'type_tag_for_datatype' attribute requires the initializer to be "
10194  "an %select{integer|integral}0 constant expression "
10195  "that can be represented by a 64 bit integer">;
10196def err_tag_index_out_of_range : Error<
10197  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
10198def warn_type_tag_for_datatype_wrong_kind : Warning<
10199  "this type tag was not designed to be used with this function">,
10200  InGroup<TypeSafety>;
10201def warn_type_safety_type_mismatch : Warning<
10202  "argument type %0 doesn't match specified %1 type tag "
10203  "%select{that requires %3|}2">, InGroup<TypeSafety>;
10204def warn_type_safety_null_pointer_required : Warning<
10205  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
10206
10207// Generic selections.
10208def err_assoc_type_incomplete : Error<
10209  "type %0 in generic association incomplete">;
10210def err_assoc_type_nonobject : Error<
10211  "type %0 in generic association not an object type">;
10212def err_assoc_type_variably_modified : Error<
10213  "type %0 in generic association is a variably modified type">;
10214def err_assoc_compatible_types : Error<
10215  "type %0 in generic association compatible with previously specified type %1">;
10216def note_compat_assoc : Note<
10217  "compatible type %0 specified here">;
10218def err_generic_sel_no_match : Error<
10219  "controlling expression type %0 not compatible with any generic association type">;
10220def err_generic_sel_multi_match : Error<
10221  "controlling expression type %0 compatible with %1 generic association types">;
10222
10223
10224// Blocks
10225def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
10226  " or %select{pick a deployment target that supports them|for OpenCL C 2.0"
10227  " or OpenCL C 3.0 with __opencl_c_device_enqueue feature}0">;
10228def err_block_returning_array_function : Error<
10229  "block cannot return %select{array|function}0 type %1">;
10230
10231// Builtin annotation
10232def err_builtin_annotation_first_arg : Error<
10233  "first argument to __builtin_annotation must be an integer">;
10234def err_builtin_annotation_second_arg : Error<
10235  "second argument to __builtin_annotation must be a non-wide string constant">;
10236def err_msvc_annotation_wide_str : Error<
10237  "arguments to __annotation must be wide string constants">;
10238
10239// CFString checking
10240def err_cfstring_literal_not_string_constant : Error<
10241  "CFString literal is not a string constant">;
10242def warn_cfstring_truncated : Warning<
10243  "input conversion stopped due to an input byte that does not "
10244  "belong to the input codeset UTF-8">,
10245  InGroup<DiagGroup<"CFString-literal">>;
10246
10247// os_log checking
10248// TODO: separate diagnostic for os_trace()
10249def err_os_log_format_not_string_constant : Error<
10250  "os_log() format argument is not a string constant">;
10251def err_os_log_argument_too_big : Error<
10252  "os_log() argument %0 is too big (%1 bytes, max %2)">;
10253def warn_os_log_format_narg : Error<
10254 "os_log() '%%n' format specifier is not allowed">, DefaultError;
10255
10256// Statements.
10257def err_continue_not_in_loop : Error<
10258  "'continue' statement not in loop statement">;
10259def err_break_not_in_loop_or_switch : Error<
10260  "'break' statement not in loop or switch statement">;
10261def warn_loop_ctrl_binds_to_inner : Warning<
10262  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
10263  InGroup<GccCompat>;
10264def err_omp_bind_required_on_loop : Error<
10265  "expected 'bind' clause for 'loop' construct without an enclosing OpenMP "
10266  "construct">;
10267def err_omp_loop_reduction_clause : Error<
10268  "'reduction' clause not allowed with '#pragma omp loop bind(teams)'">;
10269def warn_break_binds_to_switch : Warning<
10270  "'break' is bound to loop, GCC binds it to switch">,
10271  InGroup<GccCompat>;
10272def err_default_not_in_switch : Error<
10273  "'default' statement not in switch statement">;
10274def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
10275def warn_bool_switch_condition : Warning<
10276  "switch condition has boolean value">, InGroup<SwitchBool>;
10277def warn_case_value_overflow : Warning<
10278  "overflow converting case value to switch condition type (%0 to %1)">,
10279  InGroup<Switch>;
10280def err_duplicate_case : Error<"duplicate case value '%0'">;
10281def err_duplicate_case_differing_expr : Error<
10282  "duplicate case value: '%0' and '%1' both equal '%2'">;
10283def warn_case_empty_range : Warning<"empty case range specified">;
10284def warn_missing_case_for_condition :
10285  Warning<"no case matching constant switch condition '%0'">;
10286def err_loop_attr_conflict : Error<
10287  "conflicting loop attribute %0">;
10288def err_attribute_power_of_two_in_range : Error<
10289  "%0 attribute requires an integer argument which is a constant power of two "
10290  "between %1 and %2 inclusive; provided argument was %3">;
10291
10292def warn_def_missing_case : Warning<"%plural{"
10293  "1:enumeration value %1 not explicitly handled in switch|"
10294  "2:enumeration values %1 and %2 not explicitly handled in switch|"
10295  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
10296  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
10297  InGroup<SwitchEnum>, DefaultIgnore;
10298
10299def warn_missing_case : Warning<"%plural{"
10300  "1:enumeration value %1 not handled in switch|"
10301  "2:enumeration values %1 and %2 not handled in switch|"
10302  "3:enumeration values %1, %2, and %3 not handled in switch|"
10303  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
10304  InGroup<Switch>;
10305def warn_switch_default : Warning<"'switch' missing 'default' label">,
10306  InGroup<SwitchDefault>, DefaultIgnore;
10307
10308def warn_unannotated_fallthrough : Warning<
10309  "unannotated fall-through between switch labels">,
10310  InGroup<ImplicitFallthrough>, DefaultIgnore;
10311def warn_unannotated_fallthrough_per_function : Warning<
10312  "unannotated fall-through between switch labels in partly-annotated "
10313  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
10314def note_insert_fallthrough_fixit : Note<
10315  "insert '%0;' to silence this warning">;
10316def note_insert_break_fixit : Note<
10317  "insert 'break;' to avoid fall-through">;
10318def err_fallthrough_attr_wrong_target : Error<
10319  "%0 attribute is only allowed on empty statements">;
10320def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
10321def err_fallthrough_attr_outside_switch : Error<
10322  "fallthrough annotation is outside switch statement">;
10323def err_fallthrough_attr_invalid_placement : Error<
10324  "fallthrough annotation does not directly precede switch label">;
10325
10326def warn_unreachable_default : Warning<
10327  "default label in switch which covers all enumeration values">,
10328  InGroup<CoveredSwitchDefault>, DefaultIgnore;
10329def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
10330  InGroup<Switch>;
10331def warn_not_in_enum_assignment : Warning<"integer constant not in range "
10332  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
10333def err_typecheck_statement_requires_scalar : Error<
10334  "statement requires expression of scalar type (%0 invalid)">;
10335def err_typecheck_statement_requires_integer : Error<
10336  "statement requires expression of integer type (%0 invalid)">;
10337def err_multiple_default_labels_defined : Error<
10338  "multiple default labels in one switch">;
10339def err_switch_multiple_conversions : Error<
10340  "multiple conversions from switch condition type %0 to an integral or "
10341  "enumeration type">;
10342def note_switch_conversion : Note<
10343  "conversion to %select{integral|enumeration}0 type %1">;
10344def err_switch_explicit_conversion : Error<
10345  "switch condition type %0 requires explicit conversion to %1">;
10346def err_switch_incomplete_class_type : Error<
10347  "switch condition has incomplete class type %0">;
10348
10349def warn_empty_if_body : Warning<
10350  "if statement has empty body">, InGroup<EmptyBody>;
10351def warn_empty_for_body : Warning<
10352  "for loop has empty body">, InGroup<EmptyBody>;
10353def warn_empty_range_based_for_body : Warning<
10354  "range-based for loop has empty body">, InGroup<EmptyBody>;
10355def warn_empty_while_body : Warning<
10356  "while loop has empty body">, InGroup<EmptyBody>;
10357def warn_empty_switch_body : Warning<
10358  "switch statement has empty body">, InGroup<EmptyBody>;
10359def note_empty_body_on_separate_line : Note<
10360  "put the semicolon on a separate line to silence this warning">;
10361
10362def err_va_start_captured_stmt : Error<
10363  "'va_start' cannot be used in a captured statement">;
10364def err_va_start_outside_function : Error<
10365  "'va_start' cannot be used outside a function">;
10366def err_va_start_fixed_function : Error<
10367  "'va_start' used in function with fixed args">;
10368def err_va_start_used_in_wrong_abi_function : Error<
10369  "'va_start' used in %select{System V|Win64}0 ABI function">;
10370def err_ms_va_start_used_in_sysv_function : Error<
10371  "'__builtin_ms_va_start' used in System V ABI function">;
10372def warn_second_arg_of_va_start_not_last_named_param : Warning<
10373  "second argument to 'va_start' is not the last named parameter">,
10374  InGroup<Varargs>;
10375def warn_c17_compat_ellipsis_only_parameter : Warning<
10376  "'...' as the only parameter of a function is incompatible with C standards "
10377  "before C23">, DefaultIgnore, InGroup<CPre23Compat>;
10378def warn_va_start_type_is_undefined : Warning<
10379  "passing %select{an object that undergoes default argument promotion|"
10380  "an object of reference type|a parameter declared with the 'register' "
10381  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
10382def err_first_argument_to_va_arg_not_of_type_va_list : Error<
10383  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
10384def err_second_parameter_to_va_arg_incomplete: Error<
10385  "second argument to 'va_arg' is of incomplete type %0">;
10386def err_second_parameter_to_va_arg_abstract: Error<
10387  "second argument to 'va_arg' is of abstract type %0">;
10388def warn_second_parameter_to_va_arg_not_pod : Warning<
10389  "second argument to 'va_arg' is of non-POD type %0">,
10390  InGroup<NonPODVarargs>, DefaultError;
10391def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
10392  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
10393  InGroup<NonPODVarargs>, DefaultError;
10394def warn_second_parameter_to_va_arg_never_compatible : Warning<
10395  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
10396  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
10397
10398def warn_return_missing_expr : Warning<
10399  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
10400  InGroup<ReturnMismatch>;
10401def ext_return_missing_expr : ExtWarn<
10402  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
10403  InGroup<ReturnMismatch>;
10404def ext_return_has_expr : ExtWarn<
10405  "%select{void function|void method|constructor|destructor}1 %0 "
10406  "should not return a value">,
10407  DefaultError, InGroup<ReturnMismatch>;
10408def ext_return_has_void_expr : Extension<
10409  "void %select{function|method|block}1 %0 should not return void expression">;
10410def err_return_init_list : Error<
10411  "%select{void function|void method|constructor|destructor}1 %0 "
10412  "must not return a value">;
10413def err_ctor_dtor_returns_void : Error<
10414  "%select{constructor|destructor}1 %0 must not return void expression">;
10415def warn_noreturn_function_has_return_expr : Warning<
10416  "function %0 declared 'noreturn' should not return">,
10417  InGroup<InvalidNoreturn>;
10418def warn_falloff_noreturn_function : Warning<
10419  "function declared 'noreturn' should not return">,
10420  InGroup<InvalidNoreturn>;
10421def err_noreturn_block_has_return_expr : Error<
10422  "block declared 'noreturn' should not return">;
10423def err_carries_dependency_missing_on_first_decl : Error<
10424  "%select{function|parameter}0 declared '[[carries_dependency]]' "
10425  "after its first declaration">;
10426def note_carries_dependency_missing_first_decl : Note<
10427  "declaration missing '[[carries_dependency]]' attribute is here">;
10428def err_carries_dependency_param_not_function_decl : Error<
10429  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
10430  "declaration or lambda">;
10431def err_block_on_nonlocal : Error<
10432  "__block attribute not allowed, only allowed on local variables">;
10433def err_block_on_vm : Error<
10434  "__block attribute not allowed on declaration with a variably modified type">;
10435def err_sizeless_nonlocal : Error<
10436  "non-local variable with sizeless type %0">;
10437
10438def err_vec_builtin_non_vector : Error<
10439 "%select{first two|all}1 arguments to %0 must be vectors">;
10440def err_vec_builtin_incompatible_vector : Error<
10441  "%select{first two|all}1 arguments to %0 must have the same type">;
10442def err_vsx_builtin_nonconstant_argument : Error<
10443  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
10444
10445def err_shufflevector_nonconstant_argument : Error<
10446  "index for __builtin_shufflevector must be a constant integer">;
10447def err_shufflevector_argument_too_large : Error<
10448  "index for __builtin_shufflevector must be less than the total number "
10449  "of vector elements">;
10450def err_shufflevector_minus_one_is_undefined_behavior_constexpr : Error<
10451  "index for __builtin_shufflevector not within the bounds of the input vectors; index of -1 found at position %0 is not permitted in a constexpr context">;
10452
10453def err_convertvector_non_vector : Error<
10454  "first argument to __builtin_convertvector must be a vector">;
10455def err_convertvector_constexpr_unsupported_vector_cast : Error<
10456  "unsupported vector cast from %0 to %1 in a constant expression">;
10457def err_builtin_non_vector_type : Error<
10458  "%0 argument to %1 must be of vector type">;
10459def err_convertvector_incompatible_vector : Error<
10460  "first two arguments to __builtin_convertvector must have the same number of elements">;
10461
10462def err_first_argument_to_cwsc_not_call : Error<
10463  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
10464def err_first_argument_to_cwsc_block_call : Error<
10465  "first argument to __builtin_call_with_static_chain must not be a block call">;
10466def err_first_argument_to_cwsc_builtin_call : Error<
10467  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
10468def err_first_argument_to_cwsc_pdtor_call : Error<
10469  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
10470def err_second_argument_to_cwsc_not_pointer : Error<
10471  "second argument to __builtin_call_with_static_chain must be of pointer type">;
10472
10473def err_vector_incorrect_num_initializers : Error<
10474  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
10475def err_altivec_empty_initializer : Error<"expected initializer">;
10476
10477def err_invalid_neon_type_code : Error<
10478  "incompatible constant for this __builtin_neon function">;
10479def err_argument_invalid_range : Error<
10480  "argument value %0 is outside the valid range [%1, %2]">;
10481def warn_argument_invalid_range : Warning<
10482  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
10483  InGroup<DiagGroup<"argument-outside-range">>;
10484def warn_argument_undefined_behaviour : Warning<
10485  "argument value %0 will result in undefined behaviour">,
10486  InGroup<DiagGroup<"argument-undefined-behaviour">>;
10487def err_argument_not_multiple : Error<
10488  "argument should be a multiple of %0">;
10489def err_argument_not_power_of_2 : Error<
10490  "argument should be a power of 2">;
10491def err_argument_not_shifted_byte : Error<
10492  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
10493def err_argument_not_shifted_byte_or_xxff : Error<
10494  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
10495def err_argument_not_contiguous_bit_field : Error<
10496  "argument %0 value should represent a contiguous bit field">;
10497def err_rotation_argument_to_cadd : Error<
10498  "argument should be the value 90 or 270">;
10499def err_rotation_argument_to_cmla : Error<
10500  "argument should be the value 0, 90, 180 or 270">;
10501def warn_neon_vector_initializer_non_portable : Warning<
10502  "vector initializers are not compatible with NEON intrinsics in big endian "
10503  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
10504def note_neon_vector_initializer_non_portable : Note<
10505  "consider using vld1_%0%1() to initialize a vector from memory, or "
10506  "vcreate_%0%1() to initialize from an integer constant">;
10507def note_neon_vector_initializer_non_portable_q : Note<
10508  "consider using vld1q_%0%1() to initialize a vector from memory, or "
10509  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
10510  "constants">;
10511def err_systemz_invalid_tabort_code : Error<
10512  "invalid transaction abort code">;
10513def err_64_bit_builtin_32_bit_tgt : Error<
10514  "this builtin is only available on 64-bit targets">;
10515def err_32_bit_builtin_64_bit_tgt : Error<
10516  "this builtin is only available on 32-bit targets">;
10517def err_builtin_x64_aarch64_only : Error<
10518  "this builtin is only available on x86-64 and aarch64 targets">;
10519def err_mips_builtin_requires_dsp : Error<
10520  "this builtin requires 'dsp' ASE, please use -mdsp">;
10521def err_mips_builtin_requires_dspr2 : Error<
10522  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
10523def err_mips_builtin_requires_msa : Error<
10524  "this builtin requires 'msa' ASE, please use -mmsa">;
10525def err_ppc_builtin_requires_abi : Error<
10526  "this builtin requires ABI -mabi=%0">;
10527def err_ppc_invalid_use_mma_type : Error<
10528  "invalid use of PPC MMA type">;
10529def err_ppc_invalid_test_data_class_type : Error<
10530  "expected a 'float', 'double' or '__float128' for the first argument">;
10531def err_x86_builtin_invalid_rounding : Error<
10532  "invalid rounding argument">;
10533def err_x86_builtin_invalid_scale : Error<
10534  "scale argument must be 1, 2, 4, or 8">;
10535def err_x86_builtin_tile_arg_duplicate : Error<
10536  "tile arguments must refer to different tiles">;
10537
10538def err_builtin_target_unsupported : Error<
10539  "builtin is not supported on this target">;
10540def err_builtin_aix_os_unsupported : Error<
10541  "this builtin is available only on AIX 7.2 and later operating systems">;
10542def err_builtin_longjmp_unsupported : Error<
10543  "__builtin_longjmp is not supported for the current target">;
10544def err_builtin_setjmp_unsupported : Error<
10545  "__builtin_setjmp is not supported for the current target">;
10546
10547def err_builtin_longjmp_invalid_val : Error<
10548  "argument to __builtin_longjmp must be a constant 1">;
10549def err_builtin_requires_language : Error<"'%0' is only available in %1">;
10550
10551def err_constant_integer_arg_type : Error<
10552  "argument to %0 must be a constant integer">;
10553
10554def ext_mixed_decls_code : Extension<
10555  "mixing declarations and code is a C99 extension">,
10556  InGroup<DeclarationAfterStatement>;
10557def warn_mixed_decls_code : Warning<
10558  "mixing declarations and code is incompatible with standards before C99">,
10559  InGroup<DeclarationAfterStatement>, DefaultIgnore;
10560
10561def err_non_local_variable_decl_in_for : Error<
10562  "declaration of non-local variable in 'for' loop">;
10563def err_non_variable_decl_in_for : Error<
10564  "non-variable declaration in 'for' loop">;
10565def err_toomany_element_decls : Error<
10566  "only one element declaration is allowed">;
10567def err_selector_element_not_lvalue : Error<
10568  "selector element is not a valid lvalue">;
10569def err_selector_element_type : Error<
10570  "selector element type %0 is not a valid object">;
10571def err_selector_element_const_type : Error<
10572  "selector element of type %0 cannot be a constant lvalue expression">;
10573def err_collection_expr_type : Error<
10574  "the type %0 is not a pointer to a fast-enumerable object">;
10575def warn_collection_expr_type : Warning<
10576  "collection expression type %0 may not respond to %1">;
10577
10578def err_invalid_conversion_between_ext_vectors : Error<
10579  "invalid conversion between ext-vector type %0 and %1">;
10580
10581def warn_duplicate_attribute_exact : Warning<
10582  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
10583
10584def warn_duplicate_attribute : Warning<
10585  "attribute %0 is already applied with different arguments">,
10586  InGroup<IgnoredAttributes>;
10587def err_disallowed_duplicate_attribute : Error<
10588  "attribute %0 cannot appear more than once on a declaration">;
10589
10590def warn_sync_fetch_and_nand_semantics_change : Warning<
10591  "the semantics of this intrinsic changed with GCC "
10592  "version 4.4 - the newer semantics are provided here">,
10593  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
10594
10595// Type
10596def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
10597  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
10598def warn_receiver_forward_class : Warning<
10599  "receiver %0 is a forward class and corresponding @interface may not exist">,
10600  InGroup<ForwardClassReceiver>;
10601def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
10602def ext_missing_type_specifier : ExtWarn<
10603  "type specifier missing, defaults to 'int'; ISO C99 and later do not support "
10604  "implicit int">, InGroup<ImplicitInt>;
10605def err_missing_type_specifier : Error<
10606  "a type specifier is required for all declarations">;
10607def err_decimal_unsupported : Error<
10608  "GNU decimal type extension not supported">;
10609def err_objc_array_of_interfaces : Error<
10610  "array of interface %0 is invalid (probably should be an array of pointers)">;
10611def ext_c99_array_usage : Extension<
10612  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
10613  "feature">, InGroup<C99>;
10614def err_c99_array_usage_cxx : Error<
10615  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
10616  "feature, not permitted in C++">;
10617def err_type_unsupported : Error<
10618  "%0 is not supported on this target">;
10619def err_nsconsumed_attribute_mismatch : Error<
10620  "overriding method has mismatched ns_consumed attribute on its"
10621  " parameter">;
10622def err_nsreturns_retained_attribute_mismatch : Error<
10623  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
10624  " attributes">;
10625def err_nserrordomain_invalid_decl : Error<
10626  "domain argument %select{|%1 }0does not refer to global constant">;
10627def err_nserrordomain_wrong_type : Error<
10628  "domain argument %0 does not point to an NSString or CFString constant">;
10629
10630def warn_nsconsumed_attribute_mismatch : Warning<
10631  err_nsconsumed_attribute_mismatch.Summary>, InGroup<NSConsumedMismatch>;
10632def warn_nsreturns_retained_attribute_mismatch : Warning<
10633  err_nsreturns_retained_attribute_mismatch.Summary>, InGroup<NSReturnsMismatch>;
10634
10635def note_getter_unavailable : Note<
10636  "or because setter is declared here, but no getter method %0 is found">;
10637def err_invalid_protocol_qualifiers : Error<
10638  "invalid protocol qualifiers on non-ObjC type">;
10639def warn_ivar_use_hidden : Warning<
10640  "local declaration of %0 hides instance variable">,
10641   InGroup<ShadowIvar>;
10642def warn_direct_initialize_call : Warning<
10643  "explicit call to +initialize results in duplicate call to +initialize">,
10644   InGroup<ExplicitInitializeCall>;
10645def warn_direct_super_initialize_call : Warning<
10646  "explicit call to [super initialize] should only be in implementation "
10647  "of +initialize">,
10648   InGroup<ExplicitInitializeCall>;
10649def err_ivar_use_in_class_method : Error<
10650  "instance variable %0 accessed in class method">;
10651def err_private_ivar_access : Error<"instance variable %0 is private">,
10652  AccessControl;
10653def err_protected_ivar_access : Error<"instance variable %0 is protected">,
10654  AccessControl;
10655def warn_maynot_respond : Warning<"%0 may not respond to %1">;
10656def ext_typecheck_base_super : Warning<
10657  "method parameter type "
10658  "%diff{$ does not match super class method parameter type $|"
10659  "does not match super class method parameter type}0,1">,
10660   InGroup<SuperSubClassMismatch>, DefaultIgnore;
10661def warn_missing_method_return_type : Warning<
10662  "method has no return type specified; defaults to 'id'">,
10663  InGroup<MissingMethodReturnType>, DefaultIgnore;
10664def warn_direct_ivar_access : Warning<"instance variable %0 is being "
10665  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
10666
10667// Spell-checking diagnostics
10668def err_unknown_typename : Error<
10669  "unknown type name %0">;
10670def err_unknown_type_or_class_name_suggest : Error<
10671  "unknown %select{type|class}1 name %0; did you mean %2?">;
10672def err_unknown_typename_suggest : Error<
10673  "unknown type name %0; did you mean %1?">;
10674def err_unknown_nested_typename_suggest : Error<
10675  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
10676def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
10677def err_undeclared_use_suggest : Error<
10678  "use of undeclared %0; did you mean %1?">;
10679def err_undeclared_var_use_suggest : Error<
10680  "use of undeclared identifier %0; did you mean %1?">;
10681def err_no_template : Error<"no template named %0">;
10682def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
10683def err_no_member_template : Error<"no template named %0 in %1">;
10684def err_no_member_template_suggest : Error<
10685  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
10686def err_non_template_in_template_id : Error<
10687  "%0 does not name a template but is followed by template arguments">;
10688def err_non_template_in_template_id_suggest : Error<
10689  "%0 does not name a template but is followed by template arguments; "
10690  "did you mean %1?">;
10691def err_non_template_in_member_template_id_suggest : Error<
10692  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
10693def note_non_template_in_template_id_found : Note<
10694  "non-template declaration found by name lookup">;
10695def err_mem_init_not_member_or_class_suggest : Error<
10696  "initializer %0 does not name a non-static data member or base "
10697  "class; did you mean the %select{base class|member}1 %2?">;
10698def err_field_designator_unknown_suggest : Error<
10699  "field designator %0 does not refer to any field in type %1; did you mean "
10700  "%2?">;
10701def err_typecheck_member_reference_ivar_suggest : Error<
10702  "%0 does not have a member named %1; did you mean %2?">;
10703def err_property_not_found_suggest : Error<
10704  "property %0 not found on object of type %1; did you mean %2?">;
10705def err_class_property_found : Error<
10706  "property %0 is a class property; did you mean to access it with class '%1'?">;
10707def err_ivar_access_using_property_syntax_suggest : Error<
10708  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
10709def warn_property_access_suggest : Warning<
10710"property %0 not found on object of type %1; did you mean to access property %2?">,
10711InGroup<PropertyAccessDotSyntax>;
10712def err_property_found_suggest : Error<
10713  "property %0 found on object of type %1; did you mean to access "
10714  "it with the \".\" operator?">;
10715def err_undef_interface_suggest : Error<
10716  "cannot find interface declaration for %0; did you mean %1?">;
10717def warn_undef_interface_suggest : Warning<
10718  "cannot find interface declaration for %0; did you mean %1?">;
10719def err_undef_superclass_suggest : Error<
10720  "cannot find interface declaration for %0, superclass of %1; did you mean "
10721  "%2?">;
10722def err_undeclared_protocol_suggest : Error<
10723  "cannot find protocol declaration for %0; did you mean %1?">;
10724def note_base_class_specified_here : Note<
10725  "base class %0 specified here">;
10726def err_using_directive_suggest : Error<
10727  "no namespace named %0; did you mean %1?">;
10728def err_using_directive_member_suggest : Error<
10729  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
10730def note_namespace_defined_here : Note<"namespace %0 defined here">;
10731def err_sizeof_pack_no_pack_name_suggest : Error<
10732  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
10733def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
10734
10735def err_uncasted_use_of_unknown_any : Error<
10736  "%0 has unknown type; cast it to its declared type to use it">;
10737def err_uncasted_call_of_unknown_any : Error<
10738  "%0 has unknown return type; cast the call to its declared return type">;
10739def err_uncasted_send_to_unknown_any_method : Error<
10740  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
10741  "message send to the method's return type">;
10742def err_unsupported_unknown_any_decl : Error<
10743  "%0 has unknown type, which is not supported for this kind of declaration">;
10744def err_unsupported_unknown_any_expr : Error<
10745  "unsupported expression with unknown type">;
10746def err_unsupported_unknown_any_call : Error<
10747  "call to unsupported expression with unknown type">;
10748def err_unknown_any_addrof : Error<
10749  "the address of a declaration with unknown type "
10750  "can only be cast to a pointer type">;
10751def err_unknown_any_addrof_call : Error<
10752  "address-of operator cannot be applied to a call to a function with "
10753  "unknown return type">;
10754def err_unknown_any_var_function_type : Error<
10755  "variable %0 with unknown type cannot be given a function type">;
10756def err_unknown_any_function : Error<
10757  "function %0 with unknown type must be given a function type">;
10758
10759def err_filter_expression_integral : Error<
10760  "filter expression has non-integral type %0">;
10761
10762def err_non_asm_stmt_in_naked_function : Error<
10763  "non-ASM statement in naked function is not supported">;
10764def err_asm_naked_this_ref : Error<
10765  "'this' pointer references not allowed in naked functions">;
10766def err_asm_naked_parm_ref : Error<
10767  "parameter references not allowed in naked functions">;
10768
10769// OpenCL warnings and errors.
10770def err_invalid_astype_of_different_size : Error<
10771  "invalid reinterpretation: sizes of %0 and %1 must match">;
10772def err_static_kernel : Error<
10773  "kernel functions cannot be declared static">;
10774def err_method_kernel : Error<
10775  "kernel functions cannot be class members">;
10776def err_template_kernel : Error<
10777  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
10778def err_opencl_ptrptr_kernel_param : Error<
10779  "kernel parameter cannot be declared as a pointer to a pointer">;
10780def err_kernel_arg_address_space : Error<
10781  "pointer arguments to kernel functions must reside in '__global', "
10782  "'__constant' or '__local' address space">;
10783def err_opencl_ext_vector_component_invalid_length : Error<
10784  "vector component access has invalid length %0; supported lengths are: 1,2,3,4,8,16">;
10785def err_opencl_function_variable : Error<
10786  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
10787def err_opencl_addrspace_scope : Error<
10788  "variables in the %0 address space can only be declared in the outermost "
10789  "scope of a kernel function">;
10790def err_static_function_scope : Error<
10791  "variables in function scope cannot be declared static">;
10792def err_opencl_bitfields : Error<
10793  "bit-fields are not supported in OpenCL">;
10794def err_opencl_vla : Error<
10795  "variable length arrays are not supported in OpenCL">;
10796def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
10797    "scalar operand type has greater rank than the type of the vector "
10798    "element. (%0 and %1)">;
10799def err_bad_kernel_param_type : Error<
10800  "%0 cannot be used as the type of a kernel parameter">;
10801def err_record_with_pointers_kernel_param : Error<
10802  "%select{struct|union}0 kernel parameters may not contain pointers">;
10803def note_within_field_of_type : Note<
10804  "within field of type %0 declared here">;
10805def note_illegal_field_declared_here : Note<
10806  "field of illegal %select{type|pointer type}0 %1 declared here">;
10807def err_opencl_type_struct_or_union_field : Error<
10808  "the %0 type cannot be used to declare a structure or union field">;
10809def err_event_t_addr_space_qual : Error<
10810  "the event_t type can only be used with __private address space qualifier">;
10811def err_expected_kernel_void_return_type : Error<
10812  "kernel must have void return type">;
10813def err_sampler_initializer_not_integer : Error<
10814  "sampler_t initialization requires 32-bit integer, not %0">;
10815def warn_sampler_initializer_invalid_bits : Warning<
10816  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
10817def err_sampler_argument_required : Error<
10818  "sampler_t variable required - got %0">;
10819def err_wrong_sampler_addressspace: Error<
10820  "sampler type cannot be used with the __local and __global address space qualifiers">;
10821def err_opencl_nonconst_global_sampler : Error<
10822  "global sampler requires a const or constant address space qualifier">;
10823def err_opencl_cast_non_zero_to_event_t : Error<
10824  "cannot cast non-zero value '%0' to 'event_t'">;
10825def err_opencl_global_invalid_addr_space : Error<
10826  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
10827def err_missing_actual_pipe_type : Error<
10828  "missing actual type specifier for pipe">;
10829def err_reference_pipe_type : Error <
10830  "pipes packet types cannot be of reference type">;
10831def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
10832def err_opencl_kernel_attr :
10833  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
10834def err_return_value_with_address_space : Error<
10835  "return type cannot be qualified with address space">;
10836def err_opencl_constant_no_init : Error<
10837  "variable in constant address space must be initialized">;
10838def err_opencl_atomic_init: Error<
10839  "atomic variable can be %select{assigned|initialized}0 to a variable only "
10840  "in global address space">;
10841def err_opencl_implicit_vector_conversion : Error<
10842  "implicit conversions between vector types (%0 and %1) are not permitted">;
10843def err_opencl_invalid_type_array : Error<
10844  "array of %0 type is invalid in OpenCL">;
10845def err_opencl_ternary_with_block : Error<
10846  "block type cannot be used as expression in ternary expression in OpenCL">;
10847def err_opencl_pointer_to_type : Error<
10848  "pointer to type %0 is invalid in OpenCL">;
10849def err_opencl_type_can_only_be_used_as_function_parameter : Error <
10850  "type %0 can only be used as a function parameter in OpenCL">;
10851def err_opencl_type_not_found : Error<
10852  "%0 type %1 not found; include the base header with -finclude-default-header">;
10853def warn_opencl_attr_deprecated_ignored : Warning <
10854  "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>;
10855def err_opencl_variadic_function : Error<
10856  "invalid prototype, variadic arguments are not allowed in OpenCL">;
10857def err_opencl_requires_extension : Error<
10858  "use of %select{type|declaration}0 %1 requires %2 support">;
10859def ext_opencl_double_without_pragma : Extension<
10860  "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
10861  " supported">;
10862def warn_opencl_generic_address_space_arg : Warning<
10863  "passing non-generic address space pointer to %0"
10864  " may cause dynamic conversion affecting performance">,
10865  InGroup<Conversion>, DefaultIgnore;
10866
10867// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
10868def err_opencl_builtin_pipe_first_arg : Error<
10869  "first argument to %0 must be a pipe type">;
10870def err_opencl_builtin_pipe_arg_num : Error<
10871  "invalid number of arguments to function: %0">;
10872def err_opencl_builtin_pipe_invalid_arg : Error<
10873  "invalid argument type to function %0 (expecting %1 having %2)">;
10874def err_opencl_builtin_pipe_invalid_access_modifier : Error<
10875  "invalid pipe access modifier (expecting %0)">;
10876
10877// OpenCL access qualifier
10878def err_opencl_invalid_access_qualifier : Error<
10879  "access qualifier can only be used for pipe and image type">;
10880def err_opencl_invalid_read_write : Error<
10881  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 "
10882  "and without __opencl_c_read_write_images feature}2">;
10883def err_opencl_multiple_access_qualifiers : Error<
10884  "multiple access qualifiers">;
10885def note_opencl_typedef_access_qualifier : Note<
10886  "previously declared '%0' here">;
10887
10888// OpenCL v2.0 s6.12.5 Blocks restrictions
10889def err_opencl_block_storage_type : Error<
10890  "the __block storage type is not permitted">;
10891def err_opencl_invalid_block_declaration : Error<
10892  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
10893def err_opencl_extern_block_declaration : Error<
10894  "invalid block variable declaration - using 'extern' storage class is disallowed">;
10895def err_opencl_block_ref_block : Error<
10896  "cannot refer to a block inside block">;
10897
10898// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
10899def err_opencl_builtin_to_addr_invalid_arg : Error<
10900  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
10901
10902// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
10903def err_opencl_enqueue_kernel_incorrect_args : Error<
10904  "illegal call to enqueue_kernel, incorrect argument types">;
10905def err_opencl_enqueue_kernel_local_size_args : Error<
10906  "mismatch in number of block parameters and local size arguments passed">;
10907def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
10908  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
10909def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
10910  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
10911def err_opencl_enqueue_kernel_blocks_no_args : Error<
10912  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
10913
10914def err_opencl_builtin_expected_type : Error<
10915  "illegal call to %0, expected %1 argument type">;
10916
10917// OpenCL v3.0 s6.3.7 - Vector Components
10918def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
10919  "vector component name '%0' is a feature from OpenCL version 3.0 onwards">,
10920  InGroup<OpenCLUnsupportedRGBA>;
10921
10922def err_openclcxx_placement_new : Error<
10923  "use of placement new requires explicit declaration">;
10924
10925// MIG routine annotations.
10926def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
10927  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
10928  InGroup<IgnoredAttributes>;
10929
10930def warn_imp_cast_drops_unaligned : Warning<
10931  "implicit cast from type %0 to type %1 drops __unaligned qualifier">,
10932  InGroup<DiagGroup<"unaligned-qualifier-implicit-cast">>;
10933
10934// Function effects
10935// spoofing nonblocking/nonallocating
10936def warn_invalid_add_func_effects : Warning<
10937  "attribute '%0' should not be added via type conversion">,
10938  InGroup<FunctionEffects>;
10939def warn_mismatched_func_effect_override : Warning<
10940  "attribute '%0' on overriding function does not match base declaration">,
10941  InGroup<FunctionEffects>;
10942def warn_mismatched_func_effect_redeclaration : Warning<
10943  "attribute '%0' on function does not match previous declaration">,
10944  InGroup<FunctionEffects>;
10945def warn_conflicting_func_effects : Warning<
10946  "effects conflict when merging declarations; kept '%0', discarded '%1'">,
10947  InGroup<FunctionEffects>;
10948def err_func_with_effects_no_prototype : Error<
10949  "'%0' function must have a prototype">;
10950
10951} // end of sema category
10952
10953let CategoryName = "API Notes Issue" in {
10954
10955def err_incompatible_replacement_type : Error<
10956  "API notes replacement type %0 has a different size from original type %1">;
10957
10958} // end of API Notes category
10959
10960let CategoryName = "OpenMP Issue" in {
10961// OpenMP support.
10962def err_omp_expected_var_arg : Error<
10963  "%0 is not a global variable, static local variable or static data member">;
10964def err_omp_expected_var_arg_suggest : Error<
10965  "%0 is not a global variable, static local variable or static data member; "
10966  "did you mean %1">;
10967def err_omp_global_var_arg : Error<
10968  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
10969def err_omp_ref_type_arg : Error<
10970  "arguments of '#pragma omp %0' cannot be of reference type %1">;
10971def err_omp_region_not_file_context : Error<
10972  "directive must be at file or namespace scope">;
10973def err_omp_var_scope : Error<
10974  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
10975def err_omp_var_used : Error<
10976  "'#pragma omp %0' must precede all references to variable %q1">;
10977def err_omp_var_thread_local : Error<
10978  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
10979def err_omp_private_incomplete_type : Error<
10980  "a private variable with incomplete type %0">;
10981def err_omp_firstprivate_incomplete_type : Error<
10982  "a firstprivate variable with incomplete type %0">;
10983def err_omp_lastprivate_incomplete_type : Error<
10984  "a lastprivate variable with incomplete type %0">;
10985def err_omp_reduction_incomplete_type : Error<
10986  "a reduction list item with incomplete type %0">;
10987def warn_omp_minus_in_reduction_deprecated : Warning<
10988  "minus(-) operator for reductions is deprecated; use + or user defined reduction instead">,
10989  InGroup<Deprecated>;
10990def err_omp_unexpected_clause_value : Error<
10991  "expected %0 in OpenMP clause '%1'">;
10992def err_omp_unexpected_call_to_omp_runtime_api
10993    : Error<"calls to OpenMP runtime API are not allowed within a region that "
10994            "corresponds to a construct with an order clause that specifies "
10995            "concurrent">;
10996def err_omp_expected_var_name_member_expr : Error<
10997  "expected variable name%select{| or data member of current class}0">;
10998def err_omp_expected_var_name_member_expr_with_type : Error<
10999  "expected variable%select{| or static data member|, static data member, "
11000  "or non-static data member of current class}0 of type '%1'">;
11001def err_omp_expected_var_name_member_expr_or_array_item : Error<
11002  "expected variable name%select{|, data member of current class}0, array element or array section">;
11003def err_omp_expected_addressable_lvalue_or_array_item : Error<
11004  "expected addressable lvalue expression, array element%select{ or array section|, array section or array shaping expression}0%select{| of non 'omp_depend_t' type}1">;
11005def err_omp_expected_named_var_member_or_array_expression: Error<
11006  "expected expression containing only member accesses and/or array sections based on named variables">;
11007def err_omp_bit_fields_forbidden_in_clause : Error<
11008  "bit fields cannot be used to specify storage in a '%0' clause">;
11009def err_array_section_does_not_specify_contiguous_storage : Error<
11010  "array section does not specify contiguous storage">;
11011def err_array_section_does_not_specify_length : Error<
11012  "array section does not specify length for outermost dimension">;
11013def err_omp_union_type_not_allowed : Error<
11014  "mapping of union members is not allowed">;
11015def err_omp_expected_access_to_data_field : Error<
11016  "expected access to data field">;
11017def err_omp_multiple_array_items_in_map_clause : Error<
11018  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
11019def err_omp_duplicate_map_type_modifier : Error<
11020  "same map type modifier has been specified more than once">;
11021def err_omp_duplicate_motion_modifier : Error<
11022  "same motion modifier has been specified more than once">;
11023def err_omp_pointer_mapped_along_with_derived_section : Error<
11024  "pointer cannot be mapped along with a section derived from itself">;
11025def err_omp_original_storage_is_shared_and_does_not_contain : Error<
11026  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
11027def err_omp_same_pointer_dereferenced : Error<
11028  "same pointer dereferenced in multiple different ways in map clause expressions">;
11029def note_omp_task_predetermined_firstprivate_here : Note<
11030  "predetermined as a firstprivate in a task construct here">;
11031def err_omp_threadprivate_incomplete_type : Error<
11032  "threadprivate variable with incomplete type %0">;
11033def err_omp_no_dsa_for_variable : Error<
11034  "variable %0 must have explicitly specified data sharing attributes">;
11035def err_omp_defaultmap_no_attr_for_variable : Error<
11036  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
11037def note_omp_default_dsa_none : Note<
11038  "explicit data sharing attribute requested here">;
11039def note_omp_defaultmap_attr_none : Note<
11040  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
11041def err_omp_wrong_dsa : Error<
11042  "%0 variable cannot be %1">;
11043def err_omp_variably_modified_type_not_supported : Error<
11044  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
11045def note_omp_explicit_dsa : Note<
11046  "defined as %0">;
11047def note_omp_predetermined_dsa : Note<
11048  "%select{static data member is predetermined as shared|"
11049  "variable with static storage duration is predetermined as shared|"
11050  "loop iteration variable is predetermined as private|"
11051  "loop iteration variable is predetermined as linear|"
11052  "loop iteration variable is predetermined as lastprivate|"
11053  "constant variable is predetermined as shared|"
11054  "global variable is predetermined as shared|"
11055  "non-shared variable in a task construct is predetermined as firstprivate|"
11056  "variable with automatic storage duration is predetermined as private}0"
11057  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
11058def note_omp_implicit_dsa : Note<
11059  "implicitly determined as %0">;
11060def err_omp_loop_var_dsa : Error<
11061  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
11062def err_omp_not_for : Error<
11063  "%select{statement after '#pragma omp %1' must be a for loop|"
11064  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
11065def note_omp_collapse_ordered_expr : Note<
11066  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
11067def err_omp_negative_expression_in_clause : Error<
11068  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
11069def err_omp_not_integral : Error<
11070  "expression must have integral or unscoped enumeration "
11071  "type, not %0">;
11072def err_omp_threadprivate_in_target : Error<
11073  "threadprivate variables cannot be used in target constructs">;
11074def err_omp_incomplete_type : Error<
11075  "expression has incomplete class type %0">;
11076def err_omp_explicit_conversion : Error<
11077  "expression requires explicit conversion from %0 to %1">;
11078def note_omp_conversion_here : Note<
11079  "conversion to %select{integral|enumeration}0 type %1 declared here">;
11080def err_omp_ambiguous_conversion : Error<
11081  "ambiguous conversion from type %0 to an integral or unscoped "
11082  "enumeration type">;
11083def err_omp_iterator_not_integral_or_pointer : Error<
11084  "expected integral or pointer type as the iterator-type, not %0">;
11085def err_omp_iterator_step_not_integral : Error<
11086  "iterator step expression %0 is not the integral expression">;
11087def err_omp_iterator_step_constant_zero : Error<
11088  "iterator step expression %0 evaluates to 0">;
11089def err_omp_required_access : Error<
11090  "%0 variable must be %1">;
11091def err_omp_const_variable : Error<
11092  "const-qualified variable cannot be %0">;
11093def err_omp_const_not_mutable_variable : Error<
11094  "const-qualified variable without mutable fields cannot be %0">;
11095def err_omp_const_list_item : Error<
11096  "const-qualified list item cannot be %0">;
11097def err_omp_linear_incomplete_type : Error<
11098  "a linear variable with incomplete type %0">;
11099def err_omp_linear_expected_int_or_ptr : Error<
11100  "argument of a linear clause should be of integral or pointer "
11101  "type, not %0">;
11102def warn_omp_linear_step_zero : Warning<
11103  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
11104  InGroup<OpenMPClauses>;
11105def warn_omp_alignment_not_power_of_two : Warning<
11106  "aligned clause will be ignored because the requested alignment is not a power of 2">,
11107  InGroup<OpenMPClauses>;
11108def err_omp_invalid_target_decl : Error<
11109  "%0 used in declare target directive is not a variable or a function name">;
11110def err_omp_declare_target_to_and_link : Error<
11111  "%0 must not appear in both clauses 'to' and 'link'">;
11112def warn_omp_not_in_target_context : Warning<
11113  "declaration is not declared in any declare target region">,
11114  InGroup<OpenMPTarget>;
11115def err_omp_function_in_link_clause : Error<
11116  "function name is not allowed in 'link' clause">;
11117def err_omp_aligned_expected_array_or_ptr : Error<
11118  "argument of aligned clause should be array"
11119  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
11120  ", not %0">;
11121def err_omp_used_in_clause_twice : Error<
11122  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
11123def err_omp_local_var_in_threadprivate_init : Error<
11124  "variable with local storage in initial value of threadprivate variable">;
11125def err_omp_loop_not_canonical_init : Error<
11126  "initialization clause of OpenMP for loop is not in canonical form "
11127  "('var = init' or 'T var = init')">;
11128def ext_omp_loop_not_canonical_init : ExtWarn<
11129  "initialization clause of OpenMP for loop is not in canonical form "
11130  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
11131def err_omp_loop_not_canonical_cond : Error<
11132  "condition of OpenMP for loop must be a relational comparison "
11133  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
11134def err_omp_loop_not_canonical_incr : Error<
11135  "increment clause of OpenMP for loop must perform simple addition "
11136  "or subtraction on loop variable %0">;
11137def err_omp_loop_variable_type : Error<
11138  "variable must be of integer or %select{pointer|random access iterator}0 type">;
11139def err_omp_loop_incr_not_compatible : Error<
11140  "increment expression must cause %0 to %select{decrease|increase}1 "
11141  "on each iteration of OpenMP for loop">;
11142def note_omp_loop_cond_requires_compatible_incr : Note<
11143  "loop step is expected to be %select{negative|positive}0 due to this condition">;
11144def err_omp_loop_diff_cxx : Error<
11145  "could not calculate number of iterations calling 'operator-' with "
11146  "upper and lower loop bounds">;
11147def err_omp_loop_cannot_use_stmt : Error<
11148  "'%0' statement cannot be used in OpenMP for loop">;
11149def err_omp_simd_region_cannot_use_stmt : Error<
11150  "'%0' statement cannot be used in OpenMP simd region">;
11151def warn_omp_loop_64_bit_var : Warning<
11152  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
11153  InGroup<OpenMPLoopForm>;
11154def err_omp_unknown_reduction_identifier_prior_omp_6_0 : Error<
11155  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
11156  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
11157def err_omp_unknown_reduction_identifier_since_omp_6_0 : Error<
11158  "incorrect reduction identifier, expected one of '+', '*', '&', '|', '^', "
11159  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
11160def err_omp_not_resolved_reduction_identifier : Error<
11161  "unable to resolve declare reduction construct for type %0">;
11162def err_omp_reduction_ref_type_arg : Error<
11163  "argument of OpenMP clause '%0' must reference the same object in all threads">;
11164def err_omp_clause_not_arithmetic_type_arg : Error<
11165  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
11166def err_omp_clause_floating_type_arg : Error<
11167  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
11168def err_omp_once_referenced : Error<
11169  "variable can appear only once in OpenMP '%0' clause">;
11170def err_omp_once_referenced_in_target_update : Error<
11171  "variable can appear only once in OpenMP 'target update' construct">;
11172def note_omp_referenced : Note<
11173  "previously referenced here">;
11174def err_omp_reduction_in_task : Error<
11175  "reduction variables may not be accessed in an explicit task">;
11176def err_omp_reduction_id_not_compatible : Error<
11177  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
11178def err_omp_reduction_identifier_mismatch : Error<
11179  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
11180def note_omp_previous_reduction_identifier : Note<
11181  "previously marked as task_reduction with different reduction operation">;
11182def err_omp_prohibited_region : Error<
11183  "region cannot be%select{| closely}0 nested inside '%1' region"
11184  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
11185  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
11186  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
11187  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
11188  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
11189def err_omp_prohibited_region_simd : Error<
11190  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
11191def err_omp_prohibited_region_atomic : Error<
11192  "OpenMP constructs may not be nested inside an atomic region">;
11193def err_omp_prohibited_region_order
11194    : Error<"construct '%0' not allowed in a region associated with a "
11195            "directive with 'order' clause">;
11196def err_omp_prohibited_region_critical_same_name : Error<
11197  "cannot nest 'critical' regions having the same name %0">;
11198def note_omp_previous_critical_region : Note<
11199  "previous 'critical' region starts here">;
11200def err_omp_several_directives_in_region : Error<
11201  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
11202def note_omp_previous_directive : Note<
11203  "previous '%0' directive used here">;
11204def err_omp_sections_not_compound_stmt : Error<
11205  "the statement for '#pragma omp %0' must be a compound statement">;
11206def err_omp_orphaned_section_directive : Error<
11207  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
11208  " must be closely nested to a sections region%select{|, not a %1 region}0">;
11209def err_omp_sections_substmt_not_section : Error<
11210  "statement in 'omp %0' directive must be enclosed into a section region">;
11211def err_omp_parallel_reduction_in_task_firstprivate : Error<
11212  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
11213def err_omp_atomic_read_not_expression_statement : Error<
11214  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
11215  " where v and x are both lvalue expressions with scalar type">;
11216def note_omp_atomic_read_write: Note<
11217  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
11218def err_omp_atomic_write_not_expression_statement : Error<
11219  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
11220  " where x is a lvalue expression with scalar type">;
11221def err_omp_atomic_update_not_expression_statement : Error<
11222  "the statement for 'atomic update' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x',"
11223  " where x is an lvalue expression with scalar type">;
11224def err_omp_atomic_not_expression_statement : Error<
11225  "the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x',"
11226  " where x is an lvalue expression with scalar type">;
11227def note_omp_atomic_update: Note<
11228  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
11229  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
11230  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
11231def err_omp_atomic_capture_not_expression_statement : Error<
11232  "the statement for 'atomic capture' must be an expression statement of form 'v = ++x;', 'v = --x;', 'v = x++;', 'v = x--;', 'v = x binop= expr;', 'v = x = x binop expr' or 'v = x = expr binop x',"
11233  " where x and v are both lvalue expressions with scalar type">;
11234def err_omp_atomic_capture_not_compound_statement : Error<
11235  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
11236  " '{v = x; x = x binop expr;}', '{v = x; x = expr binop x;}', '{x = x binop expr; v = x;}', '{x = expr binop x; v = x;}' or '{v = x; x = expr;}',"
11237  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
11238  " where x is an lvalue expression with scalar type">;
11239def note_omp_atomic_capture: Note<
11240  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
11241def err_omp_atomic_compare : Error<
11242  "the statement for 'atomic compare' must be a compound statement of form '{x = expr ordop x ? expr : x;}', '{x = x ordop expr? expr : x;}',"
11243  " '{x = x == e ? d : x;}', '{x = e == x ? d : x;}', or 'if(expr ordop x) {x = expr;}', 'if(x ordop expr) {x = expr;}', 'if(x == e) {x = d;}',"
11244  " 'if(e == x) {x = d;}' where 'x' is an lvalue expression with scalar type, 'expr', 'e', and 'd' are expressions with scalar type,"
11245  " and 'ordop' is one of '<' or '>'">;
11246def err_omp_atomic_compare_capture : Error<
11247  "the statement for 'atomic compare capture' must be a compound statement of form '{v = x; cond-up-stmt}', ''{cond-up-stmt v = x;}', '{if(x == e) {x = d;} else {v = x;}}',"
11248  " '{r = x == e; if(r) {x = d;}}', or '{r = x == e; if(r) {x = d;} else {v = x;}}', where 'cond-update-stmt' can have one of the following forms: 'if(expr ordop x) {x = expr;}',"
11249  " 'if(x ordop expr) {x = expr;}', 'if(x == e) {x = d;}', or 'if(e == x) {x = d;}' where 'x', 'r', and 'v' are lvalue expressions with scalar type, 'expr', 'e', and 'd' are expressions with scalar type,"
11250  " and 'ordop' is one of '<' or '>'">;
11251def note_omp_atomic_compare: Note<
11252  "%select{expected compound statement|expected exactly one expression statement|expected assignment statement|expected conditional operator|expect result value to be at false expression|"
11253  "expect binary operator in conditional expression|expect '<', '>' or '==' as order operator|expect comparison in a form of 'x == e', 'e == x', 'x ordop expr', or 'expr ordop x'|"
11254  "expect lvalue for result value|expect scalar value|expect integer value|unexpected 'else' statement|expect '==' operator|expect an assignment statement 'v = x'|"
11255  "expect a 'if' statement|expect no more than two statements|expect a compound statement|expect 'else' statement|expect a form 'r = x == e; if (r) ...'}0">;
11256def err_omp_atomic_fail_wrong_or_no_clauses : Error<"expected a memory order clause">;
11257def err_omp_atomic_no_compare : Error<"expected 'compare' clause with the '%0' modifier">;
11258def err_omp_atomic_weak_no_equality : Error<"expected '==' operator for 'weak' clause">;
11259def err_omp_atomic_several_clauses : Error<
11260  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update', 'capture', or 'compare' clause">;
11261def err_omp_several_mem_order_clauses : Error<
11262  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
11263def err_omp_atomic_incompatible_mem_order_clause : Error<
11264  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
11265def note_omp_previous_mem_order_clause : Note<
11266  "'%0' clause used here">;
11267def err_omp_target_contains_not_only_teams : Error<
11268  "target construct with nested teams region contains statements outside of the teams construct">;
11269def note_omp_nested_teams_construct_here : Note<
11270  "nested teams construct here">;
11271def note_omp_nested_statement_here : Note<
11272  "%select{statement|directive}0 outside teams construct here">;
11273def err_omp_single_copyprivate_with_nowait : Error<
11274  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
11275def err_omp_nowait_clause_without_depend: Error<
11276  "directive '#pragma omp taskwait' cannot use 'nowait' clause without 'depend' clause">;
11277def note_omp_nowait_clause_here : Note<
11278  "'nowait' clause is here">;
11279def err_omp_single_decl_in_declare_simd_variant : Error<
11280  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
11281def err_omp_function_expected : Error<
11282  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
11283def err_omp_wrong_cancel_region : Error<
11284  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
11285def err_omp_parent_cancel_region_nowait : Error<
11286  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
11287def err_omp_parent_cancel_region_ordered : Error<
11288  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
11289def err_omp_reduction_wrong_type : Error<"reduction type cannot be %select{qualified with 'const', 'volatile' or 'restrict'|a function|a reference|an array}0 type">;
11290def err_omp_wrong_var_in_declare_reduction : Error<"only %select{'omp_priv' or 'omp_orig'|'omp_in' or 'omp_out'}0 variables are allowed in %select{initializer|combiner}0 expression">;
11291def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
11292def err_omp_mapper_wrong_type : Error<
11293  "mapper type must be of struct, union or class type">;
11294def err_omp_declare_mapper_wrong_var : Error<
11295  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
11296def err_omp_declare_mapper_redefinition : Error<
11297  "redefinition of user-defined mapper for type %0 with name %1">;
11298def err_omp_invalid_mapper: Error<
11299  "cannot find a valid user-defined mapper for type %0 with name %1">;
11300def err_array_section_use : Error<"%select{OpenACC sub-array|OpenMP array section}0 is not allowed here">;
11301def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
11302def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
11303def err_omp_typecheck_section_value : Error<
11304  "subscripted value is not an array or pointer">;
11305def err_omp_typecheck_section_not_integer : Error<
11306  "array section %select{lower bound|length}0 is not an integer">;
11307def err_omp_typecheck_shaping_not_integer : Error<
11308  "array shaping operation dimension is not an integer">;
11309def err_omp_shaping_dimension_not_positive : Error<
11310  "array shaping dimension is evaluated to a non-positive value %0">;
11311def err_omp_section_function_type : Error<
11312  "section of pointer to function type %0">;
11313def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
11314  InGroup<CharSubscript>, DefaultIgnore;
11315def err_omp_section_incomplete_type : Error<
11316  "section of pointer to incomplete type %0">;
11317def err_omp_section_not_subset_of_array : Error<
11318  "array section must be a subset of the original array">;
11319def err_omp_section_length_negative : Error<
11320  "section length is evaluated to a negative value %0">;
11321def err_omp_section_stride_non_positive : Error<
11322  "section stride is evaluated to a non-positive value %0">;
11323def err_omp_section_length_undefined : Error<
11324  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
11325def err_omp_wrong_linear_modifier : Error<
11326  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
11327def err_omp_wrong_linear_modifier_non_reference : Error<
11328  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
11329def err_omp_step_simple_modifier_exclusive : Error<
11330  "step simple modifier is exclusive and can't be use with 'val', 'uval' or 'ref' modifier">;
11331def err_omp_wrong_simdlen_safelen_values : Error<
11332  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
11333def err_omp_wrong_if_directive_name_modifier : Error<
11334  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
11335def err_omp_no_more_if_clause : Error<
11336  "no more 'if' clause is allowed">;
11337def err_omp_unnamed_if_clause : Error<
11338  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
11339def note_omp_previous_named_if_clause : Note<
11340  "previous clause with directive name modifier specified here">;
11341def err_omp_ordered_directive_with_param : Error<
11342  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
11343def err_omp_ordered_directive_without_param : Error<
11344  "'ordered' directive with '%0' clause cannot be closely nested inside ordered region without specified parameter">;
11345def note_omp_ordered_param : Note<
11346  "'ordered' clause%select{| with specified parameter}0">;
11347def err_omp_expected_base_var_name : Error<
11348  "expected variable name as a base of the array %select{subscript|section}0">;
11349def err_omp_map_shared_storage : Error<
11350  "variable already marked as mapped in current construct">;
11351def err_omp_invalid_map_type_for_directive : Error<
11352  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
11353def err_omp_invalid_map_type_modifier_for_directive : Error<
11354  "map type modifier '%0' is not allowed for '#pragma omp %1'">;
11355def err_omp_no_clause_for_directive : Error<
11356  "expected at least one %0 clause for '#pragma omp %1'">;
11357def err_omp_threadprivate_in_clause : Error<
11358  "threadprivate variables are not allowed in '%0' clause">;
11359def err_omp_wrong_ordered_loop_count : Error<
11360  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
11361def note_collapse_loop_count : Note<
11362  "parameter of the 'collapse' clause">;
11363def err_omp_clauses_mutually_exclusive : Error<
11364  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
11365def note_omp_previous_clause : Note<
11366  "'%0' clause is specified here">;
11367def err_omp_hint_clause_no_name : Error<
11368  "the name of the construct must be specified in presence of 'hint' clause">;
11369def err_omp_critical_with_hint : Error<
11370  "constructs with the same name must have a 'hint' clause with the same value">;
11371def note_omp_critical_hint_here : Note<
11372  "%select{|previous }0'hint' clause with value '%1'">;
11373def note_omp_critical_no_hint : Note<
11374  "%select{|previous }0directive with no 'hint' clause specified">;
11375def err_omp_depend_clause_thread_simd : Error<
11376  "'%0' clauses cannot be mixed with '%1' clause">;
11377def err_omp_depend_sink_expected_loop_iteration : Error<
11378  "expected%select{| %1}0 loop iteration variable">;
11379def err_omp_depend_sink_unexpected_expr : Error<
11380  "unexpected expression: number of expressions is larger than the number of associated loops">;
11381def err_omp_depend_sink_expected_plus_minus : Error<
11382  "expected '+' or '-' operation">;
11383def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error<
11384  "'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">;
11385def err_omp_sink_and_source_not_allowed : Error<
11386  "'%0(%select{source|sink:vec}1)' clause%select{|s}1 cannot be mixed with '%0(%select{sink:vec|source}1)' clause%select{s|}1">;
11387def err_omp_depend_zero_length_array_section_not_allowed : Error<
11388  "zero-length array section is not allowed in 'depend' clause">;
11389def err_omp_depend_sink_source_with_modifier : Error<
11390  "depend modifier cannot be used with 'sink' or 'source' depend type">;
11391def err_omp_depend_modifier_not_iterator : Error<
11392  "expected iterator specification as depend modifier">;
11393def err_omp_map_modifier_not_iterator : Error<
11394  "expected iterator specification as map modifier">;
11395def err_omp_linear_ordered : Error<
11396  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
11397def err_omp_unexpected_schedule_modifier : Error<
11398  "modifier '%0' cannot be used along with modifier '%1'">;
11399def err_omp_schedule_nonmonotonic_static : Error<
11400  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
11401def err_omp_simple_clause_incompatible_with_ordered : Error<
11402  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
11403def err_omp_ordered_simd : Error<
11404  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
11405def err_omp_variable_in_given_clause_and_dsa : Error<
11406  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
11407def err_omp_param_or_this_in_clause : Error<
11408  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
11409def err_omp_expected_uniform_param : Error<
11410  "expected a reference to a parameter specified in a 'uniform' clause">;
11411def err_omp_expected_int_param : Error<
11412  "expected a reference to an integer-typed parameter">;
11413def err_omp_at_least_one_motion_clause_required : Error<
11414  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
11415def err_omp_cannot_update_with_internal_linkage : Error<
11416  "the host cannot update a declare target variable that is not externally visible">;
11417def err_omp_usedeviceptr_not_a_pointer : Error<
11418  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
11419def err_omp_argument_type_isdeviceptr : Error <
11420  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
11421def warn_omp_nesting_simd : Warning<
11422  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
11423  InGroup<SourceUsesOpenMP>;
11424def err_omp_orphaned_device_directive : Error<
11425  "orphaned 'omp %0' directives are prohibited"
11426  "; perhaps you forget to enclose the directive into a "
11427  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
11428def err_omp_reduction_non_addressable_expression : Error<
11429  "expected addressable reduction item for the task-based directives">;
11430def err_omp_reduction_with_nogroup : Error<
11431  "'reduction' clause cannot be used with 'nogroup' clause">;
11432def err_omp_reduction_vla_unsupported : Error<
11433  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
11434def err_omp_linear_distribute_var_non_loop_iteration : Error<
11435  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
11436def warn_omp_non_trivial_type_mapped : Warning<
11437  "type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
11438  InGroup<OpenMPMapping>;
11439def err_omp_requires_clause_redeclaration : Error <
11440  "only one %0 clause can appear on a requires directive in a single translation unit">;
11441def note_omp_requires_previous_clause : Note <
11442  "%0 clause previously used here">;
11443def err_omp_directive_before_requires : Error <
11444  "'%0' region encountered before requires directive with '%1' clause">;
11445def note_omp_requires_encountered_directive : Note <
11446  "'%0' previously encountered here">;
11447def err_omp_device_ancestor_without_requires_reverse_offload : Error <
11448  "device clause with ancestor device-modifier used without specifying 'requires reverse_offload'">;
11449def err_omp_invalid_scope : Error <
11450  "'#pragma omp %0' directive must appear only in file scope">;
11451def note_omp_invalid_length_on_this_ptr_mapping : Note <
11452  "expected length on mapping of 'this' array section expression to be '1'">;
11453def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
11454  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
11455def note_omp_invalid_subscript_on_this_ptr_map : Note <
11456  "expected 'this' subscript expression on map clause to be 'this[0]'">;
11457def err_omp_invalid_map_this_expr : Error <
11458  "invalid 'this' expression on 'map' clause">;
11459def err_omp_implied_type_not_found : Error<
11460  "'%0' type not found; include <omp.h>">;
11461def err_omp_expected_omp_depend_t_lvalue : Error<
11462  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
11463def err_omp_depobj_expected : Error<
11464  "expected depobj expression">;
11465def err_omp_depobj_single_clause_expected : Error<
11466  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
11467def err_omp_scan_single_clause_expected : Error<
11468  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
11469def err_omp_inclusive_exclusive_not_reduction : Error<
11470  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
11471  "of the parent directive">;
11472def err_omp_reduction_not_inclusive_exclusive : Error<
11473  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
11474  " 'exclusive' clause on an inner 'omp scan' directive">;
11475def err_omp_wrong_inscan_reduction : Error<
11476  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
11477  " 'omp parallel for', or 'omp parallel for simd' directive">;
11478def err_omp_inscan_reduction_expected : Error<
11479  "expected 'reduction' clause with the 'inscan' modifier">;
11480def note_omp_previous_inscan_reduction : Note<
11481  "'reduction' clause with 'inscan' modifier is used here">;
11482def err_omp_expected_predefined_allocator : Error<
11483  "expected one of the predefined allocators for the variables with the static "
11484  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
11485  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
11486  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
11487def warn_omp_used_different_allocator : Warning<
11488  "allocate directive specifies %select{default|'%1'}0 allocator while "
11489  "previously used %select{default|'%3'}2">,
11490  InGroup<OpenMPClauses>;
11491def note_omp_previous_allocator : Note<
11492  "previous allocator is specified here">;
11493def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
11494  "inside of the target region; provide an 'allocator' clause or use 'requires'"
11495  " directive with the 'dynamic_allocators' clause">;
11496def err_expected_allocator_expression : Error<"expected an allocator expression "
11497  "inside of the target region; provide an allocator expression or use 'requires'"
11498  " directive with the 'dynamic_allocators' clause">;
11499def warn_omp_allocate_thread_on_task_target_directive : Warning<
11500  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
11501  InGroup<OpenMPClauses>;
11502def err_omp_expected_private_copy_for_allocate : Error<
11503  "the referenced item is not found in any private clause on the same directive">;
11504def err_omp_stmt_depends_on_loop_counter : Error<
11505  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
11506def err_omp_invariant_dependency : Error<
11507  "expected loop invariant expression">;
11508def err_omp_invariant_or_linear_dependency : Error<
11509  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
11510def err_omp_wrong_dependency_iterator_type : Error<
11511  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
11512def err_target_unsupported_type
11513    : Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support,"
11514            " but target '%5' does not support it">;
11515def err_omp_lambda_capture_in_declare_target_not_to : Error<
11516  "variable captured in declare target region must appear in a to clause">;
11517def err_omp_device_type_mismatch : Error<
11518  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
11519def err_omp_wrong_device_function_call : Error<
11520  "function with 'device_type(%0)' is not available on %select{device|host}1">;
11521def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
11522def err_omp_declare_target_has_local_vars : Error<
11523  "local variable '%0' should not be used in 'declare target' directive; ">;
11524def warn_omp_declare_target_after_first_use : Warning<
11525  "declaration marked as declare target after first use, it may lead to incorrect results">,
11526  InGroup<OpenMPTarget>;
11527def err_omp_declare_variant_incompat_attributes : Error<
11528  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
11529def warn_omp_declare_variant_score_not_constant
11530    : Warning<"score expressions in the OpenMP context selector need to be "
11531              "constant; %0 is not and will be ignored">,
11532      InGroup<SourceUsesOpenMP>;
11533def err_omp_declare_variant_user_condition_not_constant
11534    : Error<"the user condition in the OpenMP context selector needs to be "
11535            "constant; %0 is not">;
11536def warn_omp_declare_variant_after_used : Warning<
11537  "'#pragma omp declare variant' cannot be applied for function after first "
11538  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
11539def warn_omp_declare_variant_after_emitted : Warning<
11540  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
11541  " the original function might be used">, InGroup<SourceUsesOpenMP>;
11542def err_omp_declare_variant_doesnt_support : Error<
11543  "'#pragma omp declare variant' does not "
11544  "support %select{function templates|virtual functions|"
11545  "deduced return types|constructors|destructors|deleted functions|"
11546  "defaulted functions|constexpr functions|consteval function}0">;
11547def err_omp_declare_variant_diff : Error<
11548  "function with '#pragma omp declare variant' has a different %select{calling convention"
11549  "|return type|constexpr specification|inline specification|storage class|"
11550  "linkage}0">;
11551def err_omp_declare_variant_prototype_required : Error<
11552  "function with '#pragma omp declare variant' must have a prototype when "
11553  "'append_args' is used">;
11554def err_omp_interop_type_not_found : Error<
11555  "'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">;
11556def err_omp_declare_variant_incompat_types : Error<
11557  "variant in '#pragma omp declare variant' with type %0 is incompatible with"
11558  " type %1%select{| with appended arguments}2">;
11559def err_omp_declare_variant_same_base_function : Error<
11560  "variant in '#pragma omp declare variant' is the same as the base function">;
11561def warn_omp_declare_variant_marked_as_declare_variant : Warning<
11562  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
11563  >, InGroup<SourceUsesOpenMP>;
11564def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
11565def err_omp_one_defaultmap_each_category: Error<
11566  "at most one defaultmap clause for each variable-category can appear on the directive">;
11567def err_omp_lastprivate_conditional_non_scalar : Error<
11568  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
11569  >;
11570def err_omp_flush_order_clause_and_list : Error<
11571  "'flush' directive with memory order clause '%0' cannot have the list">;
11572def note_omp_flush_order_clause_here : Note<
11573  "memory order clause '%0' is specified here">;
11574def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
11575  "expected addressable lvalue in '%0' clause">;
11576def err_omp_var_expected : Error<
11577  "expected variable of the '%0' type%select{|, not %2}1">;
11578def err_omp_non_pointer_type_array_shaping_base : Error<
11579  "expected expression with a pointer to a complete type as a base of an array "
11580  "shaping operation">;
11581def err_omp_reduction_task_not_parallel_or_worksharing : Error<
11582  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
11583  " worksharing constructs">;
11584def err_omp_expected_array_alloctraits : Error<
11585  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
11586def err_omp_predefined_allocator_with_traits : Error<
11587  "predefined allocator cannot have traits specified">;
11588def note_omp_predefined_allocator : Note<
11589  "predefined trait '%0' used here">;
11590def err_omp_nonpredefined_allocator_without_traits : Error<
11591  "non-predefined allocator must have traits specified">;
11592def err_omp_allocator_used_in_clauses : Error<
11593  "allocators used in 'uses_allocators' clause cannot appear in other "
11594  "data-sharing or data-mapping attribute clauses">;
11595def err_omp_allocator_not_in_uses_allocators : Error<
11596  "allocator must be specified in the 'uses_allocators' clause">;
11597def note_omp_protected_structured_block
11598    : Note<"jump bypasses OpenMP structured block">;
11599def note_omp_exits_structured_block
11600    : Note<"jump exits scope of OpenMP structured block">;
11601def err_omp_lastprivate_loop_var_non_loop_iteration : Error<
11602  "only loop iteration variables are allowed in 'lastprivate' clause in "
11603  "'omp %0' directives">;
11604def err_omp_interop_variable_expected : Error<
11605  "expected%select{| non-const}0 variable of type 'omp_interop_t'">;
11606def err_omp_interop_variable_wrong_type : Error<
11607  "interop variable must be of type 'omp_interop_t'">;
11608def err_omp_interop_prefer_type : Error<
11609  "prefer_list item must be a string literal or constant integral "
11610  "expression">;
11611def err_omp_interop_bad_depend_clause : Error<
11612  "'depend' clause requires the 'targetsync' interop type">;
11613def err_omp_interop_var_multiple_actions : Error<
11614  "interop variable %0 used in multiple action clauses">;
11615def err_omp_dispatch_statement_call
11616    : Error<"statement after '#pragma omp dispatch' must be a direct call"
11617            " to a target function or an assignment to one">;
11618def err_omp_unroll_full_variable_trip_count : Error<
11619  "loop to be fully unrolled must have a constant trip count">;
11620def note_omp_directive_here : Note<"'%0' directive found here">;
11621def err_omp_instantiation_not_supported
11622    : Error<"instantiation of '%0' not supported yet">;
11623def err_omp_adjust_arg_multiple_clauses : Error<
11624  "'adjust_arg' argument %0 used in multiple clauses">;
11625def err_omp_clause_requires_dispatch_construct : Error<
11626  "'%0' clause requires 'dispatch' context selector">;
11627def err_omp_append_args_with_varargs : Error<
11628  "'append_args' is not allowed with varargs functions">;
11629def err_openmp_vla_in_task_untied : Error<
11630  "variable length arrays are not supported in OpenMP tasking regions with 'untied' clause">;
11631def warn_omp_unterminated_declare_target : Warning<
11632  "expected '#pragma omp end declare target' at end of file to match '#pragma omp %0'">,
11633  InGroup<SourceUsesOpenMP>;
11634def err_ompx_bare_no_grid : Error<
11635  "'ompx_bare' clauses requires explicit grid size via 'num_teams' and 'thread_limit' clauses">;
11636} // end of OpenMP category
11637
11638let CategoryName = "Related Result Type Issue" in {
11639// Objective-C related result type compatibility
11640def warn_related_result_type_compatibility_class : Warning<
11641  "method is expected to return an instance of its class type "
11642  "%diff{$, but is declared to return $|"
11643  ", but is declared to return different type}0,1">;
11644def warn_related_result_type_compatibility_protocol : Warning<
11645  "protocol method is expected to return an instance of the implementing "
11646  "class, but is declared to return %0">;
11647def note_related_result_type_family : Note<
11648  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
11649  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
11650  "self}1' method family%select{| and is expected to return an instance of its "
11651  "class type}0">;
11652def note_related_result_type_overridden : Note<
11653  "overridden method returns an instance of its class type">;
11654def note_related_result_type_inferred : Note<
11655  "%select{class|instance}0 method %1 is assumed to return an instance of "
11656  "its receiver type (%2)">;
11657def note_related_result_type_explicit : Note<
11658  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
11659  "%select{| and is expected to return an instance of its class type}0">;
11660def err_invalid_type_for_program_scope_var : Error<
11661  "the %0 type cannot be used to declare a program scope variable">;
11662
11663}
11664
11665let CategoryName = "Modules Issue" in {
11666def err_module_decl_in_module_map_module : Error<
11667  "'module' declaration found while building module from module map">;
11668def err_module_decl_in_header_unit : Error<
11669  "'module' declaration found while building header unit">;
11670def err_module_interface_implementation_mismatch : Error<
11671  "missing 'export' specifier in module declaration while "
11672  "building module interface">;
11673def err_current_module_name_mismatch : Error<
11674  "module name '%0' specified on command line does not match name of module">;
11675def err_module_redefinition : Error<
11676  "redefinition of module '%0'">;
11677def note_prev_module_definition : Note<"previously defined here">;
11678def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
11679def err_module_not_defined : Error<
11680  "definition of module '%0' is not available; use -fmodule-file= to specify "
11681  "path to precompiled module interface">;
11682def err_module_redeclaration : Error<
11683  "translation unit contains multiple module declarations">;
11684def note_prev_module_declaration : Note<"previous module declaration is here">;
11685def err_module_declaration_missing_after_global_module_introducer : Error<
11686  "missing 'module' declaration at end of global module fragment "
11687  "introduced here">;
11688def err_module_private_specialization : Error<
11689  "%select{template|partial|member}0 specialization cannot be "
11690  "declared __module_private__">;
11691def err_module_private_local : Error<
11692  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
11693  "__module_private__">;
11694def err_module_private_local_class : Error<
11695  "local %select{struct|interface|union|class|enum}0 cannot be declared "
11696  "__module_private__">;
11697def err_module_unimported_use : Error<
11698  "%select{declaration|definition|default argument|"
11699  "explicit specialization|partial specialization}0 of %1 must be imported "
11700  "from module '%2' before it is required">;
11701def err_module_unimported_use_header : Error<
11702  "%select{missing '#include'|missing '#include %3'}2; "
11703  "%select{||default argument of |explicit specialization of |"
11704  "partial specialization of }0%1 must be "
11705  "%select{declared|defined|defined|declared|declared}0 "
11706  "before it is used">;
11707def err_module_unimported_use_multiple : Error<
11708  "%select{declaration|definition|default argument|"
11709  "explicit specialization|partial specialization}0 of %1 must be imported "
11710  "from one of the following modules before it is required:%2">;
11711def note_unreachable_entity : Note<
11712  "%select{declaration|definition|default argument declared|"
11713  "explicit specialization declared|partial specialization declared}0 here "
11714  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
11715def ext_module_import_in_extern_c : ExtWarn<
11716  "import of C++ module '%0' appears within extern \"C\" language linkage "
11717  "specification">, DefaultError,
11718  InGroup<DiagGroup<"module-import-in-extern-c">>;
11719def err_module_import_not_at_top_level_fatal : Error<
11720  "import of module '%0' appears within %1">, DefaultFatal;
11721def ext_module_import_not_at_top_level_noop : ExtWarn<
11722  "redundant #include of module '%0' appears within %1">, DefaultError,
11723  InGroup<DiagGroup<"modules-import-nested-redundant">>;
11724def note_module_import_not_at_top_level : Note<"%0 begins here">;
11725def err_module_self_import : Error<
11726  "import of module '%0' appears within same top-level module '%1'">;
11727def err_module_self_import_cxx20 : Error<
11728  "import of module '%0' appears within its own %select{interface|implementation}1">;
11729def err_module_import_in_implementation : Error<
11730  "@import of module '%0' in implementation of '%1'; use #import">;
11731
11732// C++ Modules
11733def err_module_import_non_interface_nor_parition : Error<
11734  "import of module '%0' imported non C++20 importable modules">;
11735def err_module_decl_not_at_start : Error<
11736  "module declaration must occur at the start of the translation unit">;
11737def note_global_module_introducer_missing : Note<
11738  "add 'module;' to the start of the file to introduce a "
11739  "global module fragment">;
11740def err_export_within_anonymous_namespace : Error<
11741  "export declaration appears within anonymous namespace">;
11742def note_anonymous_namespace : Note<"anonymous namespace begins here">;
11743def note_export : Note<"export block begins here">;
11744def err_export_within_export : Error<
11745  "export declaration appears within another export declaration">;
11746def err_export_anon_ns_internal : Error<
11747  "anonymous namespaces cannot be exported">;
11748def err_export_internal : Error<
11749  "declaration of %0 with internal linkage cannot be exported">;
11750def err_export_using_internal : Error<
11751  "using declaration referring to %1 with %select{internal|module|unknown}0 "
11752  "linkage cannot be exported">;
11753def err_export_not_in_module_interface : Error<
11754  "export declaration can only be used within a module purview">;
11755def err_export_inline_not_defined : Error<
11756  "inline function not defined%select{| before the private module fragment}0">;
11757def err_export_partition_impl : Error<
11758  "module partition implementations cannot be exported">;
11759def err_export_in_private_module_fragment : Error<
11760  "export declaration cannot be used in a private module fragment">;
11761def note_private_module_fragment : Note<
11762  "private module fragment begins here">;
11763def err_private_module_fragment_not_module : Error<
11764  "private module fragment declaration with no preceding module declaration">;
11765def err_private_module_fragment_redefined : Error<
11766  "private module fragment redefined">;
11767def err_private_module_fragment_not_module_interface : Error<
11768  "private module fragment in module implementation unit">;
11769def note_not_module_interface_add_export : Note<
11770  "add 'export' here if this is intended to be a module interface unit">;
11771def err_invalid_module_name : Error<"%0 is an invalid name for a module">;
11772def err_extern_def_in_header_unit : Error<
11773  "non-inline external definitions are not permitted in C++ header units">;
11774
11775def warn_experimental_header_unit : Warning<
11776  "the implementation of header units is in an experimental phase">,
11777  InGroup<DiagGroup<"experimental-header-units">>;
11778
11779def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
11780  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
11781  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
11782def note_equivalent_internal_linkage_decl : Note<
11783  "declared here%select{ in module '%1'|}0">;
11784
11785def note_redefinition_modules_same_file : Note<
11786  "'%0' included multiple times, additional include site in header from module '%1'">;
11787def note_redefinition_include_same_file : Note<
11788  "'%0' included multiple times, additional include site here">;
11789}
11790
11791let CategoryName = "Coroutines Issue" in {
11792def err_return_in_coroutine : Error<
11793  "return statement not allowed in coroutine; did you mean 'co_return'?">;
11794def note_declared_coroutine_here : Note<
11795  "function is a coroutine due to use of '%0' here">;
11796def err_coroutine_objc_method : Error<
11797  "Objective-C methods as coroutines are not yet supported">;
11798def err_coroutine_unevaluated_context : Error<
11799  "'%0' cannot be used in an unevaluated context">;
11800def err_coroutine_within_handler : Error<
11801  "'%0' cannot be used in the handler of a try block">;
11802def err_coroutine_outside_function : Error<
11803  "'%0' cannot be used outside a function">;
11804def err_coroutine_invalid_func_context : Error<
11805  "'%1' cannot be used in %select{a constructor|a destructor"
11806  "|the 'main' function|a constexpr function"
11807  "|a function with a deduced return type|a varargs function"
11808  "|a consteval function}0">;
11809def err_implied_coroutine_type_not_found : Error<
11810  "%0 type was not found; include <coroutine> before defining "
11811  "a coroutine">;
11812def err_implicit_coroutine_std_nothrow_type_not_found : Error<
11813  "std::nothrow was not found; include <new> before defining a coroutine which "
11814  "uses get_return_object_on_allocation_failure()">;
11815def err_malformed_std_nothrow : Error<
11816  "std::nothrow must be a valid variable declaration">;
11817def err_malformed_std_coroutine_handle : Error<
11818  "std::coroutine_handle isn't a class template">;
11819def err_coroutine_handle_missing_member : Error<
11820  "std::coroutine_handle must have a member named '%0'">;
11821def err_malformed_std_coroutine_traits : Error<
11822  "std::coroutine_traits isn't a class template">;
11823def err_implied_std_coroutine_traits_promise_type_not_found : Error<
11824  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
11825def err_implied_std_coroutine_traits_promise_type_not_class : Error<
11826  "this function cannot be a coroutine: %0 is not a class">;
11827def err_coroutine_promise_type_incomplete : Error<
11828  "this function cannot be a coroutine: %0 is an incomplete type">;
11829def err_coroutine_type_missing_specialization : Error<
11830  "this function cannot be a coroutine: missing definition of "
11831  "specialization %0">;
11832def err_coroutine_promise_incompatible_return_functions : Error<
11833  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
11834def note_coroutine_promise_implicit_await_transform_required_here : Note<
11835  "call to 'await_transform' implicitly required by 'co_await' here">;
11836def note_coroutine_promise_suspend_implicitly_required : Note<
11837  "call to '%select{initial_suspend|final_suspend}0' implicitly "
11838  "required by the %select{initial suspend point|final suspend point}0">;
11839def err_coroutine_promise_unhandled_exception_required : Error<
11840  "%0 is required to declare the member 'unhandled_exception()'">;
11841def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
11842  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
11843  InGroup<CoroutineMissingUnhandledException>;
11844def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
11845  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
11846def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
11847  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
11848def err_coroutine_promise_new_requires_nothrow : Error<
11849  "%0 is required to have a non-throwing noexcept specification when the promise "
11850   "type declares 'get_return_object_on_allocation_failure()'">;
11851def note_coroutine_promise_call_implicitly_required : Note<
11852  "call to %0 implicitly required by coroutine function here">;
11853def err_await_suspend_invalid_return_type : Error<
11854  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
11855>;
11856def note_await_ready_no_bool_conversion : Note<
11857  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
11858>;
11859def warn_coroutine_handle_address_invalid_return_type : Warning <
11860  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API">,
11861  InGroup<Coroutine>;
11862def err_coroutine_promise_final_suspend_requires_nothrow : Error<
11863  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
11864>;
11865def note_coroutine_function_declare_noexcept : Note<
11866  "must be declared with 'noexcept'"
11867>;
11868def warn_always_inline_coroutine : Warning<
11869  "this coroutine may be split into pieces; not every piece is guaranteed to be inlined"
11870  >,
11871  InGroup<AlwaysInlineCoroutine>;
11872def err_coroutine_unusable_new : Error<
11873  "'operator new' provided by %0 is not usable with the function signature of %1"
11874>;
11875def err_coroutine_unfound_nothrow_new : Error <
11876  "unable to find %select{'::operator new(size_t, nothrow_t)'|"
11877  "'::operator new(size_t, align_val_t, nothrow_t)'}1 for %0"
11878>;
11879def warn_non_aligned_allocation_function : Warning <
11880  "under -fcoro-aligned-allocation, the non-aligned allocation function "
11881  "for the promise type %0 has higher precedence than the global aligned "
11882  "allocation function">,
11883  InGroup<CoroNonAlignedAllocationFunction>;
11884def err_conflicting_aligned_options : Error <
11885  "conflicting option '-fcoro-aligned-allocation' and '-fno-aligned-allocation'"
11886>;
11887def err_coro_invalid_addr_of_label : Error<
11888  "the GNU address of label extension is not allowed in coroutines"
11889>;
11890def err_coroutine_return_type : Error<
11891  "function returns a type %0 marked with [[clang::coro_return_type]] but is neither a coroutine nor a coroutine wrapper; "
11892  "non-coroutines should be marked with [[clang::coro_wrapper]] to allow returning coroutine return type"
11893>;
11894} // end of coroutines issue category
11895
11896let CategoryName = "Documentation Issue" in {
11897def warn_not_a_doxygen_trailing_member_comment : Warning<
11898  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
11899def warn_splice_in_doxygen_comment : Warning<
11900  "line splicing in Doxygen comments are not supported">, InGroup<Documentation>, DefaultIgnore;
11901} // end of documentation issue category
11902
11903let CategoryName = "Nullability Issue" in {
11904
11905def warn_mismatched_nullability_attr : Warning<
11906  "nullability specifier %0 conflicts with existing specifier %1">,
11907  InGroup<Nullability>;
11908
11909def warn_nullability_declspec : Warning<
11910  "nullability specifier %0 cannot be applied "
11911  "to non-pointer type %1; did you mean to apply the specifier to the "
11912  "%select{pointer|block pointer|member pointer|function pointer|"
11913  "member function pointer}2?">,
11914  InGroup<NullabilityDeclSpec>,
11915  DefaultError;
11916
11917def note_nullability_here : Note<"%0 specified here">;
11918
11919def err_nullability_nonpointer : Error<
11920  "nullability specifier %0 cannot be applied to non-pointer type %1">;
11921
11922def warn_nullability_lost : Warning<
11923  "implicit conversion from nullable pointer %0 to non-nullable pointer "
11924  "type %1">,
11925  InGroup<NullableToNonNullConversion>, DefaultIgnore;
11926def warn_zero_as_null_pointer_constant : Warning<
11927  "zero as null pointer constant">,
11928  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
11929
11930def err_nullability_cs_multilevel : Error<
11931  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
11932def note_nullability_type_specifier : Note<
11933  "use nullability type specifier %0 to affect the innermost "
11934  "pointer type of %1">;
11935
11936def warn_null_resettable_setter : Warning<
11937  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
11938  InGroup<Nullability>;
11939
11940def warn_nullability_missing : Warning<
11941  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
11942  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
11943  InGroup<NullabilityCompleteness>;
11944def warn_nullability_missing_array : Warning<
11945  "array parameter is missing a nullability type specifier (_Nonnull, "
11946  "_Nullable, or _Null_unspecified)">,
11947  InGroup<NullabilityCompletenessOnArrays>;
11948def note_nullability_fix_it : Note<
11949  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
11950  "%select{pointer|block pointer|member pointer|array parameter}1 "
11951  "%select{should never be null|may be null|should not declare nullability}0">;
11952
11953def warn_nullability_inferred_on_nested_type : Warning<
11954  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
11955  "deprecated">,
11956  InGroup<NullabilityInferredOnNestedType>;
11957
11958def err_objc_type_arg_explicit_nullability : Error<
11959  "type argument %0 cannot explicitly specify nullability">;
11960
11961def err_objc_type_param_bound_explicit_nullability : Error<
11962  "type parameter %0 bound %1 cannot explicitly specify nullability">;
11963
11964}
11965
11966let CategoryName = "Generics Issue" in {
11967
11968def err_objc_type_param_bound_nonobject : Error<
11969  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
11970
11971def err_objc_type_param_bound_missing_pointer : Error<
11972  "missing '*' in type bound %0 for type parameter %1">;
11973def err_objc_type_param_bound_qualified : Error<
11974  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
11975
11976def err_objc_type_param_redecl : Error<
11977  "redeclaration of type parameter %0">;
11978
11979def err_objc_type_param_arity_mismatch : Error<
11980  "%select{forward class declaration|class definition|category|extension}0 has "
11981  "too %select{few|many}1 type parameters (expected %2, have %3)">;
11982
11983def err_objc_type_param_bound_conflict : Error<
11984  "type bound %0 for type parameter %1 conflicts with "
11985  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
11986
11987def err_objc_type_param_variance_conflict : Error<
11988  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
11989  "%select{in|co|contra}2variant type parameter %3">;
11990
11991def note_objc_type_param_here : Note<"type parameter %0 declared here">;
11992
11993def err_objc_type_param_bound_missing : Error<
11994  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
11995
11996def err_objc_parameterized_category_nonclass : Error<
11997  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
11998  "parameters">;
11999
12000def err_objc_parameterized_forward_class : Error<
12001  "forward declaration of non-parameterized class %0 cannot have type "
12002  "parameters">;
12003
12004def err_objc_parameterized_forward_class_first : Error<
12005  "class %0 previously declared with type parameters">;
12006
12007def err_objc_type_arg_missing_star : Error<
12008  "type argument %0 must be a pointer (requires a '*')">;
12009def err_objc_type_arg_qualified : Error<
12010  "type argument %0 cannot be qualified with '%1'">;
12011
12012def err_objc_type_arg_missing : Error<
12013  "no type or protocol named %0">;
12014
12015def err_objc_type_args_and_protocols : Error<
12016  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
12017  "%select{protocol|type}0 (%2)">;
12018
12019def err_objc_type_args_non_class : Error<
12020  "type arguments cannot be applied to non-class type %0">;
12021
12022def err_objc_type_args_non_parameterized_class : Error<
12023  "type arguments cannot be applied to non-parameterized class %0">;
12024
12025def err_objc_type_args_specialized_class : Error<
12026  "type arguments cannot be applied to already-specialized class type %0">;
12027
12028def err_objc_type_args_wrong_arity : Error<
12029  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
12030}
12031
12032def err_type_available_only_in_default_eval_method : Error<
12033  "cannot use type '%0' within '#pragma clang fp eval_method'; type is set "
12034  "according to the default eval method for the translation unit">;
12035
12036def err_objc_type_arg_not_id_compatible : Error<
12037  "type argument %0 is neither an Objective-C object nor a block type">;
12038
12039def err_objc_type_arg_does_not_match_bound : Error<
12040  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
12041
12042def warn_objc_redundant_qualified_class_type : Warning<
12043  "parameterized class %0 already conforms to the protocols listed; did you "
12044  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
12045
12046def warn_block_literal_attributes_on_omitted_return_type : Warning<
12047  "attribute %0 ignored, because it cannot be applied to omitted return type">,
12048  InGroup<IgnoredAttributes>;
12049
12050def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
12051  "'%0' qualifier on omitted return type %1 has no effect">,
12052  InGroup<IgnoredQualifiers>;
12053
12054def warn_shadow_field : Warning<
12055  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
12056  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
12057def note_shadow_field : Note<"declared here">;
12058
12059def err_multiversion_required_in_redecl : Error<
12060  "function declaration is missing %select{'target'|'cpu_specific' or "
12061  "'cpu_dispatch'|'target_version'}0 attribute in a multiversioned function">;
12062def note_multiversioning_caused_here : Note<
12063  "function multiversioning caused by this declaration">;
12064def err_multiversion_after_used : Error<
12065  "function declaration cannot become a multiversioned function after first "
12066  "usage">;
12067def err_bad_multiversion_option : Error<
12068  "function multiversioning doesn't support %select{feature|architecture}0 "
12069  "'%1'">;
12070def err_multiversion_duplicate : Error<
12071  "multiversioned function redeclarations require identical target attributes">;
12072def err_multiversion_noproto : Error<
12073  "multiversioned function must have a prototype">;
12074def err_multiversion_disallowed_other_attr
12075    : Error<"attribute "
12076            "'%select{|target|cpu_specific|cpu_dispatch|target_clones|target_version}0' "
12077            "multiversioning cannot be combined"
12078            " with attribute %1">;
12079def err_multiversion_diff : Error<
12080  "multiversioned function declaration has a different %select{calling convention"
12081  "|return type|constexpr specification|inline specification|linkage|"
12082  "language linkage}0">;
12083def err_multiversion_doesnt_support
12084    : Error<"attribute "
12085            "'%select{|target|cpu_specific|cpu_dispatch|target_clones|target_version}0' "
12086            "multiversioned functions do not "
12087            "yet support %select{function templates|virtual functions|"
12088            "deduced return types|constructors|destructors|deleted functions|"
12089            "defaulted functions|constexpr functions|consteval "
12090            "function|lambdas}1">;
12091def err_multiversion_not_allowed_on_main : Error<
12092  "'main' cannot be a multiversioned function">;
12093def err_multiversion_not_supported : Error<
12094 "function multiversioning is not supported on the current target">;
12095def err_multiversion_types_mixed : Error<
12096  "multiversioning attributes cannot be combined">;
12097def err_cpu_dispatch_mismatch : Error<
12098 "'cpu_dispatch' function redeclared with different CPUs">;
12099def err_cpu_specific_multiple_defs : Error<
12100 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
12101def warn_multiversion_duplicate_entries : Warning<
12102 "CPU list contains duplicate entries; attribute ignored">,
12103  InGroup<FunctionMultiVersioning>;
12104def warn_dispatch_body_ignored : Warning<
12105  "body of cpu_dispatch function will be ignored">,
12106  InGroup<FunctionMultiVersioning>;
12107def err_target_clone_must_have_default
12108    : Error<"'target_clones' multiversioning requires a default target">;
12109def err_target_clone_doesnt_match
12110    : Error<"'target_clones' attribute does not match previous declaration">;
12111def warn_target_clone_mixed_values
12112    : ExtWarn<
12113          "mixing 'target_clones' specifier mechanisms is permitted for GCC "
12114          "compatibility; use a comma separated sequence of string literals, "
12115          "or a string literal containing a comma-separated list of versions">,
12116      InGroup<TargetClonesMixedSpecifiers>;
12117def warn_target_clone_duplicate_options
12118    : Warning<"version list contains duplicate entries">,
12119      InGroup<FunctionMultiVersioning>;
12120def warn_target_clone_no_impact_options
12121    : Warning<"version list contains entries that don't impact code generation">,
12122      InGroup<FunctionMultiVersioning>;
12123
12124// three-way comparison operator diagnostics
12125def err_implied_comparison_category_type_not_found : Error<
12126  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
12127  "because type '%0' was not found; include <compare>">;
12128def err_spaceship_argument_narrowing : Error<
12129  "argument to 'operator<=>' "
12130  "%select{cannot be narrowed from type %1 to %2|"
12131  "evaluates to %1, which cannot be narrowed to type %2}0">;
12132def err_std_compare_type_not_supported : Error<
12133  "standard library implementation of %0 is not supported; "
12134   "%select{member '%2' does not have expected form|"
12135   "member '%2' is missing|"
12136   "the type is not trivially copyable|"
12137   "the type does not have the expected form}1">;
12138def note_rewriting_operator_as_spaceship : Note<
12139  "while rewriting comparison as call to 'operator<=>' declared here">;
12140def err_three_way_vector_comparison : Error<
12141  "three-way comparison between vectors is not supported">;
12142
12143// Memory Tagging Extensions (MTE) diagnostics
12144def err_memtag_arg_null_or_pointer : Error<
12145  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
12146def err_memtag_any2arg_pointer : Error<
12147  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
12148def err_memtag_arg_must_be_pointer : Error<
12149  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
12150def err_memtag_arg_must_be_integer : Error<
12151  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
12152
12153def warn_dereference_of_noderef_type : Warning<
12154  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
12155def warn_dereference_of_noderef_type_no_decl : Warning<
12156  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
12157def warn_noderef_on_non_pointer_or_array : Warning<
12158  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
12159def warn_noderef_to_dereferenceable_pointer : Warning<
12160  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
12161
12162def err_builtin_launder_invalid_arg : Error<
12163  "%select{non-pointer|function pointer|void pointer}0 argument to "
12164  "'__builtin_launder' is not allowed">;
12165
12166def err_builtin_invalid_arg_type: Error <
12167  "%ordinal0 argument must be "
12168  "%select{a vector, integer or floating point type|a matrix|"
12169  "a pointer to a valid matrix element type|"
12170  "a signed integer or floating point type|a vector type|"
12171  "a floating point type|"
12172  "a vector of integers|"
12173  "an unsigned integer|"
12174  "an 'int'}1 (was %2)">;
12175
12176def err_builtin_matrix_disabled: Error<
12177  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
12178def err_matrix_index_not_integer: Error<
12179  "matrix %select{row|column}0 index is not an integer">;
12180def err_matrix_index_outside_range: Error<
12181  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
12182def err_matrix_incomplete_index: Error<
12183  "single subscript expressions are not allowed for matrix values">;
12184def err_matrix_separate_incomplete_index: Error<
12185  "matrix row and column subscripts cannot be separated by any expression">;
12186def err_matrix_subscript_comma: Error<
12187  "comma expressions are not allowed as indices in matrix subscript expressions">;
12188def err_builtin_matrix_scalar_unsigned_arg: Error<
12189  "%0 argument must be a constant unsigned integer expression">;
12190def err_builtin_matrix_pointer_arg_mismatch: Error<
12191  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
12192def err_builtin_matrix_store_to_const: Error<
12193  "cannot store matrix to read-only pointer">;
12194def err_builtin_matrix_stride_too_small: Error<
12195  "stride must be greater or equal to the number of rows">;
12196def err_builtin_matrix_invalid_dimension: Error<
12197  "%0 dimension is outside the allowed range [1, %1]">;
12198
12199def warn_mismatched_import : Warning<
12200  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
12201  "previous declaration">,
12202  InGroup<IgnoredAttributes>;
12203def warn_import_on_definition : Warning<
12204  "import %select{module|name}0 cannot be applied to a function with a definition">,
12205  InGroup<IgnoredAttributes>;
12206
12207def err_preserve_field_info_not_field : Error<
12208  "__builtin_preserve_field_info argument %0 not a field access">;
12209def err_preserve_field_info_not_const: Error<
12210  "__builtin_preserve_field_info argument %0 not a constant">;
12211def err_btf_type_id_not_const: Error<
12212  "__builtin_btf_type_id argument %0 not a constant">;
12213def err_preserve_type_info_invalid : Error<
12214  "__builtin_preserve_type_info argument %0 invalid">;
12215def err_preserve_type_info_not_const: Error<
12216  "__builtin_preserve_type_info argument %0 not a constant">;
12217def err_preserve_enum_value_invalid : Error<
12218  "__builtin_preserve_enum_value argument %0 invalid">;
12219def err_preserve_enum_value_not_const: Error<
12220  "__builtin_preserve_enum_value argument %0 not a constant">;
12221
12222def err_bit_cast_non_trivially_copyable : Error<
12223  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
12224def err_bit_cast_type_size_mismatch : Error<
12225  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
12226
12227// SYCL-specific diagnostics
12228def warn_sycl_kernel_num_of_template_params : Warning<
12229  "'sycl_kernel' attribute only applies to a function template with at least"
12230  " two template parameters">, InGroup<IgnoredAttributes>;
12231def warn_sycl_kernel_invalid_template_param_type : Warning<
12232  "template parameter of a function template with the 'sycl_kernel' attribute"
12233  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
12234def warn_sycl_kernel_num_of_function_params : Warning<
12235  "function template with 'sycl_kernel' attribute must have a single parameter">,
12236  InGroup<IgnoredAttributes>;
12237def warn_sycl_kernel_return_type : Warning<
12238  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
12239  InGroup<IgnoredAttributes>;
12240def err_sycl_special_type_num_init_method : Error<
12241  "types with 'sycl_special_class' attribute must have one and only one '__init' "
12242  "method defined">;
12243
12244def warn_cuda_maxclusterrank_sm_90 : Warning<
12245  "maxclusterrank requires sm_90 or higher, CUDA arch provided: %0, ignoring "
12246  "%1 attribute">, InGroup<IgnoredAttributes>;
12247
12248// VTable pointer authentication errors
12249def err_non_polymorphic_vtable_pointer_auth : Error<
12250  "cannot set vtable pointer authentication on monomorphic type %0">;
12251def err_incomplete_type_vtable_pointer_auth : Error<
12252  "cannot set vtable pointer authentication on an incomplete type %0">;
12253def err_non_top_level_vtable_pointer_auth : Error<
12254  "cannot set vtable pointer authentication on %0 which is a subclass of polymorphic type %1">;
12255def err_duplicated_vtable_pointer_auth : Error<
12256  "multiple vtable pointer authentication policies on %0">;
12257def err_invalid_authentication_key : Error<
12258  "invalid authentication key %0">;
12259def err_invalid_address_discrimination : Error<
12260  "invalid address discrimination mode %0">;
12261def err_invalid_extra_discrimination : Error<
12262  "invalid extra discrimination selection %0">;
12263def err_invalid_custom_discrimination : Error<
12264  "invalid custom discrimination">;
12265def err_missing_custom_discrimination : Error<
12266  "missing custom discrimination">;
12267def err_no_default_vtable_pointer_auth : Error<
12268  "cannot specify a default vtable pointer authentication "
12269  "%select{key|address discrimination mode|discriminator}0 with no default set"
12270>;
12271
12272def err_bit_int_bad_size : Error<"%select{signed|unsigned}0 _BitInt must "
12273                                 "have a bit size of at least %select{2|1}0">;
12274def err_bit_int_max_size : Error<"%select{signed|unsigned}0 _BitInt of bit "
12275                                 "sizes greater than %1 not supported">;
12276
12277// errors of expect.with.probability
12278def err_probability_not_constant_float : Error<
12279   "probability argument to __builtin_expect_with_probability must be constant "
12280   "floating-point expression">;
12281def err_probability_out_of_range : Error<
12282   "probability argument to __builtin_expect_with_probability is outside the "
12283   "range [0.0, 1.0]">;
12284
12285// TCB warnings
12286def err_tcb_conflicting_attributes : Error<
12287  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
12288def warn_tcb_enforcement_violation : Warning<
12289  "calling %0 is a violation of trusted computing base '%1'">,
12290  InGroup<DiagGroup<"tcb-enforcement">>;
12291
12292// RISC-V builtin required extension warning
12293def err_riscv_builtin_requires_extension : Error<
12294  "builtin requires%select{| at least one of the following extensions}0: %1">;
12295def err_riscv_builtin_invalid_lmul : Error<
12296  "LMUL argument must be in the range [0,3] or [5,7]">;
12297def err_riscv_type_requires_extension : Error<
12298  "RISC-V type %0 requires the '%1' extension"
12299>;
12300
12301def err_std_source_location_impl_not_found : Error<
12302  "'std::source_location::__impl' was not found; it must be defined before '__builtin_source_location' is called">;
12303def err_std_source_location_impl_malformed : Error<
12304  "'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'">;
12305
12306def err_std_initializer_list_malformed : Error<
12307  "%0 layout not recognized. Must be a non-polymorphic class type with no bases and two fields: a 'const E *' and either another 'const E *' or a 'std::size_t'">;
12308
12309// HLSL Diagnostics
12310def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in '%1' shaders, requires %select{|one of the following: }2%3">;
12311def err_hlsl_attr_invalid_type : Error<
12312   "attribute %0 only applies to a field or parameter of type '%1'">;
12313def err_hlsl_attr_invalid_ast_node : Error<
12314   "attribute %0 only applies to %1">;
12315def err_hlsl_entry_shader_attr_mismatch : Error<
12316   "%0 attribute on entry function does not match the target profile">;
12317def err_hlsl_numthreads_argument_oor : Error<"argument '%select{X|Y|Z}0' to numthreads attribute cannot exceed %1">;
12318def err_hlsl_numthreads_invalid : Error<"total number of threads cannot exceed %0">;
12319def err_hlsl_missing_numthreads : Error<"missing numthreads attribute for %0 shader entry">;
12320def err_hlsl_attribute_param_mismatch : Error<"%0 attribute parameters do not match the previous declaration">;
12321def err_hlsl_duplicate_parameter_modifier : Error<"duplicate parameter modifier %0">;
12322def err_hlsl_missing_semantic_annotation : Error<
12323  "semantic annotations must be present for all parameters of an entry "
12324  "function or patch constant function">;
12325def err_hlsl_init_priority_unsupported : Error<
12326  "initializer priorities are not supported in HLSL">;
12327
12328def err_hlsl_unsupported_register_type : Error<"invalid resource class specifier '%0' used; expected 'b', 's', 't', or 'u'">;
12329def err_hlsl_unsupported_register_number : Error<"register number should be an integer">;
12330def err_hlsl_expected_space : Error<"invalid space specifier '%0' used; expected 'space' followed by an integer, like space1">;
12331def warn_hlsl_packoffset_mix : Warning<"cannot mix packoffset elements with nonpackoffset elements in a cbuffer">,
12332    InGroup<HLSLMixPackOffset>;
12333def err_hlsl_packoffset_overlap : Error<"packoffset overlap between %0, %1">;
12334def err_hlsl_packoffset_cross_reg_boundary : Error<"packoffset cannot cross register boundary">;
12335def err_hlsl_packoffset_alignment_mismatch : Error<"packoffset at 'y' not match alignment %0 required by %1">;
12336def err_hlsl_pointers_unsupported : Error<
12337  "%select{pointers|references}0 are unsupported in HLSL">;
12338
12339def err_hlsl_operator_unsupported : Error<
12340  "the '%select{&|*|->}0' operator is unsupported in HLSL">;
12341
12342def err_hlsl_param_qualifier_mismatch :
12343  Error<"conflicting parameter qualifier %0 on parameter %1">;
12344
12345def warn_hlsl_impcast_vector_truncation : Warning<
12346  "implicit conversion truncates vector: %0 to %1">, InGroup<Conversion>;
12347
12348def warn_hlsl_availability : Warning<
12349  "%0 is only available %select{|in %4 environment }3on %1 %2 or newer">,
12350  InGroup<HLSLAvailability>, DefaultError;
12351def warn_hlsl_availability_unavailable :
12352  Warning<err_unavailable.Summary>,
12353  InGroup<HLSLAvailability>, DefaultError;
12354
12355def err_hlsl_export_not_on_function : Error<
12356  "export declaration can only be used on functions">;
12357
12358// Layout randomization diagnostics.
12359def err_non_designated_init_used : Error<
12360  "a randomized struct can only be initialized with a designated initializer">;
12361def err_cast_from_randomized_struct : Error<
12362  "casting from randomized structure pointer type %0 to %1">;
12363
12364// Unsafe buffer usage diagnostics.
12365def warn_unsafe_buffer_variable : Warning<
12366  "%0 is an %select{unsafe pointer used for buffer access|unsafe buffer that "
12367  "does not perform bounds checks}1">,
12368  InGroup<UnsafeBufferUsage>, DefaultIgnore;
12369def warn_unsafe_buffer_operation : Warning<
12370  "%select{unsafe pointer operation|unsafe pointer arithmetic|"
12371  "unsafe buffer access|function introduces unsafe buffer manipulation|unsafe invocation of span::data}0">,
12372  InGroup<UnsafeBufferUsage>, DefaultIgnore;
12373def note_unsafe_buffer_operation : Note<
12374  "used%select{| in pointer arithmetic| in buffer access}0 here">;
12375def note_unsafe_buffer_variable_fixit_group : Note<
12376  "change type of %0 to '%select{std::span' to preserve bounds information|std::array' to label it for hardening|std::span::iterator' to preserve bounds information}1%select{|, and change %2 to '%select{std::span|std::array|std::span::iterator}1' to propagate bounds information between them}3">;
12377def note_unsafe_buffer_variable_fixit_together : Note<
12378  "change type of %0 to '%select{std::span' to preserve bounds information|std::array' to label it for hardening|std::span::iterator' to preserve bounds information}1"
12379  "%select{|, and change %2 to safe types to make function %4 bounds-safe}3">;
12380def note_safe_buffer_usage_suggestions_disabled : Note<
12381  "pass -fsafe-buffer-usage-suggestions to receive code hardening suggestions">;
12382def warn_unsafe_buffer_usage_in_container : Warning<
12383  "the two-parameter std::span construction is unsafe as it can introduce mismatch between buffer size and the bound information">,
12384  InGroup<UnsafeBufferUsageInContainer>, DefaultIgnore;
12385#ifndef NDEBUG
12386// Not a user-facing diagnostic. Useful for debugging false negatives in
12387// -fsafe-buffer-usage-suggestions (i.e. lack of -Wunsafe-buffer-usage fixits).
12388def note_safe_buffer_debug_mode : Note<"safe buffers debug: %0">;
12389#endif
12390
12391def err_builtin_pass_in_regs_non_class : Error<
12392  "argument %0 is not an unqualified class type">;
12393
12394
12395// WebAssembly reference type and table diagnostics.
12396def err_wasm_reference_pr : Error<
12397  "%select{pointer|reference}0 to WebAssembly reference type is not allowed">;
12398def err_wasm_ca_reference : Error<
12399  "cannot %select{capture|take address of}0 WebAssembly reference">;
12400def err_wasm_funcref_not_wasm : Error<
12401  "invalid use of '__funcref' keyword outside the WebAssembly triple">;
12402def err_wasm_table_pr : Error<
12403  "cannot form a %select{pointer|reference}0 to a WebAssembly table">;
12404def err_typecheck_wasm_table_must_have_zero_length : Error<
12405  "only zero-length WebAssembly tables are currently supported">;
12406def err_wasm_table_in_function : Error<
12407  "WebAssembly table cannot be declared within a function">;
12408def err_wasm_table_as_function_parameter : Error<
12409  "cannot use WebAssembly table as a function parameter">;
12410def err_wasm_table_invalid_uett_operand : Error<
12411  "invalid application of '%0' to WebAssembly table">;
12412def err_wasm_cast_table : Error<
12413  "cannot cast %select{to|from}0 a WebAssembly table">;
12414def err_wasm_table_conditional_expression : Error<
12415  "cannot use a WebAssembly table within a branch of a conditional expression">;
12416def err_wasm_table_art : Error<
12417  "cannot %select{assign|return|throw|subscript}0 a WebAssembly table">;
12418def err_wasm_reftype_tc : Error<
12419  "cannot %select{throw|catch}0 a WebAssembly reference type">;
12420def err_wasm_reftype_exception_spec : Error<
12421  "WebAssembly reference type not allowed in exception specification">;
12422def err_wasm_table_must_be_static : Error<
12423  "WebAssembly table must be static">;
12424def err_wasm_reftype_multidimensional_array : Error<
12425  "multi-dimensional arrays of WebAssembly references are not allowed">;
12426def err_wasm_builtin_arg_must_be_table_type : Error <
12427  "%ordinal0 argument must be a WebAssembly table">;
12428def err_wasm_builtin_arg_must_match_table_element_type : Error <
12429  "%ordinal0 argument must match the element type of the WebAssembly table in the %ordinal1 argument">;
12430def err_wasm_builtin_arg_must_be_integer_type : Error <
12431  "%ordinal0 argument must be an integer">;
12432
12433// OpenACC diagnostics.
12434def warn_acc_construct_unimplemented
12435    : Warning<"OpenACC construct '%0' not yet implemented, pragma ignored">,
12436      InGroup<SourceUsesOpenACC>;
12437def warn_acc_clause_unimplemented
12438    : Warning<"OpenACC clause '%0' not yet implemented, clause ignored">,
12439      InGroup<SourceUsesOpenACC>;
12440def err_acc_construct_appertainment
12441    : Error<"OpenACC construct '%0' cannot be used here; it can only "
12442            "be used in a statement context">;
12443def err_acc_clause_appertainment
12444    : Error<"OpenACC '%1' clause is not valid on '%0' directive">;
12445def err_acc_duplicate_clause_disallowed
12446    : Error<"OpenACC '%1' clause cannot appear more than once on a '%0' "
12447            "directive">;
12448def note_acc_previous_clause_here : Note<"previous clause is here">;
12449def err_acc_branch_in_out_compute_construct
12450    : Error<"invalid %select{branch|return|throw}0 %select{out of|into}1 "
12451            "OpenACC Compute Construct">;
12452def note_acc_branch_into_compute_construct
12453    : Note<"invalid branch into OpenACC Compute Construct">;
12454def note_acc_branch_out_of_compute_construct
12455    : Note<"invalid branch out of OpenACC Compute Construct">;
12456def warn_acc_if_self_conflict
12457    : Warning<"OpenACC construct 'self' has no effect when an 'if' clause "
12458              "evaluates to true">,
12459      InGroup<DiagGroup<"openacc-self-if-potential-conflict">>;
12460def err_acc_int_expr_requires_integer
12461    : Error<"OpenACC %select{clause '%1'|directive '%2'|sub-array bound}0 "
12462            "requires expression of integer type (%3 invalid)">;
12463def err_acc_int_expr_incomplete_class_type
12464    : Error<"OpenACC integer expression has incomplete class type %0">;
12465def err_acc_int_expr_explicit_conversion
12466    : Error<"OpenACC integer expression type %0 requires explicit conversion "
12467            "to %1">;
12468def note_acc_int_expr_conversion
12469    : Note<"conversion to %select{integral|enumeration}0 type %1">;
12470def err_acc_int_expr_multiple_conversions
12471    : Error<"multiple conversions from expression type %0 to an integral type">;
12472def err_acc_num_gangs_num_args
12473    : Error<"%select{no|too many}0 integer expression arguments provided to "
12474            "OpenACC 'num_gangs' "
12475            "%select{|clause: '%1' directive expects maximum of %2, %3 were "
12476            "provided}0">;
12477def err_acc_not_a_var_ref
12478    : Error<"OpenACC variable is not a valid variable name, sub-array, array "
12479            "element,%select{| member of a composite variable,}0 or composite "
12480            "variable member">;
12481def err_acc_typecheck_subarray_value
12482    : Error<"OpenACC sub-array subscripted value is not an array or pointer">;
12483def err_acc_subarray_function_type
12484    : Error<"OpenACC sub-array cannot be of function type %0">;
12485def err_acc_subarray_incomplete_type
12486    : Error<"OpenACC sub-array base is of incomplete type %0">;
12487def err_acc_subarray_no_length
12488    : Error<"OpenACC sub-array length is unspecified and cannot be inferred "
12489            "because the subscripted value is %select{not an array|an array of "
12490            "unknown bound}0">;
12491def err_acc_subarray_negative
12492    : Error<"OpenACC sub-array %select{lower bound|length}0 evaluated to "
12493            "negative value %1">;
12494def err_acc_subarray_out_of_range
12495    : Error<"OpenACC sub-array %select{lower bound|length}0 evaluated to a "
12496            "value (%1) that would be out of the range of the subscripted "
12497            "array size of %2">;
12498def err_acc_subarray_base_plus_length_out_of_range
12499    : Error<"OpenACC sub-array specified range [%0:%1] would be out of the "
12500            "range of the subscripted array size of %2">;
12501def warn_acc_deprecated_alias_name
12502    : Warning<"OpenACC clause name '%0' is a deprecated clause name and is "
12503              "now an alias for '%1'">,
12504      InGroup<DiagGroup<"openacc-deprecated-clause-alias">>;
12505def err_acc_var_not_pointer_type
12506    : Error<"expected pointer in '%0' clause, type is %1">;
12507def note_acc_expected_pointer_var : Note<"expected variable of pointer type">;
12508def err_acc_clause_after_device_type
12509    : Error<"OpenACC clause '%0' may not follow a '%1' clause in a "
12510            "%select{'%3'|compute}2 construct">;
12511def err_acc_clause_cannot_combine
12512    : Error<"OpenACC clause '%0' may not appear on the same construct as a "
12513            "'%1' clause on a 'loop' construct">;
12514def err_acc_reduction_num_gangs_conflict
12515    : Error<
12516          "OpenACC 'reduction' clause may not appear on a 'parallel' construct "
12517          "with a 'num_gangs' clause with more than 1 argument, have %0">;
12518def err_acc_reduction_type
12519    : Error<"OpenACC 'reduction' variable must be of scalar type, sub-array, or a "
12520            "composite of scalar types;%select{| sub-array base}1 type is %0">;
12521def err_acc_reduction_composite_type
12522    : Error<"OpenACC 'reduction' variable must be a composite of scalar types; "
12523            "%1 %select{is not a class or struct|is incomplete|is not an "
12524            "aggregate}0">;
12525def err_acc_reduction_composite_member_type :Error<
12526    "OpenACC 'reduction' composite variable must not have non-scalar field">;
12527def note_acc_reduction_composite_member_loc : Note<"invalid field is here">;
12528def err_acc_loop_not_for_loop
12529    : Error<"OpenACC 'loop' construct can only be applied to a 'for' loop">;
12530def note_acc_construct_here : Note<"'%0' construct is here">;
12531def err_acc_loop_spec_conflict
12532    : Error<"OpenACC clause '%0' on '%1' construct conflicts with previous "
12533            "data dependence clause">;
12534
12535// AMDGCN builtins diagnostics
12536def err_amdgcn_global_load_lds_size_invalid_value : Error<"invalid size value">;
12537def note_amdgcn_global_load_lds_size_valid_value : Note<"size must be 1, 2, or 4">;
12538} // end of sema component.
12539