xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
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}0 "
87  "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}0 "
91  "%select{cannot be narrowed from type %2 to %3|"
92  "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 warn_float_overflow : Warning<
116  "magnitude of floating-point constant too large for type %0; maximum is %1">,
117   InGroup<LiteralRange>;
118def warn_float_underflow : Warning<
119  "magnitude of floating-point constant too small for type %0; minimum is %1">,
120  InGroup<LiteralRange>;
121def warn_float_compare_literal : Warning<
122  "floating-point comparison is always %select{true|false}0; "
123  "constant cannot be represented exactly in type %1">,
124  InGroup<LiteralRange>;
125def warn_double_const_requires_fp64 : Warning<
126  "double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, "
127  "casting to single precision">;
128def err_half_const_requires_fp16 : Error<
129  "half precision constant requires cl_khr_fp16">;
130
131// C99 variable-length arrays
132def ext_vla : Extension<"variable length arrays are a C99 feature">,
133  InGroup<VLAExtension>;
134def warn_vla_used : Warning<"variable length array used">,
135  InGroup<VLA>, DefaultIgnore;
136def err_vla_in_sfinae : Error<
137  "variable length array cannot be formed during template argument deduction">;
138def err_array_star_in_function_definition : Error<
139  "variable length array must be bound in function definition">;
140def err_vla_decl_in_file_scope : Error<
141  "variable length array declaration not allowed at file scope">;
142def err_vla_decl_has_static_storage : Error<
143  "variable length array declaration cannot have 'static' storage duration">;
144def err_vla_decl_has_extern_linkage : Error<
145  "variable length array declaration cannot have 'extern' linkage">;
146def ext_vla_folded_to_constant : ExtWarn<
147  "variable length array folded to constant array as an extension">,
148  InGroup<GNUFoldingConstant>;
149def err_vla_unsupported : Error<
150  "variable length arrays are not supported for %select{the current target|'%1'}0">;
151def note_vla_unsupported : Note<
152  "variable length arrays are not supported for the current target">;
153
154// C99 variably modified types
155def err_variably_modified_template_arg : Error<
156  "variably modified type %0 cannot be used as a template argument">;
157def err_variably_modified_nontype_template_param : Error<
158  "non-type template parameter of variably modified type %0">;
159def err_variably_modified_new_type : Error<
160  "'new' cannot allocate object of variably modified type %0">;
161
162// C99 Designated Initializers
163def ext_designated_init : Extension<
164  "designated initializers are a C99 feature">, InGroup<C99Designator>;
165def err_array_designator_negative : Error<
166  "array designator value '%0' is negative">;
167def err_array_designator_empty_range : Error<
168  "array designator range [%0, %1] is empty">;
169def err_array_designator_non_array : Error<
170  "array designator cannot initialize non-array type %0">;
171def err_array_designator_too_large : Error<
172  "array designator index (%0) exceeds array bounds (%1)">;
173def err_field_designator_non_aggr : Error<
174  "field designator cannot initialize a "
175  "%select{non-struct, non-union|non-class}0 type %1">;
176def err_field_designator_unknown : Error<
177  "field designator %0 does not refer to any field in type %1">;
178def err_field_designator_nonfield : Error<
179  "field designator %0 does not refer to a non-static data member">;
180def note_field_designator_found : Note<"field designator refers here">;
181def err_designator_for_scalar_or_sizeless_init : Error<
182  "designator in initializer for %select{scalar|indivisible sizeless}0 "
183  "type %1">;
184def warn_initializer_overrides : Warning<
185  "initializer %select{partially |}0overrides prior initialization of "
186  "this subobject">, InGroup<InitializerOverrides>;
187def ext_initializer_overrides : ExtWarn<warn_initializer_overrides.Summary>,
188  InGroup<InitializerOverrides>, SFINAEFailure;
189def err_initializer_overrides_destructed : Error<
190  "initializer would partially override prior initialization of object of "
191  "type %1 with non-trivial destruction">;
192def note_previous_initializer : Note<
193  "previous initialization %select{|with side effects }0is here"
194  "%select{| (side effects will not occur at run time)}0">;
195def err_designator_into_flexible_array_member : Error<
196  "designator into flexible array member subobject">;
197def note_flexible_array_member : Note<
198  "initialized flexible array member %0 is here">;
199def ext_flexible_array_init : Extension<
200  "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
201
202// C++20 designated initializers
203def ext_cxx_designated_init : Extension<
204  "designated initializers are a C++20 extension">, InGroup<CXX20Designator>,
205  SuppressInSystemMacro;
206def warn_cxx17_compat_designated_init : Warning<
207  "designated initializers are incompatible with C++ standards before C++20">,
208  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
209def ext_designated_init_mixed : ExtWarn<
210  "mixture of designated and non-designated initializers in the same "
211  "initializer list is a C99 extension">, InGroup<C99Designator>;
212def note_designated_init_mixed : Note<
213  "first non-designated initializer is here">;
214def ext_designated_init_array : ExtWarn<
215  "array designators are a C99 extension">, InGroup<C99Designator>;
216def ext_designated_init_nested : ExtWarn<
217  "nested designators are a C99 extension">, InGroup<C99Designator>;
218def ext_designated_init_reordered : ExtWarn<
219  "ISO C++ requires field designators to be specified in declaration order; "
220  "field %1 will be initialized after field %0">, InGroup<ReorderInitList>,
221  SFINAEFailure;
222def note_previous_field_init : Note<
223  "previous initialization for field %0 is here">;
224def ext_designated_init_brace_elision : ExtWarn<
225  "brace elision for designated initializer is a C99 extension">,
226  InGroup<C99Designator>, SFINAEFailure;
227
228// Declarations.
229def ext_plain_complex : ExtWarn<
230  "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
231def ext_imaginary_constant : Extension<
232  "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
233def ext_integer_complex : Extension<
234  "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
235
236def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
237  "'_Fract' or '_Accum', not '%0'">;
238def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
239def err_invalid_width_spec : Error<
240  "'%select{|short|long|long long}0 %1' is invalid">;
241def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
242
243def ext_auto_type_specifier : ExtWarn<
244  "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
245def warn_auto_storage_class : Warning<
246  "'auto' storage class specifier is redundant and incompatible with C++11">,
247  InGroup<CXX11Compat>, DefaultIgnore;
248
249def warn_deprecated_register : Warning<
250  "'register' storage class specifier is deprecated "
251  "and incompatible with C++17">, InGroup<DeprecatedRegister>;
252def ext_register_storage_class : ExtWarn<
253  "ISO C++17 does not allow 'register' storage class specifier">,
254  DefaultError, InGroup<Register>;
255
256def err_invalid_decl_spec_combination : Error<
257  "cannot combine with previous '%0' declaration specifier">;
258def err_invalid_vector_decl_spec_combination : Error<
259  "cannot combine with previous '%0' declaration specifier. "
260  "'__vector' must be first">;
261def err_invalid_pixel_decl_spec_combination : Error<
262  "'__pixel' must be preceded by '__vector'.  "
263  "'%0' declaration specifier not allowed here">;
264def err_invalid_vector_bool_decl_spec : Error<
265  "cannot use '%0' with '__vector bool'">;
266def err_invalid_vector_long_decl_spec : Error<
267  "cannot use 'long' with '__vector'">;
268def err_invalid_vector_float_decl_spec : Error<
269  "cannot use 'float' with '__vector'">;
270def err_invalid_vector_double_decl_spec : Error <
271  "use of 'double' with '__vector' requires VSX support to be enabled "
272  "(available on POWER7 or later)">;
273def err_invalid_vector_bool_int128_decl_spec : Error <
274  "use of '__int128' with '__vector bool' requires VSX support enabled (on "
275  "POWER10 or later)">;
276def err_invalid_vector_int128_decl_spec : Error<
277  "use of '__int128' with '__vector' requires extended Altivec support"
278  " (available on POWER8 or later)">;
279def err_invalid_vector_long_long_decl_spec : Error <
280  "use of 'long long' with '__vector' requires VSX support (available on "
281  "POWER7 or later) to be enabled">;
282def err_invalid_vector_long_double_decl_spec : Error<
283  "cannot use 'long double' with '__vector'">;
284def warn_vector_long_decl_spec_combination : Warning<
285  "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
286
287def err_redeclaration_different_type : Error<
288  "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
289def err_bad_variable_name : Error<
290  "%0 cannot be the name of a variable or data member">;
291def err_bad_parameter_name : Error<
292  "%0 cannot be the name of a parameter">;
293def err_bad_parameter_name_template_id : Error<
294  "parameter name cannot have template arguments">;
295def ext_parameter_name_omitted_c2x : ExtWarn<
296  "omitting the parameter name in a function definition is a C2x extension">,
297  InGroup<C2x>;
298def err_anyx86_interrupt_attribute : Error<
299  "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
300  "have %select{a 'void' return type|"
301  "only a pointer parameter optionally followed by an integer parameter|"
302  "a pointer as the first parameter|a %2 type as the second parameter}1">;
303def err_anyx86_interrupt_called : Error<
304  "interrupt service routine cannot be called directly">;
305def warn_anyx86_interrupt_regsave : Warning<
306  "interrupt service routine should only call a function"
307  " with attribute 'no_caller_saved_registers'">,
308  InGroup<DiagGroup<"interrupt-service-routine">>;
309def warn_arm_interrupt_calling_convention : Warning<
310   "call to function without interrupt attribute could clobber interruptee's VFP registers">,
311   InGroup<Extra>;
312def warn_interrupt_attribute_invalid : Warning<
313   "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to "
314   "functions that have %select{no parameters|a 'void' return type}1">,
315   InGroup<IgnoredAttributes>;
316def warn_riscv_repeated_interrupt_attribute : Warning<
317  "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
318def note_riscv_repeated_interrupt_attribute : Note<
319  "repeated RISC-V 'interrupt' attribute is here">;
320def warn_unused_parameter : Warning<"unused parameter %0">,
321  InGroup<UnusedParameter>, DefaultIgnore;
322def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">,
323  InGroup<UnusedButSetParameter>, DefaultIgnore;
324def warn_unused_variable : Warning<"unused variable %0">,
325  InGroup<UnusedVariable>, DefaultIgnore;
326def warn_unused_but_set_variable : Warning<"variable %0 set but not used">,
327  InGroup<UnusedButSetVariable>, DefaultIgnore;
328def warn_unused_local_typedef : Warning<
329  "unused %select{typedef|type alias}0 %1">,
330  InGroup<UnusedLocalTypedef>, DefaultIgnore;
331def warn_unused_property_backing_ivar :
332  Warning<"ivar %0 which backs the property is not "
333  "referenced in this property's accessor">,
334  InGroup<UnusedPropertyIvar>, DefaultIgnore;
335def warn_unused_const_variable : Warning<"unused variable %0">,
336  InGroup<UnusedConstVariable>, DefaultIgnore;
337def warn_unused_exception_param : Warning<"unused exception parameter %0">,
338  InGroup<UnusedExceptionParameter>, DefaultIgnore;
339def warn_decl_in_param_list : Warning<
340  "declaration of %0 will not be visible outside of this function">,
341  InGroup<Visibility>;
342def warn_redefinition_in_param_list : Warning<
343  "redefinition of %0 will not be visible outside of this function">,
344  InGroup<Visibility>;
345def warn_empty_parens_are_function_decl : Warning<
346  "empty parentheses interpreted as a function declaration">,
347  InGroup<VexingParse>;
348def warn_parens_disambiguated_as_function_declaration : Warning<
349  "parentheses were disambiguated as a function declaration">,
350  InGroup<VexingParse>;
351def warn_parens_disambiguated_as_variable_declaration : Warning<
352  "parentheses were disambiguated as redundant parentheses around declaration "
353  "of variable named %0">, InGroup<VexingParse>;
354def warn_redundant_parens_around_declarator : Warning<
355  "redundant parentheses surrounding declarator">,
356  InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
357def note_additional_parens_for_variable_declaration : Note<
358  "add a pair of parentheses to declare a variable">;
359def note_raii_guard_add_name : Note<
360  "add a variable name to declare a %0 initialized with %1">;
361def note_function_style_cast_add_parentheses : Note<
362  "add enclosing parentheses to perform a function-style cast">;
363def note_remove_parens_for_variable_declaration : Note<
364  "remove parentheses to silence this warning">;
365def note_empty_parens_function_call : Note<
366  "change this ',' to a ';' to call %0">;
367def note_empty_parens_default_ctor : Note<
368  "remove parentheses to declare a variable">;
369def note_empty_parens_zero_initialize : Note<
370  "replace parentheses with an initializer to declare a variable">;
371def warn_unused_function : Warning<"unused function %0">,
372  InGroup<UnusedFunction>, DefaultIgnore;
373def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
374  InGroup<UnusedTemplate>, DefaultIgnore;
375def warn_unused_member_function : Warning<"unused member function %0">,
376  InGroup<UnusedMemberFunction>, DefaultIgnore;
377def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
378  InGroup<UsedButMarkedUnused>, DefaultIgnore;
379def warn_unneeded_internal_decl : Warning<
380  "%select{function|variable}0 %1 is not needed and will not be emitted">,
381  InGroup<UnneededInternalDecl>, DefaultIgnore;
382def warn_unneeded_static_internal_decl : Warning<
383  "'static' function %0 declared in header file "
384  "should be declared 'static inline'">,
385  InGroup<UnneededInternalDecl>, DefaultIgnore;
386def warn_unneeded_member_function : Warning<
387  "member function %0 is not needed and will not be emitted">,
388  InGroup<UnneededMemberFunction>, DefaultIgnore;
389def warn_unused_private_field: Warning<"private field %0 is not used">,
390  InGroup<UnusedPrivateField>, DefaultIgnore;
391def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
392  "%select{used|required to be captured for this use}1">,
393  InGroup<UnusedLambdaCapture>, DefaultIgnore;
394
395def warn_reserved_extern_symbol: Warning<
396  "identifier %0 is reserved because %select{"
397  "<ERROR>|" // ReservedIdentifierStatus::NotReserved
398  "it starts with '_' at global scope|"
399  "it starts with '_' and has C language linkage|"
400  "it starts with '__'|"
401  "it starts with '_' followed by a capital letter|"
402  "it contains '__'}1">,
403  InGroup<ReservedIdentifier>, DefaultIgnore;
404
405def warn_parameter_size: Warning<
406  "%0 is a large (%1 bytes) pass-by-value argument; "
407  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
408def warn_return_value_size: Warning<
409  "return value of %0 is a large (%1 bytes) pass-by-value object; "
410  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
411def warn_return_value_udt: Warning<
412  "%0 has C-linkage specified, but returns user-defined type %1 which is "
413  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
414def warn_return_value_udt_incomplete: Warning<
415  "%0 has C-linkage specified, but returns incomplete type %1 which could be "
416  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
417def warn_implicit_function_decl : Warning<
418  "implicit declaration of function %0">,
419  InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
420def ext_implicit_function_decl_c99 : ExtWarn<
421  "call to undeclared function %0; ISO C99 and later do not support implicit "
422  "function declarations">, InGroup<ImplicitFunctionDeclare>, DefaultError;
423def note_function_suggestion : Note<"did you mean %0?">;
424
425def err_ellipsis_first_param : Error<
426  "ISO C requires a named parameter before '...'">;
427def err_declarator_need_ident : Error<"declarator requires an identifier">;
428def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
429def err_language_linkage_spec_not_ascii : Error<
430  "string literal in language linkage specifier cannot have an "
431  "encoding-prefix">;
432def ext_use_out_of_scope_declaration : ExtWarn<
433  "use of out-of-scope declaration of %0%select{| whose type is not "
434  "compatible with that of an implicit declaration}1">,
435  InGroup<DiagGroup<"out-of-scope-function">>;
436def err_inline_non_function : Error<
437  "'inline' can only appear on functions%select{| and non-local variables}0">;
438def err_noreturn_non_function : Error<
439  "'_Noreturn' can only appear on functions">;
440def warn_qual_return_type : Warning<
441  "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
442  InGroup<IgnoredQualifiers>, DefaultIgnore;
443def warn_deprecated_redundant_constexpr_static_def : Warning<
444  "out-of-line definition of constexpr static data member is redundant "
445  "in C++17 and is deprecated">,
446  InGroup<Deprecated>, DefaultIgnore;
447
448def warn_decl_shadow :
449  Warning<"declaration shadows a %select{"
450          "local variable|"
451          "variable in %2|"
452          "static data member of %2|"
453          "field of %2|"
454          "typedef in %2|"
455          "type alias in %2|"
456          "structured binding}1">,
457  InGroup<Shadow>, DefaultIgnore, SuppressInSystemMacro;
458def warn_decl_shadow_uncaptured_local :
459  Warning<warn_decl_shadow.Summary>,
460  InGroup<ShadowUncapturedLocal>, DefaultIgnore;
461def warn_ctor_parm_shadows_field:
462  Warning<"constructor parameter %0 shadows the field %1 of %2">,
463  InGroup<ShadowFieldInConstructor>, DefaultIgnore;
464def warn_modifying_shadowing_decl :
465  Warning<"modifying constructor parameter %0 that shadows a "
466          "field of %1">,
467  InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
468
469// C++ decomposition declarations
470def err_decomp_decl_context : Error<
471  "decomposition declaration not permitted in this context">;
472def warn_cxx14_compat_decomp_decl : Warning<
473  "decomposition declarations are incompatible with "
474  "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
475def ext_decomp_decl : ExtWarn<
476  "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
477def ext_decomp_decl_cond : ExtWarn<
478  "ISO C++17 does not permit structured binding declaration in a condition">,
479  InGroup<DiagGroup<"binding-in-condition">>;
480def err_decomp_decl_spec : Error<
481  "decomposition declaration cannot be declared "
482  "%plural{1:'%1'|:with '%1' specifiers}0">;
483def ext_decomp_decl_spec : ExtWarn<
484  "decomposition declaration declared "
485  "%plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension">,
486  InGroup<CXX20>;
487def warn_cxx17_compat_decomp_decl_spec : Warning<
488  "decomposition declaration declared "
489  "%plural{1:'%1'|:with '%1' specifiers}0 "
490  "is incompatible with C++ standards before C++20">,
491  InGroup<CXXPre20Compat>, DefaultIgnore;
492def err_decomp_decl_type : Error<
493  "decomposition declaration cannot be declared with type %0; "
494  "declared type must be 'auto' or reference to 'auto'">;
495def err_decomp_decl_constraint : Error<
496  "decomposition declaration cannot be declared with constrained 'auto'">;
497def err_decomp_decl_parens : Error<
498  "decomposition declaration cannot be declared with parentheses">;
499def err_decomp_decl_template : Error<
500  "decomposition declaration template not supported">;
501def err_decomp_decl_not_alone : Error<
502  "decomposition declaration must be the only declaration in its group">;
503def err_decomp_decl_requires_init : Error<
504  "decomposition declaration %0 requires an initializer">;
505def err_decomp_decl_wrong_number_bindings : Error<
506  "type %0 decomposes into %3 %plural{1:element|:elements}2, but "
507  "%select{%plural{0:no|:only %1}1|%1}4 "
508  "%plural{1:name was|:names were}1 provided">;
509def err_decomp_decl_unbindable_type : Error<
510  "cannot decompose %select{union|non-class, non-array}1 type %2">;
511def err_decomp_decl_multiple_bases_with_members : Error<
512  "cannot decompose class type %1: "
513  "%select{its base classes %2 and|both it and its base class}0 %3 "
514  "have non-static data members">;
515def err_decomp_decl_ambiguous_base : Error<
516  "cannot decompose members of ambiguous base class %1 of %0:%2">;
517def err_decomp_decl_inaccessible_base : Error<
518  "cannot decompose members of inaccessible base class %1 of %0">,
519  AccessControl;
520def err_decomp_decl_inaccessible_field : Error<
521  "cannot decompose %select{private|protected}0 member %1 of %3">,
522  AccessControl;
523def err_decomp_decl_lambda : Error<
524  "cannot decompose lambda closure type">;
525def err_decomp_decl_anon_union_member : Error<
526  "cannot decompose class type %0 because it has an anonymous "
527  "%select{struct|union}1 member">;
528def err_decomp_decl_std_tuple_element_not_specialized : Error<
529  "cannot decompose this type; 'std::tuple_element<%0>::type' "
530  "does not name a type">;
531def err_decomp_decl_std_tuple_size_not_constant : Error<
532  "cannot decompose this type; 'std::tuple_size<%0>::value' "
533  "is not a valid integral constant expression">;
534def note_in_binding_decl_init : Note<
535  "in implicit initialization of binding declaration %0">;
536
537def err_std_type_trait_not_class_template : Error<
538  "unsupported standard library implementation: "
539  "'std::%0' is not a class template">;
540
541// C++ using declarations
542def err_using_requires_qualname : Error<
543  "using declaration requires a qualified name">;
544def err_using_typename_non_type : Error<
545  "'typename' keyword used on a non-type">;
546def err_using_dependent_value_is_type : Error<
547  "dependent using declaration resolved to type without 'typename'">;
548def err_using_decl_nested_name_specifier_is_not_class : Error<
549  "using declaration in class refers into '%0', which is not a class">;
550def warn_cxx17_compat_using_decl_non_member_enumerator : Warning<
551  "member using declaration naming non-class '%0' enumerator is "
552  "incompatible with C++ standards before C++20">, InGroup<CXXPre20Compat>,
553  DefaultIgnore;
554def err_using_decl_nested_name_specifier_is_current_class : Error<
555  "using declaration refers to its own class">;
556def err_using_decl_nested_name_specifier_is_not_base_class : Error<
557  "using declaration refers into '%0', which is not a base class of %1">;
558def err_using_decl_constructor_not_in_direct_base : Error<
559  "%0 is not a direct base of %1, cannot inherit constructors">;
560def err_using_decl_can_not_refer_to_class_member : Error<
561  "using declaration cannot refer to class member">;
562def warn_cxx17_compat_using_decl_class_member_enumerator : Warning<
563  "member using declaration naming a non-member enumerator is incompatible "
564  "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
565def err_using_enum_is_dependent : Error<
566  "using-enum cannot name a dependent type">;
567def err_using_enum_not_enum : Error<
568  "%0 is not an enumerated type">;
569def err_ambiguous_inherited_constructor : Error<
570  "constructor of %0 inherited from multiple base class subobjects">;
571def note_ambiguous_inherited_constructor_using : Note<
572  "inherited from base class %0 here">;
573def note_using_decl_class_member_workaround : Note<
574  "use %select{an alias declaration|a typedef declaration|a reference|"
575  "a const variable|a constexpr variable}0 instead">;
576def err_using_decl_can_not_refer_to_namespace : Error<
577  "using declaration cannot refer to a namespace">;
578def warn_cxx17_compat_using_decl_scoped_enumerator: Warning<
579  "using declaration naming a scoped enumerator is incompatible with "
580  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
581def ext_using_decl_scoped_enumerator : ExtWarn<
582  "using declaration naming a scoped enumerator is a C++20 extension">,
583  InGroup<CXX20>;
584def err_using_decl_constructor : Error<
585  "using declaration cannot refer to a constructor">;
586def warn_cxx98_compat_using_decl_constructor : Warning<
587  "inheriting constructors are incompatible with C++98">,
588  InGroup<CXX98Compat>, DefaultIgnore;
589def err_using_decl_destructor : Error<
590  "using declaration cannot refer to a destructor">;
591def err_using_decl_template_id : Error<
592  "using declaration cannot refer to a template specialization">;
593def note_using_decl_target : Note<"target of using declaration">;
594def note_using_decl_conflict : Note<"conflicting declaration">;
595def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
596def err_using_decl_conflict : Error<
597  "target of using declaration conflicts with declaration already in scope">;
598def err_using_decl_conflict_reverse : Error<
599  "declaration conflicts with target of using declaration already in scope">;
600def note_using_decl : Note<"%select{|previous }0using declaration">;
601def err_using_decl_redeclaration_expansion : Error<
602  "using declaration pack expansion at block scope produces multiple values">;
603def err_use_of_empty_using_if_exists : Error<
604  "reference to unresolved using declaration">;
605def note_empty_using_if_exists_here : Note<
606  "using declaration annotated with 'using_if_exists' here">;
607def err_using_if_exists_on_ctor : Error<
608  "'using_if_exists' attribute cannot be applied to an inheriting constructor">;
609def err_using_enum_decl_redeclaration : Error<
610  "redeclaration of using-enum declaration">;
611def note_using_enum_decl : Note<"%select{|previous }0using-enum declaration">;
612
613def warn_access_decl_deprecated : Warning<
614  "access declarations are deprecated; use using declarations instead">,
615  InGroup<Deprecated>;
616def err_access_decl : Error<
617  "ISO C++11 does not allow access declarations; "
618  "use using declarations instead">;
619def warn_deprecated_copy : Warning<
620  "definition of implicit copy %select{constructor|assignment operator}1 "
621  "for %0 is deprecated because it has a user-declared copy "
622  "%select{assignment operator|constructor}1">,
623  InGroup<DeprecatedCopy>, DefaultIgnore;
624def warn_deprecated_copy_with_dtor : Warning<
625  "definition of implicit copy %select{constructor|assignment operator}1 "
626  "for %0 is deprecated because it has a user-declared destructor">,
627  InGroup<DeprecatedCopyWithDtor>, DefaultIgnore;
628def warn_deprecated_copy_with_user_provided_copy: Warning<
629  "definition of implicit copy %select{constructor|assignment operator}1 "
630  "for %0 is deprecated because it has a user-provided copy "
631  "%select{assignment operator|constructor}1">,
632  InGroup<DeprecatedCopyWithUserProvidedCopy>, DefaultIgnore;
633def warn_deprecated_copy_with_user_provided_dtor : Warning<
634  "definition of implicit copy %select{constructor|assignment operator}1 "
635  "for %0 is deprecated because it has a user-provided destructor">,
636  InGroup<DeprecatedCopyWithUserProvidedDtor>, DefaultIgnore;
637def warn_cxx17_compat_exception_spec_in_signature : Warning<
638  "mangled name of %0 will change in C++17 due to non-throwing exception "
639  "specification in function signature">, InGroup<CXX17CompatMangling>;
640
641def warn_global_constructor : Warning<
642  "declaration requires a global constructor">,
643  InGroup<GlobalConstructors>, DefaultIgnore;
644def warn_global_destructor : Warning<
645  "declaration requires a global destructor">,
646   InGroup<GlobalConstructors>, DefaultIgnore;
647def warn_exit_time_destructor : Warning<
648  "declaration requires an exit-time destructor">,
649  InGroup<ExitTimeDestructors>, DefaultIgnore;
650
651def err_invalid_thread : Error<
652  "'%0' is only allowed on variable declarations">;
653def err_thread_non_global : Error<
654  "'%0' variables must have global storage">;
655def err_thread_unsupported : Error<
656  "thread-local storage is not supported for the current target">;
657
658// FIXME: Combine fallout warnings to just one warning.
659def warn_maybe_falloff_nonvoid_function : Warning<
660  "non-void function does not return a value in all control paths">,
661  InGroup<ReturnType>;
662def warn_falloff_nonvoid_function : Warning<
663  "non-void function does not return a value">,
664  InGroup<ReturnType>;
665def err_maybe_falloff_nonvoid_block : Error<
666  "non-void block does not return a value in all control paths">;
667def err_falloff_nonvoid_block : Error<
668  "non-void block does not return a value">;
669def warn_maybe_falloff_nonvoid_coroutine : Warning<
670  "non-void coroutine does not return a value in all control paths">,
671  InGroup<ReturnType>;
672def warn_falloff_nonvoid_coroutine : Warning<
673  "non-void coroutine does not return a value">,
674  InGroup<ReturnType>;
675def warn_suggest_noreturn_function : Warning<
676  "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
677  InGroup<MissingNoreturn>, DefaultIgnore;
678def warn_suggest_noreturn_block : Warning<
679  "block could be declared with attribute 'noreturn'">,
680  InGroup<MissingNoreturn>, DefaultIgnore;
681
682// Unreachable code.
683def warn_unreachable : Warning<
684  "code will never be executed">,
685  InGroup<UnreachableCode>, DefaultIgnore;
686def warn_unreachable_break : Warning<
687  "'break' will never be executed">,
688  InGroup<UnreachableCodeBreak>, DefaultIgnore;
689def warn_unreachable_return : Warning<
690  "'return' will never be executed">,
691  InGroup<UnreachableCodeReturn>, DefaultIgnore;
692def warn_unreachable_loop_increment : Warning<
693  "loop will run at most once (loop increment never executed)">,
694  InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
695def warn_unreachable_fallthrough_attr : Warning<
696  "fallthrough annotation in unreachable code">,
697  InGroup<UnreachableCodeFallthrough>, DefaultIgnore;
698def note_unreachable_silence : Note<
699  "silence by adding parentheses to mark code as explicitly dead">;
700def warn_unreachable_association : Warning<
701  "due to lvalue conversion of the controlling expression, association of type "
702  "%0 will never be selected because it is %select{of array type|qualified}1">,
703  InGroup<UnreachableCodeGenericAssoc>;
704
705/// Built-in functions.
706def ext_implicit_lib_function_decl : ExtWarn<
707  "implicitly declaring library function '%0' with type %1">,
708  InGroup<ImplicitFunctionDeclare>;
709def ext_implicit_lib_function_decl_c99 : ExtWarn<
710  "call to undeclared library function '%0' with type %1; ISO C99 and later "
711  "do not support implicit function declarations">,
712  InGroup<ImplicitFunctionDeclare>, DefaultError;
713def note_include_header_or_declare : Note<
714  "include the header <%0> or explicitly provide a declaration for '%1'">;
715def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
716def warn_implicit_decl_no_jmp_buf
717    : Warning<"declaration of built-in function '%0' requires the declaration"
718    " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.">,
719      InGroup<DiagGroup<"incomplete-setjmp-declaration">>;
720def warn_implicit_decl_requires_sysheader : Warning<
721  "declaration of built-in function '%1' requires inclusion of the header <%0>">,
722  InGroup<BuiltinRequiresHeader>;
723def warn_redecl_library_builtin : Warning<
724  "incompatible redeclaration of library function %0">,
725  InGroup<DiagGroup<"incompatible-library-redeclaration">>;
726def err_builtin_definition : Error<"definition of builtin function %0">;
727def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
728def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
729def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as "
730  "%select{GCP|CDE}1">;
731def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
732def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
733def err_invalid_cpu_specific_dispatch_value : Error<
734"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
735def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
736  InGroup<ImplicitFunctionDeclare>, DefaultError;
737def warn_cstruct_memaccess : Warning<
738  "%select{destination for|source of|first operand of|second operand of}0 this "
739  "%1 call is a pointer to record %2 that is not trivial to "
740  "%select{primitive-default-initialize|primitive-copy}3">,
741  InGroup<NonTrivialMemaccess>;
742def note_nontrivial_field : Note<
743  "field is non-trivial to %select{copy|default-initialize}0">;
744def err_non_trivial_c_union_in_invalid_context : Error<
745  "cannot %select{"
746  "use type %1 for a function/method parameter|"
747  "use type %1 for function/method return|"
748  "default-initialize an object of type %1|"
749  "declare an automatic variable of type %1|"
750  "copy-initialize an object of type %1|"
751  "assign to a variable of type %1|"
752  "construct an automatic compound literal of type %1|"
753  "capture a variable of type %1|"
754  "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion"
755  "}3 "
756  "since it %select{contains|is}2 a union that is non-trivial to "
757  "%select{default-initialize|destruct|copy}0">;
758def note_non_trivial_c_union : Note<
759  "%select{%2 has subobjects that are|%3 has type %2 that is}0 "
760  "non-trivial to %select{default-initialize|destruct|copy}1">;
761def warn_dyn_class_memaccess : Warning<
762  "%select{destination for|source of|first operand of|second operand of}0 this "
763  "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
764  "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
765  InGroup<DynamicClassMemaccess>;
766def note_bad_memaccess_silence : Note<
767  "explicitly cast the pointer to silence this warning">;
768def warn_sizeof_pointer_expr_memaccess : Warning<
769  "'%0' call operates on objects of type %1 while the size is based on a "
770  "different type %2">,
771  InGroup<SizeofPointerMemaccess>;
772def warn_sizeof_pointer_expr_memaccess_note : Note<
773  "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
774  "it by the number of elements)|remove the addressof in the argument to "
775  "'sizeof' (and multiply it by the number of elements)|provide an explicit "
776  "length}0?">;
777def warn_sizeof_pointer_type_memaccess : Warning<
778  "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
779  "%select{destination|source}2; expected %3 or an explicit length">,
780  InGroup<SizeofPointerMemaccess>;
781def warn_strlcpycat_wrong_size : Warning<
782  "size argument in %0 call appears to be size of the source; "
783  "expected the size of the destination">,
784  InGroup<DiagGroup<"strlcpy-strlcat-size">>;
785def note_strlcpycat_wrong_size : Note<
786  "change size argument to be the size of the destination">;
787def warn_memsize_comparison : Warning<
788  "size argument in %0 call is a comparison">,
789  InGroup<DiagGroup<"memsize-comparison">>;
790def note_memsize_comparison_paren : Note<
791  "did you mean to compare the result of %0 instead?">;
792def note_memsize_comparison_cast_silence : Note<
793  "explicitly cast the argument to size_t to silence this warning">;
794def warn_suspicious_sizeof_memset : Warning<
795  "%select{'size' argument to memset is '0'|"
796  "setting buffer to a 'sizeof' expression}0"
797  "; did you mean to transpose the last two arguments?">,
798  InGroup<MemsetTransposedArgs>;
799def note_suspicious_sizeof_memset_silence : Note<
800  "%select{parenthesize the third argument|"
801  "cast the second argument to 'int'}0 to silence">;
802def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
803  InGroup<SuspiciousBzero>;
804def note_suspicious_bzero_size_silence : Note<
805  "parenthesize the second argument to silence">;
806
807def warn_strncat_large_size : Warning<
808  "the value of the size argument in 'strncat' is too large, might lead to a "
809  "buffer overflow">, InGroup<StrncatSize>;
810def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
811  "to be size of the source">, InGroup<StrncatSize>;
812def warn_strncat_wrong_size : Warning<
813  "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
814def note_strncat_wrong_size : Note<
815  "change the argument to be the free space in the destination buffer minus "
816  "the terminating null byte">;
817
818def warn_assume_side_effects : Warning<
819  "the argument to %0 has side effects that will be discarded">,
820  InGroup<DiagGroup<"assume">>;
821def warn_assume_attribute_string_unknown : Warning<
822  "unknown assumption string '%0'; attribute is potentially ignored">,
823  InGroup<UnknownAssumption>;
824def warn_assume_attribute_string_unknown_suggested : Warning<
825  "unknown assumption string '%0' may be misspelled; attribute is potentially "
826  "ignored, did you mean '%1'?">,
827  InGroup<MisspelledAssumption>;
828
829def warn_builtin_chk_overflow : Warning<
830  "'%0' will always overflow; destination buffer has size %1,"
831  " but size argument is %2">,
832  InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
833
834def warn_fortify_source_overflow
835  : Warning<warn_builtin_chk_overflow.Summary>, InGroup<FortifySource>;
836def warn_fortify_source_size_mismatch : Warning<
837  "'%0' size argument is too large; destination buffer has size %1,"
838  " but size argument is %2">, InGroup<FortifySource>;
839
840def warn_fortify_strlen_overflow: Warning<
841  "'%0' will always overflow; destination buffer has size %1,"
842  " but the source string has length %2 (including NUL byte)">,
843  InGroup<FortifySource>;
844
845def warn_fortify_source_format_overflow : Warning<
846  "'%0' will always overflow; destination buffer has size %1,"
847  " but format string expands to at least %2">,
848  InGroup<FortifySource>;
849
850def warn_fortify_scanf_overflow : Warning<
851  "'%0' may overflow; destination buffer in argument %1 has size "
852  "%2, but the corresponding specifier may require size %3">,
853  InGroup<FortifySource>;
854
855def err_function_start_invalid_type: Error<
856  "argument must be a function">;
857
858/// main()
859// static main() is not an error in C, just in C++.
860def warn_static_main : Warning<"'main' should not be declared static">,
861    InGroup<Main>;
862def err_static_main : Error<"'main' is not allowed to be declared static">;
863def err_inline_main : Error<"'main' is not allowed to be declared inline">;
864def ext_variadic_main : ExtWarn<
865  "'main' is not allowed to be declared variadic">, InGroup<Main>;
866def ext_noreturn_main : ExtWarn<
867  "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
868def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
869def err_constexpr_main : Error<
870  "'main' is not allowed to be declared %select{constexpr|consteval}0">;
871def err_deleted_main : Error<"'main' is not allowed to be deleted">;
872def err_mainlike_template_decl : Error<"%0 cannot be a template">;
873def err_main_returns_nonint : Error<"'main' must return 'int'">;
874def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
875    InGroup<MainReturnType>;
876def note_main_change_return_type : Note<"change return type to 'int'">;
877def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
878    "must be 0, 2, or 3">;
879def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
880    InGroup<Main>;
881def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
882    "parameter of 'main' (%select{argument count|argument array|environment|"
883    "platform-specific data}0) must be of type %1">;
884def warn_main_returns_bool_literal : Warning<"bool literal returned from "
885    "'main'">, InGroup<Main>;
886def err_main_global_variable :
887    Error<"main cannot be declared as global variable">;
888def warn_main_redefined : Warning<"variable named 'main' with external linkage "
889    "has undefined behavior">, InGroup<Main>;
890def ext_main_used : Extension<
891  "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
892
893/// parser diagnostics
894def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
895  InGroup<MissingDeclarations>;
896def err_no_declarators : Error<"declaration does not declare anything">;
897def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
898  InGroup<MissingDeclarations>;
899def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
900
901def ext_non_c_like_anon_struct_in_typedef : ExtWarn<
902  "anonymous non-C-compatible type given name for linkage purposes "
903  "by %select{typedef|alias}0 declaration; "
904  "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>;
905def err_non_c_like_anon_struct_in_typedef : Error<
906  "anonymous non-C-compatible type given name for linkage purposes "
907  "by %select{typedef|alias}0 declaration after its linkage was computed; "
908  "add a tag name here to establish linkage prior to definition">;
909def err_typedef_changes_linkage : Error<
910  "unsupported: anonymous type given name for linkage purposes "
911  "by %select{typedef|alias}0 declaration after its linkage was computed; "
912  "add a tag name here to establish linkage prior to definition">;
913def note_non_c_like_anon_struct : Note<
914  "type is not C-compatible due to this "
915  "%select{base class|default member initializer|lambda expression|"
916  "friend declaration|member declaration}0">;
917def note_typedef_for_linkage_here : Note<
918  "type is given name %0 for linkage purposes by this "
919  "%select{typedef|alias}1 declaration">;
920
921def err_statically_allocated_object : Error<
922  "interface type cannot be statically allocated">;
923def err_object_cannot_be_passed_returned_by_value : Error<
924  "interface type %1 cannot be %select{returned|passed}0 by value"
925  "; did you forget * in %1?">;
926def err_parameters_retval_cannot_have_fp16_type : Error<
927  "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
928def err_opencl_half_load_store : Error<
929  "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
930  "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
931def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
932def err_opencl_half_declaration : Error<
933  "declaring variable of type %0 is not allowed">;
934def err_opencl_invalid_param : Error<
935  "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">;
936def err_opencl_invalid_return : Error<
937  "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
938def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
939def warn_pragma_options_align_reset_failed : Warning<
940  "#pragma options align=reset failed: %0">,
941  InGroup<IgnoredPragmas>;
942def err_pragma_options_align_mac68k_target_unsupported : Error<
943  "mac68k alignment pragma is not supported on this target">;
944def warn_pragma_align_not_xl_compatible : Warning<
945  "#pragma align(packed) may not be compatible with objects generated with AIX XL C/C++">,
946  InGroup<AIXCompat>;
947def warn_pragma_pack_invalid_alignment : Warning<
948  "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
949  InGroup<IgnoredPragmas>;
950def err_pragma_pack_invalid_alignment : Error<
951  warn_pragma_pack_invalid_alignment.Summary>;
952def warn_pragma_pack_non_default_at_include : Warning<
953  "non-default #pragma pack value changes the alignment of struct or union "
954  "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
955  DefaultIgnore;
956def warn_pragma_pack_modified_after_include : Warning<
957  "the current #pragma pack alignment value is modified in the included "
958  "file">, InGroup<PragmaPack>;
959def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
960  "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
961def note_pragma_pack_here : Note<
962  "previous '#pragma pack' directive that modifies alignment is here">;
963def note_pragma_pack_pop_instead_reset : Note<
964  "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
965// Follow the Microsoft implementation.
966def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
967def warn_pragma_pack_pop_identifier_and_alignment : Warning<
968  "specifying both a name and alignment to 'pop' is undefined">;
969def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
970  InGroup<IgnoredPragmas>;
971def err_pragma_fc_pp_scope : Error<
972  "'#pragma float_control push/pop' can only appear at file or namespace scope "
973  "or within a language linkage specification">;
974def err_pragma_fc_noprecise_requires_nofenv : Error<
975  "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
976def err_pragma_fc_except_requires_precise : Error<
977  "'#pragma float_control(except, on)' is illegal when precise is disabled">;
978def err_pragma_fc_noprecise_requires_noexcept : Error<
979  "'#pragma float_control(precise, off)' is illegal when except is enabled">;
980def err_pragma_fenv_requires_precise : Error<
981  "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">;
982def warn_cxx_ms_struct :
983  Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
984          "with base classes or virtual functions">,
985  DefaultError, InGroup<IncompatibleMSStruct>;
986def err_pragma_pack_identifer_not_supported : Error<
987  "specifying an identifier within `#pragma pack` is not supported on this target">;
988def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
989def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
990def err_invalid_super_scope : Error<"invalid use of '__super', "
991  "this keyword can only be used inside class or member function scope">;
992def err_super_in_lambda_unsupported : Error<
993  "use of '__super' inside a lambda is unsupported">;
994
995def err_pragma_expected_file_scope : Error<
996  "'#pragma %0' can only appear at file scope">;
997def err_pragma_alloc_text_c_linkage: Error<
998  "'#pragma alloc_text' is applicable only to functions with C linkage">;
999def err_pragma_alloc_text_not_function: Error<
1000  "'#pragma alloc_text' is applicable only to functions">;
1001
1002def warn_pragma_unused_undeclared_var : Warning<
1003  "undeclared variable %0 used as an argument for '#pragma unused'">,
1004  InGroup<IgnoredPragmas>;
1005def warn_atl_uuid_deprecated : Warning<
1006  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
1007  InGroup<DeprecatedDeclarations>;
1008def warn_pragma_unused_expected_var_arg : Warning<
1009  "only variables can be arguments to '#pragma unused'">,
1010  InGroup<IgnoredPragmas>;
1011def err_pragma_push_visibility_mismatch : Error<
1012  "#pragma visibility push with no matching #pragma visibility pop">;
1013def note_surrounding_namespace_ends_here : Note<
1014  "surrounding namespace with visibility attribute ends here">;
1015def err_pragma_pop_visibility_mismatch : Error<
1016  "#pragma visibility pop with no matching #pragma visibility push">;
1017def note_surrounding_namespace_starts_here : Note<
1018  "surrounding namespace with visibility attribute starts here">;
1019def err_pragma_loop_invalid_argument_type : Error<
1020  "invalid argument of type %0; expected an integer type">;
1021def err_pragma_loop_invalid_argument_value : Error<
1022  "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
1023def err_pragma_loop_compatibility : Error<
1024  "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
1025def err_pragma_loop_precedes_nonloop : Error<
1026  "expected a for, while, or do-while loop to follow '%0'">;
1027
1028def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
1029  "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
1030  "those declarations">;
1031def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
1032  "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
1033def err_pragma_attribute_invalid_matchers : Error<
1034  "attribute %0 can't be applied to %1">;
1035def err_pragma_attribute_stack_mismatch : Error<
1036  "'#pragma clang attribute %select{%1.|}0pop' with no matching"
1037  " '#pragma clang attribute %select{%1.|}0push'">;
1038def warn_pragma_attribute_unused : Warning<
1039  "unused attribute %0 in '#pragma clang attribute push' region">,
1040  InGroup<PragmaClangAttribute>;
1041def note_pragma_attribute_region_ends_here : Note<
1042  "'#pragma clang attribute push' regions ends here">;
1043def err_pragma_attribute_no_pop_eof : Error<"unterminated "
1044  "'#pragma clang attribute push' at end of file">;
1045def note_pragma_attribute_applied_decl_here : Note<
1046  "when applied to this declaration">;
1047def err_pragma_attr_attr_no_push : Error<
1048  "'#pragma clang attribute' attribute with no matching "
1049  "'#pragma clang attribute push'">;
1050
1051/// Objective-C parser diagnostics
1052def err_duplicate_class_def : Error<
1053  "duplicate interface definition for class %0">;
1054def err_undef_superclass : Error<
1055  "cannot find interface declaration for %0, superclass of %1">;
1056def err_forward_superclass : Error<
1057  "attempting to use the forward class %0 as superclass of %1">;
1058def err_no_nsconstant_string_class : Error<
1059  "cannot find interface declaration for %0">;
1060def err_recursive_superclass : Error<
1061  "trying to recursively use %0 as superclass of %1">;
1062def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
1063def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
1064def warn_duplicate_protocol_def : Warning<
1065  "duplicate protocol definition of %0 is ignored">,
1066  InGroup<DiagGroup<"duplicate-protocol">>;
1067def err_protocol_has_circular_dependency : Error<
1068  "protocol has circular dependency">;
1069def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
1070def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
1071def err_atprotocol_protocol : Error<
1072  "@protocol is using a forward protocol declaration of %0">;
1073def warn_readonly_property : Warning<
1074  "attribute 'readonly' of property %0 restricts attribute "
1075  "'readwrite' of property inherited from %1">,
1076  InGroup<PropertyAttr>;
1077
1078def warn_property_attribute : Warning<
1079  "'%1' attribute on property %0 does not match the property inherited from %2">,
1080  InGroup<PropertyAttr>;
1081def warn_property_types_are_incompatible : Warning<
1082  "property type %0 is incompatible with type %1 inherited from %2">,
1083  InGroup<DiagGroup<"incompatible-property-type">>;
1084def warn_protocol_property_mismatch : Warning<
1085  "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
1086  "getter %1|with setter %1}0 was selected for synthesis">,
1087  InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
1088def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Summary>;
1089def err_undef_interface : Error<"cannot find interface declaration for %0">;
1090def err_category_forward_interface : Error<
1091  "cannot define %select{category|class extension}0 for undefined class %1">;
1092def err_class_extension_after_impl : Error<
1093  "cannot declare class extension for %0 after class implementation">;
1094def note_implementation_declared : Note<
1095  "class implementation is declared here">;
1096def note_while_in_implementation : Note<
1097  "detected while default synthesizing properties in class implementation">;
1098def note_class_declared : Note<
1099  "class is declared here">;
1100def note_receiver_class_declared : Note<
1101  "receiver is instance of class declared here">;
1102def note_receiver_expr_here : Note<
1103  "receiver expression is here">;
1104def note_receiver_is_id : Note<
1105  "receiver is treated with 'id' type for purpose of method lookup">;
1106def note_suppressed_class_declare : Note<
1107  "class with specified objc_requires_property_definitions attribute is declared here">;
1108def err_objc_root_class_subclass : Error<
1109  "objc_root_class attribute may only be specified on a root class declaration">;
1110def err_restricted_superclass_mismatch : Error<
1111  "cannot subclass a class that was declared with the "
1112  "'objc_subclassing_restricted' attribute">;
1113def err_class_stub_subclassing_mismatch : Error<
1114  "'objc_class_stub' attribute cannot be specified on a class that does not "
1115  "have the 'objc_subclassing_restricted' attribute">;
1116def err_implementation_of_class_stub : Error<
1117  "cannot declare implementation of a class declared with the "
1118  "'objc_class_stub' attribute">;
1119def warn_objc_root_class_missing : Warning<
1120  "class %0 defined without specifying a base class">,
1121  InGroup<ObjCRootClass>;
1122def err_objc_runtime_visible_category : Error<
1123  "cannot implement a category for class %0 that is only visible via the "
1124  "Objective-C runtime">;
1125def err_objc_runtime_visible_subclass : Error<
1126  "cannot implement subclass %0 of a superclass %1 that is only visible via the "
1127  "Objective-C runtime">;
1128def note_objc_needs_superclass : Note<
1129  "add a super class to fix this problem">;
1130def err_conflicting_super_class : Error<"conflicting super class name %0">;
1131def err_dup_implementation_class : Error<"reimplementation of class %0">;
1132def err_dup_implementation_category : Error<
1133  "reimplementation of category %1 for class %0">;
1134def err_conflicting_ivar_type : Error<
1135  "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
1136def err_duplicate_ivar_declaration : Error<
1137  "instance variable is already declared">;
1138def warn_on_superclass_use : Warning<
1139  "class implementation may not have super class">;
1140def err_conflicting_ivar_bitwidth : Error<
1141  "instance variable %0 has conflicting bit-field width">;
1142def err_conflicting_ivar_name : Error<
1143  "conflicting instance variable names: %0 vs %1">;
1144def err_inconsistent_ivar_count : Error<
1145  "inconsistent number of instance variables specified">;
1146def warn_undef_method_impl : Warning<"method definition for %0 not found">,
1147  InGroup<DiagGroup<"incomplete-implementation">>;
1148def warn_objc_boxing_invalid_utf8_string : Warning<
1149  "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
1150  InGroup<ObjCBoxing>;
1151
1152def err_objc_non_runtime_protocol_in_protocol_expr : Error<
1153  "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">;
1154def err_objc_direct_on_protocol : Error<
1155  "'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
1156  "declared in an Objective-C protocol">;
1157def err_objc_direct_duplicate_decl : Error<
1158  "%select{|direct }0%select{method|property}1 declaration conflicts "
1159  "with previous %select{|direct }2declaration of %select{method|property}1 %3">;
1160def err_objc_direct_impl_decl_mismatch : Error<
1161  "direct method was declared in %select{the primary interface|an extension|a category}0 "
1162  "but is implemented in %select{the primary interface|a category|a different category}1">;
1163def err_objc_direct_missing_on_decl : Error<
1164  "direct method implementation was previously declared not direct">;
1165def err_objc_direct_on_override : Error<
1166  "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">;
1167def err_objc_override_direct_method : Error<
1168  "cannot override a method that is declared direct by a superclass">;
1169def warn_objc_direct_ignored : Warning<
1170  "%0 attribute isn't implemented by this Objective-C runtime">,
1171  InGroup<IgnoredAttributes>;
1172def warn_objc_direct_property_ignored : Warning<
1173  "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
1174  InGroup<IgnoredAttributes>;
1175def err_objc_direct_dynamic_property : Error<
1176  "direct property cannot be @dynamic">;
1177def err_objc_direct_protocol_conformance : Error<
1178  "%select{category %1|class extension}0 cannot conform to protocol %2 because "
1179  "of direct members declared in interface %3">;
1180def note_direct_member_here : Note<"direct member declared here">;
1181
1182def warn_conflicting_overriding_ret_types : Warning<
1183  "conflicting return type in "
1184  "declaration of %0%diff{: $ vs $|}1,2">,
1185  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1186
1187def warn_conflicting_ret_types : Warning<
1188  "conflicting return type in "
1189  "implementation of %0%diff{: $ vs $|}1,2">,
1190  InGroup<MismatchedReturnTypes>;
1191
1192def warn_conflicting_overriding_ret_type_modifiers : Warning<
1193  "conflicting distributed object modifiers on return type "
1194  "in declaration of %0">,
1195  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1196
1197def warn_conflicting_ret_type_modifiers : Warning<
1198  "conflicting distributed object modifiers on return type "
1199  "in implementation of %0">,
1200  InGroup<DistributedObjectModifiers>;
1201
1202def warn_non_covariant_overriding_ret_types : Warning<
1203  "conflicting return type in "
1204  "declaration of %0: %1 vs %2">,
1205  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1206
1207def warn_non_covariant_ret_types : Warning<
1208  "conflicting return type in "
1209  "implementation of %0: %1 vs %2">,
1210  InGroup<MethodSignatures>, DefaultIgnore;
1211
1212def warn_conflicting_overriding_param_types : Warning<
1213  "conflicting parameter types in "
1214  "declaration of %0%diff{: $ vs $|}1,2">,
1215  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1216
1217def warn_conflicting_param_types : Warning<
1218  "conflicting parameter types in "
1219  "implementation of %0%diff{: $ vs $|}1,2">,
1220  InGroup<MismatchedParameterTypes>;
1221
1222def warn_conflicting_param_modifiers : Warning<
1223  "conflicting distributed object modifiers on parameter type "
1224  "in implementation of %0">,
1225  InGroup<DistributedObjectModifiers>;
1226
1227def warn_conflicting_overriding_param_modifiers : Warning<
1228  "conflicting distributed object modifiers on parameter type "
1229  "in declaration of %0">,
1230  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1231
1232def warn_non_contravariant_overriding_param_types : Warning<
1233  "conflicting parameter types in "
1234  "declaration of %0: %1 vs %2">,
1235  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1236
1237def warn_non_contravariant_param_types : Warning<
1238  "conflicting parameter types in "
1239  "implementation of %0: %1 vs %2">,
1240  InGroup<MethodSignatures>, DefaultIgnore;
1241
1242def warn_conflicting_overriding_variadic :Warning<
1243  "conflicting variadic declaration of method and its "
1244  "implementation">,
1245  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1246
1247def warn_conflicting_variadic :Warning<
1248  "conflicting variadic declaration of method and its "
1249  "implementation">;
1250
1251def warn_category_method_impl_match:Warning<
1252  "category is implementing a method which will also be implemented"
1253  " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1254
1255def warn_implements_nscopying : Warning<
1256"default assign attribute on property %0 which implements "
1257"NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1258
1259def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1260  InGroup<ObjCMultipleMethodNames>;
1261def warn_strict_multiple_method_decl : Warning<
1262  "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1263def warn_accessor_property_type_mismatch : Warning<
1264  "type of property %0 does not match type of accessor %1">;
1265def note_conv_function_declared_at : Note<"type conversion function declared here">;
1266def note_method_declared_at : Note<"method %0 declared here">;
1267def note_direct_method_declared_at : Note<"direct method %0 declared here">;
1268def note_property_attribute : Note<"property %0 is declared "
1269  "%select{deprecated|unavailable|partial}1 here">;
1270def err_setter_type_void : Error<"type of setter must be void">;
1271def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1272def warn_duplicate_method_decl :
1273  Warning<"multiple declarations of method %0 found and ignored">,
1274  InGroup<MethodDuplicate>, DefaultIgnore;
1275def warn_objc_cdirective_format_string :
1276  Warning<"using %0 directive in %select{NSString|CFString}1 "
1277          "which is being passed as a formatting argument to the formatting "
1278          "%select{method|CFfunction}2">,
1279  InGroup<ObjCCStringFormat>, DefaultIgnore;
1280def err_objc_var_decl_inclass :
1281    Error<"cannot declare variable inside @interface or @protocol">;
1282def err_missing_method_context : Error<
1283  "missing context for method declaration">;
1284def err_objc_property_attr_mutually_exclusive : Error<
1285  "property attributes '%0' and '%1' are mutually exclusive">;
1286def err_objc_property_requires_object : Error<
1287  "property with '%0' attribute must be of object type">;
1288def warn_objc_property_assign_on_object : Warning<
1289  "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1290  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1291def warn_objc_property_no_assignment_attribute : Warning<
1292  "no 'assign', 'retain', or 'copy' attribute is specified - "
1293  "'assign' is assumed">,
1294  InGroup<ObjCPropertyNoAttribute>;
1295def warn_objc_isa_use : Warning<
1296  "direct access to Objective-C's isa is deprecated in favor of "
1297  "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1298def warn_objc_isa_assign : Warning<
1299  "assignment to Objective-C's isa is deprecated in favor of "
1300  "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1301def warn_objc_pointer_masking : Warning<
1302  "bitmasking for introspection of Objective-C object pointers is strongly "
1303  "discouraged">,
1304  InGroup<ObjCPointerIntrospect>;
1305def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Summary>,
1306  InGroup<ObjCPointerIntrospectPerformSelector>;
1307def warn_objc_property_default_assign_on_object : Warning<
1308  "default property attribute 'assign' not appropriate for object">,
1309  InGroup<ObjCPropertyNoAttribute>;
1310def warn_property_attr_mismatch : Warning<
1311  "property attribute in class extension does not match the primary class">,
1312  InGroup<PropertyAttr>;
1313def warn_property_implicitly_mismatched : Warning <
1314  "primary property declaration is implicitly strong while redeclaration "
1315  "in class extension is weak">,
1316  InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1317def warn_objc_property_copy_missing_on_block : Warning<
1318    "'copy' attribute must be specified for the block property "
1319    "when -fobjc-gc-only is specified">;
1320def warn_objc_property_retain_of_block : Warning<
1321    "retain'ed block property does not copy the block "
1322    "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1323def warn_objc_readonly_property_has_setter : Warning<
1324    "setter cannot be specified for a readonly property">,
1325    InGroup<ObjCReadonlyPropertyHasSetter>;
1326def warn_atomic_property_rule : Warning<
1327  "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1328  "with a user defined %select{getter|setter}2">,
1329  InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1330def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1331  "synthesized, or both be user defined, or the property must be nonatomic">;
1332def err_atomic_property_nontrivial_assign_op : Error<
1333  "atomic property of reference type %0 cannot have non-trivial assignment"
1334  " operator">;
1335def warn_cocoa_naming_owned_rule : Warning<
1336  "property follows Cocoa naming"
1337  " convention for returning 'owned' objects">,
1338  InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1339def err_cocoa_naming_owned_rule : Error<
1340  "property follows Cocoa naming"
1341  " convention for returning 'owned' objects">;
1342def note_cocoa_naming_declare_family : Note<
1343  "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1344  "object">;
1345def warn_auto_synthesizing_protocol_property :Warning<
1346  "auto property synthesis will not synthesize property %0"
1347  " declared in protocol %1">,
1348  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1349def note_add_synthesize_directive : Note<
1350  "add a '@synthesize' directive">;
1351def warn_no_autosynthesis_shared_ivar_property : Warning <
1352  "auto property synthesis will not synthesize property "
1353  "%0 because it cannot share an ivar with another synthesized property">,
1354  InGroup<ObjCNoPropertyAutoSynthesis>;
1355def warn_no_autosynthesis_property : Warning<
1356  "auto property synthesis will not synthesize property "
1357  "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1358  "via another property">,
1359  InGroup<ObjCNoPropertyAutoSynthesis>;
1360def warn_autosynthesis_property_in_superclass : Warning<
1361  "auto property synthesis will not synthesize property "
1362  "%0; it will be implemented by its superclass, use @dynamic to "
1363  "acknowledge intention">,
1364  InGroup<ObjCNoPropertyAutoSynthesis>;
1365def warn_autosynthesis_property_ivar_match :Warning<
1366  "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1367  "%2, not existing instance variable %3">,
1368  InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1369def warn_missing_explicit_synthesis : Warning <
1370  "auto property synthesis is synthesizing property not explicitly synthesized">,
1371  InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1372def warn_property_getter_owning_mismatch : Warning<
1373  "property declared as returning non-retained objects"
1374  "; getter returning retained objects">;
1375def warn_property_redecl_getter_mismatch : Warning<
1376  "getter name mismatch between property redeclaration (%1) and its original "
1377  "declaration (%0)">, InGroup<PropertyAttr>;
1378def err_property_setter_ambiguous_use : Error<
1379  "synthesized properties %0 and %1 both claim setter %2 -"
1380  " use of this setter will cause unexpected behavior">;
1381def warn_default_atomic_custom_getter_setter : Warning<
1382  "atomic by default property %0 has a user defined %select{getter|setter}1 "
1383  "(property should be marked 'atomic' if this is intended)">,
1384  InGroup<CustomAtomic>, DefaultIgnore;
1385def err_use_continuation_class : Error<
1386  "illegal redeclaration of property in class extension %0"
1387  " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1388def err_type_mismatch_continuation_class : Error<
1389  "type of property %0 in class extension does not match "
1390  "property type in primary class">;
1391def err_use_continuation_class_redeclaration_readwrite : Error<
1392  "illegal redeclaration of 'readwrite' property in class extension %0"
1393  " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1394  "'readonly' public property?)">;
1395def err_continuation_class : Error<"class extension has no primary class">;
1396def err_property_type : Error<"property cannot have array or function type %0">;
1397def err_missing_property_context : Error<
1398  "missing context for property implementation declaration">;
1399def err_bad_property_decl : Error<
1400  "property implementation must have its declaration in interface %0 or one of "
1401  "its extensions">;
1402def err_category_property : Error<
1403  "property declared in category %0 cannot be implemented in "
1404  "class implementation">;
1405def note_property_declare : Note<
1406  "property declared here">;
1407def note_protocol_property_declare : Note<
1408  "it could also be property "
1409  "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1410  "%1|with setter %1}0 declared here">;
1411def note_property_synthesize : Note<
1412  "property synthesized here">;
1413def err_synthesize_category_decl : Error<
1414  "@synthesize not allowed in a category's implementation">;
1415def err_synthesize_on_class_property : Error<
1416  "@synthesize not allowed on a class property %0">;
1417def err_missing_property_interface : Error<
1418  "property implementation in a category with no category declaration">;
1419def err_bad_category_property_decl : Error<
1420  "property implementation must have its declaration in the category %0">;
1421def err_bad_property_context : Error<
1422  "property implementation must be in a class or category implementation">;
1423def err_missing_property_ivar_decl : Error<
1424  "synthesized property %0 must either be named the same as a compatible"
1425  " instance variable or must explicitly name an instance variable">;
1426def err_arc_perform_selector_retains : Error<
1427  "performSelector names a selector which retains the object">;
1428def warn_arc_perform_selector_leaks : Warning<
1429  "performSelector may cause a leak because its selector is unknown">,
1430  InGroup<DiagGroup<"arc-performSelector-leaks">>;
1431def warn_dealloc_in_category : Warning<
1432"-dealloc is being overridden in a category">,
1433InGroup<DeallocInCategory>;
1434def err_gc_weak_property_strong_type : Error<
1435  "weak attribute declared on a __strong type property in GC mode">;
1436def warn_arc_repeated_use_of_weak : Warning <
1437  "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1438  "accessed multiple times in this %select{function|method|block|lambda}2 "
1439  "but may be unpredictably set to nil; assign to a strong variable to keep "
1440  "the object alive">,
1441  InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1442def warn_implicitly_retains_self : Warning <
1443  "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1444  "this is intended behavior">,
1445  InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1446def warn_arc_possible_repeated_use_of_weak : Warning <
1447  "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1448  "be accessed multiple times in this %select{function|method|block|lambda}2 "
1449  "and may be unpredictably set to nil; assign to a strong variable to keep "
1450  "the object alive">,
1451  InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1452def note_arc_weak_also_accessed_here : Note<
1453  "also accessed here">;
1454def err_incomplete_synthesized_property : Error<
1455  "cannot synthesize property %0 with incomplete type %1">;
1456
1457def err_property_ivar_type : Error<
1458  "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1459def err_property_accessor_type : Error<
1460  "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1461def err_ivar_in_superclass_use : Error<
1462  "property %0 attempting to use instance variable %1 declared in super class %2">;
1463def err_weak_property : Error<
1464  "existing instance variable %1 for __weak property %0 must be __weak">;
1465def err_strong_property : Error<
1466  "existing instance variable %1 for strong property %0 may not be __weak">;
1467def err_dynamic_property_ivar_decl : Error<
1468  "dynamic property cannot have instance variable specification">;
1469def err_duplicate_ivar_use : Error<
1470  "synthesized properties %0 and %1 both claim instance variable %2">;
1471def err_property_implemented : Error<"property %0 is already implemented">;
1472def warn_objc_missing_super_call : Warning<
1473  "method possibly missing a [super %0] call">,
1474  InGroup<ObjCMissingSuperCalls>;
1475def err_dealloc_bad_result_type : Error<
1476  "dealloc return type must be correctly specified as 'void' under ARC, "
1477  "instead of %0">;
1478def warn_undeclared_selector : Warning<
1479  "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1480def warn_undeclared_selector_with_typo : Warning<
1481  "undeclared selector %0; did you mean %1?">,
1482  InGroup<UndeclaredSelector>, DefaultIgnore;
1483def warn_implicit_atomic_property : Warning<
1484  "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1485def note_auto_readonly_iboutlet_fixup_suggest : Note<
1486  "property should be changed to be readwrite">;
1487def warn_auto_readonly_iboutlet_property : Warning<
1488  "readonly IBOutlet property %0 when auto-synthesized may "
1489  "not work correctly with 'nib' loader">,
1490  InGroup<DiagGroup<"readonly-iboutlet-property">>;
1491def warn_auto_implicit_atomic_property : Warning<
1492  "property is assumed atomic when auto-synthesizing the property">,
1493  InGroup<ImplicitAtomic>, DefaultIgnore;
1494def warn_unimplemented_selector:  Warning<
1495  "no method with selector %0 is implemented in this translation unit">,
1496  InGroup<Selector>, DefaultIgnore;
1497def warn_unimplemented_protocol_method : Warning<
1498  "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1499def warn_multiple_selectors: Warning<
1500  "several methods with selector %0 of mismatched types are found "
1501  "for the @selector expression">,
1502  InGroup<SelectorTypeMismatch>, DefaultIgnore;
1503def err_direct_selector_expression : Error<
1504  "@selector expression formed with direct selector %0">;
1505def warn_potentially_direct_selector_expression : Warning<
1506  "@selector expression formed with potentially direct selector %0">,
1507  InGroup<ObjCPotentiallyDirectSelector>;
1508def warn_strict_potentially_direct_selector_expression : Warning<
1509  warn_potentially_direct_selector_expression.Summary>,
1510  InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore;
1511
1512def err_objc_kindof_nonobject : Error<
1513  "'__kindof' specifier cannot be applied to non-object type %0">;
1514def err_objc_kindof_wrong_position : Error<
1515  "'__kindof' type specifier must precede the declarator">;
1516
1517def err_objc_method_unsupported_param_ret_type : Error<
1518  "%0 %select{parameter|return}1 type is unsupported; "
1519  "support for vector types for this target is introduced in %2">;
1520
1521def warn_messaging_unqualified_id : Warning<
1522  "messaging unqualified id">, DefaultIgnore,
1523  InGroup<DiagGroup<"objc-messaging-id">>;
1524def err_messaging_unqualified_id_with_direct_method : Error<
1525  "messaging unqualified id with a method that is possibly direct">;
1526def err_messaging_super_with_direct_method : Error<
1527  "messaging super with a direct method">;
1528def err_messaging_class_with_direct_method : Error<
1529  "messaging a Class with a method that is possibly direct">;
1530
1531// C++ declarations
1532def err_static_assert_expression_is_not_constant : Error<
1533  "static assertion expression is not an integral constant expression">;
1534def err_constexpr_if_condition_expression_is_not_constant : Error<
1535  "constexpr if condition is not a constant expression">;
1536def err_static_assert_failed : Error<"static assertion failed%select{: %1|}0">;
1537def err_static_assert_requirement_failed : Error<
1538  "static assertion failed due to requirement '%0'%select{: %2|}1">;
1539def note_expr_evaluates_to : Note<
1540  "expression evaluates to '%0 %1 %2'">;
1541
1542def warn_consteval_if_always_true : Warning<
1543  "consteval if is always true in an %select{unevaluated|immediate}0 context">,
1544  InGroup<DiagGroup<"redundant-consteval-if">>;
1545
1546def ext_inline_variable : ExtWarn<
1547  "inline variables are a C++17 extension">, InGroup<CXX17>;
1548def warn_cxx14_compat_inline_variable : Warning<
1549  "inline variables are incompatible with C++ standards before C++17">,
1550  DefaultIgnore, InGroup<CXXPre17Compat>;
1551
1552def warn_inline_namespace_reopened_noninline : Warning<
1553  "inline namespace reopened as a non-inline namespace">,
1554  InGroup<InlineNamespaceReopenedNoninline>;
1555def err_inline_namespace_mismatch : Error<
1556  "non-inline namespace cannot be reopened as inline">;
1557
1558def err_unexpected_friend : Error<
1559  "friends can only be classes or functions">;
1560def ext_enum_friend : ExtWarn<
1561  "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1562def warn_cxx98_compat_enum_friend : Warning<
1563  "befriending enumeration type %0 is incompatible with C++98">,
1564  InGroup<CXX98Compat>, DefaultIgnore;
1565def ext_nonclass_type_friend : ExtWarn<
1566  "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1567def warn_cxx98_compat_nonclass_type_friend : Warning<
1568  "non-class friend type %0 is incompatible with C++98">,
1569  InGroup<CXX98Compat>, DefaultIgnore;
1570def err_friend_is_member : Error<
1571  "friends cannot be members of the declaring class">;
1572def warn_cxx98_compat_friend_is_member : Warning<
1573  "friend declaration naming a member of the declaring class is incompatible "
1574  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1575def ext_unelaborated_friend_type : ExtWarn<
1576  "unelaborated friend declaration is a C++11 extension; specify "
1577  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1578  InGroup<CXX11>;
1579def warn_cxx98_compat_unelaborated_friend_type : Warning<
1580  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1581  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1582def err_qualified_friend_no_match : Error<
1583  "friend declaration of %0 does not match any declaration in %1">;
1584def err_introducing_special_friend : Error<
1585  "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1586  " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1587  "as a friend">;
1588def err_tagless_friend_type_template : Error<
1589  "friend type templates must use an elaborated type">;
1590def err_no_matching_local_friend : Error<
1591  "no matching function found in local scope">;
1592def err_no_matching_local_friend_suggest : Error<
1593  "no matching function %0 found in local scope; did you mean %3?">;
1594def err_partial_specialization_friend : Error<
1595  "partial specialization cannot be declared as a friend">;
1596def err_qualified_friend_def : Error<
1597  "friend function definition cannot be qualified with '%0'">;
1598def err_friend_def_in_local_class : Error<
1599  "friend function cannot be defined in a local class">;
1600def err_friend_not_first_in_declaration : Error<
1601  "'friend' must appear first in a non-function declaration">;
1602def err_using_decl_friend : Error<
1603  "cannot befriend target of using declaration">;
1604def warn_template_qualified_friend_unsupported : Warning<
1605  "dependent nested name specifier '%0' for friend class declaration is "
1606  "not supported; turning off access control for %1">,
1607  InGroup<UnsupportedFriend>;
1608def warn_template_qualified_friend_ignored : Warning<
1609  "dependent nested name specifier '%0' for friend template declaration is "
1610  "not supported; ignoring this friend declaration">,
1611  InGroup<UnsupportedFriend>;
1612def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1613  "unqualified friend declaration referring to type outside of the nearest "
1614  "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1615  InGroup<MicrosoftUnqualifiedFriend>;
1616def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1617
1618def err_invalid_base_in_interface : Error<
1619  "interface type cannot inherit from "
1620  "%select{struct|non-public interface|class}0 %1">;
1621
1622def err_abstract_type_in_decl : Error<
1623  "%select{return|parameter|variable|field|instance variable|"
1624  "synthesized instance variable}0 type %1 is an abstract class">;
1625def err_allocation_of_abstract_type : Error<
1626  "allocating an object of abstract class type %0">;
1627def err_throw_abstract_type : Error<
1628  "cannot throw an object of abstract type %0">;
1629def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1630def err_capture_of_abstract_type : Error<
1631  "by-copy capture of value of abstract type %0">;
1632def err_capture_of_incomplete_or_sizeless_type : Error<
1633  "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">;
1634def err_capture_default_non_local : Error<
1635  "non-local lambda expression cannot have a capture-default">;
1636
1637def err_multiple_final_overriders : Error<
1638  "virtual function %q0 has more than one final overrider in %1">;
1639def note_final_overrider : Note<"final overrider of %q0 in %1">;
1640
1641def err_type_defined_in_type_specifier : Error<
1642  "%0 cannot be defined in a type specifier">;
1643def err_type_defined_in_result_type : Error<
1644  "%0 cannot be defined in the result type of a function">;
1645def err_type_defined_in_param_type : Error<
1646  "%0 cannot be defined in a parameter type">;
1647def err_type_defined_in_alias_template : Error<
1648  "%0 cannot be defined in a type alias template">;
1649def err_type_defined_in_condition : Error<
1650  "%0 cannot be defined in a condition">;
1651def err_type_defined_in_enum : Error<
1652  "%0 cannot be defined in an enumeration">;
1653def ext_type_defined_in_offsetof : Extension<
1654  "defining a type within '%select{__builtin_offsetof|offsetof}0' is a Clang "
1655  "extension">, InGroup<GNUOffsetofExtensions>;
1656
1657def note_pure_virtual_function : Note<
1658  "unimplemented pure virtual method %0 in %1">;
1659
1660def note_pure_qualified_call_kext : Note<
1661  "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1662
1663def err_deleted_decl_not_first : Error<
1664  "deleted definition must be first declaration">;
1665
1666def err_deleted_override : Error<
1667  "deleted function %0 cannot override a non-deleted function">;
1668def err_non_deleted_override : Error<
1669  "non-deleted function %0 cannot override a deleted function">;
1670def err_consteval_override : Error<
1671  "consteval function %0 cannot override a non-consteval function">;
1672def err_non_consteval_override : Error<
1673  "non-consteval function %0 cannot override a consteval function">;
1674
1675def warn_weak_vtable : Warning<
1676  "%0 has no out-of-line virtual method definitions; its vtable will be "
1677  "emitted in every translation unit">,
1678  InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1679def warn_weak_template_vtable : Warning<
1680  "this warning is no longer in use and will be removed in the next release">,
1681  InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1682
1683def ext_using_undefined_std : ExtWarn<
1684  "using directive refers to implicitly-defined namespace 'std'">;
1685
1686// C++ exception specifications
1687def err_exception_spec_in_typedef : Error<
1688  "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1689def err_distant_exception_spec : Error<
1690  "exception specifications are not allowed beyond a single level "
1691  "of indirection">;
1692def err_incomplete_in_exception_spec : Error<
1693  "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1694  "in exception specification">;
1695def err_sizeless_in_exception_spec : Error<
1696  "%select{|reference to }0sizeless type %1 is not allowed "
1697  "in exception specification">;
1698def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Summary>,
1699  InGroup<MicrosoftExceptionSpec>;
1700def err_rref_in_exception_spec : Error<
1701  "rvalue reference type %0 is not allowed in exception specification">;
1702def err_mismatched_exception_spec : Error<
1703  "exception specification in declaration does not match previous declaration">;
1704def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Summary>,
1705  InGroup<MicrosoftExceptionSpec>;
1706def err_override_exception_spec : Error<
1707  "exception specification of overriding function is more lax than "
1708  "base version">;
1709def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Summary>,
1710  InGroup<MicrosoftExceptionSpec>;
1711def err_incompatible_exception_specs : Error<
1712  "target exception specification is not superset of source">;
1713def warn_incompatible_exception_specs : Warning<
1714  err_incompatible_exception_specs.Summary>, InGroup<IncompatibleExceptionSpec>;
1715def err_deep_exception_specs_differ : Error<
1716  "exception specifications of %select{return|argument}0 types differ">;
1717def warn_deep_exception_specs_differ : Warning<
1718  err_deep_exception_specs_differ.Summary>, InGroup<IncompatibleExceptionSpec>;
1719def err_missing_exception_specification : Error<
1720  "%0 is missing exception specification '%1'">;
1721def ext_missing_exception_specification : ExtWarn<
1722  err_missing_exception_specification.Summary>,
1723  InGroup<DiagGroup<"missing-exception-spec">>;
1724def err_exception_spec_not_parsed : Error<
1725  "exception specification is not available until end of class definition">;
1726def err_exception_spec_cycle : Error<
1727  "exception specification of %0 uses itself">;
1728def err_exception_spec_incomplete_type : Error<
1729  "exception specification needed for member of incomplete class %0">;
1730def warn_wasm_dynamic_exception_spec_ignored : ExtWarn<
1731  "dynamic exception specifications with types are currently ignored in wasm">,
1732  InGroup<WebAssemblyExceptionSpec>;
1733
1734// C++ access checking
1735def err_class_redeclared_with_different_access : Error<
1736  "%0 redeclared with '%1' access">;
1737def err_access : Error<
1738  "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1739def ext_ms_using_declaration_inaccessible : ExtWarn<
1740  "using declaration referring to inaccessible member '%0' (which refers "
1741  "to accessible member '%1') is a Microsoft compatibility extension">,
1742    AccessControl, InGroup<MicrosoftUsingDecl>;
1743def err_access_ctor : Error<
1744  "calling a %select{private|protected}0 constructor of class %2">,
1745  AccessControl;
1746def ext_rvalue_to_reference_access_ctor : Extension<
1747  "C++98 requires an accessible copy constructor for class %2 when binding "
1748  "a reference to a temporary; was %select{private|protected}0">,
1749  AccessControl, InGroup<BindToTemporaryCopy>;
1750def err_access_base_ctor : Error<
1751  // The ERRORs represent other special members that aren't constructors, in
1752  // hopes that someone will bother noticing and reporting if they appear
1753  "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1754  "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1755  "|*ERROR*|}2constructor">, AccessControl;
1756def err_access_field_ctor : Error<
1757  // The ERRORs represent other special members that aren't constructors, in
1758  // hopes that someone will bother noticing and reporting if they appear
1759  "field of type %0 has %select{private|protected}2 "
1760  "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1761  AccessControl;
1762def err_access_friend_function : Error<
1763  "friend function %1 is a %select{private|protected}0 member of %3">,
1764  AccessControl;
1765
1766def err_access_dtor : Error<
1767  "calling a %select{private|protected}1 destructor of class %0">,
1768  AccessControl;
1769def err_access_dtor_base :
1770    Error<"base class %0 has %select{private|protected}1 destructor">,
1771    AccessControl;
1772def err_access_dtor_vbase :
1773    Error<"inherited virtual base class %1 has "
1774    "%select{private|protected}2 destructor">,
1775    AccessControl;
1776def err_access_dtor_temp :
1777    Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1778    AccessControl;
1779def err_access_dtor_exception :
1780    Error<"exception object of type %0 has %select{private|protected}1 "
1781          "destructor">, AccessControl;
1782def err_access_dtor_field :
1783    Error<"field of type %1 has %select{private|protected}2 destructor">,
1784    AccessControl;
1785def err_access_dtor_var :
1786    Error<"variable of type %1 has %select{private|protected}2 destructor">,
1787    AccessControl;
1788def err_access_dtor_ivar :
1789    Error<"instance variable of type %0 has %select{private|protected}1 "
1790          "destructor">,
1791    AccessControl;
1792def note_previous_access_declaration : Note<
1793  "previously declared '%1' here">;
1794def note_access_natural : Note<
1795  "%select{|implicitly }1declared %select{private|protected}0 here">;
1796def note_access_constrained_by_path : Note<
1797  "constrained by %select{|implicitly }1%select{private|protected}0"
1798  " inheritance here">;
1799def note_access_protected_restricted_noobject : Note<
1800  "must name member using the type of the current context %0">;
1801def note_access_protected_restricted_ctordtor : Note<
1802  "protected %select{constructor|destructor}0 can only be used to "
1803  "%select{construct|destroy}0 a base class subobject">;
1804def note_access_protected_restricted_object : Note<
1805  "can only access this member on an object of type %0">;
1806def warn_cxx98_compat_sfinae_access_control : Warning<
1807  "substitution failure due to access control is incompatible with C++98">,
1808  InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1809
1810// C++ name lookup
1811def err_incomplete_nested_name_spec : Error<
1812  "incomplete type %0 named in nested name specifier">;
1813def err_incomplete_enum : Error<
1814  "enumeration %0 is incomplete">;
1815def err_dependent_nested_name_spec : Error<
1816  "nested name specifier for a declaration cannot depend on a template "
1817  "parameter">;
1818def err_nested_name_member_ref_lookup_ambiguous : Error<
1819  "lookup of %0 in member access expression is ambiguous">;
1820def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1821  "lookup of %0 in member access expression is ambiguous; using member of %1">,
1822  InGroup<AmbigMemberTemplate>;
1823def note_ambig_member_ref_object_type : Note<
1824  "lookup in the object type %0 refers here">;
1825def note_ambig_member_ref_scope : Note<
1826  "lookup from the current scope refers here">;
1827def err_qualified_member_nonclass : Error<
1828  "qualified member access refers to a member in %0">;
1829def err_incomplete_member_access : Error<
1830  "member access into incomplete type %0">;
1831def err_incomplete_type : Error<
1832  "incomplete type %0 where a complete type is required">;
1833def warn_cxx98_compat_enum_nested_name_spec : Warning<
1834  "enumeration type in nested name specifier is incompatible with C++98">,
1835  InGroup<CXX98Compat>, DefaultIgnore;
1836def err_nested_name_spec_is_not_class : Error<
1837  "%0 cannot appear before '::' because it is not a class"
1838  "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1839def ext_nested_name_spec_is_enum : ExtWarn<
1840  "use of enumeration in a nested name specifier is a C++11 extension">,
1841  InGroup<CXX11>;
1842def err_out_of_line_qualified_id_type_names_constructor : Error<
1843  "qualified reference to %0 is a constructor name rather than a "
1844  "%select{template name|type}1 in this context">;
1845def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1846  "ISO C++ specifies that "
1847  "qualified reference to %0 is a constructor name rather than a "
1848  "%select{template name|type}1 in this context, despite preceding "
1849  "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1850  InGroup<DiagGroup<"injected-class-name">>;
1851
1852// C++ class members
1853def err_storageclass_invalid_for_member : Error<
1854  "storage class specified for a member declaration">;
1855def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1856def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1857def ext_mutable_reference : ExtWarn<
1858  "'mutable' on a reference type is a Microsoft extension">,
1859  InGroup<MicrosoftMutableReference>;
1860def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1861def err_mutable_nonmember : Error<
1862  "'mutable' can only be applied to member variables">;
1863def err_virtual_in_union : Error<
1864  "unions cannot have virtual functions">;
1865def err_virtual_non_function : Error<
1866  "'virtual' can only appear on non-static member functions">;
1867def err_virtual_out_of_class : Error<
1868  "'virtual' can only be specified inside the class definition">;
1869def err_virtual_member_function_template : Error<
1870  "'virtual' cannot be specified on member function templates">;
1871def err_static_overrides_virtual : Error<
1872  "'static' member function %0 overrides a virtual function in a base class">;
1873def err_explicit_non_function : Error<
1874  "'explicit' can only appear on non-static member functions">;
1875def err_explicit_out_of_class : Error<
1876  "'explicit' can only be specified inside the class definition">;
1877def err_explicit_non_ctor_or_conv_function : Error<
1878  "'explicit' can only be applied to a constructor or conversion function">;
1879def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1880def err_static_out_of_line : Error<
1881  "'static' can only be specified inside the class definition">;
1882def ext_static_out_of_line : ExtWarn<
1883  err_static_out_of_line.Summary>,
1884  InGroup<MicrosoftTemplate>;
1885def err_storage_class_for_static_member : Error<
1886  "static data member definition cannot specify a storage class">;
1887def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1888def err_not_integral_type_bitfield : Error<
1889  "bit-field %0 has non-integral type %1">;
1890def err_not_integral_type_anon_bitfield : Error<
1891  "anonymous bit-field has non-integral type %0">;
1892def err_anon_bitfield_qualifiers : Error<
1893  "anonymous bit-field cannot have qualifiers">;
1894def err_member_function_initialization : Error<
1895  "initializer on function does not look like a pure-specifier">;
1896def err_non_virtual_pure : Error<
1897  "%0 is not virtual and cannot be declared pure">;
1898def ext_pure_function_definition : ExtWarn<
1899  "function definition with pure-specifier is a Microsoft extension">,
1900  InGroup<MicrosoftPureDefinition>;
1901def err_qualified_member_of_unrelated : Error<
1902  "%q0 is not a member of class %1">;
1903
1904def err_member_function_call_bad_cvr : Error<
1905  "'this' argument to member function %0 has type %1, but function is not marked "
1906  "%select{const|restrict|const or restrict|volatile|const or volatile|"
1907  "volatile or restrict|const, volatile, or restrict}2">;
1908def err_member_function_call_bad_ref : Error<
1909  "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1910  "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1911def err_member_function_call_bad_type : Error<
1912  "cannot initialize object parameter of type %0 with an expression "
1913  "of type %1">;
1914
1915def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1916  "call to pure virtual member function %0 has undefined behavior; "
1917  "overrides of %0 in subclasses are not available in the "
1918  "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
1919
1920def select_special_member_kind : TextSubstitution<
1921  "%select{default constructor|copy constructor|move constructor|"
1922  "copy assignment operator|move assignment operator|destructor}0">;
1923
1924def note_member_declared_at : Note<"member is declared here">;
1925def note_ivar_decl : Note<"instance variable is declared here">;
1926def note_bitfield_decl : Note<"bit-field is declared here">;
1927def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1928def note_member_synthesized_at : Note<
1929  "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 "
1930  "first required here">;
1931def note_comparison_synthesized_at : Note<
1932  "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 "
1933  "first required here">;
1934def err_missing_default_ctor : Error<
1935  "%select{constructor for %1 must explicitly initialize the|"
1936  "implicit default constructor for %1 must explicitly initialize the|"
1937  "cannot use constructor inherited from base class %4;}0 "
1938  "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1939  "does not have a default constructor">;
1940def note_due_to_dllexported_class : Note<
1941  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1942
1943def err_illegal_union_or_anon_struct_member : Error<
1944  "%select{anonymous struct|union}0 member %1 has a non-trivial "
1945  "%sub{select_special_member_kind}2">;
1946
1947def warn_frame_address : Warning<
1948  "calling '%0' with a nonzero argument is unsafe">,
1949  InGroup<FrameAddress>, DefaultIgnore;
1950
1951def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1952  "%select{anonymous struct|union}0 member %1 with a non-trivial "
1953  "%sub{select_special_member_kind}2 is incompatible with C++98">,
1954  InGroup<CXX98Compat>, DefaultIgnore;
1955
1956def note_nontrivial_virtual_dtor : Note<
1957  "destructor for %0 is not trivial because it is virtual">;
1958def note_nontrivial_has_virtual : Note<
1959  "because type %0 has a virtual %select{member function|base class}1">;
1960def note_nontrivial_no_def_ctor : Note<
1961  "because %select{base class of |field of |}0type %1 has no "
1962  "default constructor">;
1963def note_user_declared_ctor : Note<
1964  "implicit default constructor suppressed by user-declared constructor">;
1965def note_nontrivial_no_copy : Note<
1966  "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1967  "assignment operator|<<ERROR>>}2 can be used to "
1968  "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1969  "%select{base class|field|an object}0 of type %3">;
1970def note_nontrivial_user_provided : Note<
1971  "because %select{base class of |field of |}0type %1 has a user-provided "
1972  "%sub{select_special_member_kind}2">;
1973def note_nontrivial_default_member_init : Note<
1974  "because field %0 has an initializer">;
1975def note_nontrivial_param_type : Note<
1976  "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1977def note_nontrivial_default_arg : Note<"because it has a default argument">;
1978def note_nontrivial_variadic : Note<"because it is a variadic function">;
1979def note_nontrivial_subobject : Note<
1980  "because the function selected to %select{construct|copy|move|copy|move|"
1981  "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1982def note_nontrivial_objc_ownership : Note<
1983  "because type %0 has a member with %select{no|no|__strong|__weak|"
1984  "__autoreleasing}1 ownership">;
1985
1986/// Selector for a TagTypeKind value.
1987def select_tag_type_kind : TextSubstitution<
1988  "%select{struct|interface|union|class|enum}0">;
1989
1990def err_static_data_member_not_allowed_in_anon_struct : Error<
1991  "static data member %0 not allowed in anonymous "
1992  "%sub{select_tag_type_kind}1">;
1993def ext_static_data_member_in_union : ExtWarn<
1994  "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1995def warn_cxx98_compat_static_data_member_in_union : Warning<
1996  "static data member %0 in union is incompatible with C++98">,
1997  InGroup<CXX98Compat>, DefaultIgnore;
1998def ext_union_member_of_reference_type : ExtWarn<
1999  "union member %0 has reference type %1, which is a Microsoft extension">,
2000  InGroup<MicrosoftUnionMemberReference>;
2001def err_union_member_of_reference_type : Error<
2002  "union member %0 has reference type %1">;
2003def ext_anonymous_struct_union_qualified : Extension<
2004  "anonymous %select{struct|union}0 cannot be '%1'">;
2005def err_different_return_type_for_overriding_virtual_function : Error<
2006  "virtual function %0 has a different return type "
2007  "%diff{($) than the function it overrides (which has return type $)|"
2008  "than the function it overrides}1,2">;
2009def note_overridden_virtual_function : Note<
2010  "overridden virtual function is here">;
2011def err_conflicting_overriding_cc_attributes : Error<
2012  "virtual function %0 has different calling convention attributes "
2013  "%diff{($) than the function it overrides (which has calling convention $)|"
2014  "than the function it overrides}1,2">;
2015def warn_overriding_method_missing_noescape : Warning<
2016  "parameter of overriding method should be annotated with "
2017  "__attribute__((noescape))">, InGroup<MissingNoEscape>;
2018def note_overridden_marked_noescape : Note<
2019  "parameter of overridden method is annotated with __attribute__((noescape))">;
2020def note_cat_conform_to_noescape_prot : Note<
2021  "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
2022
2023def err_covariant_return_inaccessible_base : Error<
2024  "invalid covariant return for virtual function: %1 is a "
2025  "%select{private|protected}2 base class of %0">, AccessControl;
2026def err_covariant_return_ambiguous_derived_to_base_conv : Error<
2027  "return type of virtual function %3 is not covariant with the return type of "
2028  "the function it overrides (ambiguous conversion from derived class "
2029  "%0 to base class %1:%2)">;
2030def err_covariant_return_not_derived : Error<
2031  "return type of virtual function %0 is not covariant with the return type of "
2032  "the function it overrides (%1 is not derived from %2)">;
2033def err_covariant_return_incomplete : Error<
2034  "return type of virtual function %0 is not covariant with the return type of "
2035  "the function it overrides (%1 is incomplete)">;
2036def err_covariant_return_type_different_qualifications : Error<
2037  "return type of virtual function %0 is not covariant with the return type of "
2038  "the function it overrides (%1 has different qualifiers than %2)">;
2039def err_covariant_return_type_class_type_more_qualified : Error<
2040  "return type of virtual function %0 is not covariant with the return type of "
2041  "the function it overrides (class type %1 is more qualified than class "
2042  "type %2">;
2043
2044// C++ implicit special member functions
2045def note_in_declaration_of_implicit_special_member : Note<
2046  "while declaring the implicit %sub{select_special_member_kind}1"
2047  " for %0">;
2048
2049// C++ constructors
2050def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
2051def err_invalid_qualified_constructor : Error<
2052  "'%0' qualifier is not allowed on a constructor">;
2053def err_ref_qualifier_constructor : Error<
2054  "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
2055
2056def err_constructor_return_type : Error<
2057  "constructor cannot have a return type">;
2058def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
2059def err_constructor_byvalue_arg : Error<
2060  "copy constructor must pass its first argument by reference">;
2061def warn_no_constructor_for_refconst : Warning<
2062  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
2063  "constructor to initialize its non-modifiable members">;
2064def note_refconst_member_not_initialized : Note<
2065  "%select{const|reference}0 member %1 will never be initialized">;
2066def ext_ms_explicit_constructor_call : ExtWarn<
2067  "explicit constructor calls are a Microsoft extension">,
2068  InGroup<MicrosoftExplicitConstructorCall>;
2069
2070// C++ destructors
2071def err_destructor_not_member : Error<
2072  "destructor must be a non-static member function">;
2073def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
2074def err_invalid_qualified_destructor : Error<
2075  "'%0' qualifier is not allowed on a destructor">;
2076def err_ref_qualifier_destructor : Error<
2077  "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
2078def err_destructor_return_type : Error<"destructor cannot have a return type">;
2079def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
2080def err_destructor_with_params : Error<"destructor cannot have any parameters">;
2081def err_destructor_variadic : Error<"destructor cannot be variadic">;
2082def ext_destructor_typedef_name : ExtWarn<
2083  "destructor cannot be declared using a %select{typedef|type alias}1 %0 "
2084  "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>;
2085def err_undeclared_destructor_name : Error<
2086  "undeclared identifier %0 in destructor name">;
2087def err_destructor_name : Error<
2088  "expected the class name after '~' to name the enclosing class">;
2089def err_destructor_name_nontype : Error<
2090  "identifier %0 after '~' in destructor name does not name a type">;
2091def err_destructor_expr_mismatch : Error<
2092  "identifier %0 in object destruction expression does not name the type "
2093  "%1 of the object being destroyed">;
2094def err_destructor_expr_nontype : Error<
2095  "identifier %0 in object destruction expression does not name a type">;
2096def err_destructor_expr_type_mismatch : Error<
2097  "destructor type %0 in object destruction expression does not match the "
2098  "type %1 of the object being destroyed">;
2099def note_destructor_type_here : Note<
2100  "type %0 found by destructor name lookup">;
2101def note_destructor_nontype_here : Note<
2102  "non-type declaration found by destructor name lookup">;
2103def ext_dtor_named_in_wrong_scope : Extension<
2104  "ISO C++ requires the name after '::~' to be found in the same scope as "
2105  "the name before '::~'">, InGroup<DtorName>;
2106def ext_qualified_dtor_named_in_lexical_scope : ExtWarn<
2107  "qualified destructor name only found in lexical scope; omit the qualifier "
2108  "to find this type name by unqualified lookup">, InGroup<DtorName>;
2109def ext_dtor_name_ambiguous : Extension<
2110  "ISO C++ considers this destructor name lookup to be ambiguous">,
2111  InGroup<DtorName>;
2112
2113def err_destroy_attr_on_non_static_var : Error<
2114  "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
2115  " variable with static or thread storage duration">;
2116
2117def err_destructor_template : Error<
2118  "destructor cannot be declared as a template">;
2119
2120// C++ initialization
2121def err_init_conversion_failed : Error<
2122  "cannot initialize %select{a variable|a parameter|template parameter|"
2123  "return object|statement expression result|an "
2124  "exception object|a member subobject|an array element|a new value|a value|a "
2125  "base class|a constructor delegation|a vector element|a block element|a "
2126  "block element|a complex element|a lambda capture|a compound literal "
2127  "initializer|a related result|a parameter of CF audited function}0 "
2128  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2129  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2130  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2131  "|: different number of parameters (%5 vs %6)"
2132  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2133  "|: different return type%diff{ ($ vs $)|}5,6"
2134  "|: different qualifiers (%5 vs %6)"
2135  "|: different exception specifications}4">;
2136def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2137  "declared here; conversion would be valid if it was derived from %1">;
2138
2139def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2140  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2141def err_lvalue_reference_bind_to_initlist : Error<
2142  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2143  "initializer list temporary">;
2144def err_lvalue_reference_bind_to_temporary : Error<
2145  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2146  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2147def err_lvalue_reference_bind_to_unrelated : Error<
2148  "%select{non-const|volatile}0 lvalue reference "
2149  "%diff{to type $ cannot bind to a value of unrelated type $|"
2150  "cannot bind to a value of unrelated type}1,2">;
2151def err_reference_bind_drops_quals : Error<
2152  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2153  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2154  "not permitted due to incompatible qualifiers}2">;
2155def err_reference_bind_failed : Error<
2156  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2157  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2158  "incompatible type}0,3">;
2159def err_reference_bind_temporary_addrspace : Error<
2160  "reference of type %0 cannot bind to a temporary object because of "
2161  "address space mismatch">;
2162def err_reference_bind_init_list : Error<
2163  "reference to type %0 cannot bind to an initializer list">;
2164def err_init_list_bad_dest_type : Error<
2165  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2166  "list">;
2167def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2168  "aggregate initialization of type %0 with user-declared constructors "
2169  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2170def warn_cxx17_compat_aggregate_init_paren_list : Warning<
2171  "aggregate initialization of type %0 from a parenthesized list of values "
2172  "is a C++20 extension">, DefaultIgnore, InGroup<CXX20>;
2173
2174def err_reference_bind_to_bitfield : Error<
2175  "%select{non-const|volatile}0 reference cannot bind to "
2176  "bit-field%select{| %1}2">;
2177def err_reference_bind_to_vector_element : Error<
2178  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2179def err_reference_bind_to_matrix_element : Error<
2180  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2181def err_reference_var_requires_init : Error<
2182  "declaration of reference variable %0 requires an initializer">;
2183def err_reference_without_init : Error<
2184  "reference to type %0 requires an initializer">;
2185def note_value_initialization_here : Note<
2186  "in value-initialization of type %0 here">;
2187def err_reference_has_multiple_inits : Error<
2188  "reference cannot be initialized with multiple values">;
2189def err_init_non_aggr_init_list : Error<
2190  "initialization of non-aggregate type %0 with an initializer list">;
2191def err_init_reference_member_uninitialized : Error<
2192  "reference member of type %0 uninitialized">;
2193def note_uninit_reference_member : Note<
2194  "uninitialized reference member is here">;
2195def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2196  InGroup<Uninitialized>;
2197def warn_base_class_is_uninit : Warning<
2198  "base class %0 is uninitialized when used here to access %q1">,
2199  InGroup<Uninitialized>;
2200def warn_reference_field_is_uninit : Warning<
2201  "reference %0 is not yet bound to a value when used here">,
2202  InGroup<Uninitialized>;
2203def note_uninit_in_this_constructor : Note<
2204  "during field initialization in %select{this|the implicit default}0 "
2205  "constructor">;
2206def warn_static_self_reference_in_init : Warning<
2207  "static variable %0 is suspiciously used within its own initialization">,
2208  InGroup<UninitializedStaticSelfInit>;
2209def warn_uninit_self_reference_in_init : Warning<
2210  "variable %0 is uninitialized when used within its own initialization">,
2211  InGroup<Uninitialized>;
2212def warn_uninit_self_reference_in_reference_init : Warning<
2213  "reference %0 is not yet bound to a value when used within its own"
2214  " initialization">,
2215  InGroup<Uninitialized>;
2216def warn_uninit_var : Warning<
2217  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2218  InGroup<Uninitialized>, DefaultIgnore;
2219def warn_sometimes_uninit_var : Warning<
2220  "variable %0 is %select{used|captured}1 uninitialized whenever "
2221  "%select{'%3' condition is %select{true|false}4|"
2222  "'%3' loop %select{is entered|exits because its condition is false}4|"
2223  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2224  "switch %3 is taken|"
2225  "its declaration is reached|"
2226  "%3 is called}2">,
2227  InGroup<UninitializedSometimes>, DefaultIgnore;
2228def warn_maybe_uninit_var : Warning<
2229  "variable %0 may be uninitialized when "
2230  "%select{used here|captured by block}1">,
2231  InGroup<UninitializedMaybe>, DefaultIgnore;
2232def note_var_declared_here : Note<"variable %0 is declared here">;
2233def note_uninit_var_use : Note<
2234  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2235def warn_uninit_byref_blockvar_captured_by_block : Warning<
2236  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2237  "block">, InGroup<Uninitialized>, DefaultIgnore;
2238def note_block_var_fixit_add_initialization : Note<
2239  "did you mean to use __block %0?">;
2240def note_in_omitted_aggregate_initializer : Note<
2241  "in implicit initialization of %select{"
2242  "array element %1 with omitted initializer|"
2243  "field %1 with omitted initializer|"
2244  "trailing array elements in runtime-sized array new}0">;
2245def note_in_reference_temporary_list_initializer : Note<
2246  "in initialization of temporary of type %0 created to "
2247  "list-initialize this reference">;
2248def note_var_fixit_add_initialization : Note<
2249  "initialize the variable %0 to silence this warning">;
2250def note_uninit_fixit_remove_cond : Note<
2251  "remove the %select{'%1' if its condition|condition if it}0 "
2252  "is always %select{false|true}2">;
2253def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2254def err_list_init_in_parens : Error<
2255  "cannot initialize %select{non-class|reference}0 type %1 with a "
2256  "parenthesized initializer list">;
2257
2258def warn_uninit_const_reference : Warning<
2259  "variable %0 is uninitialized when passed as a const reference argument "
2260  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2261
2262def warn_unsequenced_mod_mod : Warning<
2263  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2264def warn_unsequenced_mod_use : Warning<
2265  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2266
2267def select_initialized_entity_kind : TextSubstitution<
2268  "%select{copying variable|copying parameter|initializing template parameter|"
2269  "returning object|initializing statement expression result|"
2270  "throwing object|copying member subobject|copying array element|"
2271  "allocating object|copying temporary|initializing base subobject|"
2272  "initializing vector element|capturing value}0">;
2273
2274def err_temp_copy_no_viable : Error<
2275  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2276def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2277  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2278  "C++98 requires a copy constructor when binding a reference to a temporary">,
2279  InGroup<BindToTemporaryCopy>;
2280def err_temp_copy_ambiguous : Error<
2281  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2282  "of type %1">;
2283def err_temp_copy_deleted : Error<
2284  "%sub{select_initialized_entity_kind}0 of type %1 "
2285  "invokes deleted constructor">;
2286def err_temp_copy_incomplete : Error<
2287  "copying a temporary object of incomplete type %0">;
2288def warn_cxx98_compat_temp_copy : Warning<
2289  "%sub{select_initialized_entity_kind}1 "
2290  "of type %2 when binding a reference to a temporary would %select{invoke "
2291  "an inaccessible constructor|find no viable constructor|find ambiguous "
2292  "constructors|invoke a deleted constructor}0 in C++98">,
2293  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2294def err_selected_explicit_constructor : Error<
2295  "chosen constructor is explicit in copy-initialization">;
2296def note_explicit_ctor_deduction_guide_here : Note<
2297  "explicit %select{constructor|deduction guide}0 declared here">;
2298
2299// C++11 decltype
2300def err_decltype_in_declarator : Error<
2301    "'decltype' cannot be used to name a declaration">;
2302
2303// C++11 auto
2304def warn_cxx98_compat_auto_type_specifier : Warning<
2305  "'auto' type specifier is incompatible with C++98">,
2306  InGroup<CXX98Compat>, DefaultIgnore;
2307def err_auto_variable_cannot_appear_in_own_initializer : Error<
2308  "variable %0 declared with deduced type %1 "
2309  "cannot appear in its own initializer">;
2310def err_binding_cannot_appear_in_own_initializer : Error<
2311  "binding %0 cannot appear in the initializer of its own "
2312  "decomposition declaration">;
2313def err_illegal_decl_array_of_auto : Error<
2314  "'%0' declared as array of %1">;
2315def err_new_array_of_auto : Error<
2316  "cannot allocate array of 'auto'">;
2317def err_auto_not_allowed : Error<
2318  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2319  "use of "
2320  "%select{class template|function template|variable template|alias template|"
2321  "template template parameter|concept|template}2 %3 requires template "
2322  "arguments; argument deduction}0 not allowed "
2323  "%select{in function prototype"
2324  "|in non-static struct member|in struct member"
2325  "|in non-static union member|in union member"
2326  "|in non-static class member|in interface member"
2327  "|in exception declaration|in template parameter until C++17|in block literal"
2328  "|in template argument|in typedef|in type alias|in function return type"
2329  "|in conversion function type|here|in lambda parameter"
2330  "|in type allocated by 'new'|in K&R-style function parameter"
2331  "|in template parameter|in friend declaration|in function prototype that is "
2332  "not a function declaration|in requires expression parameter}1">;
2333def err_dependent_deduced_tst : Error<
2334  "typename specifier refers to "
2335  "%select{class template|function template|variable template|alias template|"
2336  "template template parameter|template}0 member in %1; "
2337  "argument deduction not allowed here">;
2338def err_deduced_tst : Error<
2339  "typename specifier refers to "
2340  "%select{class template|function template|variable template|alias template|"
2341  "template template parameter|template}0; argument deduction not allowed "
2342  "here">;
2343def err_auto_not_allowed_var_inst : Error<
2344  "'auto' variable template instantiation is not allowed">;
2345def err_auto_var_requires_init : Error<
2346  "declaration of variable %0 with deduced type %1 requires an initializer">;
2347def err_auto_new_requires_ctor_arg : Error<
2348  "new expression for type %0 requires a constructor argument">;
2349def ext_auto_new_list_init : Extension<
2350  "ISO C++ standards before C++17 do not allow new expression for "
2351  "type %0 to use list-initialization">, InGroup<CXX17>;
2352def err_auto_var_init_no_expression : Error<
2353  "initializer for variable %0 with type %1 is empty">;
2354def err_auto_expr_init_no_expression : Error<
2355  "initializer for functional-style cast to %0 is empty">;
2356def err_auto_var_init_multiple_expressions : Error<
2357  "initializer for variable %0 with type %1 contains multiple expressions">;
2358def err_auto_expr_init_multiple_expressions : Error<
2359  "initializer for functional-style cast to %0 contains multiple expressions">;
2360def err_auto_var_init_paren_braces : Error<
2361  "cannot deduce type for variable %1 with type %2 from "
2362  "%select{parenthesized|nested}0 initializer list">;
2363def err_auto_new_ctor_multiple_expressions : Error<
2364  "new expression for type %0 contains multiple constructor arguments">;
2365def err_auto_expr_init_paren_braces : Error<
2366  "cannot deduce actual type for %1 from "
2367  "%select{parenthesized|nested}0 initializer list">;
2368def warn_cxx20_compat_auto_expr : Warning<
2369  "'auto' as a functional-style cast is incompatible with C++ standards "
2370  "before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore;
2371def err_auto_missing_trailing_return : Error<
2372  "'auto' return without trailing return type; deduced return types are a "
2373  "C++14 extension">;
2374def err_deduced_return_type : Error<
2375  "deduced return types are a C++14 extension">;
2376def err_trailing_return_without_auto : Error<
2377  "function with trailing return type must specify return type 'auto', not %0">;
2378def err_trailing_return_in_parens : Error<
2379  "trailing return type may not be nested within parentheses">;
2380def err_auto_var_deduction_failure : Error<
2381  "variable %0 with type %1 has incompatible initializer of type %2">;
2382def err_auto_var_deduction_failure_from_init_list : Error<
2383  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2384def err_auto_expr_deduction_failure : Error<
2385  "functional-style cast to %0 has incompatible initializer of type %1">;
2386def err_auto_new_deduction_failure : Error<
2387  "new expression for type %0 has incompatible constructor argument of type %1">;
2388def err_auto_inconsistent_deduction : Error<
2389  "deduced conflicting types %diff{($ vs $) |}0,1"
2390  "for initializer list element type">;
2391def err_auto_different_deductions : Error<
2392  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2393  "deduced as %1 in declaration of %2 and "
2394  "deduced as %3 in declaration of %4">;
2395def err_auto_non_deduced_not_alone : Error<
2396  "%select{function with deduced return type|"
2397  "declaration with trailing return type}0 "
2398  "must be the only declaration in its group">;
2399def err_implied_std_initializer_list_not_found : Error<
2400  "cannot deduce type of initializer list because std::initializer_list was "
2401  "not found; include <initializer_list>">;
2402def err_malformed_std_initializer_list : Error<
2403  "std::initializer_list must be a class template with a single type parameter">;
2404def err_auto_init_list_from_c : Error<
2405  "cannot use __auto_type with initializer list in C">;
2406def err_auto_bitfield : Error<
2407  "cannot pass bit-field as __auto_type initializer in C">;
2408
2409// C++1y decltype(auto) type
2410def err_decltype_auto_invalid : Error<
2411  "'decltype(auto)' not allowed here">;
2412def err_decltype_auto_cannot_be_combined : Error<
2413  "'decltype(auto)' cannot be combined with other type specifiers">;
2414def err_decltype_auto_function_declarator_not_declaration : Error<
2415  "'decltype(auto)' can only be used as a return type "
2416  "in a function declaration">;
2417def err_decltype_auto_compound_type : Error<
2418  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2419def err_decltype_auto_initializer_list : Error<
2420  "cannot deduce 'decltype(auto)' from initializer list">;
2421
2422// C++17 deduced class template specialization types
2423def err_deduced_class_template_compound_type : Error<
2424  "cannot %select{form pointer to|form reference to|form array of|"
2425  "form function returning|use parentheses when declaring variable with}0 "
2426  "deduced class template specialization type">;
2427def err_deduced_non_class_template_specialization_type : Error<
2428  "%select{<error>|function template|variable template|alias template|"
2429  "template template parameter|concept|template}0 %1 requires template "
2430  "arguments; argument deduction only allowed for class templates">;
2431def err_deduced_class_template_ctor_ambiguous : Error<
2432  "ambiguous deduction for template arguments of %0">;
2433def err_deduced_class_template_ctor_no_viable : Error<
2434  "no viable constructor or deduction guide for deduction of "
2435  "template arguments of %0">;
2436def err_deduced_class_template_incomplete : Error<
2437  "template %0 has no definition and no %select{|viable }1deduction guides "
2438  "for deduction of template arguments">;
2439def err_deduced_class_template_deleted : Error<
2440  "class template argument deduction for %0 selected a deleted constructor">;
2441def err_deduced_class_template_explicit : Error<
2442  "class template argument deduction for %0 selected an explicit "
2443  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2444def err_deduction_guide_no_trailing_return_type : Error<
2445  "deduction guide declaration without trailing return type">;
2446def err_deduction_guide_bad_trailing_return_type : Error<
2447  "deduced type %1 of deduction guide is not %select{|written as }2"
2448  "a specialization of template %0">;
2449def err_deduction_guide_with_complex_decl : Error<
2450  "cannot specify any part of a return type in the "
2451  "declaration of a deduction guide">;
2452def err_deduction_guide_invalid_specifier : Error<
2453  "deduction guide cannot be declared '%0'">;
2454def err_deduction_guide_name_not_class_template : Error<
2455  "cannot specify deduction guide for "
2456  "%select{<error>|function template|variable template|alias template|"
2457  "template template parameter|concept|dependent template name}0 %1">;
2458def err_deduction_guide_wrong_scope : Error<
2459  "deduction guide must be declared in the same scope as template %q0">;
2460def err_deduction_guide_defines_function : Error<
2461  "deduction guide cannot have a function definition">;
2462def err_deduction_guide_redeclared : Error<
2463  "redeclaration of deduction guide">;
2464def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2465  "%select{explicitly instantiated|explicitly specialized}0">;
2466def err_deduction_guide_template_not_deducible : Error<
2467  "deduction guide template contains "
2468  "%select{a template parameter|template parameters}0 that cannot be "
2469  "deduced">;
2470def err_deduction_guide_wrong_access : Error<
2471  "deduction guide has different access from the corresponding "
2472  "member template">;
2473def note_deduction_guide_template_access : Note<
2474  "member template declared %0 here">;
2475def note_deduction_guide_access : Note<
2476  "deduction guide declared %0 by intervening access specifier">;
2477def warn_cxx14_compat_class_template_argument_deduction : Warning<
2478  "class template argument deduction is incompatible with C++ standards "
2479  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2480  InGroup<CXXPre17Compat>, DefaultIgnore;
2481def warn_ctad_maybe_unsupported : Warning<
2482  "%0 may not intend to support class template argument deduction">,
2483  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2484def note_suppress_ctad_maybe_unsupported : Note<
2485  "add a deduction guide to suppress this warning">;
2486
2487
2488// C++14 deduced return types
2489def err_auto_fn_deduction_failure : Error<
2490  "cannot deduce return type %0 from returned value of type %1">;
2491def err_auto_fn_different_deductions : Error<
2492  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2493  "deduced as %2 in earlier return statement">;
2494def err_auto_fn_used_before_defined : Error<
2495  "function %0 with deduced return type cannot be used before it is defined">;
2496def err_auto_fn_no_return_but_not_auto : Error<
2497  "cannot deduce return type %0 for function with no return statements">;
2498def err_auto_fn_return_void_but_not_auto : Error<
2499  "cannot deduce return type %0 from omitted return expression">;
2500def err_auto_fn_return_init_list : Error<
2501  "cannot deduce return type from initializer list">;
2502def err_auto_fn_virtual : Error<
2503  "function with deduced return type cannot be virtual">;
2504def warn_cxx11_compat_deduced_return_type : Warning<
2505  "return type deduction is incompatible with C++ standards before C++14">,
2506  InGroup<CXXPre14Compat>, DefaultIgnore;
2507
2508// C++11 override control
2509def override_keyword_only_allowed_on_virtual_member_functions : Error<
2510  "only virtual member functions can be marked '%0'">;
2511def override_keyword_hides_virtual_member_function : Error<
2512  "non-virtual member function marked '%0' hides virtual member "
2513  "%select{function|functions}1">;
2514def err_function_marked_override_not_overriding : Error<
2515  "%0 marked 'override' but does not override any member functions">;
2516def warn_destructor_marked_not_override_overriding : TextSubstitution <
2517  "%0 overrides a destructor but is not marked 'override'">;
2518def warn_function_marked_not_override_overriding : TextSubstitution <
2519  "%0 overrides a member function but is not marked 'override'">;
2520def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2521  "%sub{warn_destructor_marked_not_override_overriding}0">,
2522  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2523def warn_inconsistent_function_marked_not_override_overriding : Warning <
2524  "%sub{warn_function_marked_not_override_overriding}0">,
2525  InGroup<CXX11WarnInconsistentOverrideMethod>;
2526def warn_suggest_destructor_marked_not_override_overriding : Warning <
2527  "%sub{warn_destructor_marked_not_override_overriding}0">,
2528  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2529def warn_suggest_function_marked_not_override_overriding : Warning <
2530  "%sub{warn_function_marked_not_override_overriding}0">,
2531  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2532def err_class_marked_final_used_as_base : Error<
2533  "base %0 is marked '%select{final|sealed}1'">;
2534def warn_abstract_final_class : Warning<
2535  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2536def warn_final_dtor_non_final_class : Warning<
2537  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2538  InGroup<FinalDtorNonFinalClass>;
2539def note_final_dtor_non_final_class_silence : Note<
2540  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2541
2542// C++11 attributes
2543def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2544
2545// C++11 final
2546def err_final_function_overridden : Error<
2547  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2548
2549// C++11 scoped enumerations
2550def err_enum_invalid_underlying : Error<
2551  "non-integral type %0 is an invalid underlying type">;
2552def err_enumerator_too_large : Error<
2553  "enumerator value is not representable in the underlying type %0">;
2554def ext_enumerator_too_large : Extension<
2555  "enumerator value is not representable in the underlying type %0">,
2556  InGroup<MicrosoftEnumValue>;
2557def err_enumerator_wrapped : Error<
2558  "enumerator value %0 is not representable in the underlying type %1">;
2559def err_enum_redeclare_type_mismatch : Error<
2560  "enumeration redeclared with different underlying type %0 (was %1)">;
2561def err_enum_redeclare_fixed_mismatch : Error<
2562  "enumeration previously declared with %select{non|}0fixed underlying type">;
2563def err_enum_redeclare_scoped_mismatch : Error<
2564  "enumeration previously declared as %select{un|}0scoped">;
2565def err_only_enums_have_underlying_types : Error<
2566  "only enumeration types have underlying types">;
2567def err_underlying_type_of_incomplete_enum : Error<
2568  "cannot determine underlying type of incomplete enumeration type %0">;
2569
2570// C++11 delegating constructors
2571def err_delegating_ctor : Error<
2572  "delegating constructors are permitted only in C++11">;
2573def warn_cxx98_compat_delegating_ctor : Warning<
2574  "delegating constructors are incompatible with C++98">,
2575  InGroup<CXX98Compat>, DefaultIgnore;
2576def err_delegating_initializer_alone : Error<
2577  "an initializer for a delegating constructor must appear alone">;
2578def warn_delegating_ctor_cycle : Warning<
2579  "constructor for %0 creates a delegation cycle">, DefaultError,
2580  InGroup<DelegatingCtorCycles>;
2581def note_it_delegates_to : Note<"it delegates to">;
2582def note_which_delegates_to : Note<"which delegates to">;
2583
2584// C++11 range-based for loop
2585def err_for_range_decl_must_be_var : Error<
2586  "for range declaration must declare a variable">;
2587def err_for_range_storage_class : Error<
2588  "loop variable %0 may not be declared %select{'extern'|'static'|"
2589  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2590def err_type_defined_in_for_range : Error<
2591  "types may not be defined in a for range declaration">;
2592def err_for_range_deduction_failure : Error<
2593  "cannot use type %0 as a range">;
2594def err_for_range_incomplete_type : Error<
2595  "cannot use incomplete type %0 as a range">;
2596def err_for_range_iter_deduction_failure : Error<
2597  "cannot use type %0 as an iterator">;
2598def ext_for_range_begin_end_types_differ : ExtWarn<
2599  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2600  InGroup<CXX17>;
2601def warn_for_range_begin_end_types_differ : Warning<
2602  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2603  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2604def note_in_for_range: Note<
2605  "when looking up '%select{begin|end}0' function for range expression "
2606  "of type %1">;
2607def err_for_range_invalid: Error<
2608  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2609  "function available">;
2610def note_for_range_member_begin_end_ignored : Note<
2611  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2612def err_range_on_array_parameter : Error<
2613  "cannot build range expression with array function parameter %0 since "
2614  "parameter with array type %1 is treated as pointer type %2">;
2615def err_for_range_dereference : Error<
2616  "invalid range expression of type %0; did you mean to dereference it "
2617  "with '*'?">;
2618def note_for_range_invalid_iterator : Note <
2619  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2620def note_for_range_begin_end : Note<
2621  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2622def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2623  "loop variable %0 "
2624  "%diff{of type $ binds to a temporary constructed from type $"
2625  "|binds to a temporary constructed from a different type}1,2">,
2626  InGroup<RangeLoopConstruct>, DefaultIgnore;
2627def note_use_type_or_non_reference : Note<
2628  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2629def warn_for_range_ref_binds_ret_temp : Warning<
2630  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2631  InGroup<RangeLoopBindReference>, DefaultIgnore;
2632def note_use_non_reference_type : Note<"use non-reference type %0">;
2633def warn_for_range_copy : Warning<
2634  "loop variable %0 creates a copy from type %1">,
2635  InGroup<RangeLoopConstruct>, DefaultIgnore;
2636def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2637def err_objc_for_range_init_stmt : Error<
2638  "initialization statement is not supported when iterating over Objective-C "
2639  "collection">;
2640
2641// C++11 constexpr
2642def warn_cxx98_compat_constexpr : Warning<
2643  "'constexpr' specifier is incompatible with C++98">,
2644  InGroup<CXX98Compat>, DefaultIgnore;
2645// FIXME: Maybe this should also go in -Wc++14-compat?
2646def warn_cxx14_compat_constexpr_not_const : Warning<
2647  "'constexpr' non-static member function will not be implicitly 'const' "
2648  "in C++14; add 'const' to avoid a change in behavior">,
2649  InGroup<DiagGroup<"constexpr-not-const">>;
2650def err_invalid_consteval_take_address : Error<
2651  "cannot take address of consteval function %0 outside"
2652  " of an immediate invocation">;
2653def err_invalid_consteval_call : Error<
2654  "call to consteval function %q0 is not a constant expression">;
2655def note_invalid_consteval_initializer : Note<
2656  "in the default initalizer of %0">;
2657def note_invalid_consteval_initializer_here : Note<
2658  "initialized here %0">;
2659def err_invalid_consteval_decl_kind : Error<
2660  "%0 cannot be declared consteval">;
2661def err_invalid_constexpr : Error<
2662  "%select{function parameter|typedef}0 "
2663  "cannot be %sub{select_constexpr_spec_kind}1">;
2664def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2665  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2666def err_constexpr_tag : Error<
2667  "%select{class|struct|interface|union|enum}0 "
2668  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2669def err_constexpr_dtor : Error<
2670  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2671def err_constexpr_dtor_subobject : Error<
2672  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2673  "%select{data member %2|base class %3}1 does not have a "
2674  "constexpr destructor">;
2675def note_constexpr_dtor_subobject : Note<
2676  "%select{data member %1|base class %2}0 declared here">;
2677def err_constexpr_wrong_decl_kind : Error<
2678  "%sub{select_constexpr_spec_kind}0 can only be used "
2679  "in %select{|variable and function|function|variable}0 declarations">;
2680def err_invalid_constexpr_var_decl : Error<
2681  "constexpr variable declaration must be a definition">;
2682def err_constexpr_static_mem_var_requires_init : Error<
2683  "declaration of constexpr static data member %0 requires an initializer">;
2684def err_constexpr_var_non_literal : Error<
2685  "constexpr variable cannot have non-literal type %0">;
2686def err_constexpr_var_requires_const_init : Error<
2687  "constexpr variable %0 must be initialized by a constant expression">;
2688def err_constexpr_var_requires_const_destruction : Error<
2689  "constexpr variable %0 must have constant destruction">;
2690def err_constexpr_redecl_mismatch : Error<
2691  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2692  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2693def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2694def warn_cxx17_compat_constexpr_virtual : Warning<
2695  "virtual constexpr functions are incompatible with "
2696  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2697def err_constexpr_virtual_base : Error<
2698  "constexpr %select{member function|constructor}0 not allowed in "
2699  "%select{struct|interface|class}1 with virtual base "
2700  "%plural{1:class|:classes}2">;
2701def note_non_literal_incomplete : Note<
2702  "incomplete type %0 is not a literal type">;
2703def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2704  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2705def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2706def err_constexpr_non_literal_return : Error<
2707  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2708def err_constexpr_non_literal_param : Error<
2709  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2710  "not a literal type">;
2711def err_constexpr_body_invalid_stmt : Error<
2712  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2713def ext_constexpr_body_invalid_stmt : ExtWarn<
2714  "use of this statement in a constexpr %select{function|constructor}0 "
2715  "is a C++14 extension">, InGroup<CXX14>;
2716def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2717  "use of this statement in a constexpr %select{function|constructor}0 "
2718  "is incompatible with C++ standards before C++14">,
2719  InGroup<CXXPre14Compat>, DefaultIgnore;
2720def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2721  "use of this statement in a constexpr %select{function|constructor}0 "
2722  "is a C++20 extension">, InGroup<CXX20>;
2723def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2724  "use of this statement in a constexpr %select{function|constructor}0 "
2725  "is incompatible with C++ standards before C++20">,
2726  InGroup<CXXPre20Compat>, DefaultIgnore;
2727def ext_constexpr_body_invalid_stmt_cxx2b : ExtWarn<
2728  "use of this statement in a constexpr %select{function|constructor}0 "
2729  "is a C++2b extension">, InGroup<CXX2b>;
2730def warn_cxx20_compat_constexpr_body_invalid_stmt : Warning<
2731  "use of this statement in a constexpr %select{function|constructor}0 "
2732  "is incompatible with C++ standards before C++2b">,
2733  InGroup<CXXPre2bCompat>, DefaultIgnore;
2734def ext_constexpr_type_definition : ExtWarn<
2735  "type definition in a constexpr %select{function|constructor}0 "
2736  "is a C++14 extension">, InGroup<CXX14>;
2737def warn_cxx11_compat_constexpr_type_definition : Warning<
2738  "type definition in a constexpr %select{function|constructor}0 "
2739  "is incompatible with C++ standards before C++14">,
2740  InGroup<CXXPre14Compat>, DefaultIgnore;
2741def err_constexpr_vla : Error<
2742  "variably-modified type %0 cannot be used in a constexpr "
2743  "%select{function|constructor}1">;
2744def ext_constexpr_local_var : ExtWarn<
2745  "variable declaration in a constexpr %select{function|constructor}0 "
2746  "is a C++14 extension">, InGroup<CXX14>;
2747def warn_cxx11_compat_constexpr_local_var : Warning<
2748  "variable declaration in a constexpr %select{function|constructor}0 "
2749  "is incompatible with C++ standards before C++14">,
2750  InGroup<CXXPre14Compat>, DefaultIgnore;
2751def ext_constexpr_static_var : ExtWarn<
2752  "definition of a %select{static|thread_local}1 variable "
2753  "in a constexpr %select{function|constructor}0 "
2754  "is a C++2b extension">, InGroup<CXX2b>;
2755def warn_cxx20_compat_constexpr_var : Warning<
2756  "definition of a %select{static variable|thread_local variable|variable "
2757  "of non-literal type}1 in a constexpr %select{function|constructor}0 "
2758  "is incompatible with C++ standards before C++2b">,
2759  InGroup<CXXPre2bCompat>, DefaultIgnore;
2760def err_constexpr_local_var_non_literal_type : Error<
2761  "variable of non-literal type %1 cannot be defined in a constexpr "
2762  "%select{function|constructor}0 before C++2b">;
2763def ext_constexpr_local_var_no_init : ExtWarn<
2764  "uninitialized variable in a constexpr %select{function|constructor}0 "
2765  "is a C++20 extension">, InGroup<CXX20>;
2766def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2767  "uninitialized variable in a constexpr %select{function|constructor}0 "
2768  "is incompatible with C++ standards before C++20">,
2769  InGroup<CXXPre20Compat>, DefaultIgnore;
2770def ext_constexpr_function_never_constant_expr : ExtWarn<
2771  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2772  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2773def err_attr_cond_never_constant_expr : Error<
2774  "%0 attribute expression never produces a constant expression">;
2775def err_diagnose_if_invalid_diagnostic_type : Error<
2776  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2777  "instead">;
2778def err_constexpr_body_no_return : Error<
2779  "no return statement in %select{constexpr|consteval}0 function">;
2780def err_constexpr_return_missing_expr : Error<
2781  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2782def warn_cxx11_compat_constexpr_body_no_return : Warning<
2783  "constexpr function with no return statements is incompatible with C++ "
2784  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2785def ext_constexpr_body_multiple_return : ExtWarn<
2786  "multiple return statements in constexpr function is a C++14 extension">,
2787  InGroup<CXX14>;
2788def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2789  "multiple return statements in constexpr function "
2790  "is incompatible with C++ standards before C++14">,
2791  InGroup<CXXPre14Compat>, DefaultIgnore;
2792def note_constexpr_body_previous_return : Note<
2793  "previous return statement is here">;
2794
2795// C++20 function try blocks in constexpr
2796def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2797  "function try block in constexpr %select{function|constructor}0 is "
2798  "a C++20 extension">, InGroup<CXX20>;
2799def warn_cxx17_compat_constexpr_function_try_block : Warning<
2800  "function try block in constexpr %select{function|constructor}0 is "
2801  "incompatible with C++ standards before C++20">,
2802  InGroup<CXXPre20Compat>, DefaultIgnore;
2803
2804def ext_constexpr_union_ctor_no_init : ExtWarn<
2805  "constexpr union constructor that does not initialize any member "
2806  "is a C++20 extension">, InGroup<CXX20>;
2807def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2808  "constexpr union constructor that does not initialize any member "
2809  "is incompatible with C++ standards before C++20">,
2810  InGroup<CXXPre20Compat>, DefaultIgnore;
2811def ext_constexpr_ctor_missing_init : ExtWarn<
2812  "constexpr constructor that does not initialize all members "
2813  "is a C++20 extension">, InGroup<CXX20>;
2814def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2815  "constexpr constructor that does not initialize all members "
2816  "is incompatible with C++ standards before C++20">,
2817  InGroup<CXXPre20Compat>, DefaultIgnore;
2818def note_constexpr_ctor_missing_init : Note<
2819  "member not initialized by constructor">;
2820def note_non_literal_no_constexpr_ctors : Note<
2821  "%0 is not literal because it is not an aggregate and has no constexpr "
2822  "constructors other than copy or move constructors">;
2823def note_non_literal_base_class : Note<
2824  "%0 is not literal because it has base class %1 of non-literal type">;
2825def note_non_literal_field : Note<
2826  "%0 is not literal because it has data member %1 of "
2827  "%select{non-literal|volatile}3 type %2">;
2828def note_non_literal_user_provided_dtor : Note<
2829  "%0 is not literal because it has a user-provided destructor">;
2830def note_non_literal_nontrivial_dtor : Note<
2831  "%0 is not literal because it has a non-trivial destructor">;
2832def note_non_literal_non_constexpr_dtor : Note<
2833  "%0 is not literal because its destructor is not constexpr">;
2834def note_non_literal_lambda : Note<
2835  "lambda closure types are non-literal types before C++17">;
2836def warn_private_extern : Warning<
2837  "use of __private_extern__ on a declaration may not produce external symbol "
2838  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2839def note_private_extern : Note<
2840  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2841
2842// C++ Concepts
2843def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2844  "concept declarations may only appear in global or namespace scope">;
2845def err_concept_no_parameters : Error<
2846  "concept template parameter list must have at least one parameter; explicit "
2847  "specialization of concepts is not allowed">;
2848def err_concept_extra_headers : Error<
2849  "extraneous template parameter list in concept definition">;
2850def err_concept_no_associated_constraints : Error<
2851  "concept cannot have associated constraints">;
2852def err_non_constant_constraint_expression : Error<
2853  "substitution into constraint expression resulted in a non-constant "
2854  "expression">;
2855def err_non_bool_atomic_constraint : Error<
2856  "atomic constraint must be of type 'bool' (found %0)">;
2857def err_template_arg_list_constraints_not_satisfied : Error<
2858  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
2859  "template template parameter|template}0 %1%2">;
2860def note_substituted_constraint_expr_is_ill_formed : Note<
2861  "because substituted constraint expression is ill-formed%0">;
2862def note_constraint_references_error
2863    : Note<"constraint depends on a previously diagnosed expression">;
2864def note_atomic_constraint_evaluated_to_false : Note<
2865  "%select{and|because}0 '%1' evaluated to false">;
2866def note_concept_specialization_constraint_evaluated_to_false : Note<
2867  "%select{and|because}0 '%1' evaluated to false">;
2868def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
2869  "%select{and|because}0 %1 does not satisfy %2">;
2870def note_atomic_constraint_evaluated_to_false_elaborated : Note<
2871  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
2872def err_constrained_virtual_method : Error<
2873  "virtual function cannot have a requires clause">;
2874def err_trailing_requires_clause_on_deduction_guide : Error<
2875  "deduction guide cannot have a requires clause">;
2876def err_constrained_non_templated_function
2877    : Error<"non-templated function cannot have a requires clause">;
2878def err_reference_to_function_with_unsatisfied_constraints : Error<
2879  "invalid reference to function %0: constraints not satisfied">;
2880def err_requires_expr_local_parameter_default_argument : Error<
2881  "default arguments not allowed for parameters of a requires expression">;
2882def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
2883  "constraint variable %0 cannot be used in an evaluated context">;
2884def note_expr_requirement_expr_substitution_error : Note<
2885  "%select{and|because}0 '%1' would be invalid: %2">;
2886def note_expr_requirement_expr_unknown_substitution_error : Note<
2887  "%select{and|because}0 '%1' would be invalid">;
2888def note_expr_requirement_noexcept_not_met : Note<
2889  "%select{and|because}0 '%1' may throw an exception">;
2890def note_expr_requirement_type_requirement_substitution_error : Note<
2891  "%select{and|because}0 '%1' would be invalid: %2">;
2892def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
2893  "%select{and|because}0 '%1' would be invalid">;
2894def note_expr_requirement_constraints_not_satisfied : Note<
2895  "%select{and|because}0 type constraint '%1' was not satisfied:">;
2896def note_expr_requirement_constraints_not_satisfied_simple : Note<
2897  "%select{and|because}0 %1 does not satisfy %2:">;
2898def note_type_requirement_substitution_error : Note<
2899  "%select{and|because}0 '%1' would be invalid: %2">;
2900def note_type_requirement_unknown_substitution_error : Note<
2901  "%select{and|because}0 '%1' would be invalid">;
2902def note_nested_requirement_substitution_error : Note<
2903  "%select{and|because}0 '%1' would be invalid%2">;
2904def note_nested_requirement_unknown_substitution_error : Note<
2905  "%select{and|because}0 '%1' would be invalid">;
2906def note_ambiguous_atomic_constraints : Note<
2907  "similar constraint expressions not considered equivalent; constraint "
2908  "expressions cannot be considered equivalent unless they originate from the "
2909  "same concept">;
2910def note_ambiguous_atomic_constraints_similar_expression : Note<
2911  "similar constraint expression here">;
2912def err_unsupported_placeholder_constraint : Error<
2913  "constrained placeholder types other than simple 'auto' on non-type template "
2914  "parameters not supported yet">;
2915
2916def err_template_different_requires_clause : Error<
2917  "requires clause differs in template redeclaration">;
2918def err_template_different_type_constraint : Error<
2919  "type constraint differs in template redeclaration">;
2920def err_template_template_parameter_not_at_least_as_constrained : Error<
2921  "template template argument %0 is more constrained than template template "
2922  "parameter %1">;
2923
2924def err_type_constraint_non_type_concept : Error<
2925  "concept named in type constraint is not a type concept">;
2926def err_type_constraint_missing_arguments : Error<
2927  "%0 requires more than 1 template argument; provide the remaining arguments "
2928  "explicitly to use it here">;
2929def err_placeholder_constraints_not_satisfied : Error<
2930  "deduced type %0 does not satisfy %1">;
2931
2932// C++11 char16_t/char32_t
2933def warn_cxx98_compat_unicode_type : Warning<
2934  "'%0' type specifier is incompatible with C++98">,
2935  InGroup<CXX98Compat>, DefaultIgnore;
2936def warn_cxx17_compat_unicode_type : Warning<
2937  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2938  InGroup<CXXPre20Compat>, DefaultIgnore;
2939
2940// __make_integer_seq
2941def err_integer_sequence_negative_length : Error<
2942  "integer sequences must have non-negative sequence length">;
2943def err_integer_sequence_integral_element_type : Error<
2944  "integer sequences must have integral element type">;
2945
2946// __type_pack_element
2947def err_type_pack_element_out_of_bounds : Error<
2948  "a parameter pack may not be accessed at an out of bounds index">;
2949
2950// Objective-C++
2951def err_objc_decls_may_only_appear_in_global_scope : Error<
2952  "Objective-C declarations may only appear in global scope">;
2953def warn_auto_var_is_id : Warning<
2954  "'auto' deduced as 'id' in declaration of %0">,
2955  InGroup<DiagGroup<"auto-var-id">>;
2956
2957// Attributes
2958def warn_attribute_ignored_no_calls_in_stmt: Warning<
2959  "%0 attribute is ignored because there exists no call expression inside the "
2960  "statement">,
2961  InGroup<IgnoredAttributes>;
2962
2963def warn_function_attribute_ignored_in_stmt : Warning<
2964  "attribute is ignored on this statement as it only applies to functions; "
2965  "use '%0' on statements">,
2966  InGroup<IgnoredAttributes>;
2967
2968def err_musttail_needs_trivial_args : Error<
2969  "tail call requires that the return value, all parameters, and any "
2970  "temporaries created by the expression are trivially destructible">;
2971def err_musttail_needs_call : Error<
2972  "%0 attribute requires that the return value is the result of a function call"
2973  >;
2974def err_musttail_needs_prototype : Error<
2975  "%0 attribute requires that both caller and callee functions have a "
2976  "prototype">;
2977def note_musttail_fix_non_prototype : Note<
2978  "add 'void' to the parameter list to turn an old-style K&R function "
2979  "declaration into a prototype">;
2980def err_musttail_structors_forbidden : Error<"cannot perform a tail call "
2981  "%select{from|to}0 a %select{constructor|destructor}1">;
2982def note_musttail_structors_forbidden : Note<"target "
2983  "%select{constructor|destructor}0 is declared here">;
2984def err_musttail_forbidden_from_this_context : Error<
2985  "%0 attribute cannot be used from "
2986  "%select{a block|an Objective-C function|this context}1">;
2987def err_musttail_member_mismatch : Error<
2988  "%select{non-member|static member|non-static member}0 "
2989  "function cannot perform a tail call to "
2990  "%select{non-member|static member|non-static member|pointer-to-member}1 "
2991  "function%select{| %3}2">;
2992def note_musttail_callee_defined_here : Note<"%0 declared here">;
2993def note_tail_call_required : Note<"tail call required by %0 attribute here">;
2994def err_musttail_mismatch : Error<
2995  "cannot perform a tail call to function%select{| %1}0 because its signature "
2996  "is incompatible with the calling function">;
2997def note_musttail_mismatch : Note<
2998    "target function "
2999    "%select{is a member of different class%diff{ (expected $ but has $)|}1,2"
3000    "|has different number of parameters (expected %1 but has %2)"
3001    "|has type mismatch at %ordinal3 parameter"
3002    "%diff{ (expected $ but has $)|}1,2"
3003    "|has different return type%diff{ ($ expected but has $)|}1,2}0">;
3004def err_musttail_callconv_mismatch : Error<
3005  "cannot perform a tail call to function%select{| %1}0 because it uses an "
3006  "incompatible calling convention">;
3007def note_musttail_callconv_mismatch : Note<
3008  "target function has calling convention %1 (expected %0)">;
3009def err_musttail_scope : Error<
3010  "cannot perform a tail call from this return statement">;
3011def err_musttail_no_variadic : Error<
3012  "%0 attribute may not be used with variadic functions">;
3013
3014def err_nsobject_attribute : Error<
3015  "'NSObject' attribute is for pointer types only">;
3016def err_attributes_are_not_compatible : Error<
3017  "%0 and %1 attributes are not compatible">;
3018def err_attribute_invalid_argument : Error<
3019  "%select{a reference type|an array type|a non-vector or "
3020  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
3021def err_attribute_wrong_number_arguments : Error<
3022  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
3023  ":requires exactly %1 arguments}1">;
3024def err_attribute_wrong_number_arguments_for : Error <
3025  "%0 attribute references function %1, which %plural{0:takes no arguments|1:takes one argument|"
3026  ":takes exactly %2 arguments}2">;
3027def err_attribute_bounds_for_function : Error<
3028  "%0 attribute references parameter %1, but the function %2 has only %3 parameters">;
3029def err_attribute_no_member_function : Error<
3030  "%0 attribute cannot be applied to non-static member functions">;
3031def err_attribute_parameter_types : Error<
3032  "%0 attribute parameter types do not match: parameter %1 of function %2 has type %3, "
3033  "but parameter %4 of function %5 has type %6">;
3034
3035def err_attribute_too_many_arguments : Error<
3036  "%0 attribute takes no more than %1 argument%s1">;
3037def err_attribute_too_few_arguments : Error<
3038  "%0 attribute takes at least %1 argument%s1">;
3039def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
3040def err_attribute_invalid_bitint_vector_type : Error<
3041  "'_BitInt' vector element width must be %select{a power of 2|"
3042  "at least as wide as 'CHAR_BIT'}0">;
3043def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
3044def err_attribute_bad_neon_vector_size : Error<
3045  "Neon vector size must be 64 or 128 bits">;
3046def err_attribute_invalid_sve_type : Error<
3047  "%0 attribute applied to non-SVE type %1">;
3048def err_attribute_bad_sve_vector_size : Error<
3049  "invalid SVE vector size '%0', must match value set by "
3050  "'-msve-vector-bits' ('%1')">;
3051def err_attribute_arm_feature_sve_bits_unsupported : Error<
3052  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
3053  "value of 128, 256, 512, 1024 or 2048.">;
3054def err_sve_vector_in_non_sve_target : Error<
3055  "SVE vector type %0 cannot be used in a target without sve">;
3056def err_attribute_requires_positive_integer : Error<
3057  "%0 attribute requires a %select{positive|non-negative}1 "
3058  "integral compile time constant expression">;
3059def err_attribute_requires_opencl_version : Error<
3060  "attribute %0 is supported in the OpenCL version %1%select{| onwards}2">;
3061def err_invalid_branch_protection_spec : Error<
3062  "invalid or misplaced branch protection specification '%0'">;
3063def warn_unsupported_branch_protection_spec : Warning<
3064  "unsupported branch protection specification '%0'">, InGroup<BranchProtection>;
3065
3066def warn_unsupported_target_attribute
3067    : Warning<"%select{unsupported|duplicate|unknown}0%select{| CPU|"
3068              " tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' "
3069              "attribute string; '%select{target|target_clones|target_version}3' "
3070              "attribute ignored">,
3071      InGroup<IgnoredAttributes>;
3072def err_attribute_unsupported
3073    : Error<"%0 attribute is not supported on targets missing %1;"
3074            " specify an appropriate -march= or -mcpu=">;
3075// The err_*_attribute_argument_not_int are separate because they're used by
3076// VerifyIntegerConstantExpression.
3077def err_aligned_attribute_argument_not_int : Error<
3078  "'aligned' attribute requires integer constant">;
3079def err_align_value_attribute_argument_not_int : Error<
3080  "'align_value' attribute requires integer constant">;
3081def err_alignas_attribute_wrong_decl_type : Error<
3082  "%0 attribute cannot be applied to %select{a function parameter|"
3083  "a variable with 'register' storage class|a 'catch' variable|a bit-field|"
3084  "an enumeration}1">;
3085def err_alignas_missing_on_definition : Error<
3086  "%0 must be specified on definition if it is specified on any declaration">;
3087def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
3088def err_alignas_mismatch : Error<
3089  "redeclaration has different alignment requirement (%1 vs %0)">;
3090def err_alignas_underaligned : Error<
3091  "requested alignment is less than minimum alignment of %1 for type %0">;
3092def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Summary>,
3093  InGroup<IgnoredAttributes>;
3094def err_attribute_sizeless_type : Error<
3095  "%0 attribute cannot be applied to sizeless type %1">;
3096def err_attribute_argument_n_type : Error<
3097  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
3098  "constant|a string|an identifier|a constant expression|a builtin function}2">;
3099def err_attribute_argument_type : Error<
3100  "%0 attribute requires %select{int or bool|an integer "
3101  "constant|a string|an identifier}1">;
3102def err_attribute_argument_out_of_range : Error<
3103  "%0 attribute requires integer constant between %1 and %2 inclusive">;
3104def err_init_priority_object_attr : Error<
3105  "can only use 'init_priority' attribute on file-scope definitions "
3106  "of objects of class type">;
3107def err_attribute_argument_out_of_bounds : Error<
3108  "%0 attribute parameter %1 is out of bounds">;
3109def err_attribute_only_once_per_parameter : Error<
3110  "%0 attribute can only be applied once per parameter">;
3111def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
3112def note_previous_uuid : Note<"previous uuid specified here">;
3113def warn_attribute_pointers_only : Warning<
3114  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
3115  InGroup<IgnoredAttributes>;
3116def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Summary>;
3117def err_attribute_integers_only : Error<
3118  "%0 attribute argument may only refer to a function parameter of integer "
3119  "type">;
3120def warn_attribute_return_pointers_only : Warning<
3121  "%0 attribute only applies to return values that are pointers">,
3122  InGroup<IgnoredAttributes>;
3123def warn_attribute_return_pointers_refs_only : Warning<
3124  "%0 attribute only applies to return values that are pointers or references">,
3125  InGroup<IgnoredAttributes>;
3126def warn_attribute_pointer_or_reference_only : Warning<
3127  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
3128  InGroup<IgnoredAttributes>;
3129def err_attribute_no_member_pointers : Error<
3130  "%0 attribute cannot be used with pointers to members">;
3131def err_attribute_invalid_implicit_this_argument : Error<
3132  "%0 attribute is invalid for the implicit this argument">;
3133def err_ownership_type : Error<
3134  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
3135def err_ownership_returns_index_mismatch : Error<
3136  "'ownership_returns' attribute index does not match; here it is %0">;
3137def note_ownership_returns_index_mismatch : Note<
3138  "declared with index %0 here">;
3139def err_format_strftime_third_parameter : Error<
3140  "strftime format attribute requires 3rd parameter to be 0">;
3141def err_format_attribute_not : Error<"format argument not a string type">;
3142def err_format_attribute_result_not : Error<"function does not return %0">;
3143def err_format_attribute_implicit_this_format_string : Error<
3144  "format attribute cannot specify the implicit this argument as the format "
3145  "string">;
3146def err_callback_attribute_no_callee : Error<
3147  "'callback' attribute specifies no callback callee">;
3148def err_callback_attribute_invalid_callee : Error<
3149  "'callback' attribute specifies invalid callback callee">;
3150def err_callback_attribute_multiple : Error<
3151  "multiple 'callback' attributes specified">;
3152def err_callback_attribute_argument_unknown : Error<
3153  "'callback' attribute argument %0 is not a known function parameter">;
3154def err_callback_callee_no_function_type : Error<
3155  "'callback' attribute callee does not have function type">;
3156def err_callback_callee_is_variadic : Error<
3157  "'callback' attribute callee may not be variadic">;
3158def err_callback_implicit_this_not_available : Error<
3159  "'callback' argument at position %0 references unavailable implicit 'this'">;
3160def err_init_method_bad_return_type : Error<
3161  "init methods must return an object pointer type, not %0">;
3162def err_attribute_invalid_size : Error<
3163  "vector size not an integral multiple of component size">;
3164def err_attribute_zero_size : Error<"zero %0 size">;
3165def err_attribute_size_too_large : Error<"%0 size too large">;
3166def err_typecheck_sve_ambiguous : Error<
3167  "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">;
3168def err_typecheck_sve_gnu_ambiguous : Error<
3169  "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">;
3170def err_typecheck_vector_not_convertable_implict_truncation : Error<
3171   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
3172   " %2 as implicit conversion would cause truncation">;
3173def err_typecheck_vector_not_convertable : Error<
3174  "cannot convert between vector values of different size (%0 and %1)">;
3175def err_typecheck_vector_not_convertable_non_scalar : Error<
3176  "cannot convert between vector and non-scalar values (%0 and %1)">;
3177def err_typecheck_vector_lengths_not_equal : Error<
3178  "vector operands do not have the same number of elements (%0 and %1)">;
3179def warn_typecheck_vector_element_sizes_not_equal : Warning<
3180  "vector operands do not have the same elements sizes (%0 and %1)">,
3181  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
3182def err_ext_vector_component_exceeds_length : Error<
3183  "vector component access exceeds type %0">;
3184def err_ext_vector_component_name_illegal : Error<
3185  "illegal vector component name '%0'">;
3186def err_attribute_address_space_negative : Error<
3187  "address space is negative">;
3188def err_attribute_address_space_too_high : Error<
3189  "address space is larger than the maximum supported (%0)">;
3190def err_attribute_address_multiple_qualifiers : Error<
3191  "multiple address spaces specified for type">;
3192def warn_attribute_address_multiple_identical_qualifiers : Warning<
3193  "multiple identical address spaces specified for type">,
3194  InGroup<DuplicateDeclSpecifier>;
3195def err_attribute_not_clinkage : Error<
3196  "function type with %0 attribute must have C linkage">;
3197def err_function_decl_cmse_ns_call : Error<
3198  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
3199def err_attribute_address_function_type : Error<
3200  "function type may not be qualified with an address space">;
3201def err_as_qualified_auto_decl : Error<
3202  "automatic variable qualified with an%select{| invalid}0 address space">;
3203def err_arg_with_address_space : Error<
3204  "parameter may not be qualified with an address space">;
3205def err_field_with_address_space : Error<
3206  "field may not be qualified with an address space">;
3207def err_compound_literal_with_address_space : Error<
3208  "compound literal in function scope may not be qualified with an address space">;
3209def err_address_space_mismatch_templ_inst : Error<
3210  "conflicting address space qualifiers are provided between types %0 and %1">;
3211def err_attr_objc_ownership_redundant : Error<
3212  "the type %0 is already explicitly ownership-qualified">;
3213def err_invalid_nsnumber_type : Error<
3214  "%0 is not a valid literal type for NSNumber">;
3215def err_objc_illegal_boxed_expression_type : Error<
3216  "illegal type %0 used in a boxed expression">;
3217def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3218  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3219def err_objc_incomplete_boxed_expression_type : Error<
3220  "incomplete type %0 used in a boxed expression">;
3221def err_undeclared_objc_literal_class : Error<
3222  "definition of class %0 must be available to use Objective-C "
3223  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3224  "string literals}1">;
3225def err_undeclared_boxing_method : Error<
3226  "declaration of %0 is missing in %1 class">;
3227def err_objc_literal_method_sig : Error<
3228  "literal construction method %0 has incompatible signature">;
3229def note_objc_literal_method_param : Note<
3230  "%select{first|second|third}0 parameter has unexpected type %1 "
3231  "(should be %2)">;
3232def note_objc_literal_method_return : Note<
3233  "method returns unexpected type %0 (should be an object type)">;
3234def err_invalid_collection_element : Error<
3235  "collection element of type %0 is not an Objective-C object">;
3236def err_box_literal_collection : Error<
3237  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3238  "in a collection">;
3239def warn_objc_literal_comparison : Warning<
3240  "direct comparison of %select{an array literal|a dictionary literal|"
3241  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3242  InGroup<ObjCLiteralComparison>;
3243def err_missing_atsign_prefix : Error<
3244  "%select{string|numeric}0 literal must be prefixed by '@'">;
3245def warn_objc_string_literal_comparison : Warning<
3246  "direct comparison of a string literal has undefined behavior">,
3247  InGroup<ObjCStringComparison>;
3248def warn_concatenated_literal_array_init : Warning<
3249  "suspicious concatenation of string literals in an array initialization; "
3250  "did you mean to separate the elements with a comma?">,
3251  InGroup<StringConcatation>, DefaultIgnore;
3252def warn_concatenated_nsarray_literal : Warning<
3253  "concatenated NSString literal for an NSArray expression - "
3254  "possibly missing a comma">,
3255  InGroup<ObjCStringConcatenation>;
3256def note_objc_literal_comparison_isequal : Note<
3257  "use 'isEqual:' instead">;
3258def warn_objc_collection_literal_element : Warning<
3259  "object of type %0 is not compatible with "
3260  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3261  InGroup<ObjCLiteralConversion>;
3262def warn_nsdictionary_duplicate_key : Warning<
3263  "duplicate key in dictionary literal">,
3264  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3265def note_nsdictionary_duplicate_key_here : Note<
3266  "previous equal key is here">;
3267def err_swift_param_attr_not_swiftcall : Error<
3268  "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 "
3269  "calling convention%select{|s}1">;
3270def err_swift_indirect_result_not_first : Error<
3271  "'swift_indirect_result' parameters must be first parameters of function">;
3272def err_swift_error_result_not_after_swift_context : Error<
3273  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3274def err_swift_abi_parameter_wrong_type : Error<
3275  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3276  "type here is %2">;
3277
3278def err_attribute_argument_invalid : Error<
3279  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3280  "min must not be greater than max}1">;
3281def err_attribute_argument_is_zero : Error<
3282  "%0 attribute must be greater than 0">;
3283def warn_attribute_argument_n_negative : Warning<
3284  "%0 attribute parameter %1 is negative and will be ignored">,
3285  InGroup<CudaCompat>;
3286def err_property_function_in_objc_container : Error<
3287  "use of Objective-C property in function nested in Objective-C "
3288  "container not supported, move function outside its container">;
3289
3290let CategoryName = "Cocoa API Issue" in {
3291def warn_objc_redundant_literal_use : Warning<
3292  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3293}
3294
3295def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3296  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3297
3298def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
3299
3300def err_tls_var_aligned_over_maximum : Error<
3301  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3302  "alignment (%2) for a thread-local variable on this target">;
3303
3304def err_only_annotate_after_access_spec : Error<
3305  "access specifier can only have annotation attributes">;
3306
3307def err_attribute_section_invalid_for_target : Error<
3308  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3309def err_pragma_section_invalid_for_target : Error<
3310  "argument to #pragma section is not valid for this target: %0">;
3311def warn_attribute_section_drectve : Warning<
3312  "#pragma %0(\".drectve\") has undefined behavior, "
3313  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3314def warn_mismatched_section : Warning<
3315  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3316def warn_attribute_section_on_redeclaration : Warning<
3317  "section attribute is specified on redeclared variable">, InGroup<Section>;
3318def err_mismatched_code_seg_base : Error<
3319  "derived class must specify the same code segment as its base classes">;
3320def err_mismatched_code_seg_override : Error<
3321  "overriding virtual function must specify the same code segment as its overridden function">;
3322def err_conflicting_codeseg_attribute : Error<
3323  "conflicting code segment specifiers">;
3324def warn_duplicate_codeseg_attribute : Warning<
3325  "duplicate code segment specifiers">, InGroup<Section>;
3326
3327def err_anonymous_property: Error<
3328  "anonymous property is not supported">;
3329def err_property_is_variably_modified : Error<
3330  "property %0 has a variably modified type">;
3331def err_no_accessor_for_property : Error<
3332  "no %select{getter|setter}0 defined for property %1">;
3333def err_cannot_find_suitable_accessor : Error<
3334  "cannot find suitable %select{getter|setter}0 for property %1">;
3335
3336def warn_alloca : Warning<
3337  "use of function %0 is discouraged; there is no way to check for failure but "
3338  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3339  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3340
3341def warn_alloca_align_alignof : Warning<
3342  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3343  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3344
3345def err_alignment_too_small : Error<
3346  "requested alignment must be %0 or greater">;
3347def err_alignment_too_big : Error<
3348  "requested alignment must be %0 or smaller">;
3349def err_alignment_not_power_of_two : Error<
3350  "requested alignment is not a power of 2">;
3351def warn_alignment_not_power_of_two : Warning<
3352  err_alignment_not_power_of_two.Summary>,
3353  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3354def err_alignment_dependent_typedef_name : Error<
3355  "requested alignment is dependent but declaration is not dependent">;
3356
3357def warn_alignment_builtin_useless : Warning<
3358  "%select{aligning a value|the result of checking whether a value is aligned}0"
3359  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3360def err_attribute_aligned_too_great : Error<
3361  "requested alignment must be %0 bytes or smaller">;
3362def warn_assume_aligned_too_great
3363    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3364              "alignment assumed">,
3365      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3366def warn_not_xl_compatible
3367    : Warning<"alignment of 16 bytes for a struct member is not binary "
3368              "compatible with IBM XL C/C++ for AIX 16.1.0 or older">,
3369      InGroup<AIXCompat>;
3370def note_misaligned_member_used_here : Note<
3371    "passing byval argument %0 with potentially incompatible alignment here">;
3372def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3373  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3374  InGroup<MicrosoftInconsistentDllImport>;
3375def warn_redeclaration_without_import_attribute : Warning<
3376  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3377  InGroup<MicrosoftInconsistentDllImport>;
3378def warn_dllimport_dropped_from_inline_function : Warning<
3379  "%q0 redeclared inline; %1 attribute ignored">,
3380  InGroup<IgnoredAttributes>;
3381def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3382  " exception specification; attribute ignored">,
3383  InGroup<IgnoredAttributes>;
3384def warn_attribute_ignored_on_non_definition :
3385  Warning<"%0 attribute ignored on a non-definition declaration">,
3386  InGroup<IgnoredAttributes>;
3387def warn_attribute_ignored_on_inline :
3388  Warning<"%0 attribute ignored on inline function">,
3389  InGroup<IgnoredAttributes>;
3390def warn_nocf_check_attribute_ignored :
3391  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3392  InGroup<IgnoredAttributes>;
3393def warn_attribute_after_definition_ignored : Warning<
3394  "attribute %0 after definition is ignored">,
3395   InGroup<IgnoredAttributes>;
3396def warn_attributes_likelihood_ifstmt_conflict
3397    : Warning<"conflicting attributes %0 are ignored">,
3398      InGroup<IgnoredAttributes>;
3399def warn_cxx11_gnu_attribute_on_type : Warning<
3400  "attribute %0 ignored, because it cannot be applied to a type">,
3401  InGroup<IgnoredAttributes>;
3402def warn_unhandled_ms_attribute_ignored : Warning<
3403  "__declspec attribute %0 is not supported">,
3404  InGroup<IgnoredAttributes>;
3405def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3406  "attribute %0 has no effect when annotating an infinite loop">,
3407   InGroup<IgnoredAttributes>;
3408def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3409  "annotating the infinite loop here">;
3410def warn_attribute_has_no_effect_on_compile_time_if : Warning<
3411  "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">,
3412   InGroup<IgnoredAttributes>;
3413def note_attribute_has_no_effect_on_compile_time_if_here : Note<
3414  "annotating the 'if %select{constexpr|consteval}0' statement here">;
3415def err_decl_attribute_invalid_on_stmt : Error<
3416  "%0 attribute cannot be applied to a statement">;
3417def err_attribute_invalid_on_decl : Error<
3418  "%0 attribute cannot be applied to a declaration">;
3419def warn_type_attribute_deprecated_on_decl : Warning<
3420  "applying attribute %0 to a declaration is deprecated; apply it to the type instead">,
3421  InGroup<DeprecatedAttributes>;
3422def warn_declspec_attribute_ignored : Warning<
3423  "attribute %0 is ignored, place it after "
3424  "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
3425  "type declaration">, InGroup<IgnoredAttributes>;
3426def warn_attribute_precede_definition : Warning<
3427  "attribute declaration must precede definition">,
3428  InGroup<IgnoredAttributes>;
3429def warn_attribute_void_function_method : Warning<
3430  "attribute %0 cannot be applied to "
3431  "%select{functions|Objective-C method}1 without return value">,
3432  InGroup<IgnoredAttributes>;
3433def warn_attribute_weak_on_field : Warning<
3434  "__weak attribute cannot be specified on a field declaration">,
3435  InGroup<IgnoredAttributes>;
3436def warn_gc_attribute_weak_on_local : Warning<
3437  "Objective-C GC does not allow weak variables on the stack">,
3438  InGroup<IgnoredAttributes>;
3439def warn_nsobject_attribute : Warning<
3440  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3441  InGroup<NSobjectAttribute>;
3442def warn_independentclass_attribute : Warning<
3443  "'objc_independent_class' attribute may be put on a typedef only; "
3444  "attribute is ignored">,
3445  InGroup<IndependentClassAttribute>;
3446def warn_ptr_independentclass_attribute : Warning<
3447  "'objc_independent_class' attribute may be put on Objective-C object "
3448  "pointer type only; attribute is ignored">,
3449  InGroup<IndependentClassAttribute>;
3450def warn_attribute_weak_on_local : Warning<
3451  "__weak attribute cannot be specified on an automatic variable when ARC "
3452  "is not enabled">,
3453  InGroup<IgnoredAttributes>;
3454def warn_weak_identifier_undeclared : Warning<
3455  "weak identifier %0 never declared">;
3456def warn_attribute_cmse_entry_static : Warning<
3457  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3458  InGroup<IgnoredAttributes>;
3459def warn_cmse_nonsecure_union : Warning<
3460  "passing union across security boundary via %select{parameter %1|return value}0 "
3461  "may leak information">,
3462  InGroup<DiagGroup<"cmse-union-leak">>;
3463def err_attribute_weak_static : Error<
3464  "weak declaration cannot have internal linkage">;
3465def err_attribute_selectany_non_extern_data : Error<
3466  "'selectany' can only be applied to data items with external linkage">;
3467def err_declspec_thread_on_thread_variable : Error<
3468  "'__declspec(thread)' applied to variable that already has a "
3469  "thread-local storage specifier">;
3470def err_attribute_dll_not_extern : Error<
3471  "%q0 must have external linkage when declared %q1">;
3472def err_attribute_dll_thread_local : Error<
3473  "%q0 cannot be thread local when declared %q1">;
3474def err_attribute_dll_lambda : Error<
3475  "lambda cannot be declared %0">;
3476def warn_attribute_invalid_on_definition : Warning<
3477  "'%0' attribute cannot be specified on a definition">,
3478  InGroup<IgnoredAttributes>;
3479def err_attribute_dll_redeclaration : Error<
3480  "redeclaration of %q0 cannot add %q1 attribute">;
3481def warn_attribute_dll_redeclaration : Warning<
3482  "redeclaration of %q0 should not add %q1 attribute">,
3483  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3484def err_attribute_dllimport_function_definition : Error<
3485  "dllimport cannot be applied to non-inline function definition">;
3486def err_attribute_dllimport_function_specialization_definition : Error<
3487  "cannot define non-inline dllimport template specialization">;
3488def err_attribute_dll_deleted : Error<
3489  "attribute %q0 cannot be applied to a deleted function">;
3490def err_attribute_dllimport_data_definition : Error<
3491  "definition of dllimport data">;
3492def err_attribute_dllimport_static_field_definition : Error<
3493  "definition of dllimport static field not allowed">;
3494def warn_attribute_dllimport_static_field_definition : Warning<
3495  "definition of dllimport static field">,
3496  InGroup<DiagGroup<"dllimport-static-field-def">>;
3497def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3498  "explicit instantiation declaration should not be 'dllexport'">,
3499  InGroup<DllexportExplicitInstantiationDecl>;
3500def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3501  "'dllexport' attribute ignored on explicit instantiation definition">,
3502  InGroup<IgnoredAttributes>;
3503def warn_invalid_initializer_from_system_header : Warning<
3504  "invalid constructor from class in system header, should not be explicit">,
3505  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3506def note_used_in_initialization_here : Note<"used in initialization here">;
3507def err_attribute_dll_member_of_dll_class : Error<
3508  "attribute %q0 cannot be applied to member of %q1 class">;
3509def warn_attribute_dll_instantiated_base_class : Warning<
3510  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3511  "base class template without dll attribute is not supported">,
3512  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3513def err_attribute_dll_ambiguous_default_ctor : Error<
3514  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3515def err_attribute_weakref_not_static : Error<
3516  "weakref declaration must have internal linkage">;
3517def err_attribute_weakref_not_global_context : Error<
3518  "weakref declaration of %0 must be in a global context">;
3519def err_attribute_weakref_without_alias : Error<
3520  "weakref declaration of %0 must also have an alias attribute">;
3521def err_alias_not_supported_on_darwin : Error <
3522  "aliases are not supported on darwin">;
3523def warn_attribute_wrong_decl_type_str : Warning<
3524  "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
3525def err_attribute_wrong_decl_type_str : Error<
3526  warn_attribute_wrong_decl_type_str.Summary>;
3527def warn_attribute_wrong_decl_type : Warning<
3528  "%0 attribute only applies to %select{"
3529  "functions"
3530  "|unions"
3531  "|variables and functions"
3532  "|functions and methods"
3533  "|functions, methods and blocks"
3534  "|functions, methods, and parameters"
3535  "|variables"
3536  "|variables and fields"
3537  "|variables, data members and tag types"
3538  "|types and namespaces"
3539  "|variables, functions and classes"
3540  "|kernel functions"
3541  "|non-K&R-style functions}1">,
3542  InGroup<IgnoredAttributes>;
3543def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Summary>;
3544def warn_type_attribute_wrong_type : Warning<
3545  "'%0' only applies to %select{function|pointer|"
3546  "Objective-C object or block pointer}1 types; type here is %2">,
3547  InGroup<IgnoredAttributes>;
3548def warn_incomplete_encoded_type : Warning<
3549  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3550  InGroup<DiagGroup<"encode-type">>;
3551def warn_gnu_inline_attribute_requires_inline : Warning<
3552  "'gnu_inline' attribute requires function to be marked 'inline',"
3553  " attribute ignored">,
3554  InGroup<IgnoredAttributes>;
3555def warn_gnu_inline_cplusplus_without_extern : Warning<
3556  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3557  " available, this changed in Clang 10">,
3558  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3559def err_attribute_vecreturn_only_vector_member : Error<
3560  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3561def err_attribute_vecreturn_only_pod_record : Error<
3562  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3563def err_cconv_change : Error<
3564  "function declared '%0' here was previously declared "
3565  "%select{'%2'|without calling convention}1">;
3566def warn_cconv_unsupported : Warning<
3567  "%0 calling convention is not supported %select{"
3568  // Use CallingConventionIgnoredReason Enum to specify these.
3569  "for this target"
3570  "|on variadic function"
3571  "|on constructor/destructor"
3572  "|on builtin function"
3573  "}1">,
3574  InGroup<IgnoredAttributes>;
3575def error_cconv_unsupported : Error<warn_cconv_unsupported.Summary>;
3576def err_cconv_knr : Error<
3577  "function with no prototype cannot use the %0 calling convention">;
3578def warn_cconv_knr : Warning<
3579  err_cconv_knr.Summary>,
3580  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3581def err_cconv_varargs : Error<
3582  "variadic function cannot use %0 calling convention">;
3583def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3584  "attribute was previously declared "
3585  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3586def err_function_attribute_mismatch : Error<
3587  "function declared with %0 attribute "
3588  "was previously declared without the %0 attribute">;
3589def err_objc_precise_lifetime_bad_type : Error<
3590  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3591def warn_objc_precise_lifetime_meaningless : Error<
3592  "objc_precise_lifetime is not meaningful for "
3593  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3594def err_invalid_pcs : Error<"invalid PCS type">;
3595def warn_attribute_not_on_decl : Warning<
3596  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3597def err_base_specifier_attribute : Error<
3598  "%0 attribute cannot be applied to a base specifier">;
3599def warn_declspec_allocator_nonpointer : Warning<
3600  "ignoring __declspec(allocator) because the function return type %0 is not "
3601  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3602def err_cconv_incomplete_param_type : Error<
3603  "parameter %0 must have a complete type to use function %1 with the %2 "
3604  "calling convention">;
3605def err_attribute_output_parameter : Error<
3606  "attribute only applies to output parameters">;
3607
3608def ext_cannot_use_trivial_abi : ExtWarn<
3609  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3610def note_cannot_use_trivial_abi_reason : Note<
3611  "'trivial_abi' is disallowed on %0 because %select{"
3612  "its copy constructors and move constructors are all deleted|"
3613  "it is polymorphic|"
3614  "it has a base of a non-trivial class type|it has a virtual base|"
3615  "it has a __weak field|it has a field of a non-trivial class type}1">;
3616
3617// Availability attribute
3618def warn_availability_unknown_platform : Warning<
3619  "unknown platform %0 in availability macro">, InGroup<Availability>;
3620def warn_availability_version_ordering : Warning<
3621  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3622  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3623  "attribute ignored">, InGroup<Availability>;
3624def warn_mismatched_availability: Warning<
3625  "availability does not match previous declaration">, InGroup<Availability>;
3626def warn_mismatched_availability_override : Warning<
3627  "%select{|overriding }4method %select{introduced after|"
3628  "deprecated before|obsoleted before}0 "
3629  "%select{the protocol method it implements|overridden method}4 "
3630  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3631def warn_mismatched_availability_override_unavail : Warning<
3632  "%select{|overriding }1method cannot be unavailable on %0 when "
3633  "%select{the protocol method it implements|its overridden method}1 is "
3634  "available">,
3635  InGroup<Availability>;
3636def warn_availability_on_static_initializer : Warning<
3637  "ignoring availability attribute %select{on '+load' method|"
3638  "with constructor attribute|with destructor attribute}0">,
3639  InGroup<Availability>;
3640def note_overridden_method : Note<
3641  "overridden method is here">;
3642def warn_availability_swift_unavailable_deprecated_only : Warning<
3643  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3644  InGroup<Availability>;
3645def note_protocol_method : Note<
3646  "protocol method is here">;
3647def warn_availability_fuchsia_unavailable_minor : Warning<
3648  "Fuchsia API Level prohibits specifying a minor or sub-minor version">,
3649  InGroup<Availability>;
3650
3651def warn_unguarded_availability :
3652  Warning<"%0 is only available on %1 %2 or newer">,
3653  InGroup<UnguardedAvailability>, DefaultIgnore;
3654def warn_unguarded_availability_new :
3655  Warning<warn_unguarded_availability.Summary>,
3656  InGroup<UnguardedAvailabilityNew>;
3657def note_decl_unguarded_availability_silence : Note<
3658  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3659def note_unguarded_available_silence : Note<
3660  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3661  " this warning">;
3662def warn_at_available_unchecked_use : Warning<
3663  "%select{@available|__builtin_available}0 does not guard availability here; "
3664  "use if (%select{@available|__builtin_available}0) instead">,
3665  InGroup<DiagGroup<"unsupported-availability-guard">>;
3666
3667def warn_missing_sdksettings_for_availability_checking : Warning<
3668  "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
3669  InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
3670
3671// Thread Safety Attributes
3672def warn_thread_attribute_ignored : Warning<
3673  "ignoring %0 attribute because its argument is invalid">,
3674  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3675def warn_thread_attribute_not_on_non_static_member : Warning<
3676  "%0 attribute without capability arguments can only be applied to non-static "
3677  "methods of a class">,
3678  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3679def warn_thread_attribute_not_on_capability_member : Warning<
3680  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3681  "annotated with 'capability' or 'scoped_lockable' attribute">,
3682  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3683def warn_thread_attribute_argument_not_lockable : Warning<
3684  "%0 attribute requires arguments whose type is annotated "
3685  "with 'capability' attribute; type here is %1">,
3686  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3687def warn_thread_attribute_decl_not_lockable : Warning<
3688  "%0 attribute can only be applied in a context annotated "
3689  "with 'capability' attribute">,
3690  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3691def warn_thread_attribute_decl_not_pointer : Warning<
3692  "%0 only applies to pointer types; type here is %1">,
3693  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3694def err_attribute_argument_out_of_bounds_extra_info : Error<
3695  "%0 attribute parameter %1 is out of bounds: "
3696  "%plural{0:no parameters to index into|"
3697  "1:can only be 1, since there is one parameter|"
3698  ":must be between 1 and %2}2">;
3699
3700// Thread Safety Analysis
3701def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3702  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3703def warn_unlock_kind_mismatch : Warning<
3704  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3705  "%select{shared|exclusive}3 access">,
3706  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3707def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3708  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3709def warn_no_unlock : Warning<
3710  "%0 '%1' is still held at the end of function">,
3711  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3712def warn_expecting_locked : Warning<
3713  "expecting %0 '%1' to be held at the end of function">,
3714  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3715// FIXME: improve the error message about locks not in scope
3716def warn_lock_some_predecessors : Warning<
3717  "%0 '%1' is not held on every path through here">,
3718  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3719def warn_expecting_lock_held_on_loop : Warning<
3720  "expecting %0 '%1' to be held at start of each loop">,
3721  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3722def note_locked_here : Note<"%0 acquired here">;
3723def note_unlocked_here : Note<"%0 released here">;
3724def warn_lock_exclusive_and_shared : Warning<
3725  "%0 '%1' is acquired exclusively and shared in the same scope">,
3726  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3727def note_lock_exclusive_and_shared : Note<
3728  "the other acquisition of %0 '%1' is here">;
3729def warn_variable_requires_any_lock : Warning<
3730  "%select{reading|writing}1 variable %0 requires holding "
3731  "%select{any mutex|any mutex exclusively}1">,
3732  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3733def warn_var_deref_requires_any_lock : Warning<
3734  "%select{reading|writing}1 the value pointed to by %0 requires holding "
3735  "%select{any mutex|any mutex exclusively}1">,
3736  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3737def warn_fun_excludes_mutex : Warning<
3738  "cannot call function '%1' while %0 '%2' is held">,
3739  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3740def warn_cannot_resolve_lock : Warning<
3741  "cannot resolve lock expression">,
3742  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3743def warn_acquired_before : Warning<
3744  "%0 '%1' must be acquired before '%2'">,
3745  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3746def warn_acquired_before_after_cycle : Warning<
3747  "Cycle in acquired_before/after dependencies, starting with '%0'">,
3748  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3749
3750
3751// Thread safety warnings negative capabilities
3752def warn_acquire_requires_negative_cap : Warning<
3753  "acquiring %0 '%1' requires negative capability '%2'">,
3754  InGroup<ThreadSafetyNegative>, DefaultIgnore;
3755def warn_fun_requires_negative_cap : Warning<
3756  "calling function %0 requires negative capability '%1'">,
3757  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3758
3759// Thread safety warnings on pass by reference
3760def warn_guarded_pass_by_reference : Warning<
3761  "passing variable %1 by reference requires holding %0 "
3762  "%select{'%2'|'%2' exclusively}3">,
3763  InGroup<ThreadSafetyReference>, DefaultIgnore;
3764def warn_pt_guarded_pass_by_reference : Warning<
3765  "passing the value that %1 points to by reference requires holding %0 "
3766  "%select{'%2'|'%2' exclusively}3">,
3767  InGroup<ThreadSafetyReference>, DefaultIgnore;
3768
3769// Imprecise thread safety warnings
3770def warn_variable_requires_lock : Warning<
3771  "%select{reading|writing}3 variable %1 requires holding %0 "
3772  "%select{'%2'|'%2' exclusively}3">,
3773  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3774def warn_var_deref_requires_lock : Warning<
3775  "%select{reading|writing}3 the value pointed to by %1 requires "
3776  "holding %0 %select{'%2'|'%2' exclusively}3">,
3777  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3778def warn_fun_requires_lock : Warning<
3779  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3780  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3781
3782// Precise thread safety warnings
3783def warn_variable_requires_lock_precise :
3784  Warning<warn_variable_requires_lock.Summary>,
3785  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3786def warn_var_deref_requires_lock_precise :
3787  Warning<warn_var_deref_requires_lock.Summary>,
3788  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3789def warn_fun_requires_lock_precise :
3790  Warning<warn_fun_requires_lock.Summary>,
3791  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3792def note_found_mutex_near_match : Note<"found near match '%0'">;
3793
3794// Verbose thread safety warnings
3795def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
3796  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3797def note_thread_warning_in_fun : Note<"thread warning in function %0">;
3798def note_guarded_by_declared_here : Note<"guarded_by declared here">;
3799
3800// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3801def warn_thread_safety_beta : Warning<"thread safety beta warning">,
3802  InGroup<ThreadSafetyBeta>, DefaultIgnore;
3803
3804// Consumed warnings
3805def warn_use_in_invalid_state : Warning<
3806  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3807  "state">, InGroup<Consumed>, DefaultIgnore;
3808def warn_use_of_temp_in_invalid_state : Warning<
3809  "invalid invocation of method '%0' on a temporary object while it is in the "
3810  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3811def warn_attr_on_unconsumable_class : Warning<
3812  "consumed analysis attribute is attached to member of class %0 which isn't "
3813  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3814def warn_return_typestate_for_unconsumable_type : Warning<
3815  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3816  DefaultIgnore;
3817def warn_return_typestate_mismatch : Warning<
3818  "return value not in expected state; expected '%0', observed '%1'">,
3819  InGroup<Consumed>, DefaultIgnore;
3820def warn_loop_state_mismatch : Warning<
3821  "state of variable '%0' must match at the entry and exit of loop">,
3822  InGroup<Consumed>, DefaultIgnore;
3823def warn_param_return_typestate_mismatch : Warning<
3824  "parameter '%0' not in expected state when the function returns: expected "
3825  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3826def warn_param_typestate_mismatch : Warning<
3827  "argument not in expected state; expected '%0', observed '%1'">,
3828  InGroup<Consumed>, DefaultIgnore;
3829
3830// no_sanitize attribute
3831def warn_unknown_sanitizer_ignored : Warning<
3832  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3833
3834def warn_impcast_vector_scalar : Warning<
3835  "implicit conversion turns vector to scalar: %0 to %1">,
3836  InGroup<Conversion>, DefaultIgnore;
3837def warn_impcast_complex_scalar : Warning<
3838  "implicit conversion discards imaginary component: %0 to %1">,
3839  InGroup<Conversion>, DefaultIgnore;
3840def err_impcast_complex_scalar : Error<
3841  "implicit conversion from %0 to %1 is not permitted in C++">;
3842def warn_impcast_float_precision : Warning<
3843  "implicit conversion loses floating-point precision: %0 to %1">,
3844  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3845def warn_impcast_float_result_precision : Warning<
3846  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3847  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3848def warn_impcast_double_promotion : Warning<
3849  "implicit conversion increases floating-point precision: %0 to %1">,
3850  InGroup<DoublePromotion>, DefaultIgnore;
3851def warn_impcast_integer_sign : Warning<
3852  "implicit conversion changes signedness: %0 to %1">,
3853  InGroup<SignConversion>, DefaultIgnore;
3854def warn_impcast_integer_sign_conditional : Warning<
3855  "operand of ? changes signedness: %0 to %1">,
3856  InGroup<SignConversion>, DefaultIgnore;
3857def warn_impcast_integer_precision : Warning<
3858  "implicit conversion loses integer precision: %0 to %1">,
3859  InGroup<ImplicitIntConversion>, DefaultIgnore;
3860def warn_impcast_high_order_zero_bits : Warning<
3861  "higher order bits are zeroes after implicit conversion">,
3862  InGroup<ImplicitIntConversion>, DefaultIgnore;
3863def warn_impcast_nonnegative_result : Warning<
3864  "the resulting value is always non-negative after implicit conversion">,
3865  InGroup<SignConversion>, DefaultIgnore;
3866def warn_impcast_integer_64_32 : Warning<
3867  "implicit conversion loses integer precision: %0 to %1">,
3868  InGroup<Shorten64To32>, DefaultIgnore;
3869def warn_impcast_integer_precision_constant : Warning<
3870  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3871  InGroup<ConstantConversion>;
3872def warn_impcast_single_bit_bitield_precision_constant : Warning<
3873  "implicit truncation from %2 to a one-bit wide bit-field changes value from "
3874  "%0 to %1">, InGroup<SingleBitBitFieldConstantConversion>;
3875def warn_impcast_bitfield_precision_constant : Warning<
3876  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3877  InGroup<BitFieldConstantConversion>;
3878def warn_impcast_constant_value_to_objc_bool : Warning<
3879  "implicit conversion from constant value %0 to 'BOOL'; "
3880  "the only well defined values for 'BOOL' are YES and NO">,
3881  InGroup<ObjCBoolConstantConversion>;
3882
3883def warn_impcast_fixed_point_range : Warning<
3884  "implicit conversion from %0 cannot fit within the range of values for %1">,
3885  InGroup<ImplicitFixedPointConversion>;
3886
3887def warn_impcast_literal_float_to_integer : Warning<
3888  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3889  InGroup<LiteralConversion>;
3890def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3891  "implicit conversion of out of range value from %0 to %1 is undefined">,
3892  InGroup<LiteralConversion>;
3893def warn_impcast_float_integer : Warning<
3894  "implicit conversion turns floating-point number into integer: %0 to %1">,
3895  InGroup<FloatConversion>, DefaultIgnore;
3896def warn_impcast_float_to_objc_signed_char_bool : Warning<
3897  "implicit conversion from floating-point type %0 to 'BOOL'">,
3898  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
3899def warn_impcast_int_to_objc_signed_char_bool : Warning<
3900  "implicit conversion from integral type %0 to 'BOOL'">,
3901  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
3902
3903// Implicit int -> float conversion precision loss warnings.
3904def warn_impcast_integer_float_precision : Warning<
3905  "implicit conversion from %0 to %1 may lose precision">,
3906  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
3907def warn_impcast_integer_float_precision_constant : Warning<
3908  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3909  InGroup<ImplicitConstIntFloatConversion>;
3910
3911def warn_impcast_float_to_integer : Warning<
3912  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3913  InGroup<FloatOverflowConversion>, DefaultIgnore;
3914def warn_impcast_float_to_integer_out_of_range : Warning<
3915  "implicit conversion of out of range value from %0 to %1 is undefined">,
3916  InGroup<FloatOverflowConversion>, DefaultIgnore;
3917def warn_impcast_float_to_integer_zero : Warning<
3918  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3919  InGroup<FloatZeroConversion>, DefaultIgnore;
3920
3921def warn_impcast_string_literal_to_bool : Warning<
3922  "implicit conversion turns string literal into bool: %0 to %1">,
3923  InGroup<StringConversion>, DefaultIgnore;
3924def warn_impcast_different_enum_types : Warning<
3925  "implicit conversion from enumeration type %0 to different enumeration type "
3926  "%1">, InGroup<EnumConversion>;
3927def warn_impcast_bool_to_null_pointer : Warning<
3928    "initialization of pointer of type %0 to null from a constant boolean "
3929    "expression">, InGroup<BoolConversion>;
3930def warn_non_literal_null_pointer : Warning<
3931    "expression which evaluates to zero treated as a null pointer constant of "
3932    "type %0">, InGroup<NonLiteralNullConversion>;
3933def warn_pointer_compare : Warning<
3934    "comparing a pointer to a null character constant; did you mean "
3935    "to compare to %select{NULL|(void *)0}0?">,
3936    InGroup<DiagGroup<"pointer-compare">>;
3937def warn_impcast_null_pointer_to_integer : Warning<
3938    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3939    InGroup<NullConversion>;
3940def warn_impcast_floating_point_to_bool : Warning<
3941    "implicit conversion turns floating-point number into bool: %0 to %1">,
3942    InGroup<ImplicitConversionFloatingPointToBool>;
3943def ext_ms_impcast_fn_obj : ExtWarn<
3944  "implicit conversion between pointer-to-function and pointer-to-object is a "
3945  "Microsoft extension">, InGroup<MicrosoftCast>;
3946
3947def warn_impcast_pointer_to_bool : Warning<
3948    "address of%select{| function| array}0 '%1' will always evaluate to "
3949    "'true'">,
3950    InGroup<PointerBoolConversion>;
3951def warn_cast_nonnull_to_bool : Warning<
3952    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3953    "'true' on first encounter">,
3954    InGroup<PointerBoolConversion>;
3955def warn_this_bool_conversion : Warning<
3956  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3957  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3958def warn_address_of_reference_bool_conversion : Warning<
3959  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3960  "code; pointer may be assumed to always convert to true">,
3961  InGroup<UndefinedBoolConversion>;
3962
3963def warn_xor_used_as_pow : Warning<
3964  "result of '%0' is %1; did you mean exponentiation?">,
3965  InGroup<XorUsedAsPow>;
3966def warn_xor_used_as_pow_base_extra : Warning<
3967  "result of '%0' is %1; did you mean '%2' (%3)?">,
3968  InGroup<XorUsedAsPow>;
3969def warn_xor_used_as_pow_base : Warning<
3970  "result of '%0' is %1; did you mean '%2'?">,
3971  InGroup<XorUsedAsPow>;
3972def note_xor_used_as_pow_silence : Note<
3973  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
3974
3975def warn_null_pointer_compare : Warning<
3976    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3977    "equal to a null pointer is always %select{true|false}2">,
3978    InGroup<TautologicalPointerCompare>;
3979def warn_nonnull_expr_compare : Warning<
3980    "comparison of nonnull %select{function call|parameter}0 '%1' "
3981    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3982    "encounter">,
3983    InGroup<TautologicalPointerCompare>;
3984def warn_this_null_compare : Warning<
3985  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3986  "assumed to always evaluate to %select{true|false}0">,
3987  InGroup<TautologicalUndefinedCompare>;
3988def warn_address_of_reference_null_compare : Warning<
3989  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3990  "code; comparison may be assumed to always evaluate to "
3991  "%select{true|false}0">,
3992  InGroup<TautologicalUndefinedCompare>;
3993def note_reference_is_return_value : Note<"%0 returns a reference">;
3994
3995def note_pointer_declared_here : Note<
3996  "pointer %0 declared here">;
3997def warn_division_sizeof_ptr : Warning<
3998  "'%0' will return the size of the pointer, not the array itself">,
3999  InGroup<DiagGroup<"sizeof-pointer-div">>;
4000def warn_division_sizeof_array : Warning<
4001  "expression does not compute the number of elements in this array; element "
4002  "type is %0, not %1">,
4003  InGroup<DiagGroup<"sizeof-array-div">>;
4004
4005def note_function_warning_silence : Note<
4006    "prefix with the address-of operator to silence this warning">;
4007def note_function_to_function_call : Note<
4008    "suffix with parentheses to turn this into a function call">;
4009def warn_impcast_objective_c_literal_to_bool : Warning<
4010    "implicit boolean conversion of Objective-C object literal always "
4011    "evaluates to true">,
4012    InGroup<ObjCLiteralConversion>;
4013
4014def warn_cast_align : Warning<
4015  "cast from %0 to %1 increases required alignment from %2 to %3">,
4016  InGroup<CastAlign>, DefaultIgnore;
4017def warn_old_style_cast : Warning<
4018  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore,
4019  SuppressInSystemMacro;
4020
4021// Separate between casts to void* and non-void* pointers.
4022// Some APIs use (abuse) void* for something like a user context,
4023// and often that value is an integer even if it isn't a pointer itself.
4024// Having a separate warning flag allows users to control the warning
4025// for their workflow.
4026def warn_int_to_pointer_cast : Warning<
4027  "cast to %1 from smaller integer type %0">,
4028  InGroup<IntToPointerCast>;
4029def warn_int_to_void_pointer_cast : Warning<
4030  "cast to %1 from smaller integer type %0">,
4031  InGroup<IntToVoidPointerCast>;
4032def warn_pointer_to_int_cast : Warning<
4033  "cast to smaller integer type %1 from %0">,
4034  InGroup<PointerToIntCast>;
4035def warn_pointer_to_enum_cast : Warning<
4036  warn_pointer_to_int_cast.Summary>,
4037  InGroup<PointerToEnumCast>;
4038def warn_void_pointer_to_int_cast : Warning<
4039  "cast to smaller integer type %1 from %0">,
4040  InGroup<VoidPointerToIntCast>;
4041def warn_void_pointer_to_enum_cast : Warning<
4042  warn_void_pointer_to_int_cast.Summary>,
4043  InGroup<VoidPointerToEnumCast>;
4044
4045def warn_attribute_ignored_for_field_of_type : Warning<
4046  "%0 attribute ignored for field of type %1">,
4047  InGroup<IgnoredAttributes>;
4048def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
4049  "enums in the Microsoft ABI are signed integers by default; consider giving "
4050  "the enum %0 an unsigned underlying type to make this code portable">,
4051  InGroup<SignedEnumBitfield>, DefaultIgnore;
4052def warn_attribute_packed_for_bitfield : Warning<
4053  "'packed' attribute was ignored on bit-fields with single-byte alignment "
4054  "in older versions of GCC and Clang">,
4055  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
4056def warn_transparent_union_attribute_field_size_align : Warning<
4057  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
4058  "%select{alignment|size}0 of the first field in transparent union; "
4059  "transparent_union attribute ignored">,
4060  InGroup<IgnoredAttributes>;
4061def note_transparent_union_first_field_size_align : Note<
4062  "%select{alignment|size}0 of first field is %1 bits">;
4063def warn_transparent_union_attribute_not_definition : Warning<
4064  "transparent_union attribute can only be applied to a union definition; "
4065  "attribute ignored">,
4066  InGroup<IgnoredAttributes>;
4067def warn_transparent_union_attribute_floating : Warning<
4068  "first field of a transparent union cannot have %select{floating point|"
4069  "vector}0 type %1; transparent_union attribute ignored">,
4070  InGroup<IgnoredAttributes>;
4071def warn_transparent_union_attribute_zero_fields : Warning<
4072  "transparent union definition must contain at least one field; "
4073  "transparent_union attribute ignored">,
4074  InGroup<IgnoredAttributes>;
4075def warn_attribute_type_not_supported : Warning<
4076  "%0 attribute argument not supported: %1">,
4077  InGroup<IgnoredAttributes>;
4078def warn_attribute_type_not_supported_global : Warning<
4079  "%0 attribute argument '%1' not supported on a global variable">,
4080  InGroup<IgnoredAttributes>;
4081def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
4082  InGroup<IgnoredAttributes>;
4083def warn_attribute_protected_visibility :
4084  Warning<"target does not support 'protected' visibility; using 'default'">,
4085  InGroup<DiagGroup<"unsupported-visibility">>;
4086def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
4087def note_previous_attribute : Note<"previous attribute is here">;
4088def note_conflicting_attribute : Note<"conflicting attribute is here">;
4089def note_attribute : Note<"attribute is here">;
4090def err_mismatched_ms_inheritance : Error<
4091  "inheritance model does not match %select{definition|previous declaration}0">;
4092def warn_ignored_ms_inheritance : Warning<
4093  "inheritance model ignored on %select{primary template|partial specialization}0">,
4094  InGroup<IgnoredAttributes>;
4095def note_previous_ms_inheritance : Note<
4096  "previous inheritance model specified here">;
4097def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
4098def err_mode_not_primitive : Error<
4099  "mode attribute only supported for integer and floating-point types">;
4100def err_mode_wrong_type : Error<
4101  "type of machine mode does not match type of base type">;
4102def warn_vector_mode_deprecated : Warning<
4103  "specifying vector types with the 'mode' attribute is deprecated; "
4104  "use the 'vector_size' attribute instead">,
4105  InGroup<DeprecatedAttributes>;
4106def warn_deprecated_noreturn_spelling : Warning<
4107  "the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use "
4108  "'[[noreturn]]' instead">, InGroup<DeprecatedAttributes>;
4109def err_complex_mode_vector_type : Error<
4110  "type of machine mode does not support base vector types">;
4111def err_enum_mode_vector_type : Error<
4112  "mode %0 is not supported for enumeration types">;
4113def warn_attribute_nonnull_no_pointers : Warning<
4114  "'nonnull' attribute applied to function with no pointer arguments">,
4115  InGroup<IgnoredAttributes>;
4116def warn_attribute_nonnull_parm_no_args : Warning<
4117  "'nonnull' attribute when used on parameters takes no arguments">,
4118  InGroup<IgnoredAttributes>;
4119def warn_function_stmt_attribute_precedence : Warning<
4120  "statement attribute %0 has higher precedence than function attribute "
4121  "'%select{always_inline|flatten|noinline}1'">,
4122  InGroup<IgnoredAttributes>;
4123def note_declared_nonnull : Note<
4124  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
4125def warn_attribute_sentinel_named_arguments : Warning<
4126  "'sentinel' attribute requires named arguments">,
4127  InGroup<IgnoredAttributes>;
4128def warn_attribute_sentinel_not_variadic : Warning<
4129  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
4130  InGroup<IgnoredAttributes>;
4131def warn_deprecated_ignored_on_using : Warning<
4132  "%0 currently has no effect on a using declaration">,
4133  InGroup<IgnoredAttributes>;
4134def err_attribute_sentinel_less_than_zero : Error<
4135  "'sentinel' parameter 1 less than zero">;
4136def err_attribute_sentinel_not_zero_or_one : Error<
4137  "'sentinel' parameter 2 not 0 or 1">;
4138def warn_cleanup_ext : Warning<
4139  "GCC does not allow the 'cleanup' attribute argument to be anything other "
4140  "than a simple identifier">,
4141  InGroup<GccCompat>;
4142def err_attribute_cleanup_arg_not_function : Error<
4143  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
4144def err_attribute_cleanup_func_must_take_one_arg : Error<
4145  "'cleanup' function %0 must take 1 parameter">;
4146def err_attribute_cleanup_func_arg_incompatible_type : Error<
4147  "'cleanup' function %0 parameter has "
4148  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
4149def err_attribute_regparm_wrong_platform : Error<
4150  "'regparm' is not valid on this platform">;
4151def err_attribute_regparm_invalid_number : Error<
4152  "'regparm' parameter must be between 0 and %0 inclusive">;
4153def err_attribute_not_supported_in_lang : Error<
4154  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
4155def err_attribute_not_supported_on_arch
4156    : Error<"%0 attribute is not supported on '%1'">;
4157def warn_gcc_ignores_type_attr : Warning<
4158  "GCC does not allow the %0 attribute to be written on a type">,
4159  InGroup<GccCompat>;
4160def warn_gcc_requires_variadic_function : Warning<
4161  "GCC requires a function with the %0 attribute to be variadic">,
4162  InGroup<GccCompat>;
4163
4164// Clang-Specific Attributes
4165def warn_attribute_iboutlet : Warning<
4166  "%0 attribute can only be applied to instance variables or properties">,
4167  InGroup<IgnoredAttributes>;
4168def err_iboutletcollection_type : Error<
4169  "invalid type %0 as argument of iboutletcollection attribute">;
4170def err_iboutletcollection_builtintype : Error<
4171  "type argument of iboutletcollection attribute cannot be a builtin type">;
4172def warn_iboutlet_object_type : Warning<
4173  "%select{instance variable|property}2 with %0 attribute must "
4174  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
4175def warn_iboutletcollection_property_assign : Warning<
4176  "IBOutletCollection properties should be copy/strong and not assign">,
4177  InGroup<ObjCInvalidIBOutletProperty>;
4178
4179def err_attribute_overloadable_mismatch : Error<
4180  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
4181def note_attribute_overloadable_prev_overload : Note<
4182  "previous %select{unmarked |}0overload of function is here">;
4183def err_attribute_overloadable_no_prototype : Error<
4184  "'overloadable' function %0 must have a prototype">;
4185def err_attribute_overloadable_multiple_unmarked_overloads : Error<
4186  "at most one overload for a given name may lack the 'overloadable' "
4187  "attribute">;
4188def warn_attribute_no_builtin_invalid_builtin_name : Warning<
4189  "'%0' is not a valid builtin name for %1">,
4190  InGroup<DiagGroup<"invalid-no-builtin-names">>;
4191def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
4192  "empty %0 cannot be composed with named ones">;
4193def err_attribute_no_builtin_on_non_definition : Error<
4194  "%0 attribute is permitted on definitions only">;
4195def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
4196  "%0 attribute has no effect on defaulted or deleted functions">;
4197def warn_ns_attribute_wrong_return_type : Warning<
4198  "%0 attribute only applies to %select{functions|methods|properties}1 that "
4199  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
4200  InGroup<IgnoredAttributes>;
4201def err_ns_attribute_wrong_parameter_type : Error<
4202  "%0 attribute only applies to "
4203  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
4204def warn_ns_attribute_wrong_parameter_type : Warning<
4205  "%0 attribute only applies to "
4206  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
4207  InGroup<IgnoredAttributes>;
4208def warn_objc_requires_super_protocol : Warning<
4209  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
4210  InGroup<DiagGroup<"requires-super-attribute">>;
4211def note_protocol_decl : Note<
4212  "protocol is declared here">;
4213def note_protocol_decl_undefined : Note<
4214  "protocol %0 has no definition">;
4215def err_attribute_preferred_name_arg_invalid : Error<
4216  "argument %0 to 'preferred_name' attribute is not a typedef for "
4217  "a specialization of %1">;
4218def err_attribute_builtin_alias : Error<
4219  "%0 attribute can only be applied to a ARM, HLSL or RISC-V builtin">;
4220
4221// called-once attribute diagnostics.
4222def err_called_once_attribute_wrong_type : Error<
4223  "'called_once' attribute only applies to function-like parameters">;
4224
4225def warn_completion_handler_never_called : Warning<
4226  "%select{|captured }1completion handler is never called">,
4227  InGroup<CompletionHandler>, DefaultIgnore;
4228def warn_called_once_never_called : Warning<
4229  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
4230  InGroup<CalledOnceParameter>;
4231
4232def warn_completion_handler_never_called_when : Warning<
4233  "completion handler is never %select{used|called}1 when "
4234  "%select{taking true branch|taking false branch|"
4235  "handling this case|none of the cases applies|"
4236  "entering the loop|skipping the loop|taking one of the branches}2">,
4237  InGroup<CompletionHandler>, DefaultIgnore;
4238def warn_called_once_never_called_when : Warning<
4239  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
4240  "%select{taking true branch|taking false branch|"
4241  "handling this case|none of the cases applies|"
4242  "entering the loop|skipping the loop|taking one of the branches}2">,
4243  InGroup<CalledOnceParameter>;
4244
4245def warn_completion_handler_called_twice : Warning<
4246  "completion handler is called twice">,
4247  InGroup<CompletionHandler>, DefaultIgnore;
4248def warn_called_once_gets_called_twice : Warning<
4249  "%0 parameter marked 'called_once' is called twice">,
4250  InGroup<CalledOnceParameter>;
4251def note_called_once_gets_called_twice : Note<
4252  "previous call is here%select{; set to nil to indicate "
4253  "it cannot be called afterwards|}0">;
4254
4255// objc_designated_initializer attribute diagnostics.
4256def warn_objc_designated_init_missing_super_call : Warning<
4257  "designated initializer missing a 'super' call to a designated initializer of the super class">,
4258  InGroup<ObjCDesignatedInit>;
4259def note_objc_designated_init_marked_here : Note<
4260  "method marked as designated initializer of the class here">;
4261def warn_objc_designated_init_non_super_designated_init_call : Warning<
4262  "designated initializer should only invoke a designated initializer on 'super'">,
4263  InGroup<ObjCDesignatedInit>;
4264def warn_objc_designated_init_non_designated_init_call : Warning<
4265  "designated initializer invoked a non-designated initializer">,
4266  InGroup<ObjCDesignatedInit>;
4267def warn_objc_secondary_init_super_init_call : Warning<
4268  "convenience initializer should not invoke an initializer on 'super'">,
4269  InGroup<ObjCDesignatedInit>;
4270def warn_objc_secondary_init_missing_init_call : Warning<
4271  "convenience initializer missing a 'self' call to another initializer">,
4272  InGroup<ObjCDesignatedInit>;
4273def warn_objc_implementation_missing_designated_init_override : Warning<
4274  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4275  InGroup<ObjCDesignatedInit>;
4276def err_designated_init_attr_non_init : Error<
4277  "'objc_designated_initializer' attribute only applies to init methods "
4278  "of interface or class extension declarations">;
4279
4280// objc_bridge attribute diagnostics.
4281def err_objc_attr_not_id : Error<
4282  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4283def err_objc_attr_typedef_not_id : Error<
4284  "parameter of %0 attribute must be 'id' when used on a typedef">;
4285def err_objc_attr_typedef_not_void_pointer : Error<
4286  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4287def err_objc_cf_bridged_not_interface : Error<
4288  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4289def err_objc_ns_bridged_invalid_cfobject : Error<
4290  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
4291def warn_objc_invalid_bridge : Warning<
4292  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4293def warn_objc_invalid_bridge_to_cf : Warning<
4294  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4295
4296// objc_bridge_related attribute diagnostics.
4297def err_objc_bridged_related_invalid_class : Error<
4298  "could not find Objective-C class %0 to convert %1 to %2">;
4299def err_objc_bridged_related_invalid_class_name : Error<
4300  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4301def err_objc_bridged_related_known_method : Error<
4302 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4303 "method for this conversion">;
4304
4305def err_objc_attr_protocol_requires_definition : Error<
4306  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4307
4308// Swift attributes.
4309def warn_attr_swift_name_function
4310  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4311    InGroup<SwiftNameAttribute>;
4312def warn_attr_swift_name_invalid_identifier
4313  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4314    InGroup<SwiftNameAttribute>;
4315def warn_attr_swift_name_decl_kind
4316  : Warning<"%0 attribute cannot be applied to this declaration">,
4317    InGroup<SwiftNameAttribute>;
4318def warn_attr_swift_name_subscript_invalid_parameter
4319  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4320        "have at least one parameter|"
4321        "have a 'self:' parameter}1">,
4322    InGroup<SwiftNameAttribute>;
4323def warn_attr_swift_name_missing_parameters
4324  : Warning<"%0 attribute is missing parameter label clause">,
4325    InGroup<SwiftNameAttribute>;
4326def warn_attr_swift_name_setter_parameters
4327  : Warning<"%0 attribute for setter must have one parameter for new value">,
4328    InGroup<SwiftNameAttribute>;
4329def warn_attr_swift_name_multiple_selfs
4330  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4331    InGroup<SwiftNameAttribute>;
4332def warn_attr_swift_name_getter_parameters
4333  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4334    InGroup<SwiftNameAttribute>;
4335def warn_attr_swift_name_subscript_setter_no_newValue
4336  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4337    InGroup<SwiftNameAttribute>;
4338def warn_attr_swift_name_subscript_setter_multiple_newValues
4339  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4340    InGroup<SwiftNameAttribute>;
4341def warn_attr_swift_name_subscript_getter_newValue
4342  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4343    InGroup<SwiftNameAttribute>;
4344def warn_attr_swift_name_num_params
4345  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4346            "the %1 attribute (expected %2; got %3)">,
4347    InGroup<SwiftNameAttribute>;
4348def warn_attr_swift_name_decl_missing_params
4349  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4350            "with no parameters">,
4351    InGroup<SwiftNameAttribute>;
4352
4353def err_attr_swift_error_no_error_parameter : Error<
4354  "%0 attribute can only be applied to a %select{function|method}1 with an "
4355  "error parameter">;
4356def err_attr_swift_error_return_type : Error<
4357  "%0 attribute with '%1' convention can only be applied to a "
4358  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4359
4360def err_swift_async_no_access : Error<
4361  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4362  "'not_swift_private'">;
4363def err_swift_async_bad_block_type : Error<
4364  "'swift_async' completion handler parameter must have block type returning"
4365  " 'void', type here is %0">;
4366
4367def err_swift_async_error_without_swift_async : Error<
4368  "%0 attribute must be applied to a %select{function|method}1 annotated "
4369  "with non-'none' attribute 'swift_async'">;
4370def err_swift_async_error_no_error_parameter : Error<
4371  "%0 attribute with 'nonnull_error' convention can only be applied to a "
4372  "%select{function|method}1 with a completion handler with an error "
4373  "parameter">;
4374def err_swift_async_error_non_integral : Error<
4375  "%0 attribute with '%1' convention must have an integral-typed parameter "
4376  "in completion handler at index %2, type here is %3">;
4377
4378def warn_ignored_objc_externally_retained : Warning<
4379  "'objc_externally_retained' can only be applied to local variables "
4380  "%select{of retainable type|with strong ownership}0">,
4381  InGroup<IgnoredAttributes>;
4382
4383// Function Parameter Semantic Analysis.
4384def err_param_with_void_type : Error<"argument may not have 'void' type">;
4385def err_void_only_param : Error<
4386  "'void' must be the first and only parameter if specified">;
4387def err_void_param_qualified : Error<
4388  "'void' as parameter must not have type qualifiers">;
4389def err_ident_list_in_fn_declaration : Error<
4390  "a parameter list without types is only allowed in a function definition">;
4391def ext_param_not_declared : ExtWarn<
4392  "parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not "
4393  "support implicit int">, InGroup<ImplicitInt>, DefaultError;
4394def err_param_default_argument : Error<
4395  "C does not support default arguments">;
4396def err_param_default_argument_redefinition : Error<
4397  "redefinition of default argument">;
4398def ext_param_default_argument_redefinition : ExtWarn<
4399  err_param_default_argument_redefinition.Summary>,
4400  InGroup<MicrosoftDefaultArgRedefinition>;
4401def err_param_default_argument_missing : Error<
4402  "missing default argument on parameter">;
4403def err_param_default_argument_missing_name : Error<
4404  "missing default argument on parameter %0">;
4405def err_param_default_argument_references_param : Error<
4406  "default argument references parameter %0">;
4407def err_param_default_argument_references_local : Error<
4408  "default argument references local variable %0 of enclosing function">;
4409def err_param_default_argument_references_this : Error<
4410  "default argument references 'this'">;
4411def err_param_default_argument_nonfunc : Error<
4412  "default arguments can only be specified for parameters in a function "
4413  "declaration">;
4414def err_param_default_argument_template_redecl : Error<
4415  "default arguments cannot be added to a function template that has already "
4416  "been declared">;
4417def err_param_default_argument_member_template_redecl : Error<
4418  "default arguments cannot be added to an out-of-line definition of a member "
4419  "of a %select{class template|class template partial specialization|nested "
4420  "class in a template}0">;
4421def err_param_default_argument_on_parameter_pack : Error<
4422  "parameter pack cannot have a default argument">;
4423def err_uninitialized_member_for_assign : Error<
4424  "cannot define the implicit copy assignment operator for %0, because "
4425  "non-static %select{reference|const}1 member %2 cannot use copy "
4426  "assignment operator">;
4427def err_uninitialized_member_in_ctor : Error<
4428  "%select{constructor for %1|"
4429  "implicit default constructor for %1|"
4430  "cannot use constructor inherited from %1:}0 must explicitly "
4431  "initialize the %select{reference|const}2 member %3">;
4432def err_default_arg_makes_ctor_special : Error<
4433  "addition of default argument on redeclaration makes this constructor a "
4434  "%select{default|copy|move}0 constructor">;
4435def err_stmt_expr_in_default_arg : Error<
4436  "default %select{argument|non-type template argument}0 may not use a GNU "
4437  "statement expression">;
4438
4439def err_use_of_default_argument_to_function_declared_later : Error<
4440  "use of default argument to function %0 that is declared later in class %1">;
4441def note_default_argument_declared_here : Note<
4442  "default argument declared here">;
4443def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4444def note_recursive_default_argument_used_here : Note<
4445  "default argument used here">;
4446
4447def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4448  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4449  "parameter type $|promoted type of K&R function parameter is not compatible "
4450  "with parameter type}0,1 declared in a previous prototype">,
4451  InGroup<KNRPromotedParameter>;
4452
4453
4454// C++ Overloading Semantic Analysis.
4455def err_ovl_diff_return_type : Error<
4456  "functions that differ only in their return type cannot be overloaded">;
4457def err_ovl_static_nonstatic_member : Error<
4458  "static and non-static member functions with the same parameter types "
4459  "cannot be overloaded">;
4460
4461let Deferrable = 1 in {
4462
4463def err_ovl_no_viable_function_in_call : Error<
4464  "no matching function for call to %0">;
4465def err_ovl_no_viable_member_function_in_call : Error<
4466  "no matching member function for call to %0">;
4467def err_ovl_ambiguous_call : Error<
4468  "call to %0 is ambiguous">;
4469def err_ovl_deleted_call : Error<"call to deleted function %0">;
4470def err_ovl_ambiguous_member_call : Error<
4471  "call to member function %0 is ambiguous">;
4472def err_ovl_deleted_member_call : Error<
4473  "call to deleted member function %0">;
4474def note_ovl_too_many_candidates : Note<
4475    "remaining %0 candidate%s0 omitted; "
4476    "pass -fshow-overloads=all to show them">;
4477
4478def select_ovl_candidate_kind : TextSubstitution<
4479  "%select{function|function|function (with reversed parameter order)|"
4480    "constructor|"
4481    "constructor (the implicit default constructor)|"
4482    "constructor (the implicit copy constructor)|"
4483    "constructor (the implicit move constructor)|"
4484    "function (the implicit copy assignment operator)|"
4485    "function (the implicit move assignment operator)|"
4486    "function (the implicit 'operator==' for this 'operator<=>)'|"
4487    "inherited constructor}0%select{| template| %2}1">;
4488
4489def note_ovl_candidate : Note<
4490    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4491    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4492    "| has different number of parameters (expected %5 but has %6)"
4493    "| has type mismatch at %ordinal5 parameter"
4494    "%diff{ (expected $ but has $)|}6,7"
4495    "| has different return type%diff{ ($ expected but has $)|}5,6"
4496    "| has different qualifiers (expected %5 but found %6)"
4497    "| has different exception specification}4">;
4498
4499def note_ovl_candidate_explicit : Note<
4500    "explicit %select{constructor|conversion function|deduction guide}0 "
4501    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4502def note_ovl_candidate_inherited_constructor : Note<
4503    "constructor from base class %0 inherited here">;
4504def note_ovl_candidate_inherited_constructor_slice : Note<
4505    "candidate %select{constructor|template}0 ignored: "
4506    "inherited constructor cannot be used to %select{copy|move}1 object">;
4507def note_ovl_candidate_illegal_constructor : Note<
4508    "candidate %select{constructor|template}0 ignored: "
4509    "instantiation %select{takes|would take}0 its own class type by value">;
4510def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4511    "candidate constructor ignored: cannot be used to construct an object "
4512    "in address space %0">;
4513def note_ovl_candidate_bad_deduction : Note<
4514    "candidate template ignored: failed template argument deduction">;
4515def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4516    "couldn't infer template argument %0">;
4517def note_ovl_candidate_incomplete_deduction_pack : Note<
4518    "candidate template ignored: "
4519    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4520    "expanded parameter in deduced argument pack %2">;
4521def note_ovl_candidate_inconsistent_deduction : Note<
4522    "candidate template ignored: deduced %select{conflicting types|"
4523    "conflicting values|conflicting templates|packs of different lengths}0 "
4524    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4525def note_ovl_candidate_inconsistent_deduction_types : Note<
4526    "candidate template ignored: deduced values %diff{"
4527    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4528    "%1 and %3 of conflicting types for parameter %0}2,4">;
4529def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4530    "candidate template ignored: invalid explicitly-specified argument "
4531    "for template parameter %0">;
4532def note_ovl_candidate_unsatisfied_constraints : Note<
4533    "candidate template ignored: constraints not satisfied%0">;
4534def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4535    "candidate template ignored: invalid explicitly-specified argument "
4536    "for %ordinal0 template parameter">;
4537def note_ovl_candidate_instantiation_depth : Note<
4538    "candidate template ignored: substitution exceeded maximum template "
4539    "instantiation depth">;
4540def note_ovl_candidate_underqualified : Note<
4541    "candidate template ignored: cannot deduce a type for %0 that would "
4542    "make %2 equal %1">;
4543def note_ovl_candidate_substitution_failure : Note<
4544    "candidate template ignored: substitution failure%0%1">;
4545def note_ovl_candidate_disabled_by_enable_if : Note<
4546    "candidate template ignored: disabled by %0%1">;
4547def note_ovl_candidate_disabled_by_requirement : Note<
4548    "candidate template ignored: requirement '%0' was not satisfied%1">;
4549def note_ovl_candidate_has_pass_object_size_params: Note<
4550    "candidate address cannot be taken because parameter %0 has "
4551    "pass_object_size attribute">;
4552def err_diagnose_if_succeeded : Error<"%0">;
4553def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4554    ShowInSystemHeader;
4555def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4556    "candidate disabled: %0">;
4557def err_addrof_function_disabled_by_enable_if_attr : Error<
4558    "cannot take address of function %0 because it has one or more "
4559    "non-tautological enable_if conditions">;
4560def err_addrof_function_constraints_not_satisfied : Error<
4561    "cannot take address of function %0 because its constraints are not "
4562    "satisfied">;
4563def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4564    "candidate function made ineligible by enable_if">;
4565def note_ovl_candidate_deduced_mismatch : Note<
4566    "candidate template ignored: deduced type "
4567    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4568    "adjusted type $ of %select{|element of }4argument"
4569    "|of %select{|element of }4%ordinal0 parameter does not match "
4570    "adjusted type of %select{|element of }4argument}1,2%3">;
4571def note_ovl_candidate_non_deduced_mismatch : Note<
4572    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4573// This note is needed because the above note would sometimes print two
4574// different types with the same name.  Remove this note when the above note
4575// can handle that case properly.
4576def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4577    "candidate template ignored: could not match %q0 against %q1">;
4578
4579// Note that we don't treat templates differently for this diagnostic.
4580def note_ovl_candidate_arity : Note<"candidate "
4581    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4582    "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
4583    "%plural{1:was|:were}5 provided">;
4584
4585def note_ovl_candidate_arity_one : Note<"candidate "
4586    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4587    "%select{requires at least|allows at most single|requires single}3 "
4588    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4589
4590def note_ovl_candidate_deleted : Note<
4591    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4592    "%select{explicitly made unavailable|explicitly deleted|"
4593    "implicitly deleted}3">;
4594
4595// Giving the index of the bad argument really clutters this message, and
4596// it's relatively unimportant because 1) it's generally obvious which
4597// argument(s) are of the given object type and 2) the fix is usually
4598// to complete the type, which doesn't involve changes to the call line
4599// anyway.  If people complain, we can change it.
4600def note_ovl_candidate_bad_conv_incomplete : Note<
4601    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4602    "cannot convert argument of incomplete type "
4603    "%diff{$ to $|to parameter type}3,4 for "
4604    "%select{%ordinal6 argument|object argument}5"
4605    "%select{|; dereference the argument with *|"
4606    "; take the address of the argument with &|"
4607    "; remove *|"
4608    "; remove &}7">;
4609def note_ovl_candidate_bad_list_argument : Note<
4610    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4611    "%select{cannot convert initializer list|too few initializers in list"
4612    "|too many initializers in list}7 argument to %4">;
4613def note_ovl_candidate_bad_overload : Note<
4614    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4615    "no overload of %4 matching %3 for %ordinal5 argument">;
4616def note_ovl_candidate_bad_conv : Note<
4617    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4618    "no known conversion "
4619    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4620    "%select{%ordinal6 argument|object argument}5"
4621    "%select{|; dereference the argument with *|"
4622    "; take the address of the argument with &|"
4623    "; remove *|"
4624    "; remove &}7">;
4625def note_ovl_candidate_bad_arc_conv : Note<
4626    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4627    "cannot implicitly convert argument "
4628    "%diff{of type $ to $|type to parameter type}3,4 for "
4629    "%select{%ordinal6 argument|object argument}5 under ARC">;
4630def note_ovl_candidate_bad_value_category : Note<
4631    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4632    "expects an %select{lvalue|rvalue}5 for "
4633    "%select{%ordinal4 argument|object argument}3">;
4634def note_ovl_candidate_bad_addrspace : Note<
4635    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4636    "cannot %select{pass pointer to|bind reference in}5 %3 "
4637    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4638    "argument">;
4639def note_ovl_candidate_bad_addrspace_this : Note<
4640    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4641    "'this' object is in %3, but method expects object in %4">;
4642def note_ovl_candidate_bad_gc : Note<
4643    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4644    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4645    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4646def note_ovl_candidate_bad_ownership : Note<
4647    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4648    "%select{%ordinal7|'this'}6 argument (%3) has "
4649    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4650    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4651    "__autoreleasing}5 ownership">;
4652def note_ovl_candidate_bad_cvr_this : Note<
4653    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4654    "'this' argument has type %3, but method is not marked "
4655    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4656    "volatile or restrict|const, volatile, or restrict}4">;
4657def note_ovl_candidate_bad_cvr : Note<
4658    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4659    "%ordinal5 argument (%3) would lose "
4660    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4661    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4662    "%select{||s||s|s|s}4">;
4663def note_ovl_candidate_bad_unaligned : Note<
4664    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4665    "%ordinal5 argument (%3) would lose __unaligned qualifier">;
4666def note_ovl_candidate_bad_base_to_derived_conv : Note<
4667    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4668    "cannot %select{convert from|convert from|bind}3 "
4669    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4670    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4671    "%ordinal6 argument">;
4672def note_ovl_candidate_bad_target : Note<
4673    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4674    "call to "
4675    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4676    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4677def note_ovl_candidate_constraints_not_satisfied : Note<
4678    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4679    "not satisfied">;
4680def note_implicit_member_target_infer_collision : Note<
4681    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4682    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4683    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4684
4685def note_ambiguous_type_conversion: Note<
4686    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4687def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4688def err_ovl_no_viable_function_in_init : Error<
4689  "no matching constructor for initialization of %0">;
4690def err_ovl_no_conversion_in_cast : Error<
4691  "cannot convert %1 to %2 without a conversion operator">;
4692def err_ovl_no_viable_conversion_in_cast : Error<
4693  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4694  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4695def err_ovl_ambiguous_conversion_in_cast : Error<
4696  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4697  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4698def err_ovl_deleted_conversion_in_cast : Error<
4699  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4700  "functional-style cast|}0 from %1 to %2 uses deleted function">;
4701def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4702def err_ref_init_ambiguous : Error<
4703  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4704def err_ovl_deleted_init : Error<
4705  "call to deleted constructor of %0">;
4706def err_ovl_deleted_special_init : Error<
4707  "call to implicitly-deleted %select{default constructor|copy constructor|"
4708  "move constructor|copy assignment operator|move assignment operator|"
4709  "destructor|function}0 of %1">;
4710def err_ovl_ambiguous_oper_unary : Error<
4711  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4712def err_ovl_ambiguous_oper_binary : Error<
4713  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4714def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4715  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4716  "and %2) to be ambiguous despite there being a unique best viable function"
4717  "%select{ with non-reversed arguments|}3">,
4718  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4719def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4720  "ambiguity is between a regular call to this operator and a call with the "
4721  "argument order reversed">;
4722def note_ovl_ambiguous_eqeq_reversed_self_non_const : Note<
4723  "mark 'operator==' as const or add a matching 'operator!=' to resolve the ambiguity">;
4724def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4725  "candidate function with non-reversed arguments">;
4726def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
4727  "ambiguous candidate function with reversed arguments">;
4728def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
4729def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
4730def err_ovl_deleted_oper : Error<
4731  "overload resolution selected deleted operator '%0'">;
4732def err_ovl_deleted_special_oper : Error<
4733  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
4734  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
4735  "implicitly deleted">;
4736def err_ovl_deleted_comparison : Error<
4737  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
4738def err_ovl_rewrite_equalequal_not_bool : Error<
4739  "return type %0 of selected 'operator==' function for rewritten "
4740  "'%1' comparison is not 'bool'">;
4741def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
4742  "ISO C++20 requires return type of selected 'operator==' function for "
4743  "rewritten '%1' comparison to be 'bool', not %0">,
4744  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
4745def err_ovl_no_viable_subscript :
4746    Error<"no viable overloaded operator[] for type %0">;
4747def err_ovl_no_oper :
4748    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
4749def err_ovl_unresolvable : Error<
4750  "reference to %select{overloaded|multiversioned}1 function could not be "
4751  "resolved; did you mean to call it%select{| with no arguments}0?">;
4752def err_bound_member_function : Error<
4753  "reference to non-static member function must be called"
4754  "%select{|; did you mean to call it with no arguments?}0">;
4755def note_possible_target_of_call : Note<"possible target for call">;
4756def err_no_viable_destructor : Error<
4757  "no viable destructor found for class %0">;
4758def err_ambiguous_destructor : Error<
4759  "destructor of class %0 is ambiguous">;
4760
4761def err_ovl_no_viable_object_call : Error<
4762  "no matching function for call to object of type %0">;
4763def err_ovl_ambiguous_object_call : Error<
4764  "call to object of type %0 is ambiguous">;
4765def err_ovl_ambiguous_subscript_call : Error<
4766  "call to subscript operator of type %0 is ambiguous">;
4767def err_ovl_deleted_object_call : Error<
4768  "call to deleted function call operator in type %0">;
4769def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
4770def err_member_call_without_object : Error<
4771  "call to non-static member function without an object argument">;
4772
4773// C++ Address of Overloaded Function
4774def err_addr_ovl_no_viable : Error<
4775  "address of overloaded function %0 does not match required type %1">;
4776def err_addr_ovl_ambiguous : Error<
4777  "address of overloaded function %0 is ambiguous">;
4778def err_addr_ovl_not_func_ptrref : Error<
4779  "address of overloaded function %0 cannot be converted to type %1">;
4780def err_addr_ovl_no_qualifier : Error<
4781  "cannot form member pointer of type %0 without '&' and class name">;
4782
4783} // let Deferrable
4784
4785// C++11 Literal Operators
4786def err_ovl_no_viable_literal_operator : Error<
4787  "no matching literal operator for call to %0"
4788  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
4789  "%select{| or 'const char *'}4"
4790  "%select{|, and no matching literal operator template}5">;
4791
4792// C++ Template Declarations
4793def err_template_param_shadow : Error<
4794  "declaration of %0 shadows template parameter">;
4795def ext_template_param_shadow : ExtWarn<
4796  err_template_param_shadow.Summary>, InGroup<MicrosoftTemplateShadow>;
4797def note_template_param_here : Note<"template parameter is declared here">;
4798def warn_template_export_unsupported : Warning<
4799  "exported templates are unsupported">;
4800def err_template_outside_namespace_or_class_scope : Error<
4801  "templates can only be declared in namespace or class scope">;
4802def err_template_inside_local_class : Error<
4803  "templates cannot be declared inside of a local class">;
4804def err_template_linkage : Error<"templates must have C++ linkage">;
4805def err_template_typedef : Error<"a typedef cannot be a template">;
4806def err_template_unnamed_class : Error<
4807  "cannot declare a class template with no name">;
4808def err_template_param_list_different_arity : Error<
4809  "%select{too few|too many}0 template parameters in template "
4810  "%select{|template parameter }1redeclaration">;
4811def note_template_param_list_different_arity : Note<
4812  "%select{too few|too many}0 template parameters in template template "
4813  "argument">;
4814def note_template_prev_declaration : Note<
4815  "previous template %select{declaration|template parameter}0 is here">;
4816def err_template_param_different_kind : Error<
4817  "template parameter has a different kind in template "
4818  "%select{|template parameter }0redeclaration">;
4819def note_template_param_different_kind : Note<
4820  "template parameter has a different kind in template argument">;
4821
4822def err_invalid_decl_specifier_in_nontype_parm : Error<
4823  "invalid declaration specifier in template non-type parameter">;
4824
4825def err_template_nontype_parm_different_type : Error<
4826  "template non-type parameter has a different type %0 in template "
4827  "%select{|template parameter }1redeclaration">;
4828
4829def note_template_nontype_parm_different_type : Note<
4830  "template non-type parameter has a different type %0 in template argument">;
4831def note_template_nontype_parm_prev_declaration : Note<
4832  "previous non-type template parameter with type %0 is here">;
4833def err_template_nontype_parm_bad_type : Error<
4834  "a non-type template parameter cannot have type %0">;
4835def err_template_nontype_parm_bad_structural_type : Error<
4836  "a non-type template parameter cannot have type %0 before C++20">;
4837def err_template_nontype_parm_incomplete : Error<
4838  "non-type template parameter has incomplete type %0">;
4839def err_template_nontype_parm_not_literal : Error<
4840  "non-type template parameter has non-literal type %0">;
4841def err_template_nontype_parm_rvalue_ref : Error<
4842  "non-type template parameter has rvalue reference type %0">;
4843def err_template_nontype_parm_not_structural : Error<
4844  "type %0 of non-type template parameter is not a structural type">;
4845def note_not_structural_non_public : Note<
4846  "%0 is not a structural type because it has a "
4847  "%select{non-static data member|base class}1 that is not public">;
4848def note_not_structural_mutable_field : Note<
4849  "%0 is not a structural type because it has a mutable "
4850  "non-static data member">;
4851def note_not_structural_rvalue_ref_field : Note<
4852  "%0 is not a structural type because it has a non-static data member "
4853  "of rvalue reference type">;
4854def note_not_structural_subobject : Note<
4855  "%0 is not a structural type because it has a "
4856  "%select{non-static data member|base class}1 of non-structural type %2">;
4857def warn_cxx17_compat_template_nontype_parm_type : Warning<
4858  "non-type template parameter of type %0 is incompatible with "
4859  "C++ standards before C++20">,
4860  DefaultIgnore, InGroup<CXXPre20Compat>;
4861def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
4862  "non-type template parameters declared with %0 are incompatible with C++ "
4863  "standards before C++17">,
4864  DefaultIgnore, InGroup<CXXPre17Compat>;
4865def err_template_param_default_arg_redefinition : Error<
4866  "template parameter redefines default argument">;
4867def err_template_param_default_arg_inconsistent_redefinition : Error<
4868  "template parameter default argument is inconsistent with previous definition">;
4869def note_template_param_prev_default_arg : Note<
4870  "previous default template argument defined here">;
4871def note_template_param_prev_default_arg_in_other_module : Note<
4872  "previous default template argument defined in module %0">;
4873def err_template_param_default_arg_missing : Error<
4874  "template parameter missing a default argument">;
4875def ext_template_parameter_default_in_function_template : ExtWarn<
4876  "default template arguments for a function template are a C++11 extension">,
4877  InGroup<CXX11>;
4878def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
4879  "default template arguments for a function template are incompatible with C++98">,
4880  InGroup<CXX98Compat>, DefaultIgnore;
4881def err_template_parameter_default_template_member : Error<
4882  "cannot add a default template argument to the definition of a member of a "
4883  "class template">;
4884def err_template_parameter_default_friend_template : Error<
4885  "default template argument not permitted on a friend template">;
4886def err_template_template_parm_no_parms : Error<
4887  "template template parameter must have its own template parameters">;
4888
4889def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4890  InGroup<CXX14>;
4891def warn_cxx11_compat_variable_template : Warning<
4892  "variable templates are incompatible with C++ standards before C++14">,
4893  InGroup<CXXPre14Compat>, DefaultIgnore;
4894def err_template_variable_noparams : Error<
4895  "extraneous 'template<>' in declaration of variable %0">;
4896def err_template_member : Error<"member %0 declared as a template">;
4897def err_member_with_template_arguments : Error<"member %0 cannot have template arguments">;
4898def err_template_member_noparams : Error<
4899  "extraneous 'template<>' in declaration of member %0">;
4900def err_template_tag_noparams : Error<
4901  "extraneous 'template<>' in declaration of %0 %1">;
4902
4903def warn_cxx17_compat_adl_only_template_id : Warning<
4904  "use of function template name with no prior function template "
4905  "declaration in function call with explicit template arguments "
4906  "is incompatible with C++ standards before C++20">,
4907  InGroup<CXXPre20Compat>, DefaultIgnore;
4908def ext_adl_only_template_id : ExtWarn<
4909  "use of function template name with no prior declaration in function call "
4910  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
4911
4912def warn_unqualified_call_to_std_cast_function : Warning<
4913  "unqualified call to '%0'">, InGroup<DiagGroup<"unqualified-std-cast-call">>;
4914
4915// C++ Template Argument Lists
4916def err_template_missing_args : Error<
4917  "use of "
4918  "%select{class template|function template|variable template|alias template|"
4919  "template template parameter|concept|template}0 %1 requires template "
4920  "arguments">;
4921def err_template_arg_list_different_arity : Error<
4922  "%select{too few|too many}0 template arguments for "
4923  "%select{class template|function template|variable template|alias template|"
4924  "template template parameter|concept|template}1 %2">;
4925def note_template_decl_here : Note<"template is declared here">;
4926def err_template_arg_must_be_type : Error<
4927  "template argument for template type parameter must be a type">;
4928def err_template_arg_must_be_type_suggest : Error<
4929  "template argument for template type parameter must be a type; "
4930  "did you forget 'typename'?">;
4931def ext_ms_template_type_arg_missing_typename : ExtWarn<
4932  "template argument for template type parameter must be a type; "
4933  "omitted 'typename' is a Microsoft extension">,
4934  InGroup<MicrosoftTemplate>;
4935def err_template_arg_must_be_expr : Error<
4936  "template argument for non-type template parameter must be an expression">;
4937def err_template_arg_nontype_ambig : Error<
4938  "template argument for non-type template parameter is treated as function type %0">;
4939def err_template_arg_must_be_template : Error<
4940  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4941def ext_template_arg_local_type : ExtWarn<
4942  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4943def ext_template_arg_unnamed_type : ExtWarn<
4944  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4945def warn_cxx98_compat_template_arg_local_type : Warning<
4946  "local type %0 as template argument is incompatible with C++98">,
4947  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4948def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4949  "unnamed type as template argument is incompatible with C++98">,
4950  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4951def note_template_unnamed_type_here : Note<
4952  "unnamed type used in template argument was declared here">;
4953def err_template_arg_overload_type : Error<
4954  "template argument is the type of an unresolved overloaded function">;
4955def err_template_arg_not_valid_template : Error<
4956  "template argument does not refer to a class or alias template, or template "
4957  "template parameter">;
4958def note_template_arg_refers_here_func : Note<
4959  "template argument refers to function template %0, here">;
4960def err_template_arg_template_params_mismatch : Error<
4961  "template template argument has different template parameters than its "
4962  "corresponding template template parameter">;
4963def err_template_arg_not_integral_or_enumeral : Error<
4964  "non-type template argument of type %0 must have an integral or enumeration"
4965  " type">;
4966def err_template_arg_not_ice : Error<
4967  "non-type template argument of type %0 is not an integral constant "
4968  "expression">;
4969def err_template_arg_not_address_constant : Error<
4970  "non-type template argument of type %0 is not a constant expression">;
4971def warn_cxx98_compat_template_arg_null : Warning<
4972  "use of null pointer as non-type template argument is incompatible with "
4973  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4974def err_template_arg_untyped_null_constant : Error<
4975  "null non-type template argument must be cast to template parameter type %0">;
4976def err_template_arg_wrongtype_null_constant : Error<
4977  "null non-type template argument of type %0 does not match template parameter "
4978  "of type %1">;
4979def err_non_type_template_parm_type_deduction_failure : Error<
4980  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4981def err_deduced_non_type_template_arg_type_mismatch : Error<
4982  "deduced non-type template argument does not have the same type as the "
4983  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4984def err_non_type_template_arg_subobject : Error<
4985  "non-type template argument refers to subobject '%0'">;
4986def err_non_type_template_arg_addr_label_diff : Error<
4987  "template argument / label address difference / what did you expect?">;
4988def err_non_type_template_arg_unsupported : Error<
4989  "sorry, non-type template argument of type %0 is not yet supported">;
4990def err_template_arg_not_convertible : Error<
4991  "non-type template argument of type %0 cannot be converted to a value "
4992  "of type %1">;
4993def warn_template_arg_negative : Warning<
4994  "non-type template argument with value '%0' converted to '%1' for unsigned "
4995  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4996def warn_template_arg_too_large : Warning<
4997  "non-type template argument value '%0' truncated to '%1' for "
4998  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4999def err_template_arg_no_ref_bind : Error<
5000  "non-type template parameter of reference type "
5001  "%diff{$ cannot bind to template argument of type $"
5002  "|cannot bind to template of incompatible argument type}0,1">;
5003def err_template_arg_ref_bind_ignores_quals : Error<
5004  "reference binding of non-type template parameter "
5005  "%diff{of type $ to template argument of type $|to template argument}0,1 "
5006  "ignores qualifiers">;
5007def err_template_arg_not_decl_ref : Error<
5008  "non-type template argument does not refer to any declaration">;
5009def err_template_arg_not_address_of : Error<
5010  "non-type template argument for template parameter of pointer type %0 must "
5011  "have its address taken">;
5012def err_template_arg_address_of_non_pointer : Error<
5013  "address taken in non-type template argument for template parameter of "
5014  "reference type %0">;
5015def err_template_arg_reference_var : Error<
5016  "non-type template argument of reference type %0 is not an object">;
5017def err_template_arg_field : Error<
5018  "non-type template argument refers to non-static data member %0">;
5019def err_template_arg_method : Error<
5020  "non-type template argument refers to non-static member function %0">;
5021def err_template_arg_object_no_linkage : Error<
5022  "non-type template argument refers to %select{function|object}0 %1 that "
5023  "does not have linkage">;
5024def warn_cxx98_compat_template_arg_object_internal : Warning<
5025  "non-type template argument referring to %select{function|object}0 %1 with "
5026  "internal linkage is incompatible with C++98">,
5027  InGroup<CXX98Compat>, DefaultIgnore;
5028def ext_template_arg_object_internal : ExtWarn<
5029  "non-type template argument referring to %select{function|object}0 %1 with "
5030  "internal linkage is a C++11 extension">, InGroup<CXX11>;
5031def err_template_arg_thread_local : Error<
5032  "non-type template argument refers to thread-local object">;
5033def note_template_arg_internal_object : Note<
5034  "non-type template argument refers to %select{function|object}0 here">;
5035def note_template_arg_refers_here : Note<
5036  "non-type template argument refers here">;
5037def err_template_arg_not_object_or_func : Error<
5038  "non-type template argument does not refer to an object or function">;
5039def err_template_arg_not_pointer_to_member_form : Error<
5040  "non-type template argument is not a pointer to member constant">;
5041def err_template_arg_member_ptr_base_derived_not_supported : Error<
5042  "sorry, non-type template argument of pointer-to-member type %1 that refers "
5043  "to member %q0 of a different class is not supported yet">;
5044def err_template_arg_invalid : Error<
5045  "non-type template argument '%0' is invalid">;
5046def ext_template_arg_extra_parens : ExtWarn<
5047  "address non-type template argument cannot be surrounded by parentheses">;
5048def warn_cxx98_compat_template_arg_extra_parens : Warning<
5049  "redundant parentheses surrounding address non-type template argument are "
5050  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5051def err_pointer_to_member_type : Error<
5052  "invalid use of pointer to member type after %select{.*|->*}0">;
5053def err_pointer_to_member_call_drops_quals : Error<
5054  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
5055def err_pointer_to_member_oper_value_classify: Error<
5056  "pointer-to-member function type %0 can only be called on an "
5057  "%select{rvalue|lvalue}1">;
5058def ext_pointer_to_const_ref_member_on_rvalue : Extension<
5059  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
5060  InGroup<CXX20>, SFINAEFailure;
5061def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
5062  "invoking a pointer to a 'const &' member function on an rvalue is "
5063  "incompatible with C++ standards before C++20">,
5064  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
5065def ext_ms_deref_template_argument: ExtWarn<
5066  "non-type template argument containing a dereference operation is a "
5067  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5068def ext_ms_delayed_template_argument: ExtWarn<
5069  "using the undeclared type %0 as a default template argument is a "
5070  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5071def err_template_arg_deduced_incomplete_pack : Error<
5072  "deduced incomplete pack %0 for template parameter %1">;
5073
5074// C++ template specialization
5075def err_template_spec_unknown_kind : Error<
5076  "can only provide an explicit specialization for a class template, function "
5077  "template, variable template, or a member function, static data member, "
5078  "%select{or member class|member class, or member enumeration}0 of a "
5079  "class template">;
5080def note_specialized_entity : Note<
5081  "explicitly specialized declaration is here">;
5082def err_template_spec_decl_function_scope : Error<
5083  "explicit specialization of %0 in function scope">;
5084def err_template_spec_decl_friend : Error<
5085  "cannot declare an explicit specialization in a friend">;
5086def err_template_spec_redecl_out_of_scope : Error<
5087  "%select{class template|class template partial|variable template|"
5088  "variable template partial|function template|member "
5089  "function|static data member|member class|member enumeration}0 "
5090  "specialization of %1 not in %select{a namespace enclosing %2|"
5091  "class %2 or an enclosing namespace}3">;
5092def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
5093  "%select{class template|class template partial|variable template|"
5094  "variable template partial|function template|member "
5095  "function|static data member|member class|member enumeration}0 "
5096  "specialization of %1 not in %select{a namespace enclosing %2|"
5097  "class %2 or an enclosing namespace}3 "
5098  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
5099def err_template_spec_redecl_global_scope : Error<
5100  "%select{class template|class template partial|variable template|"
5101  "variable template partial|function template|member "
5102  "function|static data member|member class|member enumeration}0 "
5103  "specialization of %1 must occur at global scope">;
5104def err_spec_member_not_instantiated : Error<
5105  "specialization of member %q0 does not specialize an instantiated member">;
5106def note_specialized_decl : Note<"attempt to specialize declaration here">;
5107def err_specialization_after_instantiation : Error<
5108  "explicit specialization of %0 after instantiation">;
5109def note_instantiation_required_here : Note<
5110  "%select{implicit|explicit}0 instantiation first required here">;
5111def err_template_spec_friend : Error<
5112  "template specialization declaration cannot be a friend">;
5113def err_template_spec_default_arg : Error<
5114  "default argument not permitted on an explicit "
5115  "%select{instantiation|specialization}0 of function %1">;
5116def err_not_class_template_specialization : Error<
5117  "cannot specialize a %select{dependent template|template template "
5118  "parameter}0">;
5119def ext_explicit_specialization_storage_class : ExtWarn<
5120  "explicit specialization cannot have a storage class">;
5121def err_explicit_specialization_inconsistent_storage_class : Error<
5122  "explicit specialization has extraneous, inconsistent storage class "
5123  "'%select{none|extern|static|__private_extern__|auto|register}0'">;
5124def err_dependent_function_template_spec_no_match : Error<
5125  "no candidate function template was found for dependent"
5126  " friend function template specialization">;
5127def note_dependent_function_template_spec_discard_reason : Note<
5128  "candidate ignored: %select{not a function template"
5129  "|not a member of the enclosing namespace;"
5130  " did you mean to explicitly qualify the specialization?}0">;
5131
5132// C++ class template specializations and out-of-line definitions
5133def err_template_spec_needs_header : Error<
5134  "template specialization requires 'template<>'">;
5135def err_template_spec_needs_template_parameters : Error<
5136  "template specialization or definition requires a template parameter list "
5137  "corresponding to the nested type %0">;
5138def err_template_param_list_matches_nontemplate : Error<
5139  "template parameter list matching the non-templated nested type %0 should "
5140  "be empty ('template<>')">;
5141def err_alias_template_extra_headers : Error<
5142  "extraneous template parameter list in alias template declaration">;
5143def err_template_spec_extra_headers : Error<
5144  "extraneous template parameter list in template specialization or "
5145  "out-of-line template definition">;
5146def warn_template_spec_extra_headers : Warning<
5147  "extraneous template parameter list in template specialization">;
5148def note_explicit_template_spec_does_not_need_header : Note<
5149  "'template<>' header not required for explicitly-specialized class %0 "
5150  "declared here">;
5151def err_template_qualified_declarator_no_match : Error<
5152  "nested name specifier '%0' for declaration does not refer into a class, "
5153  "class template or class template partial specialization">;
5154def err_specialize_member_of_template : Error<
5155  "cannot specialize %select{|(with 'template<>') }0a member of an "
5156  "unspecialized template">;
5157
5158// C++ Class Template Partial Specialization
5159def err_default_arg_in_partial_spec : Error<
5160    "default template argument in a class template partial specialization">;
5161def err_dependent_non_type_arg_in_partial_spec : Error<
5162    "type of specialized non-type template argument depends on a template "
5163    "parameter of the partial specialization">;
5164def note_dependent_non_type_default_arg_in_partial_spec : Note<
5165    "template parameter is used in default argument declared here">;
5166def err_dependent_typed_non_type_arg_in_partial_spec : Error<
5167    "non-type template argument specializes a template parameter with "
5168    "dependent type %0">;
5169def err_partial_spec_args_match_primary_template : Error<
5170    "%select{class|variable}0 template partial specialization does not "
5171    "specialize any template argument; to %select{declare|define}1 the "
5172    "primary template, remove the template argument list">;
5173def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
5174    "%select{class|variable}0 template partial specialization is not "
5175    "more specialized than the primary template">, DefaultError,
5176    InGroup<DiagGroup<"invalid-partial-specialization">>;
5177def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
5178def ext_partial_specs_not_deducible : ExtWarn<
5179    "%select{class|variable}0 template partial specialization contains "
5180    "%select{a template parameter|template parameters}1 that cannot be "
5181    "deduced; this partial specialization will never be used">,
5182    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
5183def note_non_deducible_parameter : Note<
5184    "non-deducible template parameter %0">;
5185def err_partial_spec_ordering_ambiguous : Error<
5186    "ambiguous partial specializations of %0">;
5187def note_partial_spec_match : Note<"partial specialization matches %0">;
5188def err_partial_spec_redeclared : Error<
5189  "class template partial specialization %0 cannot be redeclared">;
5190def note_prev_partial_spec_here : Note<
5191  "previous declaration of class template partial specialization %0 is here">;
5192def err_partial_spec_fully_specialized : Error<
5193  "partial specialization of %0 does not use any of its template parameters">;
5194
5195// C++ Variable Template Partial Specialization
5196def err_var_partial_spec_redeclared : Error<
5197  "variable template partial specialization %0 cannot be redefined">;
5198def note_var_prev_partial_spec_here : Note<
5199  "previous declaration of variable template partial specialization is here">;
5200def err_var_spec_no_template : Error<
5201  "no variable template matches%select{| partial}0 specialization">;
5202def err_var_spec_no_template_but_method : Error<
5203  "no variable template matches specialization; "
5204  "did you mean to use %0 as function template instead?">;
5205
5206// C++ Function template specializations
5207def err_function_template_spec_no_match : Error<
5208    "no function template matches function template specialization %0">;
5209def err_function_template_spec_ambiguous : Error<
5210    "function template specialization %0 ambiguously refers to more than one "
5211    "function template; explicitly specify%select{| additional}1 template "
5212    "arguments to identify a particular function template">;
5213def note_function_template_spec_matched : Note<
5214    "function template %q0 matches specialization %1">;
5215def err_function_template_partial_spec : Error<
5216    "function template partial specialization is not allowed">;
5217
5218// C++ Template Instantiation
5219def err_template_recursion_depth_exceeded : Error<
5220  "recursive template instantiation exceeded maximum depth of %0">,
5221  DefaultFatal, NoSFINAE;
5222def err_constraint_depends_on_self : Error<
5223  "satisfaction of constraint '%0' depends on itself">, NoSFINAE;
5224def note_template_recursion_depth : Note<
5225  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
5226
5227def err_template_instantiate_within_definition : Error<
5228  "%select{implicit|explicit}0 instantiation of template %1 within its"
5229  " own definition">;
5230def err_template_instantiate_undefined : Error<
5231  "%select{implicit|explicit}0 instantiation of undefined template %1">;
5232def err_implicit_instantiate_member_undefined : Error<
5233  "implicit instantiation of undefined member %0">;
5234def note_template_class_instantiation_was_here : Note<
5235  "class template %0 was instantiated here">;
5236def note_template_class_explicit_specialization_was_here : Note<
5237  "class template %0 was explicitly specialized here">;
5238def note_template_class_instantiation_here : Note<
5239  "in instantiation of template class %q0 requested here">;
5240def note_template_member_class_here : Note<
5241  "in instantiation of member class %q0 requested here">;
5242def note_template_member_function_here : Note<
5243  "in instantiation of member function %q0 requested here">;
5244def note_function_template_spec_here : Note<
5245  "in instantiation of function template specialization %q0 requested here">;
5246def note_template_static_data_member_def_here : Note<
5247  "in instantiation of static data member %q0 requested here">;
5248def note_template_variable_def_here : Note<
5249  "in instantiation of variable template specialization %q0 requested here">;
5250def note_template_enum_def_here : Note<
5251  "in instantiation of enumeration %q0 requested here">;
5252def note_template_nsdmi_here : Note<
5253  "in instantiation of default member initializer %q0 requested here">;
5254def note_template_type_alias_instantiation_here : Note<
5255  "in instantiation of template type alias %0 requested here">;
5256def note_template_exception_spec_instantiation_here : Note<
5257  "in instantiation of exception specification for %0 requested here">;
5258def note_template_requirement_instantiation_here : Note<
5259  "in instantiation of requirement here">;
5260def note_template_requirement_params_instantiation_here : Note<
5261  "in instantiation of requirement parameters here">;
5262def warn_var_template_missing : Warning<"instantiation of variable %q0 "
5263  "required here, but no definition is available">,
5264  InGroup<UndefinedVarTemplate>;
5265def warn_func_template_missing : Warning<"instantiation of function %q0 "
5266  "required here, but no definition is available">,
5267  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
5268def note_forward_template_decl : Note<
5269  "forward declaration of template entity is here">;
5270def note_inst_declaration_hint : Note<"add an explicit instantiation "
5271  "declaration to suppress this warning if %q0 is explicitly instantiated in "
5272  "another translation unit">;
5273def note_evaluating_exception_spec_here : Note<
5274  "in evaluation of exception specification for %q0 needed here">;
5275
5276def note_default_arg_instantiation_here : Note<
5277  "in instantiation of default argument for '%0' required here">;
5278def note_default_function_arg_instantiation_here : Note<
5279  "in instantiation of default function argument expression "
5280  "for '%0' required here">;
5281def note_explicit_template_arg_substitution_here : Note<
5282  "while substituting explicitly-specified template arguments into function "
5283  "template %0 %1">;
5284def note_function_template_deduction_instantiation_here : Note<
5285  "while substituting deduced template arguments into function template %0 "
5286  "%1">;
5287def note_deduced_template_arg_substitution_here : Note<
5288  "during template argument deduction for %select{class|variable}0 template "
5289  "%select{partial specialization |}1%2 %3">;
5290def note_prior_template_arg_substitution : Note<
5291  "while substituting prior template arguments into %select{non-type|template}0"
5292  " template parameter%1 %2">;
5293def note_template_default_arg_checking : Note<
5294  "while checking a default template argument used here">;
5295def note_concept_specialization_here : Note<
5296  "while checking the satisfaction of concept '%0' requested here">;
5297def note_nested_requirement_here : Note<
5298  "while checking the satisfaction of nested requirement requested here">;
5299def note_checking_constraints_for_template_id_here : Note<
5300  "while checking constraint satisfaction for template '%0' required here">;
5301def note_checking_constraints_for_var_spec_id_here : Note<
5302  "while checking constraint satisfaction for variable template "
5303  "partial specialization '%0' required here">;
5304def note_checking_constraints_for_class_spec_id_here : Note<
5305  "while checking constraint satisfaction for class template partial "
5306  "specialization '%0' required here">;
5307def note_checking_constraints_for_function_here : Note<
5308  "while checking constraint satisfaction for function '%0' required here">;
5309def note_constraint_substitution_here : Note<
5310  "while substituting template arguments into constraint expression here">;
5311def note_constraint_normalization_here : Note<
5312  "while calculating associated constraint of template '%0' here">;
5313def note_parameter_mapping_substitution_here : Note<
5314  "while substituting into concept arguments here; substitution failures not "
5315  "allowed in concept arguments">;
5316def note_instantiation_contexts_suppressed : Note<
5317  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5318  "see all)">;
5319
5320def err_field_instantiates_to_function : Error<
5321  "data member instantiated with function type %0">;
5322def err_variable_instantiates_to_function : Error<
5323  "%select{variable|static data member}0 instantiated with function type %1">;
5324def err_nested_name_spec_non_tag : Error<
5325  "type %0 cannot be used prior to '::' because it has no members">;
5326
5327def err_using_pack_expansion_empty : Error<
5328  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5329
5330// C++ Explicit Instantiation
5331def err_explicit_instantiation_duplicate : Error<
5332    "duplicate explicit instantiation of %0">;
5333def ext_explicit_instantiation_duplicate : ExtWarn<
5334    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5335    InGroup<MicrosoftTemplate>;
5336def note_previous_explicit_instantiation : Note<
5337    "previous explicit instantiation is here">;
5338def warn_explicit_instantiation_after_specialization : Warning<
5339  "explicit instantiation of %0 that occurs after an explicit "
5340  "specialization has no effect">,
5341  InGroup<DiagGroup<"instantiation-after-specialization">>;
5342def note_previous_template_specialization : Note<
5343    "previous template specialization is here">;
5344def err_explicit_instantiation_nontemplate_type : Error<
5345    "explicit instantiation of non-templated type %0">;
5346def note_nontemplate_decl_here : Note<
5347    "non-templated declaration is here">;
5348def err_explicit_instantiation_in_class : Error<
5349  "explicit instantiation of %0 in class scope">;
5350def err_explicit_instantiation_out_of_scope : Error<
5351  "explicit instantiation of %0 not in a namespace enclosing %1">;
5352def err_explicit_instantiation_must_be_global : Error<
5353  "explicit instantiation of %0 must occur at global scope">;
5354def warn_explicit_instantiation_out_of_scope_0x : Warning<
5355  "explicit instantiation of %0 not in a namespace enclosing %1">,
5356  InGroup<CXX11Compat>, DefaultIgnore;
5357def warn_explicit_instantiation_must_be_global_0x : Warning<
5358  "explicit instantiation of %0 must occur at global scope">,
5359  InGroup<CXX11Compat>, DefaultIgnore;
5360
5361def err_explicit_instantiation_requires_name : Error<
5362  "explicit instantiation declaration requires a name">;
5363def err_explicit_instantiation_of_typedef : Error<
5364  "explicit instantiation of typedef %0">;
5365def err_explicit_instantiation_storage_class : Error<
5366  "explicit instantiation cannot have a storage class">;
5367def err_explicit_instantiation_internal_linkage : Error<
5368  "explicit instantiation declaration of %0 with internal linkage">;
5369def err_explicit_instantiation_not_known : Error<
5370  "explicit instantiation of %0 does not refer to a function template, "
5371  "variable template, member function, member class, or static data member">;
5372def note_explicit_instantiation_here : Note<
5373  "explicit instantiation refers here">;
5374def err_explicit_instantiation_data_member_not_instantiated : Error<
5375  "explicit instantiation refers to static data member %q0 that is not an "
5376  "instantiation">;
5377def err_explicit_instantiation_member_function_not_instantiated : Error<
5378  "explicit instantiation refers to member function %q0 that is not an "
5379  "instantiation">;
5380def err_explicit_instantiation_ambiguous : Error<
5381  "partial ordering for explicit instantiation of %0 is ambiguous">;
5382def note_explicit_instantiation_candidate : Note<
5383  "explicit instantiation candidate function %q0 template here %1">;
5384def err_explicit_instantiation_inline : Error<
5385  "explicit instantiation cannot be 'inline'">;
5386def warn_explicit_instantiation_inline_0x : Warning<
5387  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5388  DefaultIgnore;
5389def err_explicit_instantiation_constexpr : Error<
5390  "explicit instantiation cannot be 'constexpr'">;
5391def ext_explicit_instantiation_without_qualified_id : Extension<
5392  "qualifier in explicit instantiation of %q0 requires a template-id "
5393  "(a typedef is not permitted)">;
5394def err_explicit_instantiation_without_template_id : Error<
5395  "explicit instantiation of %q0 must specify a template argument list">;
5396def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5397  "explicit instantiation of %q0 must occur in namespace %1">;
5398def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5399  "explicit instantiation of %q0 must occur in namespace %1">,
5400  InGroup<CXX11Compat>, DefaultIgnore;
5401def err_explicit_instantiation_undefined_member : Error<
5402  "explicit instantiation of undefined %select{member class|member function|"
5403  "static data member}0 %1 of class template %2">;
5404def err_explicit_instantiation_undefined_func_template : Error<
5405  "explicit instantiation of undefined function template %0">;
5406def err_explicit_instantiation_undefined_var_template : Error<
5407  "explicit instantiation of undefined variable template %q0">;
5408def err_explicit_instantiation_declaration_after_definition : Error<
5409  "explicit instantiation declaration (with 'extern') follows explicit "
5410  "instantiation definition (without 'extern')">;
5411def note_explicit_instantiation_definition_here : Note<
5412  "explicit instantiation definition is here">;
5413def err_invalid_var_template_spec_type : Error<"type %2 "
5414  "of %select{explicit instantiation|explicit specialization|"
5415  "partial specialization|redeclaration}0 of %1 does not match"
5416  " expected type %3">;
5417def err_mismatched_exception_spec_explicit_instantiation : Error<
5418  "exception specification in explicit instantiation does not match "
5419  "instantiated one">;
5420def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5421  err_mismatched_exception_spec_explicit_instantiation.Summary>,
5422  InGroup<MicrosoftExceptionSpec>;
5423def err_explicit_instantiation_dependent : Error<
5424  "explicit instantiation has dependent template arguments">;
5425
5426// C++ typename-specifiers
5427def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5428def err_typename_nested_not_found_enable_if : Error<
5429  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5430  "this declaration">;
5431def err_typename_nested_not_found_requirement : Error<
5432  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5433  "declaration">;
5434def err_typename_nested_not_type : Error<
5435    "typename specifier refers to non-type member %0 in %1">;
5436def err_typename_not_type : Error<
5437    "typename specifier refers to non-type %0">;
5438def note_typename_member_refers_here : Note<
5439    "referenced member %0 is declared here">;
5440def note_typename_refers_here : Note<
5441    "referenced %0 is declared here">;
5442def err_typename_missing : Error<
5443  "missing 'typename' prior to dependent type name '%0%1'">;
5444def err_typename_missing_template : Error<
5445  "missing 'typename' prior to dependent type template name '%0%1'">;
5446def ext_typename_missing : ExtWarn<
5447  "missing 'typename' prior to dependent type name '%0%1'">,
5448  InGroup<DiagGroup<"typename-missing">>;
5449def ext_typename_outside_of_template : ExtWarn<
5450  "'typename' occurs outside of a template">, InGroup<CXX11>;
5451def warn_cxx98_compat_typename_outside_of_template : Warning<
5452  "use of 'typename' outside of a template is incompatible with C++98">,
5453  InGroup<CXX98Compat>, DefaultIgnore;
5454def err_typename_refers_to_using_value_decl : Error<
5455  "typename specifier refers to a dependent using declaration for a value "
5456  "%0 in %1">;
5457def note_using_value_decl_missing_typename : Note<
5458  "add 'typename' to treat this using declaration as a type">;
5459def warn_cxx17_compat_implicit_typename : Warning<"use of implicit 'typename' is "
5460  "incompatible with C++ standards before C++20">, InGroup<CXX20Compat>,
5461  DefaultIgnore;
5462def ext_implicit_typename : ExtWarn<"missing 'typename' prior to dependent "
5463  "type name %0%1; implicit 'typename' is a C++20 extension">,
5464  InGroup<CXX20>;
5465
5466def err_template_kw_refers_to_non_template : Error<
5467  "%0%select{| following the 'template' keyword}1 "
5468  "does not refer to a template">;
5469def note_template_kw_refers_to_non_template : Note<
5470  "declared as a non-template here">;
5471def err_template_kw_refers_to_dependent_non_template : Error<
5472  "%0%select{| following the 'template' keyword}1 "
5473  "cannot refer to a dependent template">;
5474def err_template_kw_refers_to_class_template : Error<
5475  "'%0%1' instantiated to a class template, not a function template">;
5476def note_referenced_class_template : Note<
5477  "class template declared here">;
5478def err_template_kw_missing : Error<
5479  "missing 'template' keyword prior to dependent template name '%0%1'">;
5480def ext_template_outside_of_template : ExtWarn<
5481  "'template' keyword outside of a template">, InGroup<CXX11>;
5482def warn_cxx98_compat_template_outside_of_template : Warning<
5483  "use of 'template' keyword outside of a template is incompatible with C++98">,
5484  InGroup<CXX98Compat>, DefaultIgnore;
5485
5486def err_non_type_template_in_nested_name_specifier : Error<
5487  "qualified name refers into a specialization of %select{function|variable}0 "
5488  "template %1">;
5489def err_template_id_not_a_type : Error<
5490  "template name refers to non-type template %0">;
5491def note_template_declared_here : Note<
5492  "%select{function template|class template|variable template"
5493  "|type alias template|template template parameter}0 "
5494  "%1 declared here">;
5495def err_template_expansion_into_fixed_list : Error<
5496  "pack expansion used as argument for non-pack parameter of %select{alias "
5497  "template|concept}0">;
5498def note_parameter_type : Note<
5499  "parameter of type %0 is declared here">;
5500
5501// C++11 Variadic Templates
5502def err_template_param_pack_default_arg : Error<
5503  "template parameter pack cannot have a default argument">;
5504def err_template_param_pack_must_be_last_template_parameter : Error<
5505  "template parameter pack must be the last template parameter">;
5506
5507def err_template_parameter_pack_non_pack : Error<
5508  "%select{template type|non-type template|template template}0 parameter"
5509  "%select{| pack}1 conflicts with previous %select{template type|"
5510  "non-type template|template template}0 parameter%select{ pack|}1">;
5511def note_template_parameter_pack_non_pack : Note<
5512  "%select{template type|non-type template|template template}0 parameter"
5513  "%select{| pack}1 does not match %select{template type|non-type template"
5514  "|template template}0 parameter%select{ pack|}1 in template argument">;
5515def note_template_parameter_pack_here : Note<
5516  "previous %select{template type|non-type template|template template}0 "
5517  "parameter%select{| pack}1 declared here">;
5518
5519def err_unexpanded_parameter_pack : Error<
5520  "%select{expression|base type|declaration type|data member type|bit-field "
5521  "size|static assertion|fixed underlying type|enumerator value|"
5522  "using declaration|friend declaration|qualifier|initializer|default argument|"
5523  "non-type template parameter type|exception type|partial specialization|"
5524  "__if_exists name|__if_not_exists name|lambda|block|type constraint|"
5525  "requirement|requires clause}0 "
5526  "contains%plural{0: an|:}1 unexpanded parameter pack"
5527  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5528
5529def err_pack_expansion_without_parameter_packs : Error<
5530  "pack expansion does not contain any unexpanded parameter packs">;
5531def err_pack_expansion_length_conflict : Error<
5532  "pack expansion contains parameter packs %0 and %1 that have different "
5533  "lengths (%2 vs. %3)">;
5534def err_pack_expansion_length_conflict_multilevel : Error<
5535  "pack expansion contains parameter pack %0 that has a different "
5536  "length (%1 vs. %2) from outer parameter packs">;
5537def err_pack_expansion_length_conflict_partial : Error<
5538  "pack expansion contains parameter pack %0 that has a different "
5539  "length (at least %1 vs. %2) from outer parameter packs">;
5540def err_pack_expansion_member_init : Error<
5541  "pack expansion for initialization of member %0">;
5542
5543def err_function_parameter_pack_without_parameter_packs : Error<
5544  "type %0 of function parameter pack does not contain any unexpanded "
5545  "parameter packs">;
5546def err_ellipsis_in_declarator_not_parameter : Error<
5547  "only function and template parameters can be parameter packs">;
5548
5549def err_sizeof_pack_no_pack_name : Error<
5550  "%0 does not refer to the name of a parameter pack">;
5551
5552def err_fold_expression_packs_both_sides : Error<
5553  "binary fold expression has unexpanded parameter packs in both operands">;
5554def err_fold_expression_empty : Error<
5555  "unary fold expression has empty expansion for operator '%0' "
5556  "with no fallback value">;
5557def err_fold_expression_bad_operand : Error<
5558  "expression not permitted as operand of fold expression">;
5559def err_fold_expression_limit_exceeded: Error<
5560  "instantiating fold expression with %0 arguments exceeded expression nesting "
5561  "limit of %1">, DefaultFatal, NoSFINAE;
5562
5563def err_unexpected_typedef : Error<
5564  "unexpected type name %0: expected expression">;
5565def err_unexpected_namespace : Error<
5566  "unexpected namespace name %0: expected expression">;
5567def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5568def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5569  "use of undeclared identifier %0; "
5570  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5571  InGroup<MicrosoftTemplate>;
5572def err_found_in_dependent_base : Error<
5573  "explicit qualification required to use member %0 from dependent base class">;
5574def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5575  "found via unqualified lookup into dependent bases of class templates is a "
5576  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5577def err_found_later_in_class : Error<"member %0 used before its declaration">;
5578def ext_found_later_in_class : ExtWarn<
5579  "use of member %0 before its declaration is a Microsoft extension">,
5580  InGroup<MicrosoftTemplate>;
5581def ext_unqualified_base_class : ExtWarn<
5582  "unqualified base initializer of class templates is a Microsoft extension">,
5583  InGroup<MicrosoftTemplate>;
5584def note_dependent_member_use : Note<
5585  "must qualify identifier to find this declaration in dependent base class">;
5586def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5587    "visible in the template definition nor found by argument-dependent lookup">;
5588def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5589    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5590def err_undeclared_use : Error<"use of undeclared %0">;
5591def warn_deprecated : Warning<"%0 is deprecated">,
5592    InGroup<DeprecatedDeclarations>;
5593def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5594def warn_property_method_deprecated :
5595    Warning<"property access is using %0 method which is deprecated">,
5596    InGroup<DeprecatedDeclarations>;
5597def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5598    InGroup<DeprecatedDeclarations>;
5599def warn_deprecated_anonymous_namespace : Warning<
5600  "'deprecated' attribute on anonymous namespace ignored">,
5601  InGroup<IgnoredAttributes>;
5602def warn_deprecated_fwdclass_message : Warning<
5603    "%0 may be deprecated because the receiver type is unknown">,
5604    InGroup<DeprecatedDeclarations>;
5605def warn_deprecated_def : Warning<
5606  "implementing deprecated %select{method|class|category}0">,
5607  InGroup<DeprecatedImplementations>, DefaultIgnore;
5608def warn_unavailable_def : Warning<
5609  "implementing unavailable method">,
5610  InGroup<DeprecatedImplementations>, DefaultIgnore;
5611def warn_deprecated_builtin : Warning<
5612  "builtin %0 is deprecated; use %1 instead">,
5613  InGroup<DeprecatedBuiltins>;
5614def err_unavailable : Error<"%0 is unavailable">;
5615def err_property_method_unavailable :
5616    Error<"property access is using %0 method which is unavailable">;
5617def err_unavailable_message : Error<"%0 is unavailable: %1">;
5618def warn_unavailable_fwdclass_message : Warning<
5619    "%0 may be unavailable because the receiver type is unknown">,
5620    InGroup<UnavailableDeclarations>;
5621def note_availability_specified_here : Note<
5622  "%0 has been explicitly marked "
5623  "%select{unavailable|deleted|deprecated}1 here">;
5624def note_partial_availability_specified_here : Note<
5625  "%0 has been marked as being introduced in %1 %2 here, "
5626  "but the deployment target is %1 %3">;
5627def note_implicitly_deleted : Note<
5628  "explicitly defaulted function was implicitly deleted here">;
5629def warn_not_enough_argument : Warning<
5630  "not enough variable arguments in %0 declaration to fit a sentinel">,
5631  InGroup<Sentinel>;
5632def warn_missing_sentinel : Warning <
5633  "missing sentinel in %select{function call|method dispatch|block call}0">,
5634  InGroup<Sentinel>;
5635def note_sentinel_here : Note<
5636  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5637def warn_strict_uses_without_prototype : Warning<
5638  "passing arguments to %select{a function|%1}0 without a prototype is "
5639  "deprecated in all versions of C and is not supported in C2x">,
5640  InGroup<DeprecatedNonPrototype>;
5641def warn_missing_prototype : Warning<
5642  "no previous prototype for function %0">,
5643  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5644def note_declaration_not_a_prototype : Note<
5645  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5646  "to make it %select{a prototype for a zero-parameter function|one}0">;
5647// This is not actually an extension, but we only want it to be enabled in
5648// -pedantic mode and this is the most direct way of accomplishing that.
5649def warn_strict_prototypes : Extension<
5650  "a %select{function|block}0 declaration without a prototype is deprecated "
5651  "%select{in all versions of C|}0">, InGroup<StrictPrototypes>;
5652def warn_non_prototype_changes_behavior : Warning<
5653  "a function %select{declaration|definition}0 without a prototype is "
5654  "deprecated in all versions of C %select{and is not supported in C2x|and is "
5655  "treated as a zero-parameter prototype in C2x, conflicting with a "
5656  "%select{previous|subsequent}2 %select{declaration|definition}3}1">,
5657  InGroup<DeprecatedNonPrototype>;
5658def note_conflicting_prototype : Note<"conflicting prototype is here">;
5659def warn_missing_variable_declarations : Warning<
5660  "no previous extern declaration for non-static variable %0">,
5661  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5662def note_static_for_internal_linkage : Note<
5663  "declare 'static' if the %select{variable|function}0 is not intended to be "
5664  "used outside of this translation unit">;
5665def err_static_data_member_reinitialization :
5666  Error<"static data member %0 already has an initializer">;
5667def err_redefinition : Error<"redefinition of %0">;
5668def err_alias_after_tentative :
5669  Error<"alias definition of %0 after tentative definition">;
5670def err_alias_is_definition :
5671  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5672def err_definition_of_implicitly_declared_member : Error<
5673  "definition of implicitly declared %select{default constructor|copy "
5674  "constructor|move constructor|copy assignment operator|move assignment "
5675  "operator|destructor|function}1">;
5676def err_definition_of_explicitly_defaulted_member : Error<
5677  "definition of explicitly defaulted %select{default constructor|copy "
5678  "constructor|move constructor|copy assignment operator|move assignment "
5679  "operator|destructor|function}0">;
5680def err_redefinition_extern_inline : Error<
5681  "redefinition of a 'extern inline' function %0 is not supported in "
5682  "%select{C99 mode|C++}1">;
5683def warn_attr_abi_tag_namespace : Warning<
5684  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5685  InGroup<IgnoredAttributes>;
5686def err_abi_tag_on_redeclaration : Error<
5687  "cannot add 'abi_tag' attribute in a redeclaration">;
5688def err_new_abi_tag_on_redeclaration : Error<
5689  "'abi_tag' %0 missing in original declaration">;
5690def note_use_ifdef_guards : Note<
5691  "unguarded header; consider using #ifdef guards or #pragma once">;
5692
5693def warn_var_decl_not_read_only : Warning<
5694  "object of type %0 cannot be placed in read-only memory">,
5695  InGroup<ReadOnlyPlacementChecks>;
5696def note_enforce_read_only_placement : Note<"type was declared read-only here">;
5697
5698
5699def note_deleted_dtor_no_operator_delete : Note<
5700  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5701def note_deleted_special_member_class_subobject : Note<
5702  "%select{default constructor of|copy constructor of|move constructor of|"
5703  "copy assignment operator of|move assignment operator of|destructor of|"
5704  "constructor inherited by}0 "
5705  "%1 is implicitly deleted because "
5706  "%select{base class %3|%select{||||variant }4field %3}2 "
5707  "%select{has "
5708  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
5709  "%select{%select{default constructor|copy constructor|move constructor|copy "
5710  "assignment operator|move assignment operator|destructor|"
5711  "%select{default|corresponding|default|default|default}4 constructor}0|"
5712  "destructor}5"
5713  "%select{||s||}4"
5714  "|is an ObjC pointer}6">;
5715def note_deleted_default_ctor_uninit_field : Note<
5716  "%select{default constructor of|constructor inherited by}0 "
5717  "%1 is implicitly deleted because field %2 of "
5718  "%select{reference|const-qualified}4 type %3 would not be initialized">;
5719def note_deleted_default_ctor_all_const : Note<
5720  "%select{default constructor of|constructor inherited by}0 "
5721  "%1 is implicitly deleted because all "
5722  "%select{data members|data members of an anonymous union member}2"
5723  " are const-qualified">;
5724def note_deleted_copy_ctor_rvalue_reference : Note<
5725  "copy constructor of %0 is implicitly deleted because field %1 is of "
5726  "rvalue reference type %2">;
5727def note_deleted_copy_user_declared_move : Note<
5728  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
5729  " %1 has a user-declared move %select{constructor|assignment operator}2">;
5730def note_deleted_assign_field : Note<
5731  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
5732  "because field %2 is of %select{reference|const-qualified}4 type %3">;
5733
5734// These should be errors.
5735def warn_undefined_internal : Warning<
5736  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
5737  InGroup<DiagGroup<"undefined-internal">>;
5738def err_undefined_internal_type : Error<
5739  "%select{function|variable}0 %q1 is used but not defined in this "
5740  "translation unit, and cannot be defined in any other translation unit "
5741  "because its type does not have linkage">;
5742def ext_undefined_internal_type : Extension<
5743  "ISO C++ requires a definition in this translation unit for "
5744  "%select{function|variable}0 %q1 because its type does not have linkage">,
5745  InGroup<DiagGroup<"undefined-internal-type">>;
5746def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
5747  InGroup<DiagGroup<"undefined-inline">>;
5748def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
5749def note_used_here : Note<"used here">;
5750
5751def err_attribute_missing_on_first_decl : Error<
5752  "%0 attribute does not appear on the first declaration">;
5753def warn_internal_linkage_local_storage : Warning<
5754  "'internal_linkage' attribute on a non-static local variable is ignored">,
5755  InGroup<IgnoredAttributes>;
5756
5757def ext_internal_in_extern_inline : ExtWarn<
5758  "static %select{function|variable}0 %1 is used in an inline function with "
5759  "external linkage">, InGroup<StaticInInline>;
5760def ext_internal_in_extern_inline_quiet : Extension<
5761  "static %select{function|variable}0 %1 is used in an inline function with "
5762  "external linkage">, InGroup<StaticInInline>;
5763def warn_static_local_in_extern_inline : Warning<
5764  "non-constant static local variable in inline function may be different "
5765  "in different files">, InGroup<StaticLocalInInline>;
5766def note_convert_inline_to_static : Note<
5767  "use 'static' to give inline function %0 internal linkage">;
5768
5769def ext_redefinition_of_typedef : ExtWarn<
5770  "redefinition of typedef %0 is a C11 feature">,
5771  InGroup<DiagGroup<"typedef-redefinition"> >;
5772def err_redefinition_variably_modified_typedef : Error<
5773  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
5774
5775def err_inline_decl_follows_def : Error<
5776  "inline declaration of %0 follows non-inline definition">;
5777def err_inline_declaration_block_scope : Error<
5778  "inline declaration of %0 not allowed in block scope">;
5779def err_static_non_static : Error<
5780  "static declaration of %0 follows non-static declaration">;
5781def err_different_language_linkage : Error<
5782  "declaration of %0 has a different language linkage">;
5783def ext_retained_language_linkage : Extension<
5784  "friend function %0 retaining previous language linkage is an extension">,
5785  InGroup<DiagGroup<"retained-language-linkage">>;
5786def err_extern_c_global_conflict : Error<
5787  "declaration of %1 %select{with C language linkage|in global scope}0 "
5788  "conflicts with declaration %select{in global scope|with C language linkage}0">;
5789def note_extern_c_global_conflict : Note<
5790  "declared %select{in global scope|with C language linkage}0 here">;
5791def note_extern_c_begins_here : Note<
5792  "extern \"C\" language linkage specification begins here">;
5793def warn_weak_import : Warning <
5794  "an already-declared variable is made a weak_import declaration %0">;
5795def ext_static_non_static : Extension<
5796  "redeclaring non-static %0 as static is a Microsoft extension">,
5797  InGroup<MicrosoftRedeclareStatic>;
5798def err_non_static_static : Error<
5799  "non-static declaration of %0 follows static declaration">;
5800def err_extern_non_extern : Error<
5801  "extern declaration of %0 follows non-extern declaration">;
5802def err_non_extern_extern : Error<
5803  "non-extern declaration of %0 follows extern declaration">;
5804def err_non_thread_thread : Error<
5805  "non-thread-local declaration of %0 follows thread-local declaration">;
5806def err_thread_non_thread : Error<
5807  "thread-local declaration of %0 follows non-thread-local declaration">;
5808def err_thread_thread_different_kind : Error<
5809  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
5810  "follows declaration with %select{dynamic|static}1 initialization">;
5811def err_mismatched_owning_module : Error<
5812  "declaration of %0 in %select{the global module|module %2}1 follows "
5813  "declaration in %select{the global module|module %4}3">;
5814def err_redefinition_different_type : Error<
5815  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
5816def err_redefinition_different_kind : Error<
5817  "redefinition of %0 as different kind of symbol">;
5818def err_redefinition_different_namespace_alias : Error<
5819  "redefinition of %0 as an alias for a different namespace">;
5820def note_previous_namespace_alias : Note<
5821  "previously defined as an alias for %0">;
5822def warn_forward_class_redefinition : Warning<
5823  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
5824  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
5825def err_redefinition_different_typedef : Error<
5826  "%select{typedef|type alias|type alias template}0 "
5827  "redefinition with different types%diff{ ($ vs $)|}1,2">;
5828def err_redefinition_different_concept : Error<
5829  "redefinition of concept %0 with different template parameters or requirements">;
5830def err_tag_reference_non_tag : Error<
5831  "%select{non-struct type|non-class type|non-union type|non-enum "
5832  "type|typedef|type alias|template|type alias template|template "
5833  "template argument}1 %0 cannot be referenced with a "
5834  "%select{struct|interface|union|class|enum}2 specifier">;
5835def err_tag_reference_conflict : Error<
5836  "implicit declaration introduced by elaborated type conflicts with a "
5837  "%select{non-struct type|non-class type|non-union type|non-enum "
5838  "type|typedef|type alias|template|type alias template|template "
5839  "template argument}0 of the same name">;
5840def err_dependent_tag_decl : Error<
5841  "%select{declaration|definition}0 of "
5842  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
5843def err_tag_definition_of_typedef : Error<
5844  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
5845def err_conflicting_types : Error<"conflicting types for %0">;
5846def err_different_pass_object_size_params : Error<
5847  "conflicting pass_object_size attributes on parameters">;
5848def err_late_asm_label_name : Error<
5849  "cannot apply asm label to %select{variable|function}0 after its first use">;
5850def err_different_asm_label : Error<"conflicting asm label">;
5851def err_nested_redefinition : Error<"nested redefinition of %0">;
5852def err_use_with_wrong_tag : Error<
5853  "use of %0 with tag type that does not match previous declaration">;
5854def warn_struct_class_tag_mismatch : Warning<
5855  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
5856  "declared as a %select{struct|interface|class}3%select{| template}1; "
5857  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5858  InGroup<MismatchedTags>, DefaultIgnore;
5859def warn_struct_class_previous_tag_mismatch : Warning<
5860  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
5861  "here but previously declared as "
5862  "%select{a struct|an interface|a class}3%select{| template}1; "
5863  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5864  InGroup<MismatchedTags>, DefaultIgnore;
5865def note_struct_class_suggestion : Note<
5866  "did you mean %select{struct|interface|class}0 here?">;
5867def ext_forward_ref_enum : Extension<
5868  "ISO C forbids forward references to 'enum' types">;
5869def err_forward_ref_enum : Error<
5870  "ISO C++ forbids forward references to 'enum' types">;
5871def ext_ms_forward_ref_enum : ExtWarn<
5872  "forward references to 'enum' types are a Microsoft extension">,
5873  InGroup<MicrosoftEnumForwardReference>;
5874def ext_forward_ref_enum_def : Extension<
5875  "redeclaration of already-defined enum %0 is a GNU extension">,
5876  InGroup<GNURedeclaredEnum>;
5877
5878def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
5879def err_duplicate_member : Error<"duplicate member %0">;
5880def err_misplaced_ivar : Error<
5881  "instance variables may not be placed in %select{categories|class extension}0">;
5882def warn_ivars_in_interface : Warning<
5883  "declaration of instance variables in the interface is deprecated">,
5884  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
5885def ext_enum_value_not_int : Extension<
5886  "ISO C restricts enumerator values to range of 'int' (%0 is too "
5887  "%select{small|large}1)">;
5888def ext_enum_too_large : ExtWarn<
5889  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
5890def ext_enumerator_increment_too_large : ExtWarn<
5891  "incremented enumerator value %0 is not representable in the "
5892  "largest integer type">, InGroup<EnumTooLarge>;
5893def warn_flag_enum_constant_out_of_range : Warning<
5894  "enumeration value %0 is out of range of flags in enumeration type %1">,
5895  InGroup<FlagEnum>;
5896
5897def err_vm_decl_in_file_scope : Error<
5898  "variably modified type declaration not allowed at file scope">;
5899def err_vm_decl_has_extern_linkage : Error<
5900  "variably modified type declaration cannot have 'extern' linkage">;
5901def err_typecheck_field_variable_size : Error<
5902  "fields must have a constant size: 'variable length array in structure' "
5903  "extension will never be supported">;
5904def err_vm_func_decl : Error<
5905  "function declaration cannot have variably modified type">;
5906def err_array_too_large : Error<
5907  "array is too large (%0 elements)">;
5908
5909def err_typecheck_negative_array_size : Error<"array size is negative">;
5910def warn_typecheck_function_qualifiers_ignored : Warning<
5911  "'%0' qualifier on function type %1 has no effect">,
5912  InGroup<IgnoredQualifiers>;
5913def warn_typecheck_function_qualifiers_unspecified : Warning<
5914  "'%0' qualifier on function type %1 has unspecified behavior">;
5915def warn_typecheck_reference_qualifiers : Warning<
5916  "'%0' qualifier on reference type %1 has no effect">,
5917  InGroup<IgnoredReferenceQualifiers>;
5918def err_typecheck_invalid_restrict_not_pointer : Error<
5919  "restrict requires a pointer or reference (%0 is invalid)">;
5920def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
5921  "restrict requires a pointer or reference">;
5922def err_typecheck_invalid_restrict_invalid_pointee : Error<
5923  "pointer to function type %0 may not be 'restrict' qualified">;
5924def ext_typecheck_zero_array_size : Extension<
5925  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
5926def err_typecheck_zero_array_size : Error<
5927  "zero-length arrays are not permitted in %select{C++|SYCL device code}0">;
5928def err_array_size_non_int : Error<"size of array has non-integer type %0">;
5929def err_init_element_not_constant : Error<
5930  "initializer element is not a compile-time constant">;
5931def ext_aggregate_init_not_constant : Extension<
5932  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
5933def err_local_cant_init : Error<
5934  "'__local' variable cannot have an initializer">;
5935def err_loader_uninitialized_cant_init
5936    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
5937            "initializer">;
5938def err_loader_uninitialized_trivial_ctor
5939    : Error<"variable with 'loader_uninitialized' attribute must have a "
5940            "trivial default constructor">;
5941def err_loader_uninitialized_redeclaration
5942    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
5943def err_loader_uninitialized_extern_decl
5944    : Error<"variable %0 cannot be declared both 'extern' and with the "
5945            "'loader_uninitialized' attribute">;
5946def err_block_extern_cant_init : Error<
5947  "declaration of block scope identifier with linkage cannot have an initializer">;
5948def warn_extern_init : Warning<"'extern' variable has an initializer">,
5949  InGroup<DiagGroup<"extern-initializer">>;
5950def err_variable_object_no_init : Error<
5951  "variable-sized object may not be initialized">;
5952def err_excess_initializers : Error<
5953  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
5954def ext_excess_initializers : ExtWarn<
5955  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
5956  InGroup<ExcessInitializers>;
5957def err_excess_initializers_for_sizeless_type : Error<
5958  "excess elements in initializer for indivisible sizeless type %0">;
5959def ext_excess_initializers_for_sizeless_type : ExtWarn<
5960  "excess elements in initializer for indivisible sizeless type %0">,
5961  InGroup<ExcessInitializers>;
5962def err_excess_initializers_in_char_array_initializer : Error<
5963  "excess elements in char array initializer">;
5964def ext_excess_initializers_in_char_array_initializer : ExtWarn<
5965  "excess elements in char array initializer">,
5966  InGroup<ExcessInitializers>;
5967def err_initializer_string_for_char_array_too_long : Error<
5968  "initializer-string for char array is too long, array size is %0 but initializer has size %1 (including the null terminating character)">;
5969def ext_initializer_string_for_char_array_too_long : ExtWarn<
5970  "initializer-string for char array is too long">,
5971  InGroup<ExcessInitializers>;
5972def warn_missing_field_initializers : Warning<
5973  "missing field %0 initializer">,
5974  InGroup<MissingFieldInitializers>, DefaultIgnore;
5975def warn_braces_around_init : Warning<
5976  "braces around %select{scalar |}0initializer">,
5977  InGroup<DiagGroup<"braced-scalar-init">>;
5978def ext_many_braces_around_init : ExtWarn<
5979  "too many braces around %select{scalar |}0initializer">,
5980  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5981def ext_complex_component_init : Extension<
5982  "complex initialization specifying real and imaginary components "
5983  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5984def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5985def err_empty_sizeless_initializer : Error<
5986  "initializer for sizeless type %0 cannot be empty">;
5987def warn_cxx98_compat_empty_scalar_initializer : Warning<
5988  "scalar initialized from empty initializer list is incompatible with C++98">,
5989  InGroup<CXX98Compat>, DefaultIgnore;
5990def warn_cxx98_compat_empty_sizeless_initializer : Warning<
5991  "initializing %0 from an empty initializer list is incompatible with C++98">,
5992  InGroup<CXX98Compat>, DefaultIgnore;
5993def warn_cxx98_compat_reference_list_init : Warning<
5994  "reference initialized from initializer list is incompatible with C++98">,
5995  InGroup<CXX98Compat>, DefaultIgnore;
5996def warn_cxx98_compat_initializer_list_init : Warning<
5997  "initialization of initializer_list object is incompatible with C++98">,
5998  InGroup<CXX98Compat>, DefaultIgnore;
5999def warn_cxx98_compat_ctor_list_init : Warning<
6000  "constructor call from initializer list is incompatible with C++98">,
6001  InGroup<CXX98Compat>, DefaultIgnore;
6002def err_illegal_initializer : Error<
6003  "illegal initializer (only variables can be initialized)">;
6004def err_illegal_initializer_type : Error<"illegal initializer type %0">;
6005def ext_init_list_type_narrowing : ExtWarn<
6006  "type %0 cannot be narrowed to %1 in initializer list">,
6007  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6008def ext_init_list_variable_narrowing : ExtWarn<
6009  "non-constant-expression cannot be narrowed from type %0 to %1 in "
6010  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6011def ext_init_list_constant_narrowing : ExtWarn<
6012  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
6013  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6014def warn_init_list_type_narrowing : Warning<
6015  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
6016  InGroup<CXX11Narrowing>, DefaultIgnore;
6017def warn_init_list_variable_narrowing : Warning<
6018  "non-constant-expression cannot be narrowed from type %0 to %1 in "
6019  "initializer list in C++11">,
6020  InGroup<CXX11Narrowing>, DefaultIgnore;
6021def warn_init_list_constant_narrowing : Warning<
6022  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
6023  "C++11">,
6024  InGroup<CXX11Narrowing>, DefaultIgnore;
6025def note_init_list_narrowing_silence : Note<
6026  "insert an explicit cast to silence this issue">;
6027def err_init_objc_class : Error<
6028  "cannot initialize Objective-C class type %0">;
6029def err_implicit_empty_initializer : Error<
6030  "initializer for aggregate with no elements requires explicit braces">;
6031def err_bitfield_has_negative_width : Error<
6032  "bit-field %0 has negative width (%1)">;
6033def err_anon_bitfield_has_negative_width : Error<
6034  "anonymous bit-field has negative width (%0)">;
6035def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
6036def err_bitfield_width_exceeds_type_width : Error<
6037  "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the "
6038  "%select{width|size}3 of its type (%4 bit%s4)">;
6039def err_incorrect_number_of_vector_initializers : Error<
6040  "number of elements must be either one or match the size of the vector">;
6041
6042// Used by C++ which allows bit-fields that are wider than the type.
6043def warn_bitfield_width_exceeds_type_width: Warning<
6044  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
6045  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
6046def err_bitfield_too_wide : Error<
6047  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
6048def warn_bitfield_too_small_for_enum : Warning<
6049  "bit-field %0 is not wide enough to store all enumerators of %1">,
6050  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6051def note_widen_bitfield : Note<
6052  "widen this field to %0 bits to store all values of %1">;
6053def warn_unsigned_bitfield_assigned_signed_enum : Warning<
6054  "assigning value of signed enum type %1 to unsigned bit-field %0; "
6055  "negative enumerators of enum %1 will be converted to positive values">,
6056  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6057def warn_signed_bitfield_enum_conversion : Warning<
6058  "signed bit-field %0 needs an extra bit to represent the largest positive "
6059  "enumerators of %1">,
6060  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6061def note_change_bitfield_sign : Note<
6062  "consider making the bitfield type %select{unsigned|signed}0">;
6063
6064def warn_missing_braces : Warning<
6065  "suggest braces around initialization of subobject">,
6066  InGroup<MissingBraces>, DefaultIgnore;
6067
6068def err_redefinition_of_label : Error<"redefinition of label %0">;
6069def err_undeclared_label_use : Error<"use of undeclared label %0">;
6070def err_goto_ms_asm_label : Error<
6071  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
6072def note_goto_ms_asm_label : Note<
6073  "inline assembly label %0 declared here">;
6074def warn_unused_label : Warning<"unused label %0">,
6075  InGroup<UnusedLabel>, DefaultIgnore;
6076
6077def err_continue_from_cond_var_init : Error<
6078  "cannot jump from this continue statement to the loop increment; "
6079  "jump bypasses initialization of loop condition variable">;
6080def err_goto_into_protected_scope : Error<
6081  "cannot jump from this goto statement to its label">;
6082def ext_goto_into_protected_scope : ExtWarn<
6083  "jump from this goto statement to its label is a Microsoft extension">,
6084  InGroup<MicrosoftGoto>;
6085def warn_cxx98_compat_goto_into_protected_scope : Warning<
6086  "jump from this goto statement to its label is incompatible with C++98">,
6087  InGroup<CXX98Compat>, DefaultIgnore;
6088def err_switch_into_protected_scope : Error<
6089  "cannot jump from switch statement to this case label">;
6090def warn_cxx98_compat_switch_into_protected_scope : Warning<
6091  "jump from switch statement to this case label is incompatible with C++98">,
6092  InGroup<CXX98Compat>, DefaultIgnore;
6093def err_indirect_goto_without_addrlabel : Error<
6094  "indirect goto in function with no address-of-label expressions">;
6095def err_indirect_goto_in_protected_scope : Error<
6096  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
6097def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
6098  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
6099  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6100def note_indirect_goto_target : Note<
6101  "possible target of %select{indirect|asm}0 goto statement">;
6102def note_protected_by_variable_init : Note<
6103  "jump bypasses variable initialization">;
6104def note_protected_by_variable_nontriv_destructor : Note<
6105  "jump bypasses variable with a non-trivial destructor">;
6106def note_protected_by_variable_non_pod : Note<
6107  "jump bypasses initialization of non-POD variable">;
6108def note_protected_by_cleanup : Note<
6109  "jump bypasses initialization of variable with __attribute__((cleanup))">;
6110def note_protected_by_vla_typedef : Note<
6111  "jump bypasses initialization of VLA typedef">;
6112def note_protected_by_vla_type_alias : Note<
6113  "jump bypasses initialization of VLA type alias">;
6114def note_protected_by_constexpr_if : Note<
6115  "jump enters controlled statement of constexpr if">;
6116def note_protected_by_consteval_if : Note<
6117  "jump enters controlled statement of consteval if">;
6118def note_protected_by_if_available : Note<
6119  "jump enters controlled statement of if available">;
6120def note_protected_by_vla : Note<
6121  "jump bypasses initialization of variable length array">;
6122def note_protected_by_objc_fast_enumeration : Note<
6123  "jump enters Objective-C fast enumeration loop">;
6124def note_protected_by_objc_try : Note<
6125  "jump bypasses initialization of @try block">;
6126def note_protected_by_objc_catch : Note<
6127  "jump bypasses initialization of @catch block">;
6128def note_protected_by_objc_finally : Note<
6129  "jump bypasses initialization of @finally block">;
6130def note_protected_by_objc_synchronized : Note<
6131  "jump bypasses initialization of @synchronized block">;
6132def note_protected_by_objc_autoreleasepool : Note<
6133  "jump bypasses auto release push of @autoreleasepool block">;
6134def note_protected_by_cxx_try : Note<
6135  "jump bypasses initialization of try block">;
6136def note_protected_by_cxx_catch : Note<
6137  "jump bypasses initialization of catch block">;
6138def note_protected_by_seh_try : Note<
6139  "jump bypasses initialization of __try block">;
6140def note_protected_by_seh_except : Note<
6141  "jump bypasses initialization of __except block">;
6142def note_protected_by_seh_finally : Note<
6143  "jump bypasses initialization of __finally block">;
6144def note_protected_by___block : Note<
6145  "jump bypasses setup of __block variable">;
6146def note_protected_by_objc_strong_init : Note<
6147  "jump bypasses initialization of __strong variable">;
6148def note_protected_by_objc_weak_init : Note<
6149  "jump bypasses initialization of __weak variable">;
6150def note_protected_by_non_trivial_c_struct_init : Note<
6151  "jump bypasses initialization of variable of non-trivial C struct type">;
6152def note_enters_block_captures_cxx_obj : Note<
6153  "jump enters lifetime of block which captures a destructible C++ object">;
6154def note_enters_block_captures_strong : Note<
6155  "jump enters lifetime of block which strongly captures a variable">;
6156def note_enters_block_captures_weak : Note<
6157  "jump enters lifetime of block which weakly captures a variable">;
6158def note_enters_block_captures_non_trivial_c_struct : Note<
6159  "jump enters lifetime of block which captures a C struct that is non-trivial "
6160  "to destroy">;
6161def note_enters_compound_literal_scope : Note<
6162  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
6163
6164def note_exits_cleanup : Note<
6165  "jump exits scope of variable with __attribute__((cleanup))">;
6166def note_exits_dtor : Note<
6167  "jump exits scope of variable with non-trivial destructor">;
6168def note_exits_temporary_dtor : Note<
6169  "jump exits scope of lifetime-extended temporary with non-trivial "
6170  "destructor">;
6171def note_exits___block : Note<
6172  "jump exits scope of __block variable">;
6173def note_exits_objc_try : Note<
6174  "jump exits @try block">;
6175def note_exits_objc_catch : Note<
6176  "jump exits @catch block">;
6177def note_exits_objc_finally : Note<
6178  "jump exits @finally block">;
6179def note_exits_objc_synchronized : Note<
6180  "jump exits @synchronized block">;
6181def note_exits_cxx_try : Note<
6182  "jump exits try block">;
6183def note_exits_cxx_catch : Note<
6184  "jump exits catch block">;
6185def note_exits_seh_try : Note<
6186  "jump exits __try block">;
6187def note_exits_seh_except : Note<
6188  "jump exits __except block">;
6189def note_exits_seh_finally : Note<
6190  "jump exits __finally block">;
6191def note_exits_objc_autoreleasepool : Note<
6192  "jump exits autoreleasepool block">;
6193def note_exits_objc_strong : Note<
6194  "jump exits scope of __strong variable">;
6195def note_exits_objc_weak : Note<
6196  "jump exits scope of __weak variable">;
6197def note_exits_block_captures_cxx_obj : Note<
6198  "jump exits lifetime of block which captures a destructible C++ object">;
6199def note_exits_block_captures_strong : Note<
6200  "jump exits lifetime of block which strongly captures a variable">;
6201def note_exits_block_captures_weak : Note<
6202  "jump exits lifetime of block which weakly captures a variable">;
6203def note_exits_block_captures_non_trivial_c_struct : Note<
6204  "jump exits lifetime of block which captures a C struct that is non-trivial "
6205  "to destroy">;
6206def note_exits_compound_literal_scope : Note<
6207  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
6208
6209def err_func_returning_qualified_void : ExtWarn<
6210  "function cannot return qualified void type %0">,
6211  InGroup<DiagGroup<"qualified-void-return-type">>;
6212def err_func_returning_array_function : Error<
6213  "function cannot return %select{array|function}0 type %1">;
6214def err_field_declared_as_function : Error<"field %0 declared as a function">;
6215def err_field_incomplete_or_sizeless : Error<
6216  "field has %select{incomplete|sizeless}0 type %1">;
6217def ext_variable_sized_type_in_struct : ExtWarn<
6218  "field %0 with variable sized type %1 not at the end of a struct or class is"
6219  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
6220
6221def ext_c99_flexible_array_member : Extension<
6222  "flexible array members are a C99 feature">, InGroup<C99>;
6223def err_flexible_array_virtual_base : Error<
6224  "flexible array member %0 not allowed in "
6225  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
6226def err_flexible_array_empty_aggregate : Error<
6227  "flexible array member %0 not allowed in otherwise empty "
6228  "%select{struct|interface|union|class|enum}1">;
6229def err_flexible_array_has_nontrivial_dtor : Error<
6230  "flexible array member %0 of type %1 with non-trivial destruction">;
6231def ext_flexible_array_in_struct : Extension<
6232  "%0 may not be nested in a struct due to flexible array member">,
6233  InGroup<FlexibleArrayExtensions>;
6234def ext_flexible_array_in_array : Extension<
6235  "%0 may not be used as an array element due to flexible array member">,
6236  InGroup<FlexibleArrayExtensions>;
6237def err_flexible_array_init : Error<
6238  "initialization of flexible array member is not allowed">;
6239def ext_flexible_array_empty_aggregate_ms : Extension<
6240  "flexible array member %0 in otherwise empty "
6241  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
6242  InGroup<MicrosoftFlexibleArray>;
6243def err_flexible_array_union : Error<
6244  "flexible array member %0 in a union is not allowed">;
6245def ext_flexible_array_union_ms : Extension<
6246  "flexible array member %0 in a union is a Microsoft extension">,
6247  InGroup<MicrosoftFlexibleArray>;
6248def ext_flexible_array_empty_aggregate_gnu : Extension<
6249  "flexible array member %0 in otherwise empty "
6250  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
6251  InGroup<GNUEmptyStruct>;
6252def ext_flexible_array_union_gnu : Extension<
6253  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
6254
6255def err_flexible_array_not_at_end : Error<
6256  "flexible array member %0 with type %1 is not at the end of"
6257  " %select{struct|interface|union|class|enum}2">;
6258def err_objc_variable_sized_type_not_at_end : Error<
6259  "field %0 with variable sized type %1 is not at the end of class">;
6260def note_next_field_declaration : Note<
6261  "next field declaration is here">;
6262def note_next_ivar_declaration : Note<
6263  "next %select{instance variable declaration|synthesized instance variable}0"
6264  " is here">;
6265def err_synthesize_variable_sized_ivar : Error<
6266  "synthesized property with variable size type %0"
6267  " requires an existing instance variable">;
6268def err_flexible_array_arc_retainable : Error<
6269  "ARC forbids flexible array members with retainable object type">;
6270def warn_variable_sized_ivar_visibility : Warning<
6271  "field %0 with variable sized type %1 is not visible to subclasses and"
6272  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
6273def warn_superclass_variable_sized_type_not_at_end : Warning<
6274  "field %0 can overwrite instance variable %1 with variable sized type %2"
6275  " in superclass %3">, InGroup<ObjCFlexibleArray>;
6276
6277let CategoryName = "ARC Semantic Issue" in {
6278
6279// ARC-mode diagnostics.
6280
6281let CategoryName = "ARC Weak References" in {
6282
6283def err_arc_weak_no_runtime : Error<
6284  "cannot create __weak reference because the current deployment target "
6285  "does not support weak references">;
6286def err_arc_weak_disabled : Error<
6287  "cannot create __weak reference in file using manual reference counting">;
6288def err_synthesizing_arc_weak_property_disabled : Error<
6289  "cannot synthesize weak property in file using manual reference counting">;
6290def err_synthesizing_arc_weak_property_no_runtime : Error<
6291  "cannot synthesize weak property because the current deployment target "
6292  "does not support weak references">;
6293def err_arc_unsupported_weak_class : Error<
6294  "class is incompatible with __weak references">;
6295def err_arc_weak_unavailable_assign : Error<
6296  "assignment of a weak-unavailable object to a __weak object">;
6297def err_arc_weak_unavailable_property : Error<
6298  "synthesizing __weak instance variable of type %0, which does not "
6299  "support weak references">;
6300def note_implemented_by_class : Note<
6301  "when implemented by class %0">;
6302def err_arc_convesion_of_weak_unavailable : Error<
6303  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
6304  " a __weak object of type %2">;
6305
6306} // end "ARC Weak References" category
6307
6308let CategoryName = "ARC Restrictions" in {
6309
6310def err_unavailable_in_arc : Error<
6311  "%0 is unavailable in ARC">;
6312def note_arc_forbidden_type : Note<
6313  "declaration uses type that is ill-formed in ARC">;
6314def note_performs_forbidden_arc_conversion : Note<
6315  "inline function performs a conversion which is forbidden in ARC">;
6316def note_arc_init_returns_unrelated : Note<
6317  "init method must return a type related to its receiver type">;
6318def note_arc_weak_disabled : Note<
6319  "declaration uses __weak, but ARC is disabled">;
6320def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
6321  "the current deployment target does not support">;
6322def note_arc_field_with_ownership : Note<
6323  "field has non-trivial ownership qualification">;
6324
6325def err_arc_illegal_explicit_message : Error<
6326  "ARC forbids explicit message send of %0">;
6327def err_arc_unused_init_message : Error<
6328  "the result of a delegate init call must be immediately returned "
6329  "or assigned to 'self'">;
6330def err_arc_mismatched_cast : Error<
6331  "%select{implicit conversion|cast}0 of "
6332  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6333  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6334  " to %3 is disallowed with ARC">;
6335def err_arc_nolifetime_behavior : Error<
6336  "explicit ownership qualifier on cast result has no effect">;
6337def err_arc_objc_property_default_assign_on_object : Error<
6338  "ARC forbids synthesizing a property of an Objective-C object "
6339  "with unspecified ownership or storage attribute">;
6340def err_arc_illegal_selector : Error<
6341  "ARC forbids use of %0 in a @selector">;
6342def err_arc_illegal_method_def : Error<
6343  "ARC forbids %select{implementation|synthesis}0 of %1">;
6344def warn_arc_strong_pointer_objc_pointer : Warning<
6345  "method parameter of type %0 with no explicit ownership">,
6346  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6347
6348} // end "ARC Restrictions" category
6349
6350def err_arc_lost_method_convention : Error<
6351  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6352  "method, but its implementation doesn't match because %select{"
6353  "its result type is not an object pointer|"
6354  "its result type is unrelated to its receiver type}1">;
6355def note_arc_lost_method_convention : Note<"declaration in interface">;
6356def err_arc_gained_method_convention : Error<
6357  "method implementation does not match its declaration">;
6358def note_arc_gained_method_convention : Note<
6359  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6360  "family because %select{its result type is not an object pointer|"
6361  "its result type is unrelated to its receiver type}1">;
6362def err_typecheck_arc_assign_self : Error<
6363  "cannot assign to 'self' outside of a method in the init family">;
6364def err_typecheck_arc_assign_self_class_method : Error<
6365  "cannot assign to 'self' in a class method">;
6366def err_typecheck_arr_assign_enumeration : Error<
6367  "fast enumeration variables cannot be modified in ARC by default; "
6368  "declare the variable __strong to allow this">;
6369def err_typecheck_arc_assign_externally_retained : Error<
6370  "variable declared with 'objc_externally_retained' "
6371  "cannot be modified in ARC">;
6372def warn_arc_retained_assign : Warning<
6373  "assigning retained object to %select{weak|unsafe_unretained}0 "
6374  "%select{property|variable}1"
6375  "; object will be released after assignment">,
6376  InGroup<ARCUnsafeRetainedAssign>;
6377def warn_arc_retained_property_assign : Warning<
6378  "assigning retained object to unsafe property"
6379  "; object will be released after assignment">,
6380  InGroup<ARCUnsafeRetainedAssign>;
6381def warn_arc_literal_assign : Warning<
6382  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6383  " to a weak %select{property|variable}1"
6384  "; object will be released after assignment">,
6385  InGroup<ARCUnsafeRetainedAssign>;
6386def err_arc_new_array_without_ownership : Error<
6387  "'new' cannot allocate an array of %0 with no explicit ownership">;
6388def err_arc_autoreleasing_var : Error<
6389  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6390  "__autoreleasing ownership">;
6391def err_arc_autoreleasing_capture : Error<
6392  "cannot capture __autoreleasing variable in a "
6393  "%select{block|lambda by copy}0">;
6394def err_arc_thread_ownership : Error<
6395  "thread-local variable has non-trivial ownership: type is %0">;
6396def err_arc_indirect_no_ownership : Error<
6397  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6398def err_arc_array_param_no_ownership : Error<
6399  "must explicitly describe intended ownership of an object array parameter">;
6400def err_arc_pseudo_dtor_inconstant_quals : Error<
6401  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6402  "type %1">;
6403def err_arc_init_method_unrelated_result_type : Error<
6404  "init methods must return a type related to the receiver type">;
6405def err_arc_nonlocal_writeback : Error<
6406  "passing address of %select{non-local|non-scalar}0 object to "
6407  "__autoreleasing parameter for write-back">;
6408def err_arc_method_not_found : Error<
6409  "no known %select{instance|class}1 method for selector %0">;
6410def err_arc_receiver_forward_class : Error<
6411  "receiver %0 for class message is a forward declaration">;
6412def err_arc_may_not_respond : Error<
6413  "no visible @interface for %0 declares the selector %1">;
6414def err_arc_receiver_forward_instance : Error<
6415  "receiver type %0 for instance message is a forward declaration">;
6416def warn_receiver_forward_instance : Warning<
6417  "receiver type %0 for instance message is a forward declaration">,
6418  InGroup<ForwardClassReceiver>, DefaultIgnore;
6419def err_arc_collection_forward : Error<
6420  "collection expression type %0 is a forward declaration">;
6421def err_arc_multiple_method_decl : Error<
6422  "multiple methods named %0 found with mismatched result, "
6423  "parameter type or attributes">;
6424def warn_arc_lifetime_result_type : Warning<
6425  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6426  "lifetime qualifier on return type is ignored">,
6427  InGroup<IgnoredQualifiers>;
6428
6429let CategoryName = "ARC Retain Cycle" in {
6430
6431def warn_arc_retain_cycle : Warning<
6432  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6433  InGroup<ARCRetainCycles>;
6434def note_arc_retain_cycle_owner : Note<
6435  "block will be retained by %select{the captured object|an object strongly "
6436  "retained by the captured object}0">;
6437
6438} // end "ARC Retain Cycle" category
6439
6440def warn_arc_object_memaccess : Warning<
6441  "%select{destination for|source of}0 this %1 call is a pointer to "
6442  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6443
6444let CategoryName = "ARC and @properties" in {
6445
6446def err_arc_strong_property_ownership : Error<
6447  "existing instance variable %1 for strong property %0 may not be "
6448  "%select{|__unsafe_unretained||__weak}2">;
6449def err_arc_assign_property_ownership : Error<
6450  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6451  "attribute must be __unsafe_unretained">;
6452def err_arc_inconsistent_property_ownership : Error<
6453  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6454  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6455
6456} // end "ARC and @properties" category
6457
6458def warn_block_capture_autoreleasing : Warning<
6459  "block captures an autoreleasing out-parameter, which may result in "
6460  "use-after-free bugs">,
6461  InGroup<BlockCaptureAutoReleasing>;
6462def note_declare_parameter_strong : Note<
6463  "declare the parameter __strong or capture a __block __strong variable to "
6464  "keep values alive across autorelease pools">;
6465
6466def err_arc_atomic_ownership : Error<
6467  "cannot perform atomic operation on a pointer to type %0: type has "
6468  "non-trivial ownership">;
6469
6470let CategoryName = "ARC Casting Rules" in {
6471
6472def err_arc_bridge_cast_incompatible : Error<
6473  "incompatible types casting %0 to %1 with a %select{__bridge|"
6474  "__bridge_transfer|__bridge_retained}2 cast">;
6475def err_arc_bridge_cast_wrong_kind : Error<
6476  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6477  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6478  "__bridge_transfer|__bridge_retained}4">;
6479def err_arc_cast_requires_bridge : Error<
6480  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6481  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6482  "requires a bridged cast">;
6483def note_arc_bridge : Note<
6484  "use __bridge to convert directly (no change in ownership)">;
6485def note_arc_cstyle_bridge : Note<
6486  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6487def note_arc_bridge_transfer : Note<
6488  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6489  "ownership of a +1 %0 into ARC">;
6490def note_arc_cstyle_bridge_transfer : Note<
6491  "use __bridge_transfer with C-style cast to transfer "
6492  "ownership of a +1 %0 into ARC">;
6493def note_arc_bridge_retained : Note<
6494  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6495  "ARC object available as a +1 %0">;
6496def note_arc_cstyle_bridge_retained : Note<
6497  "use __bridge_retained with C-style cast to make an "
6498  "ARC object available as a +1 %0">;
6499
6500} // ARC Casting category
6501
6502} // ARC category name
6503
6504def err_flexible_array_init_needs_braces : Error<
6505  "flexible array requires brace-enclosed initializer">;
6506def err_illegal_decl_array_of_functions : Error<
6507  "'%0' declared as array of functions of type %1">;
6508def err_array_incomplete_or_sizeless_type : Error<
6509  "array has %select{incomplete|sizeless}0 element type %1">;
6510def err_illegal_message_expr_incomplete_type : Error<
6511  "Objective-C message has incomplete result type %0">;
6512def err_illegal_decl_array_of_references : Error<
6513  "'%0' declared as array of references of type %1">;
6514def err_decl_negative_array_size : Error<
6515  "'%0' declared as an array with a negative size">;
6516def err_array_static_outside_prototype : Error<
6517  "%0 used in array declarator outside of function prototype">;
6518def err_array_static_not_outermost : Error<
6519  "%0 used in non-outermost array type derivation">;
6520def err_array_star_outside_prototype : Error<
6521  "star modifier used outside of function prototype">;
6522def err_illegal_decl_pointer_to_reference : Error<
6523  "'%0' declared as a pointer to a reference of type %1">;
6524def err_illegal_decl_mempointer_to_reference : Error<
6525  "'%0' declared as a member pointer to a reference of type %1">;
6526def err_illegal_decl_mempointer_to_void : Error<
6527  "'%0' declared as a member pointer to void">;
6528def err_illegal_decl_mempointer_in_nonclass : Error<
6529  "'%0' does not point into a class">;
6530def err_mempointer_in_nonclass_type : Error<
6531  "member pointer refers into non-class type %0">;
6532def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6533def err_nonfunction_block_type : Error<
6534  "block pointer to non-function type is invalid">;
6535def err_return_block_has_expr : Error<"void block should not return a value">;
6536def err_block_return_missing_expr : Error<
6537  "non-void block should return a value">;
6538def err_func_def_incomplete_result : Error<
6539  "incomplete result type %0 in function definition">;
6540def err_atomic_specifier_bad_type
6541    : Error<"_Atomic cannot be applied to "
6542            "%select{incomplete |array |function |reference |atomic |qualified "
6543            "|sizeless ||integer }0type "
6544            "%1 %select{|||||||which is not trivially copyable|}0">;
6545def warn_atomic_member_access : Warning<
6546  "accessing a member of an atomic structure or union is undefined behavior">,
6547  InGroup<DiagGroup<"atomic-access">>, DefaultError;
6548
6549// Expressions.
6550def ext_sizeof_alignof_function_type : Extension<
6551  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6552def ext_sizeof_alignof_void_type : Extension<
6553  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6554def err_opencl_sizeof_alignof_type : Error<
6555  "invalid application of '%0' to a void type">;
6556def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6557  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6558def err_sizeof_alignof_function_type : Error<
6559  "invalid application of '%0' to a function type">;
6560def err_openmp_default_simd_align_expr : Error<
6561  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6562def err_sizeof_alignof_typeof_bitfield : Error<
6563  "invalid application of '%select{sizeof|alignof|typeof|typeof_unqual}0' to "
6564  "bit-field">;
6565def err_alignof_member_of_incomplete_type : Error<
6566  "invalid application of 'alignof' to a field of a class still being defined">;
6567def err_vecstep_non_scalar_vector_type : Error<
6568  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6569def err_offsetof_incomplete_type : Error<
6570  "offsetof of incomplete type %0">;
6571def err_offsetof_record_type : Error<
6572  "offsetof requires struct, union, or class type, %0 invalid">;
6573def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6574def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6575  InGroup<InvalidOffsetof>;
6576def ext_offsetof_non_standardlayout_type : ExtWarn<
6577  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6578def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6579def err_offsetof_field_of_virtual_base : Error<
6580  "invalid application of 'offsetof' to a field of a virtual base">;
6581def warn_sub_ptr_zero_size_types : Warning<
6582  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6583  InGroup<PointerArith>;
6584def warn_pointer_arith_null_ptr : Warning<
6585  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6586  InGroup<NullPointerArithmetic>, DefaultIgnore;
6587def warn_gnu_null_ptr_arith : Extension<
6588  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6589  InGroup<GNUNullPointerArithmetic>;
6590def warn_pointer_sub_null_ptr : Warning<
6591  "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
6592  InGroup<NullPointerSubtraction>, DefaultIgnore;
6593
6594def warn_floatingpoint_eq : Warning<
6595  "comparing floating point with == or != is unsafe">,
6596  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6597
6598def err_setting_eval_method_used_in_unsafe_context : Error <
6599  "%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used with "
6600  "%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'}1">;
6601
6602def warn_remainder_division_by_zero : Warning<
6603  "%select{remainder|division}0 by zero is undefined">,
6604  InGroup<DivZero>;
6605def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6606  InGroup<DiagGroup<"shift-negative-value">>;
6607def warn_shift_negative : Warning<"shift count is negative">,
6608  InGroup<DiagGroup<"shift-count-negative">>;
6609def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6610  InGroup<DiagGroup<"shift-count-overflow">>;
6611def warn_shift_result_gt_typewidth : Warning<
6612  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6613  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6614def warn_shift_result_sets_sign_bit : Warning<
6615  "signed shift result (%0) sets the sign bit of the shift expression's "
6616  "type (%1) and becomes negative">,
6617  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6618
6619def warn_precedence_bitwise_rel : Warning<
6620  "%0 has lower precedence than %1; %1 will be evaluated first">,
6621  InGroup<Parentheses>;
6622def note_precedence_bitwise_first : Note<
6623  "place parentheses around the %0 expression to evaluate it first">;
6624def note_precedence_silence : Note<
6625  "place parentheses around the '%0' expression to silence this warning">;
6626
6627def warn_precedence_conditional : Warning<
6628  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6629  InGroup<Parentheses>;
6630def warn_precedence_bitwise_conditional : Warning<
6631  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6632  InGroup<BitwiseConditionalParentheses>;
6633def note_precedence_conditional_first : Note<
6634  "place parentheses around the '?:' expression to evaluate it first">;
6635
6636def warn_enum_constant_in_bool_context : Warning<
6637  "converting the enum constant to a boolean">,
6638  InGroup<IntInBoolContext>, DefaultIgnore;
6639def warn_left_shift_in_bool_context : Warning<
6640  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6641  InGroup<IntInBoolContext>, DefaultIgnore;
6642def warn_logical_instead_of_bitwise : Warning<
6643  "use of logical '%0' with constant operand">,
6644  InGroup<DiagGroup<"constant-logical-operand">>;
6645def note_logical_instead_of_bitwise_change_operator : Note<
6646  "use '%0' for a bitwise operation">;
6647def note_logical_instead_of_bitwise_remove_constant : Note<
6648  "remove constant to silence this warning">;
6649
6650def warn_bitwise_op_in_bitwise_op : Warning<
6651  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
6652
6653def warn_logical_and_in_logical_or : Warning<
6654  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
6655
6656def warn_overloaded_shift_in_comparison :Warning<
6657  "overloaded operator %select{>>|<<}0 has higher precedence than "
6658  "comparison operator">,
6659  InGroup<OverloadedShiftOpParentheses>;
6660def note_evaluate_comparison_first :Note<
6661  "place parentheses around comparison expression to evaluate it first">;
6662
6663def note_concatenated_string_literal_silence :Note<
6664  "place parentheses around the string literal to silence warning">;
6665
6666def warn_addition_in_bitshift : Warning<
6667  "operator '%0' has lower precedence than '%1'; "
6668  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
6669
6670def warn_self_assignment_builtin : Warning<
6671  "explicitly assigning value of variable of type %0 to itself%select{|; did "
6672  "you mean to assign to member %2?}1">,
6673  InGroup<SelfAssignment>, DefaultIgnore;
6674def warn_self_assignment_overloaded : Warning<
6675  "explicitly assigning value of variable of type %0 to itself%select{|; did "
6676  "you mean to assign to member %2?}1">,
6677  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
6678def warn_self_move : Warning<
6679  "explicitly moving variable of type %0 to itself%select{|; did you mean to "
6680  "move to member %2?}1">,
6681  InGroup<SelfMove>, DefaultIgnore;
6682
6683def err_builtin_move_forward_unsupported : Error<
6684  "unsupported signature for %q0">;
6685def err_use_of_unaddressable_function : Error<
6686  "taking address of non-addressable standard library function">;
6687// FIXME: This should also be in -Wc++23-compat once we have it.
6688def warn_cxx20_compat_use_of_unaddressable_function : Warning<
6689  "taking address of non-addressable standard library function "
6690  "is incompatible with C++20">, InGroup<CXX20Compat>;
6691
6692def warn_redundant_move_on_return : Warning<
6693  "redundant move in return statement">,
6694  InGroup<RedundantMove>, DefaultIgnore;
6695def warn_pessimizing_move_on_return : Warning<
6696  "moving a local object in a return statement prevents copy elision">,
6697  InGroup<PessimizingMove>, DefaultIgnore;
6698def warn_pessimizing_move_on_initialization : Warning<
6699  "moving a temporary object prevents copy elision">,
6700  InGroup<PessimizingMove>, DefaultIgnore;
6701def note_remove_move : Note<"remove std::move call here">;
6702
6703def warn_string_plus_int : Warning<
6704  "adding %0 to a string does not append to the string">,
6705  InGroup<StringPlusInt>;
6706def warn_string_plus_char : Warning<
6707  "adding %0 to a string pointer does not append to the string">,
6708  InGroup<StringPlusChar>;
6709def note_string_plus_scalar_silence : Note<
6710  "use array indexing to silence this warning">;
6711
6712def warn_sizeof_array_param : Warning<
6713  "sizeof on array function parameter will return size of %0 instead of %1">,
6714  InGroup<SizeofArrayArgument>;
6715
6716def warn_sizeof_array_decay : Warning<
6717  "sizeof on pointer operation will return size of %0 instead of %1">,
6718  InGroup<SizeofArrayDecay>;
6719
6720def err_sizeof_nonfragile_interface : Error<
6721  "application of '%select{alignof|sizeof}1' to interface %0 is "
6722  "not supported on this architecture and platform">;
6723def err_atdef_nonfragile_interface : Error<
6724  "use of @defs is not supported on this architecture and platform">;
6725def err_subscript_nonfragile_interface : Error<
6726  "subscript requires size of interface %0, which is not constant for "
6727  "this architecture and platform">;
6728
6729def err_arithmetic_nonfragile_interface : Error<
6730  "arithmetic on pointer to interface %0, which is not a constant size for "
6731  "this architecture and platform">;
6732
6733def warn_deprecated_comma_subscript : Warning<
6734  "top-level comma expression in array subscript is deprecated "
6735  "in C++20 and unsupported in C++2b">,
6736  InGroup<DeprecatedCommaSubscript>;
6737
6738def ext_subscript_non_lvalue : Extension<
6739  "ISO C90 does not allow subscripting non-lvalue array">;
6740def err_typecheck_subscript_value : Error<
6741  "subscripted value is not an array, pointer, or vector">;
6742def err_typecheck_subscript_not_integer : Error<
6743  "array subscript is not an integer">;
6744def err_subscript_function_type : Error<
6745  "subscript of pointer to function type %0">;
6746def err_subscript_incomplete_or_sizeless_type : Error<
6747  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
6748def err_subscript_svbool_t : Error<
6749  "subscript of svbool_t is not allowed">;
6750def err_dereference_incomplete_type : Error<
6751  "dereference of pointer to incomplete type %0">;
6752def ext_gnu_subscript_void_type : Extension<
6753  "subscript of a pointer to void is a GNU extension">,
6754  InGroup<GNUPointerArith>;
6755def err_typecheck_member_reference_struct_union : Error<
6756  "member reference base type %0 is not a structure or union">;
6757def err_typecheck_member_reference_ivar : Error<
6758  "%0 does not have a member named %1">;
6759def err_arc_weak_ivar_access : Error<
6760  "dereferencing a __weak pointer is not allowed due to possible "
6761  "null value caused by race condition, assign it to strong variable first">;
6762def err_typecheck_member_reference_arrow : Error<
6763  "member reference type %0 is not a pointer">;
6764def err_typecheck_member_reference_suggestion : Error<
6765  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
6766def note_typecheck_member_reference_suggestion : Note<
6767  "did you mean to use '.' instead?">;
6768def note_member_reference_arrow_from_operator_arrow : Note<
6769  "'->' applied to return value of the operator->() declared here">;
6770def err_typecheck_member_reference_type : Error<
6771  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
6772def err_typecheck_member_reference_unknown : Error<
6773  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
6774def err_member_reference_needs_call : Error<
6775  "base of member reference is a function; perhaps you meant to call "
6776  "it%select{| with no arguments}0?">;
6777def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
6778  InGroup<CharSubscript>, DefaultIgnore;
6779
6780def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
6781def err_no_member : Error<"no member named %0 in %1">;
6782def err_no_member_overloaded_arrow : Error<
6783  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
6784
6785def err_member_not_yet_instantiated : Error<
6786  "no member %0 in %1; it has not yet been instantiated">;
6787def note_non_instantiated_member_here : Note<
6788  "not-yet-instantiated member is declared here">;
6789
6790def err_enumerator_does_not_exist : Error<
6791  "enumerator %0 does not exist in instantiation of %1">;
6792def note_enum_specialized_here : Note<
6793  "enum %0 was explicitly specialized here">;
6794
6795def err_specialization_not_primary_template : Error<
6796  "cannot reference member of primary template because deduced class "
6797  "template specialization %0 is %select{instantiated from a partial|"
6798  "an explicit}1 specialization">;
6799
6800def err_member_redeclared : Error<"class member cannot be redeclared">;
6801def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
6802  InGroup<RedeclaredClassMember>;
6803def err_member_redeclared_in_instantiation : Error<
6804  "multiple overloads of %0 instantiate to the same signature %1">;
6805def err_member_name_of_class : Error<"member %0 has the same name as its class">;
6806def err_member_def_undefined_record : Error<
6807  "out-of-line definition of %0 from class %1 without definition">;
6808def err_member_decl_does_not_match : Error<
6809  "out-of-line %select{declaration|definition}2 of %0 "
6810  "does not match any declaration in %1">;
6811def err_friend_decl_with_def_arg_must_be_def : Error<
6812  "friend declaration specifying a default argument must be a definition">;
6813def err_friend_decl_with_def_arg_redeclared : Error<
6814  "friend declaration specifying a default argument must be the only declaration">;
6815def err_friend_decl_does_not_match : Error<
6816  "friend declaration of %0 does not match any declaration in %1">;
6817def err_member_decl_does_not_match_suggest : Error<
6818  "out-of-line %select{declaration|definition}2 of %0 "
6819  "does not match any declaration in %1; did you mean %3?">;
6820def err_member_def_does_not_match_ret_type : Error<
6821  "return type of out-of-line definition of %q0 differs from "
6822  "that in the declaration">;
6823def err_nonstatic_member_out_of_line : Error<
6824  "non-static data member defined out-of-line">;
6825def err_qualified_typedef_declarator : Error<
6826  "typedef declarator cannot be qualified">;
6827def err_qualified_param_declarator : Error<
6828  "parameter declarator cannot be qualified">;
6829def ext_out_of_line_declaration : ExtWarn<
6830  "out-of-line declaration of a member must be a definition">,
6831  InGroup<OutOfLineDeclaration>, DefaultError;
6832def err_member_extra_qualification : Error<
6833  "extra qualification on member %0">;
6834def warn_member_extra_qualification : Warning<
6835  err_member_extra_qualification.Summary>, InGroup<MicrosoftExtraQualification>;
6836def warn_namespace_member_extra_qualification : Warning<
6837  "extra qualification on member %0">,
6838  InGroup<DiagGroup<"extra-qualification">>;
6839def err_member_qualification : Error<
6840  "non-friend class member %0 cannot have a qualified name">;
6841def note_member_def_close_match : Note<"member declaration nearly matches">;
6842def note_member_def_close_const_match : Note<
6843  "member declaration does not match because "
6844  "it %select{is|is not}0 const qualified">;
6845def note_member_def_close_param_match : Note<
6846  "type of %ordinal0 parameter of member declaration does not match definition"
6847  "%diff{ ($ vs $)|}1,2">;
6848def note_local_decl_close_match : Note<"local declaration nearly matches">;
6849def note_local_decl_close_param_match : Note<
6850  "type of %ordinal0 parameter of local declaration does not match definition"
6851  "%diff{ ($ vs $)|}1,2">;
6852def err_typecheck_ivar_variable_size : Error<
6853  "instance variables must have a constant size">;
6854def err_ivar_reference_type : Error<
6855  "instance variables cannot be of reference type">;
6856def err_typecheck_illegal_increment_decrement : Error<
6857  "cannot %select{decrement|increment}1 value of type %0">;
6858def err_typecheck_expect_int : Error<
6859  "used type %0 where integer is required">;
6860def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
6861  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
6862def err_typecheck_pointer_arith_function_type : Error<
6863  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
6864  "function type%select{|s}2 %1%select{| and %3}2">;
6865def err_typecheck_pointer_arith_void_type : Error<
6866  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
6867def err_typecheck_decl_incomplete_type : Error<
6868  "variable has incomplete type %0">;
6869def ext_typecheck_decl_incomplete_type : ExtWarn<
6870  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
6871  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
6872def err_tentative_def_incomplete_type : Error<
6873  "tentative definition has type %0 that is never completed">;
6874def warn_tentative_incomplete_array : Warning<
6875  "tentative array definition assumed to have one element">;
6876def err_typecheck_incomplete_array_needs_initializer : Error<
6877  "definition of variable with array type needs an explicit size "
6878  "or an initializer">;
6879def err_array_init_not_init_list : Error<
6880  "array initializer must be an initializer "
6881  "list%select{| or string literal| or wide string literal}0">;
6882def err_array_init_narrow_string_into_wchar : Error<
6883  "initializing wide char array with non-wide string literal">;
6884def err_array_init_wide_string_into_char : Error<
6885  "initializing char array with wide string literal">;
6886def err_array_init_incompat_wide_string_into_wchar : Error<
6887  "initializing wide char array with incompatible wide string literal">;
6888def err_array_init_plain_string_into_char8_t : Error<
6889  "initializing 'char8_t' array with plain string literal">;
6890def note_array_init_plain_string_into_char8_t : Note<
6891  "add 'u8' prefix to form a 'char8_t' string literal">;
6892def err_array_init_utf8_string_into_char : Error<
6893  "initialization of %select{|signed }0char array with "
6894  "UTF-8 string literal is not permitted by %select{'-fchar8_t'|C++20}1">;
6895def warn_cxx20_compat_utf8_string : Warning<
6896  "type of UTF-8 string literal will change from array of const char to "
6897  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
6898def note_cxx20_compat_utf8_string_remove_u8 : Note<
6899  "remove 'u8' prefix to avoid a change of behavior; "
6900  "Clang encodes unprefixed narrow string literals as UTF-8">;
6901def err_array_init_different_type : Error<
6902  "cannot initialize array %diff{of type $ with array of type $|"
6903  "with different type of array}0,1">;
6904def err_array_init_non_constant_array : Error<
6905  "cannot initialize array %diff{of type $ with non-constant array of type $|"
6906  "with different type of array}0,1">;
6907def ext_array_init_copy : Extension<
6908  "initialization of an array "
6909  "%diff{of type $ from a compound literal of type $|"
6910  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
6911// This is intentionally not disabled by -Wno-gnu.
6912def ext_array_init_parens : ExtWarn<
6913  "parenthesized initialization of a member array is a GNU extension">,
6914  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
6915def warn_deprecated_string_literal_conversion : Warning<
6916  "conversion from string literal to %0 is deprecated">,
6917  InGroup<CXX11CompatDeprecatedWritableStr>;
6918def ext_deprecated_string_literal_conversion : ExtWarn<
6919  "ISO C++11 does not allow conversion from string literal to %0">,
6920  InGroup<WritableStrings>, SFINAEFailure;
6921def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
6922def err_typecheck_sclass_fscope : Error<
6923  "illegal storage class on file-scoped variable">;
6924def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
6925  InGroup<MissingDeclarations>;
6926def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
6927  "of a type">, InGroup<MissingDeclarations>;
6928def err_standalone_class_nested_name_specifier : Error<
6929  "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
6930  "have a nested name specifier">;
6931def err_typecheck_sclass_func : Error<"illegal storage class on function">;
6932def err_static_block_func : Error<
6933  "function declared in block scope cannot have 'static' storage class">;
6934def err_typecheck_address_of : Error<"address of %select{bit-field"
6935  "|vector element|property expression|register variable|matrix element}0 requested">;
6936def ext_typecheck_addrof_void : Extension<
6937  "ISO C forbids taking the address of an expression of type 'void'">;
6938def err_unqualified_pointer_member_function : Error<
6939  "must explicitly qualify name of member function when taking its address">;
6940def err_invalid_form_pointer_member_function : Error<
6941  "cannot create a non-constant pointer to member function">;
6942def err_address_of_function_with_pass_object_size_params: Error<
6943  "cannot take address of function %0 because parameter %1 has "
6944  "pass_object_size attribute">;
6945def err_parens_pointer_member_function : Error<
6946  "cannot parenthesize the name of a method when forming a member pointer">;
6947def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
6948  "extra '&' taking address of overloaded function">;
6949def err_typecheck_invalid_lvalue_addrof : Error<
6950  "cannot take the address of an rvalue of type %0">;
6951def ext_typecheck_addrof_temporary : ExtWarn<
6952  "taking the address of a temporary object of type %0">,
6953  InGroup<AddressOfTemporary>, DefaultError;
6954def err_typecheck_addrof_temporary : Error<
6955  "taking the address of a temporary object of type %0">;
6956def err_typecheck_addrof_dtor : Error<
6957  "taking the address of a destructor">;
6958def err_typecheck_unary_expr : Error<
6959  "invalid argument type %0 to unary expression">;
6960def err_typecheck_indirection_requires_pointer : Error<
6961  "indirection requires pointer operand (%0 invalid)">;
6962def ext_typecheck_indirection_through_void_pointer : ExtWarn<
6963  "ISO C does not allow indirection on operand of type %0">,
6964  InGroup<VoidPointerDeref>;
6965def ext_typecheck_indirection_through_void_pointer_cpp
6966    : ExtWarn<"ISO C++ does not allow indirection on operand of type %0">,
6967      InGroup<VoidPointerDeref>, DefaultError, SFINAEFailure;
6968def warn_indirection_through_null : Warning<
6969  "indirection of non-volatile null pointer will be deleted, not trap">,
6970  InGroup<NullDereference>;
6971def warn_binding_null_to_reference : Warning<
6972  "binding dereferenced null pointer to reference has undefined behavior">,
6973  InGroup<NullDereference>;
6974def note_indirection_through_null : Note<
6975  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
6976def warn_pointer_indirection_from_incompatible_type : Warning<
6977  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
6978  "behavior">,
6979  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6980def warn_taking_address_of_packed_member : Warning<
6981  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
6982  InGroup<DiagGroup<"address-of-packed-member">>;
6983def warn_param_mismatched_alignment : Warning<
6984  "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">,
6985  InGroup<DiagGroup<"align-mismatch">>;
6986
6987def err_objc_object_assignment : Error<
6988  "cannot assign to class object (%0 invalid)">;
6989def err_typecheck_invalid_operands : Error<
6990  "invalid operands to binary expression (%0 and %1)">, Deferrable;
6991def note_typecheck_invalid_operands_converted : Note<
6992  "%select{first|second}0 operand was implicitly converted to type %1">;
6993def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
6994  "logical expression with vector %select{type %1 and non-vector type %2|types"
6995  " %1 and %2}0 is only supported in C++">;
6996def err_typecheck_sub_ptr_compatible : Error<
6997  "%diff{$ and $ are not pointers to compatible types|"
6998  "pointers to incompatible types}0,1">;
6999def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
7000  "ordered comparison between pointer and integer (%0 and %1)">;
7001def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
7002  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
7003def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
7004  "ordered comparison between pointer and zero (%0 and %1)">;
7005def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
7006  "three-way comparison between pointer and zero">;
7007def ext_typecheck_compare_complete_incomplete_pointers : Extension<
7008  "pointer comparisons before C11 "
7009  "need to be between two complete or two incomplete types; "
7010  "%0 is %select{|in}2complete and "
7011  "%1 is %select{|in}3complete">,
7012  InGroup<C11>;
7013def warn_typecheck_ordered_comparison_of_function_pointers : Warning<
7014  "ordered comparison of function pointers (%0 and %1)">,
7015  InGroup<OrderedCompareFunctionPointers>;
7016def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
7017  "ordered comparison of function pointers (%0 and %1)">,
7018  InGroup<OrderedCompareFunctionPointers>;
7019def err_typecheck_ordered_comparison_of_function_pointers : Error<
7020  "ordered comparison of function pointers (%0 and %1)">;
7021def ext_typecheck_comparison_of_fptr_to_void : Extension<
7022  "equality comparison between function pointer and void pointer (%0 and %1)">;
7023def err_typecheck_comparison_of_fptr_to_void : Error<
7024  "equality comparison between function pointer and void pointer (%0 and %1)">;
7025def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
7026  "comparison between pointer and integer (%0 and %1)">,
7027  InGroup<DiagGroup<"pointer-integer-compare">>;
7028def err_typecheck_comparison_of_pointer_integer : Error<
7029  "comparison between pointer and integer (%0 and %1)">;
7030def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
7031  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
7032  InGroup<CompareDistinctPointerType>;
7033def ext_typecheck_cond_incompatible_operands : ExtWarn<
7034  "incompatible operand types (%0 and %1)">;
7035def err_cond_voidptr_arc : Error <
7036  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
7037  "in ARC mode">;
7038def err_typecheck_comparison_of_distinct_pointers : Error<
7039  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
7040def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
7041  "%select{comparison between %diff{ ($ and $)|}0,1"
7042  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
7043  "|conditional operator with the second and third operands of type "
7044  "%diff{ ($ and $)|}0,1}2"
7045  " which are pointers to non-overlapping address spaces">;
7046
7047def select_arith_conv_kind : TextSubstitution<
7048  "%select{arithmetic between|bitwise operation between|comparison of|"
7049  "conditional expression between|compound assignment of}0">;
7050def warn_arith_conv_enum_float : Warning<
7051  "%sub{select_arith_conv_kind}0 "
7052  "%select{floating-point|enumeration}1 type %2 "
7053  "%plural{2:with|4:from|:and}0 "
7054  "%select{enumeration|floating-point}1 type %3">,
7055  InGroup<EnumFloatConversion>, DefaultIgnore;
7056def warn_arith_conv_enum_float_cxx20 : Warning<
7057  "%sub{select_arith_conv_kind}0 "
7058  "%select{floating-point|enumeration}1 type %2 "
7059  "%plural{2:with|4:from|:and}0 "
7060  "%select{enumeration|floating-point}1 type %3 is deprecated">,
7061  InGroup<DeprecatedEnumFloatConversion>;
7062def warn_arith_conv_mixed_enum_types : Warning<
7063  "%sub{select_arith_conv_kind}0 "
7064  "different enumeration types%diff{ ($ and $)|}1,2">,
7065  InGroup<EnumEnumConversion>, DefaultIgnore;
7066def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
7067  "%sub{select_arith_conv_kind}0 "
7068  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
7069  InGroup<DeprecatedEnumEnumConversion>;
7070def warn_arith_conv_mixed_anon_enum_types : Warning<
7071  warn_arith_conv_mixed_enum_types.Summary>,
7072  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
7073def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
7074  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7075  InGroup<DeprecatedAnonEnumEnumConversion>;
7076def warn_conditional_mixed_enum_types : Warning<
7077  warn_arith_conv_mixed_enum_types.Summary>,
7078  InGroup<EnumCompareConditional>, DefaultIgnore;
7079def warn_conditional_mixed_enum_types_cxx20 : Warning<
7080  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7081  InGroup<DeprecatedEnumCompareConditional>;
7082def warn_comparison_mixed_enum_types : Warning<
7083  warn_arith_conv_mixed_enum_types.Summary>,
7084  InGroup<EnumCompare>;
7085def warn_comparison_mixed_enum_types_cxx20 : Warning<
7086  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7087  InGroup<DeprecatedEnumCompare>;
7088def warn_comparison_of_mixed_enum_types_switch : Warning<
7089  "comparison of different enumeration types in switch statement"
7090  "%diff{ ($ and $)|}0,1">,
7091  InGroup<EnumCompareSwitch>;
7092
7093def err_typecheck_assign_const : Error<
7094  "%select{"
7095  "cannot assign to return value because function %1 returns a const value|"
7096  "cannot assign to variable %1 with const-qualified type %2|"
7097  "cannot assign to %select{non-|}1static data member %2 "
7098  "with const-qualified type %3|"
7099  "cannot assign to non-static data member within const member function %1|"
7100  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
7101  "with %select{|nested }3const-qualified data member %4|"
7102  "read-only variable is not assignable}0">;
7103
7104def note_typecheck_assign_const : Note<
7105  "%select{"
7106  "function %1 which returns const-qualified type %2 declared here|"
7107  "variable %1 declared const here|"
7108  "%select{non-|}1static data member %2 declared const here|"
7109  "member function %q1 is declared const here|"
7110  "%select{|nested }1data member %2 declared const here}0">;
7111
7112def warn_unsigned_always_true_comparison : Warning<
7113  "result of comparison of %select{%3|unsigned expression}0 %2 "
7114  "%select{unsigned expression|%3}0 is always %4">,
7115  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
7116def warn_unsigned_char_always_true_comparison : Warning<
7117  "result of comparison of %select{%3|char expression}0 %2 "
7118  "%select{char expression|%3}0 is always %4, since char is interpreted as "
7119  "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore;
7120def warn_unsigned_enum_always_true_comparison : Warning<
7121  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
7122  "%select{unsigned enum expression|%3}0 is always %4">,
7123  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
7124def warn_tautological_constant_compare : Warning<
7125  "result of comparison %select{%3|%1}0 %2 "
7126  "%select{%1|%3}0 is always %4">,
7127  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
7128def warn_tautological_compare_objc_bool : Warning<
7129  "result of comparison of constant %0 with expression of type 'BOOL'"
7130  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
7131  InGroup<TautologicalObjCBoolCompare>;
7132def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
7133def warn_tautological_compare_value_range : Warning<
7134  "result of comparison of "
7135  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
7136  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
7137  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
7138
7139def warn_mixed_sign_comparison : Warning<
7140  "comparison of integers of different signs: %0 and %1">,
7141  InGroup<SignCompare>, DefaultIgnore;
7142def warn_out_of_range_compare : Warning<
7143  "result of comparison of %select{constant %0|true|false}1 with "
7144  "%select{expression of type %2|boolean expression}3 is always %4">,
7145  InGroup<TautologicalOutOfRangeCompare>;
7146def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Summary>,
7147  InGroup<TautologicalConstantCompare>;
7148def warn_integer_constants_in_conditional_always_true : Warning<
7149  "converting the result of '?:' with integer constants to a boolean always "
7150  "evaluates to 'true'">,
7151  InGroup<TautologicalConstantCompare>;
7152def warn_left_shift_always : Warning<
7153  "converting the result of '<<' to a boolean always evaluates "
7154  "to %select{false|true}0">,
7155  InGroup<TautologicalConstantCompare>;
7156def warn_null_in_arithmetic_operation : Warning<
7157  "use of NULL in arithmetic operation">,
7158  InGroup<NullArithmetic>;
7159def warn_null_in_comparison_operation : Warning<
7160  "comparison between NULL and non-pointer "
7161  "%select{(%1 and NULL)|(NULL and %1)}0">,
7162  InGroup<NullArithmetic>;
7163def err_shift_rhs_only_vector : Error<
7164  "requested shift is a vector of type %0 but the first operand is not a "
7165  "vector (%1)">;
7166
7167def warn_logical_not_on_lhs_of_check : Warning<
7168  "logical not is only applied to the left hand side of this "
7169  "%select{comparison|bitwise operator}0">,
7170  InGroup<LogicalNotParentheses>;
7171def note_logical_not_fix : Note<
7172  "add parentheses after the '!' to evaluate the "
7173  "%select{comparison|bitwise operator}0 first">;
7174def note_logical_not_silence_with_parens : Note<
7175  "add parentheses around left hand side expression to silence this warning">;
7176
7177def err_invalid_this_use : Error<
7178  "invalid use of 'this' outside of a non-static member function">;
7179def err_this_static_member_func : Error<
7180  "'this' cannot be%select{| implicitly}0 used in a static member function "
7181  "declaration">;
7182def err_invalid_member_use_in_static_method : Error<
7183  "invalid use of member %0 in static member function">;
7184def err_invalid_qualified_function_type : Error<
7185  "%select{non-member function|static member function|deduction guide}0 "
7186  "%select{of type %2 |}1cannot have '%3' qualifier">;
7187def err_compound_qualified_function_type : Error<
7188  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
7189  "cannot have '%3' qualifier">;
7190def err_qualified_function_typeid : Error<
7191  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
7192
7193def err_ref_qualifier_overload : Error<
7194  "cannot overload a member function %select{without a ref-qualifier|with "
7195  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
7196  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
7197
7198def err_invalid_non_static_member_use : Error<
7199  "invalid use of non-static data member %0">;
7200def err_nested_non_static_member_use : Error<
7201  "%select{call to non-static member function|use of non-static data member}0 "
7202  "%2 of %1 from nested type %3">;
7203def warn_cxx98_compat_non_static_member_use : Warning<
7204  "use of non-static data member %0 in an unevaluated context is "
7205  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
7206def err_invalid_incomplete_type_use : Error<
7207  "invalid use of incomplete type %0">;
7208def err_builtin_func_cast_more_than_one_arg : Error<
7209  "function-style cast to a builtin type can only take one argument">;
7210def err_value_init_for_array_type : Error<
7211  "array types cannot be value-initialized">;
7212def err_init_for_function_type : Error<
7213  "cannot create object of function type %0">;
7214def warn_format_nonliteral_noargs : Warning<
7215  "format string is not a string literal (potentially insecure)">,
7216  InGroup<FormatSecurity>;
7217def warn_format_nonliteral : Warning<
7218  "format string is not a string literal">,
7219  InGroup<FormatNonLiteral>, DefaultIgnore;
7220
7221def err_unexpected_interface : Error<
7222  "unexpected interface name %0: expected expression">;
7223def err_ref_non_value : Error<"%0 does not refer to a value">;
7224def err_ref_vm_type : Error<
7225  "cannot refer to declaration with a variably modified type inside block">;
7226def err_ref_flexarray_type : Error<
7227  "cannot refer to declaration of structure variable with flexible array member "
7228  "inside block">;
7229def err_ref_array_type : Error<
7230  "cannot refer to declaration with an array type inside block">;
7231def err_property_not_found : Error<
7232  "property %0 not found on object of type %1">;
7233def err_invalid_property_name : Error<
7234  "%0 is not a valid property name (accessing an object of type %1)">;
7235def err_getter_not_found : Error<
7236  "no getter method for read from property">;
7237def err_objc_subscript_method_not_found : Error<
7238  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
7239  "found on object of type %0">;
7240def err_objc_subscript_index_type : Error<
7241  "method index parameter type %0 is not integral type">;
7242def err_objc_subscript_key_type : Error<
7243  "method key parameter type %0 is not object type">;
7244def err_objc_subscript_dic_object_type : Error<
7245  "method object parameter type %0 is not object type">;
7246def err_objc_subscript_object_type : Error<
7247  "cannot assign to this %select{dictionary|array}1 because assigning method's "
7248  "2nd parameter of type %0 is not an Objective-C pointer type">;
7249def err_objc_subscript_base_type : Error<
7250  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
7251def err_objc_multiple_subscript_type_conversion : Error<
7252  "indexing expression is invalid because subscript type %0 has "
7253  "multiple type conversion functions">;
7254def err_objc_subscript_type_conversion : Error<
7255  "indexing expression is invalid because subscript type %0 is not an integral"
7256  " or Objective-C pointer type">;
7257def err_objc_subscript_pointer : Error<
7258  "indexing expression is invalid because subscript type %0 is not an"
7259  " Objective-C pointer">;
7260def err_objc_indexing_method_result_type : Error<
7261  "method for accessing %select{dictionary|array}1 element must have Objective-C"
7262  " object return type instead of %0">;
7263def err_objc_index_incomplete_class_type : Error<
7264  "Objective-C index expression has incomplete class type %0">;
7265def err_illegal_container_subscripting_op : Error<
7266  "illegal operation on Objective-C container subscripting">;
7267def err_property_not_found_forward_class : Error<
7268  "property %0 cannot be found in forward class object %1">;
7269def err_property_not_as_forward_class : Error<
7270  "property %0 refers to an incomplete Objective-C class %1 "
7271  "(with no @interface available)">;
7272def note_forward_class : Note<
7273  "forward declaration of class here">;
7274def err_duplicate_property : Error<
7275  "property has a previous declaration">;
7276def ext_gnu_void_ptr : Extension<
7277  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
7278  InGroup<GNUPointerArith>;
7279def ext_gnu_ptr_func_arith : Extension<
7280  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
7281  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
7282  InGroup<GNUPointerArith>;
7283def err_readonly_message_assignment : Error<
7284  "assigning to 'readonly' return result of an Objective-C message not allowed">;
7285def ext_integer_increment_complex : Extension<
7286  "ISO C does not support '++'/'--' on complex integer type %0">;
7287def ext_integer_complement_complex : Extension<
7288  "ISO C does not support '~' for complex conjugation of %0">;
7289def err_nosetter_property_assignment : Error<
7290  "%select{assignment to readonly property|"
7291  "no setter method %1 for assignment to property}0">;
7292def err_nosetter_property_incdec : Error<
7293  "%select{%select{increment|decrement}1 of readonly property|"
7294  "no setter method %2 for %select{increment|decrement}1 of property}0">;
7295def err_nogetter_property_compound_assignment : Error<
7296  "a getter method is needed to perform a compound assignment on a property">;
7297def err_nogetter_property_incdec : Error<
7298  "no getter method %1 for %select{increment|decrement}0 of property">;
7299def err_no_subobject_property_setting : Error<
7300  "expression is not assignable">;
7301def err_qualified_objc_access : Error<
7302  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
7303
7304def ext_freestanding_complex : Extension<
7305  "complex numbers are an extension in a freestanding C99 implementation">;
7306
7307// FIXME: Remove when we support imaginary.
7308def err_imaginary_not_supported : Error<"imaginary types are not supported">;
7309
7310// Obj-c expressions
7311def warn_root_inst_method_not_found : Warning<
7312  "instance method %0 is being used on 'Class' which is not in the root class">,
7313  InGroup<MethodAccess>;
7314def warn_class_method_not_found : Warning<
7315  "class method %objcclass0 not found (return type defaults to 'id')">,
7316  InGroup<MethodAccess>;
7317def warn_instance_method_on_class_found : Warning<
7318  "instance method %0 found instead of class method %1">,
7319  InGroup<MethodAccess>;
7320def warn_inst_method_not_found : Warning<
7321  "instance method %objcinstance0 not found (return type defaults to 'id')">,
7322  InGroup<MethodAccess>;
7323def warn_instance_method_not_found_with_typo : Warning<
7324  "instance method %objcinstance0 not found (return type defaults to 'id')"
7325  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
7326def warn_class_method_not_found_with_typo : Warning<
7327  "class method %objcclass0 not found (return type defaults to 'id')"
7328  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
7329def err_method_not_found_with_typo : Error<
7330  "%select{instance|class}1 method %0 not found "
7331  "; did you mean %2?">;
7332def err_no_super_class_message : Error<
7333  "no @interface declaration found in class messaging of %0">;
7334def err_root_class_cannot_use_super : Error<
7335  "%0 cannot use 'super' because it is a root class">;
7336def err_invalid_receiver_to_message_super : Error<
7337  "'super' is only valid in a method body">;
7338def err_invalid_receiver_class_message : Error<
7339  "receiver type %0 is not an Objective-C class">;
7340def err_missing_open_square_message_send : Error<
7341  "missing '[' at start of message send expression">;
7342def warn_bad_receiver_type : Warning<
7343  "receiver type %0 is not 'id' or interface pointer, consider "
7344  "casting it to 'id'">,InGroup<ObjCReceiver>;
7345def err_bad_receiver_type : Error<"bad receiver type %0">;
7346def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
7347def err_unknown_receiver_suggest : Error<
7348  "unknown receiver %0; did you mean %1?">;
7349def err_objc_throw_expects_object : Error<
7350  "@throw requires an Objective-C object type (%0 invalid)">;
7351def err_objc_synchronized_expects_object : Error<
7352  "@synchronized requires an Objective-C object type (%0 invalid)">;
7353def err_rethrow_used_outside_catch : Error<
7354  "@throw (rethrow) used outside of a @catch block">;
7355def err_attribute_multiple_objc_gc : Error<
7356  "multiple garbage collection attributes specified for type">;
7357def err_catch_param_not_objc_type : Error<
7358  "@catch parameter is not a pointer to an interface type">;
7359def err_illegal_qualifiers_on_catch_parm : Error<
7360  "illegal qualifiers on @catch parameter">;
7361def err_storage_spec_on_catch_parm : Error<
7362  "@catch parameter cannot have storage specifier '%0'">;
7363def warn_register_objc_catch_parm : Warning<
7364  "'register' storage specifier on @catch parameter will be ignored">;
7365def err_qualified_objc_catch_parm : Error<
7366  "@catch parameter declarator cannot be qualified">;
7367def warn_objc_pointer_cxx_catch_fragile : Warning<
7368  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7369  "exception model">, InGroup<ObjCNonUnifiedException>;
7370def err_objc_object_catch : Error<
7371  "cannot catch an Objective-C object by value">;
7372def err_incomplete_type_objc_at_encode : Error<
7373  "'@encode' of incomplete type %0">;
7374def warn_objc_circular_container : Warning<
7375  "adding %0 to %1 might cause circular dependency in container">,
7376  InGroup<DiagGroup<"objc-circular-container">>;
7377def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7378def warn_objc_unsafe_perform_selector : Warning<
7379  "%0 is incompatible with selectors that return a "
7380  "%select{struct|union|vector}1 type">,
7381  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7382def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7383  "method %0 that returns %1 declared here">;
7384def err_attribute_arm_builtin_alias : Error<
7385  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7386def err_attribute_arm_mve_polymorphism : Error<
7387  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7388
7389def warn_setter_getter_impl_required : Warning<
7390  "property %0 requires method %1 to be defined - "
7391  "use @synthesize, @dynamic or provide a method implementation "
7392  "in this class implementation">,
7393  InGroup<ObjCPropertyImpl>;
7394def warn_setter_getter_impl_required_in_category : Warning<
7395  "property %0 requires method %1 to be defined - "
7396  "use @dynamic or provide a method implementation in this category">,
7397  InGroup<ObjCPropertyImpl>;
7398def note_parameter_named_here : Note<
7399  "passing argument to parameter %0 here">;
7400def note_parameter_here : Note<
7401  "passing argument to parameter here">;
7402def note_method_return_type_change : Note<
7403  "compiler has implicitly changed method %0 return type">;
7404
7405def warn_impl_required_for_class_property : Warning<
7406  "class property %0 requires method %1 to be defined - "
7407  "use @dynamic or provide a method implementation "
7408  "in this class implementation">,
7409  InGroup<ObjCPropertyImpl>;
7410def warn_impl_required_in_category_for_class_property : Warning<
7411  "class property %0 requires method %1 to be defined - "
7412  "use @dynamic or provide a method implementation in this category">,
7413  InGroup<ObjCPropertyImpl>;
7414
7415// C++ casts
7416// These messages adhere to the TryCast pattern: %0 is an int specifying the
7417// cast type, %1 is the source type, %2 is the destination type.
7418def err_bad_reinterpret_cast_overload : Error<
7419  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7420
7421def warn_reinterpret_different_from_static : Warning<
7422  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7423  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7424  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7425def note_reinterpret_updowncast_use_static: Note<
7426  "use 'static_cast' to adjust the pointer correctly while "
7427  "%select{upcasting|downcasting}0">;
7428
7429def err_bad_static_cast_overload : Error<
7430  "address of overloaded function %0 cannot be static_cast to type %1">;
7431
7432def err_bad_cstyle_cast_overload : Error<
7433  "address of overloaded function %0 cannot be cast to type %1">;
7434
7435
7436def err_bad_cxx_cast_generic : Error<
7437  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7438  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7439def err_bad_cxx_cast_unrelated_class : Error<
7440  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7441  "functional-style cast|}0 from %1 to %2, which are not related by "
7442  "inheritance, is not allowed">;
7443def note_type_incomplete : Note<"%0 is incomplete">;
7444def err_bad_cxx_cast_rvalue : Error<
7445  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7446  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7447def err_bad_cxx_cast_bitfield : Error<
7448  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7449  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7450def err_bad_cxx_cast_qualifiers_away : Error<
7451  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7452  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7453def err_bad_cxx_cast_addr_space_mismatch : Error<
7454  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7455  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7456  " spaces">;
7457def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7458  "ISO C++ does not allow "
7459  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7460  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7461  "even though the source and destination types are unrelated">,
7462  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7463def err_bad_const_cast_dest : Error<
7464  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7465  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7466def ext_cast_fn_obj : Extension<
7467  "cast between pointer-to-function and pointer-to-object is an extension">;
7468def ext_ms_cast_fn_obj : ExtWarn<
7469  "static_cast between pointer-to-function and pointer-to-object is a "
7470  "Microsoft extension">, InGroup<MicrosoftCast>;
7471def warn_cxx98_compat_cast_fn_obj : Warning<
7472  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7473  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7474def err_bad_reinterpret_cast_small_int : Error<
7475  "cast from pointer to smaller type %2 loses information">;
7476def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7477  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7478  "to scalar %2 of different size">;
7479def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7480  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7481  "to vector %2 of different size">;
7482def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7483  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7484  "to vector %2 of different size">;
7485def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7486  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7487  "changes address space of nested pointers">,
7488  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7489def err_bad_lvalue_to_rvalue_cast : Error<
7490  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7491  "not compatible">;
7492def err_bad_rvalue_to_rvalue_cast : Error<
7493  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7494  "not compatible">;
7495def err_bad_static_cast_pointer_nonpointer : Error<
7496  "cannot cast from type %1 to pointer type %2">;
7497def err_bad_static_cast_member_pointer_nonmp : Error<
7498  "cannot cast from type %1 to member pointer type %2">;
7499def err_bad_cxx_cast_member_pointer_size : Error<
7500  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7501  "type %1 to member pointer type %2 of different size">;
7502def err_bad_reinterpret_cast_reference : Error<
7503  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7504def warn_undefined_reinterpret_cast : Warning<
7505  "reinterpret_cast from %0 to %1 has undefined behavior">,
7506  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7507
7508// These messages don't adhere to the pattern.
7509// FIXME: Display the path somehow better.
7510def err_ambiguous_base_to_derived_cast : Error<
7511  "ambiguous cast from base %0 to derived %1:%2">;
7512def err_static_downcast_via_virtual : Error<
7513  "cannot cast %0 to %1 via virtual base %2">;
7514def err_downcast_from_inaccessible_base : Error<
7515  "cannot cast %select{private|protected}2 base class %1 to %0">;
7516def err_upcast_to_inaccessible_base : Error<
7517  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7518def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7519  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7520def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7521def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7522def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7523def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7524
7525// Other C++ expressions
7526def err_need_header_before_typeid : Error<
7527  "you need to include <typeinfo> before using the 'typeid' operator">;
7528def err_need_header_before_placement_new : Error<
7529  "no matching %0 function for non-allocating placement new expression; "
7530  "include <new>">;
7531def err_ms___leave_not_in___try : Error<
7532  "'__leave' statement not in __try block">;
7533def err_uuidof_without_guid : Error<
7534  "cannot call operator __uuidof on a type with no GUID">;
7535def err_uuidof_with_multiple_guids : Error<
7536  "cannot call operator __uuidof on a type with multiple GUIDs">;
7537def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7538def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7539def err_static_illegal_in_new : Error<
7540  "the 'static' modifier for the array size is not legal in new expressions">;
7541def err_array_new_needs_size : Error<
7542  "array size must be specified in new expression with no initializer">;
7543def err_bad_new_type : Error<
7544  "cannot allocate %select{function|reference}1 type %0 with new">;
7545def err_new_incomplete_or_sizeless_type : Error<
7546  "allocation of %select{incomplete|sizeless}0 type %1">;
7547def err_new_array_nonconst : Error<
7548  "only the first dimension of an allocated array may have dynamic size">;
7549def err_new_array_size_unknown_from_init : Error<
7550  "cannot determine allocated array size from initializer">;
7551def err_new_array_init_args : Error<
7552  "array 'new' cannot have initialization arguments">;
7553def ext_new_paren_array_nonconst : ExtWarn<
7554  "when type is in parentheses, array cannot have dynamic size">;
7555def err_placement_new_non_placement_delete : Error<
7556  "'new' expression with placement arguments refers to non-placement "
7557  "'operator delete'">;
7558def err_array_size_not_integral : Error<
7559  "array size expression must have integral or %select{|unscoped }0"
7560  "enumeration type, not %1">;
7561def err_array_size_incomplete_type : Error<
7562  "array size expression has incomplete class type %0">;
7563def err_array_size_explicit_conversion : Error<
7564  "array size expression of type %0 requires explicit conversion to type %1">;
7565def note_array_size_conversion : Note<
7566  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7567def err_array_size_ambiguous_conversion : Error<
7568  "ambiguous conversion of array size expression of type %0 to an integral or "
7569  "enumeration type">;
7570def ext_array_size_conversion : Extension<
7571  "implicit conversion from array size expression of type %0 to "
7572  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7573  InGroup<CXX11>;
7574def warn_cxx98_compat_array_size_conversion : Warning<
7575  "implicit conversion from array size expression of type %0 to "
7576  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7577  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7578def err_address_space_qualified_new : Error<
7579  "'new' cannot allocate objects of type %0 in address space '%1'">;
7580def err_address_space_qualified_delete : Error<
7581  "'delete' cannot delete objects of type %0 in address space '%1'">;
7582
7583def err_default_init_const : Error<
7584  "default initialization of an object of const type %0"
7585  "%select{| without a user-provided default constructor}1">;
7586def ext_default_init_const : ExtWarn<
7587  "default initialization of an object of const type %0"
7588  "%select{| without a user-provided default constructor}1 "
7589  "is a Microsoft extension">,
7590  InGroup<MicrosoftConstInit>;
7591def err_delete_operand : Error<"cannot delete expression of type %0">;
7592def ext_delete_void_ptr_operand : ExtWarn<
7593  "cannot delete expression with pointer-to-'void' type %0">,
7594  InGroup<DeleteIncomplete>;
7595def err_ambiguous_delete_operand : Error<
7596  "ambiguous conversion of delete expression of type %0 to a pointer">;
7597def warn_delete_incomplete : Warning<
7598  "deleting pointer to incomplete type %0 may cause undefined behavior">,
7599  InGroup<DeleteIncomplete>;
7600def err_delete_incomplete_class_type : Error<
7601  "deleting incomplete class type %0; no conversions to pointer type">;
7602def err_delete_explicit_conversion : Error<
7603  "converting delete expression from type %0 to type %1 invokes an explicit "
7604  "conversion function">;
7605def note_delete_conversion : Note<"conversion to pointer type %0">;
7606def warn_delete_array_type : Warning<
7607  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
7608def warn_mismatched_delete_new : Warning<
7609  "'delete%select{|[]}0' applied to a pointer that was allocated with "
7610  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
7611  InGroup<DiagGroup<"mismatched-new-delete">>;
7612def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
7613def err_no_suitable_delete_member_function_found : Error<
7614  "no suitable member %0 in %1">;
7615def err_ambiguous_suitable_delete_member_function_found : Error<
7616  "multiple suitable %0 functions in %1">;
7617def warn_ambiguous_suitable_delete_function_found : Warning<
7618  "multiple suitable %0 functions for %1; no 'operator delete' function "
7619  "will be invoked if initialization throws an exception">,
7620  InGroup<DiagGroup<"ambiguous-delete">>;
7621def note_member_declared_here : Note<
7622  "member %0 declared here">;
7623def note_member_first_declared_here : Note<
7624  "member %0 first declared here">;
7625def warn_bitwise_instead_of_logical : Warning<
7626  "use of bitwise '%0' with boolean operands">,
7627  InGroup<BitwiseInsteadOfLogical>, DefaultIgnore;
7628def warn_bitwise_negation_bool : Warning<
7629  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
7630  "did you mean logical negation?">,
7631  InGroup<BoolOperation>, DefaultIgnore;
7632def err_decrement_bool : Error<"cannot decrement expression of type bool">;
7633def warn_increment_bool : Warning<
7634  "incrementing expression of type bool is deprecated and "
7635  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
7636def ext_increment_bool : ExtWarn<
7637  "ISO C++17 does not allow incrementing expression of type bool">,
7638  DefaultError, InGroup<IncrementBool>;
7639def err_increment_decrement_enum : Error<
7640  "cannot %select{decrement|increment}0 expression of enum type %1">;
7641
7642def warn_deprecated_increment_decrement_volatile : Warning<
7643  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
7644  "is deprecated">, InGroup<DeprecatedVolatile>;
7645def warn_deprecated_simple_assign_volatile : Warning<
7646  "use of result of assignment to object of volatile-qualified type %0 "
7647  "is deprecated">, InGroup<DeprecatedVolatile>;
7648def warn_deprecated_volatile_return : Warning<
7649  "volatile-qualified return type %0 is deprecated">,
7650  InGroup<DeprecatedVolatile>;
7651def warn_deprecated_volatile_param : Warning<
7652  "volatile-qualified parameter type %0 is deprecated">,
7653  InGroup<DeprecatedVolatile>;
7654def warn_deprecated_volatile_structured_binding : Warning<
7655  "volatile qualifier in structured binding declaration is deprecated">,
7656  InGroup<DeprecatedVolatile>;
7657
7658def warn_deprecated_altivec_src_compat : Warning<
7659  "Current handling of vector bool and vector pixel types in this context are "
7660  "deprecated. The default behaviour will soon change to that implied by the "
7661  "'-altivec-compat=xl' option">,
7662  InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7663
7664def warn_deprecated_lax_vec_conv_all : Warning<
7665  "Implicit conversion between vector types ('%0' and '%1') is deprecated. "
7666  "In the future, the behavior implied by '-fno-lax-vector-conversions' "
7667  "will be the default.">,
7668  InGroup<DiagGroup<"deprecate-lax-vec-conv-all">>;
7669
7670def err_catch_incomplete_ptr : Error<
7671  "cannot catch pointer to incomplete type %0">;
7672def err_catch_incomplete_ref : Error<
7673  "cannot catch reference to incomplete type %0">;
7674def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
7675def err_catch_sizeless : Error<
7676  "cannot catch %select{|reference to }0sizeless type %1">;
7677def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
7678def err_catch_variably_modified : Error<
7679  "cannot catch variably modified type %0">;
7680def err_qualified_catch_declarator : Error<
7681  "exception declarator cannot be qualified">;
7682def err_early_catch_all : Error<"catch-all handler must come last">;
7683def err_bad_memptr_rhs : Error<
7684  "right hand operand to %0 has non-pointer-to-member type %1">;
7685def err_bad_memptr_lhs : Error<
7686  "left hand operand to %0 must be a %select{|pointer to }1class "
7687  "compatible with the right hand operand, but is %2">;
7688def err_memptr_incomplete : Error<
7689  "member pointer has incomplete base type %0">;
7690def warn_exception_caught_by_earlier_handler : Warning<
7691  "exception of type %0 will be caught by earlier handler">,
7692  InGroup<Exceptions>;
7693def note_previous_exception_handler : Note<"for type %0">;
7694def err_exceptions_disabled : Error<
7695  "cannot use '%0' with exceptions disabled">;
7696def err_objc_exceptions_disabled : Error<
7697  "cannot use '%0' with Objective-C exceptions disabled">;
7698def warn_throw_in_noexcept_func : Warning<
7699  "%0 has a non-throwing exception specification but can still throw">,
7700  InGroup<Exceptions>;
7701def note_throw_in_dtor : Note<
7702  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
7703  "non-throwing}1 exception specification">;
7704def note_throw_in_function : Note<"function declared non-throwing here">;
7705def err_seh_try_outside_functions : Error<
7706  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
7707def err_mixing_cxx_try_seh_try : Error<
7708  "cannot use %select{C++ 'try'|Objective-C '@try'}0 "
7709  "in the same function as SEH '__try'">;
7710def err_seh_try_unsupported : Error<
7711  "SEH '__try' is not supported on this target">;
7712def note_conflicting_try_here : Note<
7713  "conflicting %0 here">;
7714def warn_jump_out_of_seh_finally : Warning<
7715  "jump out of __finally block has undefined behavior">,
7716  InGroup<DiagGroup<"jump-seh-finally">>;
7717def warn_non_virtual_dtor : Warning<
7718  "%0 has virtual functions but non-virtual destructor">,
7719  InGroup<NonVirtualDtor>, DefaultIgnore;
7720def warn_delete_non_virtual_dtor : Warning<
7721  "%select{delete|destructor}0 called on non-final %1 that has "
7722  "virtual functions but non-virtual destructor">,
7723  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
7724def note_delete_non_virtual : Note<
7725  "qualify call to silence this warning">;
7726def warn_delete_abstract_non_virtual_dtor : Warning<
7727  "%select{delete|destructor}0 called on %1 that is abstract but has "
7728  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
7729def warn_overloaded_virtual : Warning<
7730  "%q0 hides overloaded virtual %select{function|functions}1">,
7731  InGroup<OverloadedVirtual>, DefaultIgnore;
7732def note_hidden_overloaded_virtual_declared_here : Note<
7733  "hidden overloaded virtual function %q0 declared here"
7734  "%select{|: different classes%diff{ ($ vs $)|}2,3"
7735  "|: different number of parameters (%2 vs %3)"
7736  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
7737  "|: different return type%diff{ ($ vs $)|}2,3"
7738  "|: different qualifiers (%2 vs %3)"
7739  "|: different exception specifications}1">;
7740def warn_using_directive_in_header : Warning<
7741  "using namespace directive in global context in header">,
7742  InGroup<HeaderHygiene>, DefaultIgnore;
7743def warn_overaligned_type : Warning<
7744  "type %0 requires %1 bytes of alignment and the default allocator only "
7745  "guarantees %2 bytes">,
7746  InGroup<OveralignedType>, DefaultIgnore;
7747def err_array_element_alignment : Error<
7748  "size of array element of type %0 (%1 bytes) isn't a multiple of its alignment (%2 bytes)">;
7749def err_aligned_allocation_unavailable : Error<
7750  "aligned %select{allocation|deallocation}0 function of type '%1' is "
7751  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
7752def note_silence_aligned_allocation_unavailable : Note<
7753  "if you supply your own aligned allocation functions, use "
7754  "-faligned-allocation to silence this diagnostic">;
7755
7756def err_conditional_void_nonvoid : Error<
7757  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
7758  "is of type %0">;
7759def err_conditional_ambiguous : Error<
7760  "conditional expression is ambiguous; "
7761  "%diff{$ can be converted to $ and vice versa|"
7762  "types can be convert to each other}0,1">;
7763def err_conditional_ambiguous_ovl : Error<
7764  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
7765  "can be converted to several common types">;
7766def err_conditional_vector_size : Error<
7767  "vector condition type %0 and result type %1 do not have the same number "
7768  "of elements">;
7769def err_conditional_vector_element_size : Error<
7770  "vector condition type %0 and result type %1 do not have elements of the "
7771  "same size">;
7772def err_conditional_vector_has_void : Error<
7773  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
7774def err_conditional_vector_operand_type
7775    : Error<"enumeration type %0 is not allowed in a vector conditional">;
7776def err_conditional_vector_cond_result_mismatch
7777    : Error<"cannot mix vectors and extended vectors in a vector conditional">;
7778def err_conditional_vector_mismatched
7779    : Error<"vector operands to the vector conditional must be the same type "
7780            "%diff{($ and $)|}0,1}">;
7781
7782def err_throw_incomplete : Error<
7783  "cannot throw object of incomplete type %0">;
7784def err_throw_incomplete_ptr : Error<
7785  "cannot throw pointer to object of incomplete type %0">;
7786def err_throw_sizeless : Error<
7787  "cannot throw object of sizeless type %0">;
7788def warn_throw_underaligned_obj : Warning<
7789  "underaligned exception object thrown">,
7790  InGroup<UnderalignedExceptionObject>;
7791def note_throw_underaligned_obj : Note<
7792  "required alignment of type %0 (%1 bytes) is larger than the supported "
7793  "alignment of C++ exception objects on this target (%2 bytes)">;
7794def err_return_in_constructor_handler : Error<
7795  "return in the catch of a function try block of a constructor is illegal">;
7796def warn_cdtor_function_try_handler_mem_expr : Warning<
7797  "cannot refer to a non-static member from the handler of a "
7798  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
7799
7800let CategoryName = "Lambda Issue" in {
7801  def err_capture_more_than_once : Error<
7802    "%0 can appear only once in a capture list">;
7803  def err_reference_capture_with_reference_default : Error<
7804    "'&' cannot precede a capture when the capture default is '&'">;
7805  def err_copy_capture_with_copy_default : Error<
7806    "'&' must precede a capture when the capture default is '='">;
7807  def err_capture_does_not_name_variable : Error<
7808    "%0 in capture list does not name a variable">;
7809  def err_capture_non_automatic_variable : Error<
7810    "%0 cannot be captured because it does not have automatic storage "
7811    "duration">;
7812  def err_this_capture : Error<
7813    "'this' cannot be %select{implicitly |}0captured in this context">;
7814  def note_lambda_this_capture_fixit : Note<
7815    "explicitly capture 'this'">;
7816  def err_lambda_capture_anonymous_var : Error<
7817    "unnamed variable cannot be implicitly captured in a lambda expression">;
7818  def err_lambda_capture_flexarray_type : Error<
7819    "variable %0 with flexible array member cannot be captured in "
7820    "a lambda expression">;
7821  def err_lambda_impcap : Error<
7822    "variable %0 cannot be implicitly captured in a lambda with no "
7823    "capture-default specified">;
7824  def note_lambda_variable_capture_fixit : Note<
7825    "capture %0 by %select{value|reference}1">;
7826  def note_lambda_default_capture_fixit : Note<
7827    "default capture by %select{value|reference}0">;
7828  def note_lambda_decl : Note<"lambda expression begins here">;
7829  def err_lambda_unevaluated_operand : Error<
7830    "lambda expression in an unevaluated operand">;
7831  def err_lambda_in_constant_expression : Error<
7832    "a lambda expression may not appear inside of a constant expression">;
7833  def err_lambda_in_invalid_context : Error<
7834    "a lambda expression cannot appear in this context">;
7835  def err_lambda_return_init_list : Error<
7836    "cannot deduce lambda return type from initializer list">;
7837  def err_lambda_capture_default_arg : Error<
7838    "lambda expression in default argument cannot capture any entity">;
7839  def err_lambda_incomplete_result : Error<
7840    "incomplete result type %0 in lambda expression">;
7841  def err_noreturn_lambda_has_return_expr : Error<
7842    "lambda declared 'noreturn' should not return">;
7843  def warn_maybe_falloff_nonvoid_lambda : Warning<
7844    "non-void lambda does not return a value in all control paths">,
7845    InGroup<ReturnType>;
7846  def warn_falloff_nonvoid_lambda : Warning<
7847    "non-void lambda does not return a value">,
7848    InGroup<ReturnType>;
7849  def err_access_lambda_capture : Error<
7850    // The ERRORs represent other special members that aren't constructors, in
7851    // hopes that someone will bother noticing and reporting if they appear
7852    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
7853    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
7854    AccessControl;
7855  def note_lambda_to_block_conv : Note<
7856    "implicit capture of lambda object due to conversion to block pointer "
7857    "here">;
7858  def note_var_explicitly_captured_here : Note<"variable %0 is"
7859    "%select{| explicitly}1 captured here">;
7860
7861  // C++14 lambda init-captures.
7862  def warn_cxx11_compat_init_capture : Warning<
7863    "initialized lambda captures are incompatible with C++ standards "
7864    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
7865  def ext_init_capture : ExtWarn<
7866    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
7867  def err_init_capture_no_expression : Error<
7868    "initializer missing for lambda capture %0">;
7869  def err_init_capture_multiple_expressions : Error<
7870    "initializer for lambda capture %0 contains multiple expressions">;
7871  def err_init_capture_paren_braces : Error<
7872    "cannot deduce type for lambda capture %1 from "
7873    "%select{parenthesized|nested}0 initializer list">;
7874  def err_init_capture_deduction_failure : Error<
7875    "cannot deduce type for lambda capture %0 from initializer of type %2">;
7876  def err_init_capture_deduction_failure_from_init_list : Error<
7877    "cannot deduce type for lambda capture %0 from initializer list">;
7878  def warn_cxx17_compat_init_capture_pack : Warning<
7879    "initialized lambda capture packs are incompatible with C++ standards "
7880    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7881  def ext_init_capture_pack : ExtWarn<
7882    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
7883
7884  // C++14 generic lambdas.
7885  def warn_cxx11_compat_generic_lambda : Warning<
7886    "generic lambdas are incompatible with C++11">,
7887    InGroup<CXXPre14Compat>, DefaultIgnore;
7888
7889  // C++17 '*this' captures.
7890  def warn_cxx14_compat_star_this_lambda_capture : Warning<
7891    "by value capture of '*this' is incompatible with C++ standards before C++17">,
7892     InGroup<CXXPre17Compat>, DefaultIgnore;
7893  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
7894    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
7895
7896  // C++17 parameter shadows capture
7897  def err_parameter_shadow_capture : Error<
7898    "a lambda parameter cannot shadow an explicitly captured entity">;
7899
7900  // C++20 [=, this] captures.
7901  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
7902    "explicit capture of 'this' with a capture default of '=' is incompatible "
7903    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7904  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
7905    "explicit capture of 'this' with a capture default of '=' "
7906    "is a C++20 extension">, InGroup<CXX20>;
7907  def warn_deprecated_this_capture : Warning<
7908    "implicit capture of 'this' with a capture default of '=' is deprecated">,
7909    InGroup<DeprecatedThisCapture>, DefaultIgnore;
7910  def note_deprecated_this_capture : Note<
7911    "add an explicit capture of 'this' to capture '*this' by reference">;
7912
7913  // C++20 default constructible / assignable lambdas.
7914  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
7915    "%select{default construction|assignment}0 of lambda is incompatible with "
7916    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7917}
7918
7919def err_return_in_captured_stmt : Error<
7920  "cannot return from %0">;
7921def err_capture_block_variable : Error<
7922  "__block variable %0 cannot be captured in a "
7923  "%select{lambda expression|captured statement}1">;
7924
7925def err_operator_arrow_circular : Error<
7926  "circular pointer delegation detected">;
7927def err_operator_arrow_depth_exceeded : Error<
7928  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
7929  "'operator->' calls">;
7930def note_operator_arrow_here : Note<
7931  "'operator->' declared here produces an object of type %0">;
7932def note_operator_arrows_suppressed : Note<
7933  "(skipping %0 'operator->'%s0 in backtrace)">;
7934def note_operator_arrow_depth : Note<
7935  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
7936
7937def err_pseudo_dtor_base_not_scalar : Error<
7938  "object expression of non-scalar type %0 cannot be used in a "
7939  "pseudo-destructor expression">;
7940def ext_pseudo_dtor_on_void : ExtWarn<
7941  "pseudo-destructors on type void are a Microsoft extension">,
7942  InGroup<MicrosoftVoidPseudoDtor>;
7943def err_pseudo_dtor_type_mismatch : Error<
7944  "the type of object expression "
7945  "%diff{($) does not match the type being destroyed ($)|"
7946  "does not match the type being destroyed}0,1 "
7947  "in pseudo-destructor expression">;
7948def err_pseudo_dtor_call_with_args : Error<
7949  "call to pseudo-destructor cannot have any arguments">;
7950def err_dtor_expr_without_call : Error<
7951  "reference to %select{destructor|pseudo-destructor}0 must be called"
7952  "%select{|; did you mean to call it with no arguments?}1">;
7953def err_pseudo_dtor_destructor_non_type : Error<
7954  "%0 does not refer to a type name in pseudo-destructor expression; expected "
7955  "the name of type %1">;
7956def err_invalid_use_of_function_type : Error<
7957  "a function type is not allowed here">;
7958def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
7959def err_typecheck_bool_condition : Error<
7960  "value of type %0 is not contextually convertible to 'bool'">;
7961def err_typecheck_ambiguous_condition : Error<
7962  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
7963def err_typecheck_nonviable_condition : Error<
7964  "no viable conversion%select{%diff{ from $ to $|}1,2|"
7965  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
7966def err_typecheck_nonviable_condition_incomplete : Error<
7967  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
7968def err_typecheck_deleted_function : Error<
7969  "conversion function %diff{from $ to $|between types}0,1 "
7970  "invokes a deleted function">;
7971
7972def err_expected_class_or_namespace : Error<"%0 is not a class"
7973  "%select{ or namespace|, namespace, or enumeration}1">;
7974def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
7975  "because namespace %1 does not enclose namespace %2">;
7976def err_export_non_namespace_scope_name : Error<
7977  "cannot export %0 as it is not at namespace scope">;
7978def err_redeclaration_non_exported : Error <
7979  "cannot export redeclaration %0 here since the previous declaration "
7980  "%select{is not exported|has internal linkage|has module linkage}1">;
7981def err_invalid_declarator_global_scope : Error<
7982  "definition or redeclaration of %0 cannot name the global scope">;
7983def err_invalid_declarator_in_function : Error<
7984  "definition or redeclaration of %0 not allowed inside a function">;
7985def err_invalid_declarator_in_block : Error<
7986  "definition or redeclaration of %0 not allowed inside a block">;
7987def err_not_tag_in_scope : Error<
7988  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
7989
7990def err_no_typeid_with_fno_rtti : Error<
7991  "use of typeid requires -frtti">;
7992def err_no_dynamic_cast_with_fno_rtti : Error<
7993  "use of dynamic_cast requires -frtti">;
7994def warn_no_dynamic_cast_with_rtti_disabled: Warning<
7995  "dynamic_cast will not work since RTTI data is disabled by "
7996  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7997def warn_no_typeid_with_rtti_disabled: Warning<
7998  "typeid will not work since RTTI data is disabled by "
7999  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
8000
8001def err_cannot_form_pointer_to_member_of_reference_type : Error<
8002  "cannot form a pointer-to-member to member %0 of reference type %1">;
8003def err_incomplete_object_call : Error<
8004  "incomplete type in call to object of type %0">;
8005
8006def warn_condition_is_assignment : Warning<"using the result of an "
8007  "assignment as a condition without parentheses">,
8008  InGroup<Parentheses>;
8009def warn_free_nonheap_object
8010  : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">,
8011    InGroup<FreeNonHeapObject>;
8012
8013// Completely identical except off by default.
8014def warn_condition_is_idiomatic_assignment : Warning<"using the result "
8015  "of an assignment as a condition without parentheses">,
8016  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
8017def note_condition_assign_to_comparison : Note<
8018  "use '==' to turn this assignment into an equality comparison">;
8019def note_condition_or_assign_to_comparison : Note<
8020  "use '!=' to turn this compound assignment into an inequality comparison">;
8021def note_condition_assign_silence : Note<
8022  "place parentheses around the assignment to silence this warning">;
8023
8024def warn_equality_with_extra_parens : Warning<"equality comparison with "
8025  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
8026def note_equality_comparison_to_assign : Note<
8027  "use '=' to turn this equality comparison into an assignment">;
8028def note_equality_comparison_silence : Note<
8029  "remove extraneous parentheses around the comparison to silence this warning">;
8030
8031// assignment related diagnostics (also for argument passing, returning, etc).
8032// In most of these diagnostics the %2 is a value from the
8033// Sema::AssignmentAction enumeration
8034def err_typecheck_convert_incompatible : Error<
8035  "%select{%diff{assigning to $ from incompatible type $|"
8036  "assigning to type from incompatible type}0,1"
8037  "|%diff{passing $ to parameter of incompatible type $|"
8038  "passing type to parameter of incompatible type}0,1"
8039  "|%diff{returning $ from a function with incompatible result type $|"
8040  "returning type from a function with incompatible result type}0,1"
8041  "|%diff{converting $ to incompatible type $|"
8042  "converting type to incompatible type}0,1"
8043  "|%diff{initializing $ with an expression of incompatible type $|"
8044  "initializing type with an expression of incompatible type}0,1"
8045  "|%diff{sending $ to parameter of incompatible type $|"
8046  "sending type to parameter of incompatible type}0,1"
8047  "|%diff{casting $ to incompatible type $|"
8048  "casting type to incompatible type}0,1}2"
8049  "%select{|; dereference with *|"
8050  "; take the address with &|"
8051  "; remove *|"
8052  "; remove &}3"
8053  "%select{|: different classes%diff{ ($ vs $)|}5,6"
8054  "|: different number of parameters (%5 vs %6)"
8055  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
8056  "|: different return type%diff{ ($ vs $)|}5,6"
8057  "|: different qualifiers (%5 vs %6)"
8058  "|: different exception specifications}4">;
8059def err_typecheck_missing_return_type_incompatible : Error<
8060  "%diff{return type $ must match previous return type $|"
8061  "return type must match previous return type}0,1 when %select{block "
8062  "literal|lambda expression}2 has unspecified explicit return type">;
8063
8064def note_incomplete_class_and_qualified_id : Note<
8065  "conformance of forward class %0 to protocol %1 can not be confirmed">;
8066def warn_incompatible_qualified_id : Warning<
8067  "%select{%diff{assigning to $ from incompatible type $|"
8068  "assigning to type from incompatible type}0,1"
8069  "|%diff{passing $ to parameter of incompatible type $|"
8070  "passing type to parameter of incompatible type}0,1"
8071  "|%diff{returning $ from a function with incompatible result type $|"
8072  "returning type from a function with incompatible result type}0,1"
8073  "|%diff{converting $ to incompatible type $|"
8074  "converting type to incompatible type}0,1"
8075  "|%diff{initializing $ with an expression of incompatible type $|"
8076  "initializing type with an expression of incompatible type}0,1"
8077  "|%diff{sending $ to parameter of incompatible type $|"
8078  "sending type to parameter of incompatible type}0,1"
8079  "|%diff{casting $ to incompatible type $|"
8080  "casting type to incompatible type}0,1}2">;
8081def err_incompatible_qualified_id : Error<
8082  "%select{%diff{assigning to $ from incompatible type $|"
8083  "assigning to type from incompatible type}0,1"
8084  "|%diff{passing $ to parameter of incompatible type $|"
8085  "passing type to parameter of incompatible type}0,1"
8086  "|%diff{returning $ from a function with incompatible result type $|"
8087  "returning type from a function with incompatible result type}0,1"
8088  "|%diff{converting $ to incompatible type $|"
8089  "converting type to incompatible type}0,1"
8090  "|%diff{initializing $ with an expression of incompatible type $|"
8091  "initializing type with an expression of incompatible type}0,1"
8092  "|%diff{sending $ to parameter of incompatible type $|"
8093  "sending type to parameter of incompatible type}0,1"
8094  "|%diff{casting $ to incompatible type $|"
8095  "casting type to incompatible type}0,1}2">;
8096def err_typecheck_convert_pointer_int : Error<
8097  "incompatible pointer to integer conversion "
8098  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8099  "|%diff{passing $ to parameter of type $|"
8100  "passing to parameter of different type}0,1"
8101  "|%diff{returning $ from a function with result type $|"
8102  "returning from function with different return type}0,1"
8103  "|%diff{converting $ to type $|converting between types}0,1"
8104  "|%diff{initializing $ with an expression of type $|"
8105  "initializing with expression of different type}0,1"
8106  "|%diff{sending $ to parameter of type $|"
8107  "sending to parameter of different type}0,1"
8108  "|%diff{casting $ to type $|casting between types}0,1}2"
8109  "%select{|; dereference with *|"
8110  "; take the address with &|"
8111  "; remove *|"
8112  "; remove &}3">;
8113def ext_typecheck_convert_pointer_int : ExtWarn<
8114  err_typecheck_convert_pointer_int.Summary>,
8115  InGroup<IntConversion>, DefaultError;
8116def err_typecheck_convert_int_pointer : Error<
8117  "incompatible integer to pointer conversion "
8118  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8119  "|%diff{passing $ to parameter of type $|"
8120  "passing to parameter of different type}0,1"
8121  "|%diff{returning $ from a function with result type $|"
8122  "returning from function with different return type}0,1"
8123  "|%diff{converting $ to type $|converting between types}0,1"
8124  "|%diff{initializing $ with an expression of type $|"
8125  "initializing with expression of different type}0,1"
8126  "|%diff{sending $ to parameter of type $|"
8127  "sending to parameter of different type}0,1"
8128  "|%diff{casting $ to type $|casting between types}0,1}2"
8129  "%select{|; dereference with *|"
8130  "; take the address with &|"
8131  "; remove *|"
8132  "; remove &}3">;
8133def ext_typecheck_convert_int_pointer : ExtWarn<
8134  err_typecheck_convert_int_pointer.Summary>,
8135  InGroup<IntConversion>, DefaultError;
8136def ext_typecheck_convert_pointer_void_func : Extension<
8137  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8138  "|%diff{passing $ to parameter of type $|"
8139  "passing to parameter of different type}0,1"
8140  "|%diff{returning $ from a function with result type $|"
8141  "returning from function with different return type}0,1"
8142  "|%diff{converting $ to type $|converting between types}0,1"
8143  "|%diff{initializing $ with an expression of type $|"
8144  "initializing with expression of different type}0,1"
8145  "|%diff{sending $ to parameter of type $|"
8146  "sending to parameter of different type}0,1"
8147  "|%diff{casting $ to type $|casting between types}0,1}2"
8148  " converts between void pointer and function pointer">;
8149def err_typecheck_convert_pointer_void_func : Error<
8150  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8151  "|%diff{passing $ to parameter of type $|"
8152  "passing to parameter of different type}0,1"
8153  "|%diff{returning $ from a function with result type $|"
8154  "returning from function with different return type}0,1"
8155  "|%diff{converting $ to type $|converting between types}0,1"
8156  "|%diff{initializing $ with an expression of type $|"
8157  "initializing with expression of different type}0,1"
8158  "|%diff{sending $ to parameter of type $|"
8159  "sending to parameter of different type}0,1"
8160  "|%diff{casting $ to type $|casting between types}0,1}2"
8161  " converts between void pointer and function pointer">;
8162def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
8163  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8164  "|%diff{passing $ to parameter of type $|"
8165  "passing to parameter of different type}0,1"
8166  "|%diff{returning $ from a function with result type $|"
8167  "returning from function with different return type}0,1"
8168  "|%diff{converting $ to type $|converting between types}0,1"
8169  "|%diff{initializing $ with an expression of type $|"
8170  "initializing with expression of different type}0,1"
8171  "|%diff{sending $ to parameter of type $|"
8172  "sending to parameter of different type}0,1"
8173  "|%diff{casting $ to type $|casting between types}0,1}2"
8174  " converts between pointers to integer types %select{with different sign|"
8175  "where one is of the unique plain 'char' type and the other is not}3">,
8176  InGroup<DiagGroup<"pointer-sign">>;
8177def err_typecheck_convert_incompatible_pointer_sign :
8178  Error<ext_typecheck_convert_incompatible_pointer_sign.Summary>;
8179def ext_typecheck_convert_incompatible_pointer : ExtWarn<
8180  "incompatible pointer types "
8181  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8182  "|%diff{passing $ to parameter of type $|"
8183  "passing to parameter of different type}0,1"
8184  "|%diff{returning $ from a function with result type $|"
8185  "returning from function with different return type}0,1"
8186  "|%diff{converting $ to type $|converting between types}0,1"
8187  "|%diff{initializing $ with an expression of type $|"
8188  "initializing with expression of different type}0,1"
8189  "|%diff{sending $ to parameter of type $|"
8190  "sending to parameter of different type}0,1"
8191  "|%diff{casting $ to type $|casting between types}0,1}2"
8192  "%select{|; dereference with *|"
8193  "; take the address with &|"
8194  "; remove *|"
8195  "; remove &}3">,
8196  InGroup<IncompatiblePointerTypes>;
8197def err_typecheck_convert_incompatible_pointer : Error<
8198  "incompatible pointer types "
8199  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8200  "|%diff{passing $ to parameter of type $|"
8201  "passing to parameter of different type}0,1"
8202  "|%diff{returning $ from a function with result type $|"
8203  "returning from function with different return type}0,1"
8204  "|%diff{converting $ to type $|converting between types}0,1"
8205  "|%diff{initializing $ with an expression of type $|"
8206  "initializing with expression of different type}0,1"
8207  "|%diff{sending $ to parameter of type $|"
8208  "sending to parameter of different type}0,1"
8209  "|%diff{casting $ to type $|casting between types}0,1}2"
8210  "%select{|; dereference with *|"
8211  "; take the address with &|"
8212  "; remove *|"
8213  "; remove &}3">;
8214def err_typecheck_convert_incompatible_function_pointer : Error<
8215  "incompatible function pointer types "
8216  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8217  "|%diff{passing $ to parameter of type $|"
8218  "passing to parameter of different type}0,1"
8219  "|%diff{returning $ from a function with result type $|"
8220  "returning from function with different return type}0,1"
8221  "|%diff{converting $ to type $|converting between types}0,1"
8222  "|%diff{initializing $ with an expression of type $|"
8223  "initializing with expression of different type}0,1"
8224  "|%diff{sending $ to parameter of type $|"
8225  "sending to parameter of different type}0,1"
8226  "|%diff{casting $ to type $|casting between types}0,1}2"
8227  "%select{|; dereference with *|"
8228  "; take the address with &|"
8229  "; remove *|"
8230  "; remove &}3">;
8231def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
8232  err_typecheck_convert_incompatible_function_pointer.Summary>,
8233  InGroup<IncompatibleFunctionPointerTypes>, DefaultError;
8234def warn_typecheck_convert_incompatible_function_pointer_strict : Warning<
8235  err_typecheck_convert_incompatible_function_pointer.Summary>,
8236  InGroup<DiagGroup<"incompatible-function-pointer-types-strict">>, DefaultIgnore;
8237def ext_typecheck_convert_discards_qualifiers : ExtWarn<
8238  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8239  "|%diff{passing $ to parameter of type $|"
8240  "passing to parameter of different type}0,1"
8241  "|%diff{returning $ from a function with result type $|"
8242  "returning from function with different return type}0,1"
8243  "|%diff{converting $ to type $|converting between types}0,1"
8244  "|%diff{initializing $ with an expression of type $|"
8245  "initializing with expression of different type}0,1"
8246  "|%diff{sending $ to parameter of type $|"
8247  "sending to parameter of different type}0,1"
8248  "|%diff{casting $ to type $|casting between types}0,1}2"
8249  " discards qualifiers">,
8250  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8251def err_typecheck_convert_discards_qualifiers : Error<
8252  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8253  "|%diff{passing $ to parameter of type $|"
8254  "passing to parameter of different type}0,1"
8255  "|%diff{returning $ from a function with result type $|"
8256  "returning from function with different return type}0,1"
8257  "|%diff{converting $ to type $|converting between types}0,1"
8258  "|%diff{initializing $ with an expression of type $|"
8259  "initializing with expression of different type}0,1"
8260  "|%diff{sending $ to parameter of type $|"
8261  "sending to parameter of different type}0,1"
8262  "|%diff{casting $ to type $|casting between types}0,1}2"
8263  " discards qualifiers">;
8264def ext_nested_pointer_qualifier_mismatch : ExtWarn<
8265  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8266  "|%diff{passing $ to parameter of type $|"
8267  "passing to parameter of different type}0,1"
8268  "|%diff{returning $ from a function with result type $|"
8269  "returning from function with different return type}0,1"
8270  "|%diff{converting $ to type $|converting between types}0,1"
8271  "|%diff{initializing $ with an expression of type $|"
8272  "initializing with expression of different type}0,1"
8273  "|%diff{sending $ to parameter of type $|"
8274  "sending to parameter of different type}0,1"
8275  "|%diff{casting $ to type $|casting between types}0,1}2"
8276  " discards qualifiers in nested pointer types">,
8277  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8278def err_nested_pointer_qualifier_mismatch : Error<
8279  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8280  "|%diff{passing $ to parameter of type $|"
8281  "passing to parameter of different type}0,1"
8282  "|%diff{returning $ from a function with result type $|"
8283  "returning from function with different return type}0,1"
8284  "|%diff{converting $ to type $|converting between types}0,1"
8285  "|%diff{initializing $ with an expression of type $|"
8286  "initializing with expression of different type}0,1"
8287  "|%diff{sending $ to parameter of type $|"
8288  "sending to parameter of different type}0,1"
8289  "|%diff{casting $ to type $|casting between types}0,1}2"
8290  " discards qualifiers in nested pointer types">;
8291def warn_incompatible_vectors : Warning<
8292  "incompatible vector types "
8293  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8294  "|%diff{passing $ to parameter of type $|"
8295  "passing to parameter of different type}0,1"
8296  "|%diff{returning $ from a function with result type $|"
8297  "returning from function with different return type}0,1"
8298  "|%diff{converting $ to type $|converting between types}0,1"
8299  "|%diff{initializing $ with an expression of type $|"
8300  "initializing with expression of different type}0,1"
8301  "|%diff{sending $ to parameter of type $|"
8302  "sending to parameter of different type}0,1"
8303  "|%diff{casting $ to type $|casting between types}0,1}2">,
8304  InGroup<VectorConversion>, DefaultIgnore;
8305def err_incompatible_vectors : Error<
8306  "incompatible vector types "
8307  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8308  "|%diff{passing $ to parameter of type $|"
8309  "passing to parameter of different type}0,1"
8310  "|%diff{returning $ from a function with result type $|"
8311  "returning from function with different return type}0,1"
8312  "|%diff{converting $ to type $|converting between types}0,1"
8313  "|%diff{initializing $ with an expression of type $|"
8314  "initializing with expression of different type}0,1"
8315  "|%diff{sending $ to parameter of type $|"
8316  "sending to parameter of different type}0,1"
8317  "|%diff{casting $ to type $|casting between types}0,1}2">;
8318def err_int_to_block_pointer : Error<
8319  "invalid block pointer conversion "
8320  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8321  "|%diff{passing $ to parameter of type $|"
8322  "passing to parameter of different type}0,1"
8323  "|%diff{returning $ from a function with result type $|"
8324  "returning from function with different return type}0,1"
8325  "|%diff{converting $ to type $|converting between types}0,1"
8326  "|%diff{initializing $ with an expression of type $|"
8327  "initializing with expression of different type}0,1"
8328  "|%diff{sending $ to parameter of type $|"
8329  "sending to parameter of different type}0,1"
8330  "|%diff{casting $ to type $|casting between types}0,1}2">;
8331def err_typecheck_convert_incompatible_block_pointer : Error<
8332  "incompatible block pointer types "
8333  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8334  "|%diff{passing $ to parameter of type $|"
8335  "passing to parameter of different type}0,1"
8336  "|%diff{returning $ from a function with result type $|"
8337  "returning from function with different return type}0,1"
8338  "|%diff{converting $ to type $|converting between types}0,1"
8339  "|%diff{initializing $ with an expression of type $|"
8340  "initializing with expression of different type}0,1"
8341  "|%diff{sending $ to parameter of type $|"
8342  "sending to parameter of different type}0,1"
8343  "|%diff{casting $ to type $|casting between types}0,1}2">;
8344def err_typecheck_incompatible_address_space : Error<
8345  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8346  "|%diff{passing $ to parameter of type $|"
8347  "passing to parameter of different type}0,1"
8348  "|%diff{returning $ from a function with result type $|"
8349  "returning from function with different return type}0,1"
8350  "|%diff{converting $ to type $|converting between types}0,1"
8351  "|%diff{initializing $ with an expression of type $|"
8352  "initializing with expression of different type}0,1"
8353  "|%diff{sending $ to parameter of type $|"
8354  "sending to parameter of different type}0,1"
8355  "|%diff{casting $ to type $|casting between types}0,1}2"
8356  " changes address space of pointer">;
8357def err_typecheck_incompatible_nested_address_space : Error<
8358  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8359  "|%diff{passing $ to parameter of type $|"
8360  "passing to parameter of different type}0,1"
8361  "|%diff{returning $ from a function with result type $|"
8362  "returning from function with different return type}0,1"
8363  "|%diff{converting $ to type $|converting between types}0,1"
8364  "|%diff{initializing $ with an expression of type $|"
8365  "initializing with expression of different type}0,1"
8366  "|%diff{sending $ to parameter of type $|"
8367  "sending to parameter of different type}0,1"
8368  "|%diff{casting $ to type $|casting between types}0,1}2"
8369  " changes address space of nested pointer">;
8370def err_typecheck_incompatible_ownership : Error<
8371  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8372  "|%diff{passing $ to parameter of type $|"
8373  "passing to parameter of different type}0,1"
8374  "|%diff{returning $ from a function with result type $|"
8375  "returning from function with different return type}0,1"
8376  "|%diff{converting $ to type $|converting between types}0,1"
8377  "|%diff{initializing $ with an expression of type $|"
8378  "initializing with expression of different type}0,1"
8379  "|%diff{sending $ to parameter of type $|"
8380  "sending to parameter of different type}0,1"
8381  "|%diff{casting $ to type $|casting between types}0,1}2"
8382  " changes retain/release properties of pointer">;
8383def err_typecheck_comparison_of_distinct_blocks : Error<
8384  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8385
8386def err_typecheck_array_not_modifiable_lvalue : Error<
8387  "array type %0 is not assignable">;
8388def err_typecheck_non_object_not_modifiable_lvalue : Error<
8389  "non-object type %0 is not assignable">;
8390def err_typecheck_expression_not_modifiable_lvalue : Error<
8391  "expression is not assignable">;
8392def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8393  "incomplete type %0 is not assignable">;
8394def err_typecheck_lvalue_casts_not_supported : Error<
8395  "assignment to cast is illegal, lvalue casts are not supported">;
8396
8397def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8398  "vector is not assignable (contains duplicate components)">;
8399def err_block_decl_ref_not_modifiable_lvalue : Error<
8400  "variable is not assignable (missing __block type specifier)">;
8401def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8402  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8403def err_typecheck_call_not_function : Error<
8404  "called object type %0 is not a function or function pointer">;
8405def err_call_incomplete_return : Error<
8406  "calling function with incomplete return type %0">;
8407def err_call_function_incomplete_return : Error<
8408  "calling %0 with incomplete return type %1">;
8409def err_call_incomplete_argument : Error<
8410  "argument type %0 is incomplete">;
8411def err_typecheck_call_too_few_args : Error<
8412  "too few %select{|||execution configuration }0arguments to "
8413  "%select{function|block|method|kernel function}0 call, "
8414  "expected %1, have %2">;
8415def err_typecheck_call_too_few_args_one : Error<
8416  "too few %select{|||execution configuration }0arguments to "
8417  "%select{function|block|method|kernel function}0 call, "
8418  "single argument %1 was not specified">;
8419def err_typecheck_call_too_few_args_at_least : Error<
8420  "too few %select{|||execution configuration }0arguments to "
8421  "%select{function|block|method|kernel function}0 call, "
8422  "expected at least %1, have %2">;
8423def err_typecheck_call_too_few_args_at_least_one : Error<
8424  "too few %select{|||execution configuration }0arguments to "
8425  "%select{function|block|method|kernel function}0 call, "
8426  "at least argument %1 must be specified">;
8427def err_typecheck_call_too_few_args_suggest : Error<
8428  "too few %select{|||execution configuration }0arguments to "
8429  "%select{function|block|method|kernel function}0 call, "
8430  "expected %1, have %2; did you mean %3?">;
8431def err_typecheck_call_too_few_args_at_least_suggest : Error<
8432  "too few %select{|||execution configuration }0arguments to "
8433  "%select{function|block|method|kernel function}0 call, "
8434  "expected at least %1, have %2; did you mean %3?">;
8435def err_typecheck_call_too_many_args : Error<
8436  "too many %select{|||execution configuration }0arguments to "
8437  "%select{function|block|method|kernel function}0 call, "
8438  "expected %1, have %2">;
8439def err_typecheck_call_too_many_args_one : Error<
8440  "too many %select{|||execution configuration }0arguments to "
8441  "%select{function|block|method|kernel function}0 call, "
8442  "expected single argument %1, have %2 arguments">;
8443def err_typecheck_call_too_many_args_at_most : Error<
8444  "too many %select{|||execution configuration }0arguments to "
8445  "%select{function|block|method|kernel function}0 call, "
8446  "expected at most %1, have %2">;
8447def err_typecheck_call_too_many_args_at_most_one : Error<
8448  "too many %select{|||execution configuration }0arguments to "
8449  "%select{function|block|method|kernel function}0 call, "
8450  "expected at most single argument %1, have %2 arguments">;
8451def err_typecheck_call_too_many_args_suggest : Error<
8452  "too many %select{|||execution configuration }0arguments to "
8453  "%select{function|block|method|kernel function}0 call, "
8454  "expected %1, have %2; did you mean %3?">;
8455def err_typecheck_call_too_many_args_at_most_suggest : Error<
8456  "too many %select{|||execution configuration }0arguments to "
8457  "%select{function|block|method|kernel function}0 call, "
8458  "expected at most %1, have %2; did you mean %3?">;
8459
8460def err_arc_typecheck_convert_incompatible_pointer : Error<
8461  "incompatible pointer types passing retainable parameter of type %0"
8462  "to a CF function expecting %1 type">;
8463
8464def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8465
8466def warn_call_wrong_number_of_arguments : Warning<
8467  "too %select{few|many}0 arguments in call to %1">;
8468def err_atomic_builtin_must_be_pointer : Error<
8469  "address argument to atomic builtin must be a pointer (%0 invalid)">;
8470def err_atomic_builtin_must_be_pointer_intptr : Error<
8471  "address argument to atomic builtin must be a pointer to integer or pointer"
8472  " (%0 invalid)">;
8473def err_atomic_builtin_cannot_be_const : Error<
8474  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8475def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8476  "address argument to atomic builtin must be a pointer to integer,"
8477  " floating-point or pointer (%0 invalid)">;
8478def err_atomic_builtin_pointer_size : Error<
8479  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8480  "type (%0 invalid)">;
8481def err_atomic_exclusive_builtin_pointer_size : Error<
8482  "address argument to load or store exclusive builtin must be a pointer to"
8483  " 1,2,4 or 8 byte type (%0 invalid)">;
8484def err_atomic_builtin_ext_int_size : Error<
8485  "Atomic memory operand must have a power-of-two size">;
8486def err_atomic_builtin_bit_int_prohibit : Error<
8487  "argument to atomic builtin of type '_BitInt' is not supported">;
8488def err_atomic_op_needs_atomic : Error<
8489  "address argument to atomic operation must be a pointer to _Atomic "
8490  "type (%0 invalid)">;
8491def err_atomic_op_needs_non_const_atomic : Error<
8492  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8493  "type (%1 invalid)">;
8494def err_atomic_op_needs_non_const_pointer : Error<
8495  "address argument to atomic operation must be a pointer to non-const "
8496  "type (%0 invalid)">;
8497def err_atomic_op_needs_trivial_copy : Error<
8498  "address argument to atomic operation must be a pointer to a "
8499  "trivially-copyable type (%0 invalid)">;
8500def err_atomic_op_needs_atomic_int_ptr_or_fp : Error<
8501  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8502  "integer, pointer or supported floating point type (%1 invalid)">;
8503def err_atomic_op_needs_atomic_int_or_ptr : Error<
8504  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8505  "integer or pointer (%1 invalid)">;
8506def err_atomic_op_needs_atomic_int : Error<
8507  "address argument to atomic operation must be a pointer to "
8508  "%select{|atomic }0integer (%1 invalid)">;
8509def warn_atomic_op_has_invalid_memory_order : Warning<
8510  "memory order argument to atomic operation is invalid">,
8511  InGroup<DiagGroup<"atomic-memory-ordering">>;
8512def err_atomic_op_has_invalid_synch_scope : Error<
8513  "synchronization scope argument to atomic operation is invalid">;
8514def warn_atomic_implicit_seq_cst : Warning<
8515  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8516  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8517
8518def err_overflow_builtin_must_be_int : Error<
8519  "operand argument to overflow builtin must be an integer (%0 invalid)">;
8520def err_overflow_builtin_must_be_ptr_int : Error<
8521  "result argument to overflow builtin must be a pointer "
8522  "to a non-const integer (%0 invalid)">;
8523def err_overflow_builtin_bit_int_max_size : Error<
8524  "__builtin_mul_overflow does not support 'signed _BitInt' operands of more "
8525  "than %0 bits">;
8526def err_expected_struct_pointer_argument : Error<
8527  "expected pointer to struct as %ordinal0 argument to %1, found %2">;
8528def err_expected_callable_argument : Error<
8529  "expected a callable expression as %ordinal0 argument to %1, found %2">;
8530def note_building_builtin_dump_struct_call : Note<
8531  "in call to printing function with arguments '(%0)' while dumping struct">;
8532
8533def err_atomic_load_store_uses_lib : Error<
8534  "atomic %select{load|store}0 requires runtime support that is not "
8535  "available for this target">;
8536
8537def err_nontemporal_builtin_must_be_pointer : Error<
8538  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8539def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8540  "address argument to nontemporal builtin must be a pointer to integer, float, "
8541  "pointer, or a vector of such types (%0 invalid)">;
8542
8543def err_deleted_function_use : Error<"attempt to use a deleted function">;
8544def err_deleted_inherited_ctor_use : Error<
8545  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8546
8547def note_called_by : Note<"called by %0">;
8548def err_kern_type_not_void_return : Error<
8549  "kernel function type %0 must have void return type">;
8550def err_kern_is_nonstatic_method : Error<
8551  "kernel function %0 must be a free function or static member function">;
8552def err_config_scalar_return : Error<
8553  "CUDA special function '%0' must have scalar return type">;
8554def err_kern_call_not_global_function : Error<
8555  "kernel call to non-global function %0">;
8556def err_global_call_not_config : Error<
8557  "call to global function %0 not configured">;
8558def err_ref_bad_target : Error<
8559  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8560  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
8561def note_cuda_const_var_unpromoted : Note<
8562  "const variable cannot be emitted on device side due to dynamic initialization">;
8563def note_cuda_host_var : Note<
8564  "host variable declared here">;
8565def err_ref_bad_target_global_initializer : Error<
8566  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8567  "function %1 in global initializer">;
8568def err_capture_bad_target : Error<
8569  "capture host variable %0 by reference in device or host device lambda function">;
8570def warn_maybe_capture_bad_target_this_ptr : Warning<
8571  "capture host side class data member by this pointer in device or host device lambda function "
8572  "may result in invalid memory access if this pointer is not accessible on device side">,
8573  InGroup<DiagGroup<"gpu-maybe-wrong-side">>;
8574def warn_kern_is_method : Extension<
8575  "kernel function %0 is a member function; this may not be accepted by nvcc">,
8576  InGroup<CudaCompat>;
8577def warn_kern_is_inline : Warning<
8578  "ignored 'inline' attribute on kernel function %0">,
8579  InGroup<CudaCompat>;
8580def err_variadic_device_fn : Error<
8581  "CUDA device code does not support variadic functions">;
8582def err_va_arg_in_device : Error<
8583  "CUDA device code does not support va_arg">;
8584def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
8585def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
8586  "constexpr function %0 without __host__ or __device__ attributes cannot "
8587  "overload __device__ function with same signature.  Add a __host__ "
8588  "attribute, or build with -fno-cuda-host-device-constexpr.">;
8589def note_cuda_conflicting_device_function_declared_here : Note<
8590  "conflicting __device__ function declared here">;
8591def err_cuda_device_exceptions : Error<
8592  "cannot use '%0' in "
8593  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
8594def err_dynamic_var_init : Error<
8595    "dynamic initialization is not supported for "
8596    "__device__, __constant__, __shared__, and __managed__ variables.">;
8597def err_shared_var_init : Error<
8598    "initialization is not supported for __shared__ variables.">;
8599def err_cuda_vla : Error<
8600    "cannot use variable-length arrays in "
8601    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8602def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
8603def err_cuda_host_shared : Error<
8604    "__shared__ local variables not allowed in "
8605    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8606def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
8607    "__managed__ are not allowed on non-static local variables">;
8608def err_cuda_ovl_target : Error<
8609  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
8610  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
8611def note_cuda_ovl_candidate_target_mismatch : Note<
8612    "candidate template ignored: target attributes do not match">;
8613
8614def err_cuda_device_builtin_surftex_cls_template : Error<
8615    "illegal device builtin %select{surface|texture}0 reference "
8616    "class template %1 declared here">;
8617def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
8618    "%0 needs to have exactly %1 template parameters">;
8619def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
8620    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
8621    "%select{a type|an integer or enum value}2">;
8622
8623def err_cuda_device_builtin_surftex_ref_decl : Error<
8624    "illegal device builtin %select{surface|texture}0 reference "
8625    "type %1 declared here">;
8626def note_cuda_device_builtin_surftex_should_be_template_class : Note<
8627    "%0 needs to be instantiated from a class template with proper "
8628    "template arguments">;
8629
8630def err_hip_invalid_args_builtin_mangled_name : Error<
8631    "invalid argument: symbol must be a device-side function or global variable">;
8632
8633def warn_non_pod_vararg_with_format_string : Warning<
8634  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
8635  "%select{function|block|method|constructor}2; expected type from format "
8636  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
8637// The arguments to this diagnostic should match the warning above.
8638def err_cannot_pass_objc_interface_to_vararg_format : Error<
8639  "cannot pass object with interface type %1 by value to variadic "
8640  "%select{function|block|method|constructor}2; expected type from format "
8641  "string was %3">;
8642def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
8643  "cannot pass non-trivial C object of type %0 by value to variadic "
8644  "%select{function|block|method|constructor}1">;
8645
8646
8647def err_cannot_pass_objc_interface_to_vararg : Error<
8648  "cannot pass object with interface type %0 by value through variadic "
8649  "%select{function|block|method|constructor}1">;
8650def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
8651  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
8652  " %select{function|block|method|constructor}2; call will abort at runtime">,
8653  InGroup<NonPODVarargs>, DefaultError;
8654def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
8655  "passing object of trivial but non-POD type %0 through variadic"
8656  " %select{function|block|method|constructor}1 is incompatible with C++98">,
8657  InGroup<CXX98Compat>, DefaultIgnore;
8658def warn_pass_class_arg_to_vararg : Warning<
8659  "passing object of class type %0 through variadic "
8660  "%select{function|block|method|constructor}1"
8661  "%select{|; did you mean to call '%3'?}2">,
8662  InGroup<ClassVarargs>, DefaultIgnore;
8663def err_cannot_pass_to_vararg : Error<
8664  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8665  "%select{function|block|method|constructor}2">;
8666def err_cannot_pass_to_vararg_format : Error<
8667  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8668  "%select{function|block|method|constructor}2; expected type from format "
8669  "string was %3">;
8670
8671def err_typecheck_call_invalid_ordered_compare : Error<
8672  "ordered compare requires two args of floating point type"
8673  "%diff{ ($ and $)|}0,1">;
8674def err_typecheck_call_invalid_unary_fp : Error<
8675  "floating point classification requires argument of floating point type "
8676  "(passed in %0)">;
8677def err_typecheck_cond_expect_int_float : Error<
8678  "used type %0 where integer or floating point type is required">;
8679def err_typecheck_cond_expect_scalar : Error<
8680  "used type %0 where arithmetic or pointer type is required">;
8681def err_typecheck_cond_expect_nonfloat : Error<
8682  "used type %0 where floating point type is not allowed">;
8683def ext_typecheck_cond_one_void : Extension<
8684  "C99 forbids conditional expressions with only one void side">;
8685def err_typecheck_cast_to_incomplete : Error<
8686  "cast to incomplete type %0">;
8687def ext_typecheck_cast_nonscalar : Extension<
8688  "C99 forbids casting nonscalar type %0 to the same type">;
8689def ext_typecheck_cast_to_union : Extension<
8690  "cast to union type is a GNU extension">,
8691  InGroup<GNUUnionCast>;
8692def err_typecheck_cast_to_union_no_type : Error<
8693  "cast to union type from type %0 not present in union">;
8694def err_cast_pointer_from_non_pointer_int : Error<
8695  "operand of type %0 cannot be cast to a pointer type">;
8696def warn_cast_pointer_from_sel : Warning<
8697  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
8698  InGroup<SelTypeCast>;
8699def warn_function_def_in_objc_container : Warning<
8700  "function definition inside an Objective-C container is deprecated">,
8701  InGroup<FunctionDefInObjCContainer>;
8702def err_typecheck_call_requires_real_fp : Error<
8703  "argument type %0 is not a real floating point type">;
8704def err_typecheck_call_different_arg_types : Error<
8705  "arguments are of different types%diff{ ($ vs $)|}0,1">;
8706
8707def warn_cast_calling_conv : Warning<
8708  "cast between incompatible calling conventions '%0' and '%1'; "
8709  "calls through this pointer may abort at runtime">,
8710  InGroup<DiagGroup<"cast-calling-convention">>;
8711def note_change_calling_conv_fixit : Note<
8712  "consider defining %0 with the '%1' calling convention">;
8713def warn_bad_function_cast : Warning<
8714  "cast from function call of type %0 to non-matching type %1">,
8715  InGroup<BadFunctionCast>, DefaultIgnore;
8716def warn_cast_function_type : Warning<
8717  "cast %diff{from $ to $ |}0,1converts to incompatible function type">,
8718  InGroup<CastFunctionType>, DefaultIgnore;
8719def warn_cast_function_type_strict : Warning<warn_cast_function_type.Summary>,
8720  InGroup<CastFunctionTypeStrict>, DefaultIgnore;
8721def err_cast_pointer_to_non_pointer_int : Error<
8722  "pointer cannot be cast to type %0">;
8723def err_nullptr_cast : Error<
8724  "cannot cast an object of type %select{'nullptr_t' to %1|%1 to 'nullptr_t'}0"
8725>;
8726def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">;
8727def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">;
8728def err_typecheck_expect_scalar_operand : Error<
8729  "operand of type %0 where arithmetic or pointer type is required">;
8730def err_typecheck_cond_incompatible_operands : Error<
8731  "incompatible operand types%diff{ ($ and $)|}0,1">;
8732def err_typecheck_expect_flt_or_vector : Error<
8733  "invalid operand of type %0 where floating, complex or "
8734  "a vector of such types is required">;
8735def err_cast_selector_expr : Error<
8736  "cannot type cast @selector expression">;
8737def err_make_signed_integral_only : Error<
8738  "'%select{make_unsigned|make_signed}0' is only compatible with "
8739  "non-%select{bool|_BitInt(1)}1 integers and enum types, but was given "
8740  "%2%select{| whose underlying type is %4}3">;
8741def ext_typecheck_cond_incompatible_pointers : ExtWarn<
8742  "pointer type mismatch%diff{ ($ and $)|}0,1">,
8743  InGroup<DiagGroup<"pointer-type-mismatch">>;
8744def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
8745  "pointer/integer type mismatch in conditional expression"
8746  "%diff{ ($ and $)|}0,1">,
8747  InGroup<DiagGroup<"conditional-type-mismatch">>;
8748def err_typecheck_choose_expr_requires_constant : Error<
8749  "'__builtin_choose_expr' requires a constant expression">;
8750def warn_unused_expr : Warning<"expression result unused">,
8751  InGroup<UnusedValue>;
8752def warn_unused_comma_left_operand : Warning<
8753  "left operand of comma operator has no effect">,
8754  InGroup<UnusedValue>;
8755def warn_unused_voidptr : Warning<
8756  "expression result unused; should this cast be to 'void'?">,
8757  InGroup<UnusedValue>;
8758def warn_unused_property_expr : Warning<
8759 "property access result unused - getters should not be used for side effects">,
8760  InGroup<UnusedGetterReturnValue>;
8761def warn_unused_container_subscript_expr : Warning<
8762 "container access result unused - container access should not be used for side effects">,
8763  InGroup<UnusedValue>;
8764def warn_unused_call : Warning<
8765  "ignoring return value of function declared with %0 attribute">,
8766  InGroup<UnusedValue>;
8767def warn_unused_constructor : Warning<
8768  "ignoring temporary created by a constructor declared with %0 attribute">,
8769  InGroup<UnusedValue>;
8770def warn_unused_constructor_msg : Warning<
8771  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
8772  InGroup<UnusedValue>;
8773def warn_side_effects_unevaluated_context : Warning<
8774  "expression with side effects has no effect in an unevaluated context">,
8775  InGroup<UnevaluatedExpression>;
8776def warn_side_effects_typeid : Warning<
8777  "expression with side effects will be evaluated despite being used as an "
8778  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
8779def warn_unused_result : Warning<
8780  "ignoring return value of function declared with %0 attribute">,
8781  InGroup<UnusedResult>;
8782def warn_unused_result_msg : Warning<
8783  "ignoring return value of function declared with %0 attribute: %1">,
8784  InGroup<UnusedResult>;
8785def warn_unused_result_typedef_unsupported_spelling : Warning<
8786  "'[[%select{nodiscard|gnu::warn_unused_result}0]]' attribute ignored when "
8787  "applied to a typedef; consider using '__attribute__((warn_unused_result))' "
8788  "or '[[clang::warn_unused_result]]' instead">, InGroup<IgnoredAttributes>;
8789def warn_unused_volatile : Warning<
8790  "expression result unused; assign into a variable to force a volatile load">,
8791  InGroup<DiagGroup<"unused-volatile-lvalue">>;
8792
8793def ext_cxx14_attr : Extension<
8794  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14Attrs>;
8795def ext_cxx17_attr : Extension<
8796  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17Attrs>;
8797def ext_cxx20_attr : Extension<
8798  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20Attrs>;
8799
8800def warn_unused_comparison : Warning<
8801  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
8802  InGroup<UnusedComparison>;
8803def note_inequality_comparison_to_or_assign : Note<
8804  "use '|=' to turn this inequality comparison into an or-assignment">;
8805
8806def err_incomplete_type_used_in_type_trait_expr : Error<
8807  "incomplete type %0 used in type trait expression">;
8808
8809// C++20 constinit and require_constant_initialization attribute
8810def warn_cxx20_compat_constinit : Warning<
8811  "'constinit' specifier is incompatible with C++ standards before C++20">,
8812  InGroup<CXX20Compat>, DefaultIgnore;
8813def err_constinit_local_variable : Error<
8814  "local variable cannot be declared 'constinit'">;
8815def err_require_constant_init_failed : Error<
8816  "variable does not have a constant initializer">;
8817def note_declared_required_constant_init_here : Note<
8818  "required by %select{'require_constant_initialization' attribute|"
8819  "'constinit' specifier}0 here">;
8820def ext_constinit_missing : ExtWarn<
8821  "'constinit' specifier missing on initializing declaration of %0">,
8822  InGroup<DiagGroup<"missing-constinit">>;
8823def note_constinit_specified_here : Note<"variable declared constinit here">;
8824def err_constinit_added_too_late : Error<
8825  "'constinit' specifier added after initialization of variable">;
8826def warn_require_const_init_added_too_late : Warning<
8827  "'require_constant_initialization' attribute added after initialization "
8828  "of variable">, InGroup<IgnoredAttributes>;
8829def note_constinit_missing_here : Note<
8830  "add the "
8831  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
8832  "to the initializing declaration here">;
8833
8834def err_dimension_expr_not_constant_integer : Error<
8835  "dimension expression does not evaluate to a constant unsigned int">;
8836
8837def err_typecheck_cond_incompatible_operands_null : Error<
8838  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
8839def ext_empty_struct_union : Extension<
8840  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
8841def ext_no_named_members_in_struct_union : Extension<
8842  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
8843def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
8844  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8845  InGroup<CXXCompat>, DefaultIgnore;
8846def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
8847  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8848  InGroup<ExternCCompat>;
8849def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
8850  "volatile qualifiers|const qualifier|volatile qualifier}2">,
8851  InGroup<CastQual>, DefaultIgnore;
8852def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
8853  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
8854def warn_redefine_extname_not_applied : Warning<
8855  "#pragma redefine_extname is applicable to external C declarations only; "
8856  "not applied to %select{function|variable}0 %1">,
8857  InGroup<Pragmas>;
8858} // End of general sema category.
8859
8860// inline asm.
8861let CategoryName = "Inline Assembly Issue" in {
8862  def err_asm_pmf_through_constraint_not_permitted
8863    : Error<"cannot pass a pointer-to-member through register-constrained "
8864            "inline assembly parameter">;
8865  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
8866  def err_asm_invalid_output_constraint : Error<
8867    "invalid output constraint '%0' in asm">;
8868  def err_asm_invalid_lvalue_in_input : Error<
8869    "invalid lvalue in asm input for constraint '%0'">;
8870  def err_asm_invalid_input_constraint : Error<
8871    "invalid input constraint '%0' in asm">;
8872  def err_asm_tying_incompatible_types : Error<
8873    "unsupported inline asm: input with type "
8874    "%diff{$ matching output with type $|}0,1">;
8875  def err_asm_unexpected_constraint_alternatives : Error<
8876    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
8877  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
8878  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
8879  def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">;
8880  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
8881    "global register variables on this target">;
8882  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
8883    "match variable size">;
8884  def err_asm_bad_register_type : Error<"bad type for named register variable">;
8885  def err_asm_invalid_input_size : Error<
8886    "invalid input size for constraint '%0'">;
8887  def err_asm_invalid_output_size : Error<
8888    "invalid output size for constraint '%0'">;
8889  def err_invalid_asm_cast_lvalue : Error<
8890    "invalid use of a cast in a inline asm context requiring an lvalue: "
8891    "remove the cast or build with -fheinous-gnu-extensions">;
8892  def err_invalid_asm_value_for_constraint
8893      : Error <"value '%0' out of range for constraint '%1'">;
8894  def err_asm_non_addr_value_in_memory_constraint : Error <
8895    "reference to a %select{bit-field|vector element|global register variable}0"
8896    " in asm %select{input|output}1 with a memory constraint '%2'">;
8897  def err_asm_input_duplicate_match : Error<
8898    "more than one input constraint matches the same output '%0'">;
8899  def err_store_value_to_reg : Error<
8900    "impossible constraint in asm: can't store value into a register">;
8901
8902  def warn_asm_label_on_auto_decl : Warning<
8903    "ignored asm label '%0' on automatic variable">;
8904  def warn_invalid_asm_cast_lvalue : Warning<
8905    "invalid use of a cast in an inline asm context requiring an lvalue: "
8906    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
8907    "for this in the future">;
8908  def warn_asm_mismatched_size_modifier : Warning<
8909    "value size does not match register size specified by the constraint "
8910    "and modifier">,
8911    InGroup<ASMOperandWidths>;
8912
8913  def note_asm_missing_constraint_modifier : Note<
8914    "use constraint modifier \"%0\"">;
8915  def note_asm_input_duplicate_first : Note<
8916    "constraint '%0' is already present here">;
8917 def error_duplicate_asm_operand_name : Error<
8918    "duplicate use of asm operand name \"%0\"">;
8919 def note_duplicate_asm_operand_name : Note<
8920    "asm operand name \"%0\" first referenced here">;
8921}
8922
8923  def error_inoutput_conflict_with_clobber : Error<
8924    "asm-specifier for input or output variable conflicts with asm"
8925    " clobber list">;
8926
8927let CategoryName = "Semantic Issue" in {
8928
8929def err_invalid_conversion_between_matrixes : Error<
8930  "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">;
8931
8932def err_invalid_conversion_between_matrix_and_type : Error<
8933  "conversion between matrix type %0 and incompatible type %1 is not allowed">;
8934
8935def err_invalid_conversion_between_vectors : Error<
8936  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
8937  "size">;
8938def err_invalid_conversion_between_vector_and_integer : Error<
8939  "invalid conversion between vector type %0 and integer type %1 "
8940  "of different size">;
8941
8942def err_opencl_function_pointer : Error<
8943  "%select{pointers|references}0 to functions are not allowed">;
8944
8945def err_opencl_taking_address_capture : Error<
8946  "taking address of a capture is not allowed">;
8947
8948def err_invalid_conversion_between_vector_and_scalar : Error<
8949  "invalid conversion between vector type %0 and scalar type %1">;
8950
8951// C++ member initializers.
8952def err_only_constructors_take_base_inits : Error<
8953  "only constructors take base initializers">;
8954
8955def err_multiple_mem_initialization : Error <
8956  "multiple initializations given for non-static member %0">;
8957def err_multiple_mem_union_initialization : Error <
8958  "initializing multiple members of union">;
8959def err_multiple_base_initialization : Error <
8960  "multiple initializations given for base %0">;
8961
8962def err_mem_init_not_member_or_class : Error<
8963  "member initializer %0 does not name a non-static data member or base "
8964  "class">;
8965
8966def warn_initializer_out_of_order : Warning<
8967  "%select{field|base class}0 %1 will be initialized after "
8968  "%select{field|base}2 %3">,
8969  InGroup<ReorderCtor>, DefaultIgnore;
8970
8971def warn_some_initializers_out_of_order : Warning<
8972  "initializer order does not match the declaration order">,
8973  InGroup<ReorderCtor>, DefaultIgnore;
8974
8975def note_initializer_out_of_order : Note<
8976  "%select{field|base class}0 %1 will be initialized after "
8977  "%select{field|base}2 %3">;
8978
8979def warn_abstract_vbase_init_ignored : Warning<
8980  "initializer for virtual base class %0 of abstract class %1 "
8981  "will never be used">,
8982  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
8983
8984def err_base_init_does_not_name_class : Error<
8985  "constructor initializer %0 does not name a class">;
8986def err_base_init_direct_and_virtual : Error<
8987  "base class initializer %0 names both a direct base class and an "
8988  "inherited virtual base class">;
8989def err_not_direct_base_or_virtual : Error<
8990  "type %0 is not a direct or virtual base of %1">;
8991
8992def err_in_class_initializer_non_const : Error<
8993  "non-const static data member must be initialized out of line">;
8994def err_in_class_initializer_volatile : Error<
8995  "static const volatile data member must be initialized out of line">;
8996def err_in_class_initializer_bad_type : Error<
8997  "static data member of type %0 must be initialized out of line">;
8998def ext_in_class_initializer_float_type : ExtWarn<
8999  "in-class initializer for static data member of type %0 is a GNU extension">,
9000  InGroup<GNUStaticFloatInit>;
9001def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
9002  "in-class initializer for static data member of type %0 requires "
9003  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
9004def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
9005def err_in_class_initializer_literal_type : Error<
9006  "in-class initializer for static data member of type %0 requires "
9007  "'constexpr' specifier">;
9008def err_in_class_initializer_non_constant : Error<
9009  "in-class initializer for static data member is not a constant expression">;
9010def err_default_member_initializer_not_yet_parsed : Error<
9011  "default member initializer for %1 needed within definition of enclosing "
9012  "class %0 outside of member functions">;
9013def note_default_member_initializer_not_yet_parsed : Note<
9014  "default member initializer declared here">;
9015def err_default_member_initializer_cycle
9016    : Error<"default member initializer for %0 uses itself">;
9017
9018def ext_in_class_initializer_non_constant : Extension<
9019  "in-class initializer for static data member is not a constant expression; "
9020  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
9021
9022def err_thread_dynamic_init : Error<
9023  "initializer for thread-local variable must be a constant expression">;
9024def err_thread_nontrivial_dtor : Error<
9025  "type of thread-local variable has non-trivial destruction">;
9026def note_use_thread_local : Note<
9027  "use 'thread_local' to allow this">;
9028
9029// C++ anonymous unions and GNU anonymous structs/unions
9030def ext_anonymous_union : Extension<
9031  "anonymous unions are a C11 extension">, InGroup<C11>;
9032def ext_gnu_anonymous_struct : Extension<
9033  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
9034def ext_c11_anonymous_struct : Extension<
9035  "anonymous structs are a C11 extension">, InGroup<C11>;
9036def err_anonymous_union_not_static : Error<
9037  "anonymous unions at namespace or global scope must be declared 'static'">;
9038def err_anonymous_union_with_storage_spec : Error<
9039  "anonymous union at class scope must not have a storage specifier">;
9040def err_anonymous_struct_not_member : Error<
9041  "anonymous %select{structs|structs and classes}0 must be "
9042  "%select{struct or union|class}0 members">;
9043def err_anonymous_record_member_redecl : Error<
9044  "member of anonymous %select{struct|union}0 redeclares %1">;
9045def err_anonymous_record_with_type : Error<
9046  "types cannot be declared in an anonymous %select{struct|union}0">;
9047def ext_anonymous_record_with_type : Extension<
9048  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
9049  "extension">, InGroup<MicrosoftAnonTag>;
9050def ext_anonymous_record_with_anonymous_type : Extension<
9051  "anonymous types declared in an anonymous %select{struct|union}0 "
9052  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
9053def err_anonymous_record_with_function : Error<
9054  "functions cannot be declared in an anonymous %select{struct|union}0">;
9055def err_anonymous_record_with_static : Error<
9056  "static members cannot be declared in an anonymous %select{struct|union}0">;
9057def err_anonymous_record_bad_member : Error<
9058  "anonymous %select{struct|union}0 can only contain non-static data members">;
9059def err_anonymous_record_nonpublic_member : Error<
9060  "anonymous %select{struct|union}0 cannot contain a "
9061  "%select{private|protected}1 data member">;
9062def ext_ms_anonymous_record : ExtWarn<
9063  "anonymous %select{structs|unions}0 are a Microsoft extension">,
9064  InGroup<MicrosoftAnonTag>;
9065
9066// C++ local classes
9067def err_reference_to_local_in_enclosing_context : Error<
9068  "reference to local %select{variable|binding}1 %0 declared in enclosing "
9069  "%select{%3|block literal|lambda expression|context}2">;
9070def err_capture_binding_openmp : Error<
9071  "capturing a structured binding is not yet supported in OpenMP">;
9072def ext_capture_binding : ExtWarn<
9073  "captured structured bindings are a C++20 extension">, InGroup<CXX20>;
9074def warn_cxx17_compat_capture_binding : Warning<
9075  "captured structured bindings are incompatible with "
9076  "C++ standards before C++20">,
9077  InGroup<CXXPre20Compat>, DefaultIgnore;
9078
9079def err_static_data_member_not_allowed_in_local_class : Error<
9080  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
9081
9082// C++ derived classes
9083def err_base_clause_on_union : Error<"unions cannot have base classes">;
9084def err_base_must_be_class : Error<"base specifier must name a class">;
9085def err_union_as_base_class : Error<"unions cannot be base classes">;
9086def err_circular_inheritance : Error<
9087  "circular inheritance between %0 and %1">;
9088def err_base_class_has_flexible_array_member : Error<
9089  "base class %0 has a flexible array member">;
9090def err_incomplete_base_class : Error<"base class has incomplete type">;
9091def err_duplicate_base_class : Error<
9092  "base class %0 specified more than once as a direct base class">;
9093def warn_inaccessible_base_class : Warning<
9094  "direct base %0 is inaccessible due to ambiguity:%1">,
9095  InGroup<DiagGroup<"inaccessible-base">>;
9096// FIXME: better way to display derivation?  Pass entire thing into diagclient?
9097def err_ambiguous_derived_to_base_conv : Error<
9098  "ambiguous conversion from derived class %0 to base class %1:%2">;
9099def err_ambiguous_memptr_conv : Error<
9100  "ambiguous conversion from pointer to member of %select{base|derived}0 "
9101  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
9102def ext_ms_ambiguous_direct_base : ExtWarn<
9103  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
9104  InGroup<MicrosoftInaccessibleBase>;
9105
9106def err_memptr_conv_via_virtual : Error<
9107  "conversion from pointer to member of class %0 to pointer to member "
9108  "of class %1 via virtual base %2 is not allowed">;
9109
9110// C++ member name lookup
9111def err_ambiguous_member_multiple_subobjects : Error<
9112  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
9113def err_ambiguous_member_multiple_subobject_types : Error<
9114  "member %0 found in multiple base classes of different types">;
9115def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
9116def note_ambiguous_member_type_found : Note<
9117  "member type %0 found by ambiguous name lookup">;
9118def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
9119def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
9120def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
9121  "declaration in a different namespace">;
9122def note_hidden_tag : Note<"type declaration hidden">;
9123def note_hiding_object : Note<"declaration hides type">;
9124
9125// C++ operator overloading
9126def err_operator_overload_needs_class_or_enum : Error<
9127  "overloaded %0 must have at least one parameter of class "
9128  "or enumeration type">;
9129
9130def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
9131def warn_cxx20_compat_operator_overload_static : Warning<
9132  "declaring overloaded %0 as 'static' is incompatible with C++ standards "
9133  "before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore;
9134def ext_operator_overload_static : ExtWarn<
9135  "declaring overloaded %0 as 'static' is a C++2b extension">, InGroup<CXX2b>;
9136def err_operator_overload_static : Error<
9137  "overloaded %0 cannot be a static member function">;
9138def err_operator_overload_default_arg : Error<
9139  "parameter of overloaded %0 cannot have a default argument">;
9140
9141def ext_subscript_overload : ExtWarn<
9142  "overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension">, InGroup<CXXPre2bCompat>, DefaultIgnore;
9143def error_subscript_overload : Error<
9144  "overloaded %0 cannot have %select{no|a defaulted|more than one}1 parameter before C++2b">;
9145
9146def err_operator_overload_must_be : Error<
9147  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
9148  "(has %1 parameter%s1)">;
9149
9150def err_operator_overload_must_be_member : Error<
9151  "overloaded %0 must be a non-static member function">;
9152def err_operator_overload_post_incdec_must_be_int : Error<
9153  "parameter of overloaded post-%select{increment|decrement}1 operator must "
9154  "have type 'int' (not %0)">;
9155
9156// C++ allocation and deallocation functions.
9157def err_operator_new_delete_declared_in_namespace : Error<
9158  "%0 cannot be declared inside a namespace">;
9159def err_operator_new_delete_declared_static : Error<
9160  "%0 cannot be declared static in global scope">;
9161def ext_operator_new_delete_declared_inline : ExtWarn<
9162  "replacement function %0 cannot be declared 'inline'">,
9163  InGroup<DiagGroup<"inline-new-delete">>;
9164def err_operator_new_delete_invalid_result_type : Error<
9165  "%0 must return type %1">;
9166def err_operator_new_delete_dependent_result_type : Error<
9167  "%0 cannot have a dependent return type; use %1 instead">;
9168def err_operator_new_delete_too_few_parameters : Error<
9169  "%0 must have at least one parameter">;
9170def err_operator_new_delete_template_too_few_parameters : Error<
9171  "%0 template must have at least two parameters">;
9172def warn_operator_new_returns_null : Warning<
9173  "%0 should not return a null pointer unless it is declared 'throw()'"
9174  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
9175
9176def err_operator_new_dependent_param_type : Error<
9177  "%0 cannot take a dependent type as first parameter; "
9178  "use size_t (%1) instead">;
9179def err_operator_new_param_type : Error<
9180  "%0 takes type size_t (%1) as first parameter">;
9181def err_operator_new_default_arg: Error<
9182  "parameter of %0 cannot have a default argument">;
9183def err_operator_delete_dependent_param_type : Error<
9184  "%0 cannot take a dependent type as first parameter; use %1 instead">;
9185def err_operator_delete_param_type : Error<
9186  "first parameter of %0 must have type %1">;
9187def err_destroying_operator_delete_not_usual : Error<
9188  "destroying operator delete can have only an optional size and optional "
9189  "alignment parameter">;
9190def note_implicit_delete_this_in_destructor_here : Note<
9191  "while checking implicit 'delete this' for virtual destructor">;
9192def err_builtin_operator_new_delete_not_usual : Error<
9193  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
9194  "selects non-usual %select{allocation|deallocation}0 function">;
9195def note_non_usual_function_declared_here : Note<
9196  "non-usual %0 declared here">;
9197
9198// C++ literal operators
9199def err_literal_operator_outside_namespace : Error<
9200  "literal operator %0 must be in a namespace or global scope">;
9201def err_literal_operator_id_outside_namespace : Error<
9202  "non-namespace scope '%0' cannot have a literal operator member">;
9203def err_literal_operator_default_argument : Error<
9204  "literal operator cannot have a default argument">;
9205def err_literal_operator_bad_param_count : Error<
9206  "non-template literal operator must have one or two parameters">;
9207def err_literal_operator_invalid_param : Error<
9208  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
9209def err_literal_operator_param : Error<
9210  "invalid literal operator parameter type %0, did you mean %1?">;
9211def err_literal_operator_template_with_params : Error<
9212  "literal operator template cannot have any parameters">;
9213def err_literal_operator_template : Error<
9214  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
9215def err_literal_operator_extern_c : Error<
9216  "literal operator must have C++ linkage">;
9217def ext_string_literal_operator_template : ExtWarn<
9218  "string literal operator templates are a GNU extension">,
9219  InGroup<GNUStringLiteralOperatorTemplate>;
9220def warn_user_literal_reserved : Warning<
9221  "user-defined literal suffixes not starting with '_' are reserved"
9222  "%select{; no literal will invoke this operator|}0">,
9223  InGroup<UserDefinedLiterals>;
9224
9225// C++ conversion functions
9226def err_conv_function_not_member : Error<
9227  "conversion function must be a non-static member function">;
9228def err_conv_function_return_type : Error<
9229  "conversion function cannot have a return type">;
9230def err_conv_function_with_params : Error<
9231  "conversion function cannot have any parameters">;
9232def err_conv_function_variadic : Error<
9233  "conversion function cannot be variadic">;
9234def err_conv_function_to_array : Error<
9235  "conversion function cannot convert to an array type">;
9236def err_conv_function_to_function : Error<
9237  "conversion function cannot convert to a function type">;
9238def err_conv_function_with_complex_decl : Error<
9239  "cannot specify any part of a return type in the "
9240  "declaration of a conversion function"
9241  "%select{"
9242  "; put the complete type after 'operator'|"
9243  "; use a typedef to declare a conversion to %1|"
9244  "; use an alias template to declare a conversion to %1|"
9245  "}0">;
9246def err_conv_function_redeclared : Error<
9247  "conversion function cannot be redeclared">;
9248def warn_conv_to_self_not_used : Warning<
9249  "conversion function converting %0 to itself will never be used">,
9250  InGroup<ClassConversion>;
9251def warn_conv_to_base_not_used : Warning<
9252  "conversion function converting %0 to its base class %1 will never be used">,
9253  InGroup<ClassConversion>;
9254def warn_conv_to_void_not_used : Warning<
9255  "conversion function converting %0 to %1 will never be used">,
9256  InGroup<ClassConversion>;
9257
9258def warn_not_compound_assign : Warning<
9259  "use of unary operator that may be intended as compound assignment (%0=)">;
9260
9261// C++11 explicit conversion operators
9262def ext_explicit_conversion_functions : ExtWarn<
9263  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
9264def warn_cxx98_compat_explicit_conversion_functions : Warning<
9265  "explicit conversion functions are incompatible with C++98">,
9266  InGroup<CXX98Compat>, DefaultIgnore;
9267
9268// C++11 defaulted functions
9269def err_defaulted_special_member_params : Error<
9270  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9271  "have default arguments">;
9272def err_defaulted_special_member_variadic : Error<
9273  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9274  "be variadic">;
9275def err_defaulted_special_member_return_type : Error<
9276  "explicitly-defaulted %select{copy|move}0 assignment operator must "
9277  "return %1">;
9278def err_defaulted_special_member_quals : Error<
9279  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
9280  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
9281def err_defaulted_special_member_volatile_param : Error<
9282  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
9283  "may not be volatile">;
9284def err_defaulted_special_member_move_const_param : Error<
9285  "the parameter for an explicitly-defaulted move "
9286  "%select{constructor|assignment operator}0 may not be const">;
9287def err_defaulted_special_member_copy_const_param : Error<
9288  "the parameter for this explicitly-defaulted copy "
9289  "%select{constructor|assignment operator}0 is const, but a member or base "
9290  "requires it to be non-const">;
9291def err_defaulted_copy_assign_not_ref : Error<
9292  "the parameter for an explicitly-defaulted copy assignment operator must be an "
9293  "lvalue reference type">;
9294def err_incorrect_defaulted_constexpr : Error<
9295  "defaulted definition of %sub{select_special_member_kind}0 "
9296  "is not constexpr">;
9297def err_incorrect_defaulted_consteval : Error<
9298  "defaulted declaration of %sub{select_special_member_kind}0 "
9299  "cannot be consteval because implicit definition is not constexpr">;
9300def warn_defaulted_method_deleted : Warning<
9301  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
9302  "deleted">, InGroup<DefaultedFunctionDeleted>;
9303def note_replace_equals_default_to_delete : Note<
9304  "replace 'default' with 'delete'">;
9305def err_out_of_line_default_deletes : Error<
9306  "defaulting this %sub{select_special_member_kind}0 "
9307  "would delete it after its first declaration">;
9308def note_deleted_type_mismatch : Note<
9309  "function is implicitly deleted because its declared type does not match "
9310  "the type of an implicit %sub{select_special_member_kind}0">;
9311def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
9312  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
9313  "different from the implicit type is incompatible with C++ standards before "
9314  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9315def warn_vbase_moved_multiple_times : Warning<
9316  "defaulted move assignment operator of %0 will move assign virtual base "
9317  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
9318def note_vbase_moved_here : Note<
9319  "%select{%1 is a virtual base class of base class %2 declared here|"
9320  "virtual base class %1 declared here}0">;
9321
9322// C++20 defaulted comparisons
9323// This corresponds to values of Sema::DefaultedComparisonKind.
9324def select_defaulted_comparison_kind : TextSubstitution<
9325  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
9326  "operator">;
9327def ext_defaulted_comparison : ExtWarn<
9328  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
9329def warn_cxx17_compat_defaulted_comparison : Warning<
9330  "defaulted comparison operators are incompatible with C++ standards "
9331  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9332def err_defaulted_comparison_template : Error<
9333  "comparison operator template cannot be defaulted">;
9334def err_defaulted_comparison_num_args : Error<
9335  "%select{non-member|member}0 %sub{select_defaulted_comparison_kind}1"
9336  " comparison operator must have %select{2|1}0 parameters">;
9337def err_defaulted_comparison_param : Error<
9338  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
9339  "; found %1, expected %2%select{| or %4}3">;
9340def err_defaulted_comparison_param_unknown : Error<
9341  "invalid parameter type for non-member defaulted"
9342  " %sub{select_defaulted_comparison_kind}0"
9343  "; found %1, expected class or reference to a constant class">;
9344def err_defaulted_comparison_param_mismatch : Error<
9345  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
9346  "must have the same type%diff{ (found $ vs $)|}1,2">;
9347def err_defaulted_comparison_not_friend : Error<
9348  "%sub{select_defaulted_comparison_kind}0 is not a friend of"
9349  " %select{|incomplete class }1%2">;
9350def err_defaulted_comparison_non_const : Error<
9351  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
9352  "const-qualified">;
9353def err_defaulted_comparison_return_type_not_bool : Error<
9354  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9355  "must be 'bool', not %1">;
9356def err_defaulted_comparison_deduced_return_type_not_auto : Error<
9357  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9358  "must be 'auto', not %1">;
9359def warn_defaulted_comparison_deleted : Warning<
9360  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
9361  "deleted">, InGroup<DefaultedFunctionDeleted>;
9362def err_non_first_default_compare_deletes : Error<
9363  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
9364  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
9365  "would delete it after its first declaration">;
9366def err_non_first_default_compare_in_class : Error<
9367  "defaulting this %sub{select_defaulted_comparison_kind}0 "
9368  "is not allowed because it was already declared outside the class">;
9369def note_defaulted_comparison_union : Note<
9370  "defaulted %0 is implicitly deleted because "
9371  "%2 is a %select{union-like class|union}1 with variant members">;
9372def note_defaulted_comparison_reference_member : Note<
9373  "defaulted %0 is implicitly deleted because "
9374  "class %1 has a reference member">;
9375def note_defaulted_comparison_ambiguous : Note<
9376  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
9377  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
9378def note_defaulted_comparison_inaccessible : Note<
9379  "defaulted %0 is implicitly deleted because it would invoke a "
9380  "%select{private|protected}3 %4%select{ member of %6|"
9381  " member of %6 to compare member %2| to compare base class %2}1">;
9382def note_defaulted_comparison_calls_deleted : Note<
9383  "defaulted %0 is implicitly deleted because it would invoke a deleted "
9384  "comparison function%select{| for member %2| for base class %2}1">;
9385def note_defaulted_comparison_no_viable_function : Note<
9386  "defaulted %0 is implicitly deleted because there is no viable "
9387  "%select{three-way comparison function|'operator=='}1 for "
9388  "%select{|member |base class }2%3">;
9389def note_defaulted_comparison_no_viable_function_synthesized : Note<
9390  "three-way comparison cannot be synthesized because there is no viable "
9391  "function for %select{'=='|'<'}0 comparison">;
9392def note_defaulted_comparison_not_rewritten_callee : Note<
9393  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
9394  "function would be the best match for the comparison">;
9395def note_defaulted_comparison_not_rewritten_conversion : Note<
9396  "defaulted %0 is implicitly deleted because a builtin comparison function "
9397  "using this conversion would be the best match for the comparison">;
9398def note_defaulted_comparison_cannot_deduce : Note<
9399  "return type of defaulted 'operator<=>' cannot be deduced because "
9400  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
9401  "is not a standard comparison category type">;
9402def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
9403  "return type of defaulted 'operator<=>' cannot be deduced because "
9404  "three-way comparison for %select{|member|base class}0 %1 "
9405  "has a deduced return type and is not yet defined">;
9406def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
9407  "%select{|member|base class}0 %1 declared here">;
9408def note_defaulted_comparison_cannot_deduce_callee : Note<
9409  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
9410def err_incorrect_defaulted_comparison_constexpr : Error<
9411  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
9412  "three-way comparison operator}0 "
9413  "cannot be declared %select{constexpr|consteval}2 because "
9414  "%select{it|the corresponding implicit 'operator=='}0 "
9415  "invokes a non-constexpr comparison function">;
9416def note_defaulted_comparison_not_constexpr : Note<
9417  "non-constexpr comparison function would be used to compare "
9418  "%select{|member %1|base class %1}0">;
9419def note_defaulted_comparison_not_constexpr_here : Note<
9420  "non-constexpr comparison function declared here">;
9421def note_in_declaration_of_implicit_equality_comparison : Note<
9422  "while declaring the corresponding implicit 'operator==' "
9423  "for this defaulted 'operator<=>'">;
9424
9425def ext_implicit_exception_spec_mismatch : ExtWarn<
9426  "function previously declared with an %select{explicit|implicit}0 exception "
9427  "specification redeclared with an %select{implicit|explicit}0 exception "
9428  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
9429
9430def warn_ptr_arith_precedes_bounds : Warning<
9431  "the pointer decremented by %0 refers before the beginning of the array">,
9432  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9433def warn_ptr_arith_exceeds_bounds : Warning<
9434  "the pointer incremented by %0 refers past the end of the array (that has type %1)">,
9435  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9436def warn_array_index_precedes_bounds : Warning<
9437  "array index %0 is before the beginning of the array">,
9438  InGroup<ArrayBounds>;
9439def warn_array_index_exceeds_bounds : Warning<
9440  "array index %0 is past the end of the array (that has type %1%select{|, cast to %3}2)">,
9441  InGroup<ArrayBounds>;
9442def warn_ptr_arith_exceeds_max_addressable_bounds : Warning<
9443  "the pointer incremented by %0 refers past the last possible element for an array in %1-bit "
9444  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9445  InGroup<ArrayBounds>;
9446def warn_array_index_exceeds_max_addressable_bounds : Warning<
9447  "array index %0 refers past the last possible element for an array in %1-bit "
9448  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9449  InGroup<ArrayBounds>;
9450def note_array_declared_here : Note<
9451  "array %0 declared here">;
9452
9453def warn_inconsistent_array_form : Warning<
9454  "argument %0 of type %1 with mismatched bound">,
9455  InGroup<ArrayParameter>, DefaultIgnore;
9456def note_previous_declaration_as : Note<
9457  "previously declared as %0 here">;
9458
9459def warn_printf_insufficient_data_args : Warning<
9460  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9461def warn_printf_data_arg_not_used : Warning<
9462  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9463def warn_format_invalid_conversion : Warning<
9464  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9465def warn_printf_incomplete_specifier : Warning<
9466  "incomplete format specifier">, InGroup<Format>;
9467def warn_missing_format_string : Warning<
9468  "format string missing">, InGroup<Format>;
9469def warn_scanf_nonzero_width : Warning<
9470  "zero field width in scanf format string is unused">,
9471  InGroup<Format>;
9472def warn_format_conversion_argument_type_mismatch : Warning<
9473  "format specifies type %0 but the argument has "
9474  "%select{type|underlying type}2 %1">,
9475  InGroup<Format>;
9476def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9477  warn_format_conversion_argument_type_mismatch.Summary>,
9478  InGroup<FormatPedantic>;
9479def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9480  warn_format_conversion_argument_type_mismatch.Summary>,
9481  InGroup<FormatTypeConfusion>, DefaultIgnore;
9482def warn_format_argument_needs_cast : Warning<
9483  "%select{values of type|enum values with underlying type}2 '%0' should not "
9484  "be used as format arguments; add an explicit cast to %1 instead">,
9485  InGroup<Format>;
9486def warn_format_argument_needs_cast_pedantic : Warning<
9487  warn_format_argument_needs_cast.Summary>,
9488  InGroup<FormatPedantic>, DefaultIgnore;
9489def warn_printf_positional_arg_exceeds_data_args : Warning <
9490  "data argument position '%0' exceeds the number of data arguments (%1)">,
9491  InGroup<Format>;
9492def warn_format_zero_positional_specifier : Warning<
9493  "position arguments in format strings start counting at 1 (not 0)">,
9494  InGroup<Format>;
9495def warn_format_invalid_positional_specifier : Warning<
9496  "invalid position specified for %select{field width|field precision}0">,
9497  InGroup<Format>;
9498def warn_format_mix_positional_nonpositional_args : Warning<
9499  "cannot mix positional and non-positional arguments in format string">,
9500  InGroup<Format>;
9501def warn_static_array_too_small : Warning<
9502  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9503  " callee requires at least %1">,
9504  InGroup<ArrayBounds>;
9505def note_callee_static_array : Note<
9506  "callee declares array parameter as static here">;
9507def warn_empty_format_string : Warning<
9508  "format string is empty">, InGroup<FormatZeroLength>;
9509def warn_format_string_is_wide_literal : Warning<
9510  "format string should not be a wide string">, InGroup<Format>;
9511def warn_printf_format_string_contains_null_char : Warning<
9512  "format string contains '\\0' within the string body">, InGroup<Format>;
9513def warn_printf_format_string_not_null_terminated : Warning<
9514  "format string is not null-terminated">, InGroup<Format>;
9515def warn_printf_asterisk_missing_arg : Warning<
9516  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9517  InGroup<Format>;
9518def warn_printf_asterisk_wrong_type : Warning<
9519  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9520  InGroup<Format>;
9521def warn_printf_nonsensical_optional_amount: Warning<
9522  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9523  InGroup<Format>;
9524def warn_printf_nonsensical_flag: Warning<
9525  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9526  InGroup<Format>;
9527def warn_format_nonsensical_length: Warning<
9528  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9529  InGroup<Format>;
9530def warn_format_non_standard_positional_arg: Warning<
9531  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9532def warn_format_non_standard: Warning<
9533  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
9534  InGroup<FormatNonStandard>, DefaultIgnore;
9535def warn_format_non_standard_conversion_spec: Warning<
9536  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
9537  InGroup<FormatNonStandard>, DefaultIgnore;
9538def err_invalid_mask_type_size : Error<
9539  "mask type size must be between 1-byte and 8-bytes">;
9540def warn_format_invalid_annotation : Warning<
9541  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
9542  InGroup<Format>;
9543def warn_format_P_no_precision : Warning<
9544  "using '%%P' format specifier without precision">,
9545  InGroup<Format>;
9546def warn_printf_ignored_flag: Warning<
9547  "flag '%0' is ignored when flag '%1' is present">,
9548  InGroup<Format>;
9549def warn_printf_empty_objc_flag: Warning<
9550  "missing object format flag">,
9551  InGroup<Format>;
9552def warn_printf_ObjCflags_without_ObjCConversion: Warning<
9553  "object format flags cannot be used with '%0' conversion specifier">,
9554  InGroup<Format>;
9555def warn_printf_invalid_objc_flag: Warning<
9556    "'%0' is not a valid object format flag">,
9557    InGroup<Format>;
9558def warn_printf_narg_not_supported : Warning<
9559    "'%%n' specifier not supported on this platform">,
9560    InGroup<Format>;
9561def warn_scanf_scanlist_incomplete : Warning<
9562  "no closing ']' for '%%[' in scanf format string">,
9563  InGroup<Format>;
9564def warn_format_bool_as_character : Warning<
9565  "using '%0' format specifier, but argument has boolean value">,
9566  InGroup<Format>;
9567def note_format_string_defined : Note<"format string is defined here">;
9568def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
9569def note_printf_c_str: Note<"did you mean to call the %0 method?">;
9570def note_format_security_fixit: Note<
9571  "treat the string as an argument to avoid this">;
9572
9573def warn_null_arg : Warning<
9574  "null passed to a callee that requires a non-null argument">,
9575  InGroup<NonNull>;
9576def warn_null_ret : Warning<
9577  "null returned from %select{function|method}0 that requires a non-null return value">,
9578  InGroup<NonNull>;
9579
9580def err_lifetimebound_no_object_param : Error<
9581  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
9582  "function has no implicit object parameter">;
9583def err_lifetimebound_ctor_dtor : Error<
9584  "'lifetimebound' attribute cannot be applied to a "
9585  "%select{constructor|destructor}0">;
9586
9587// CHECK: returning address/reference of stack memory
9588def warn_ret_stack_addr_ref : Warning<
9589  "%select{address of|reference to}0 stack memory associated with "
9590  "%select{local variable|parameter}2 %1 returned">,
9591  InGroup<ReturnStackAddress>;
9592def warn_ret_local_temp_addr_ref : Warning<
9593  "returning %select{address of|reference to}0 local temporary object">,
9594  InGroup<ReturnStackAddress>;
9595def warn_ret_addr_label : Warning<
9596  "returning address of label, which is local">,
9597  InGroup<ReturnStackAddress>;
9598def err_ret_local_block : Error<
9599  "returning block that lives on the local stack">;
9600def note_local_var_initializer : Note<
9601  "%select{via initialization of|binding reference}0 variable "
9602  "%select{%2 |}1here">;
9603def note_lambda_capture_initializer : Note<
9604  "%select{implicitly |}2captured%select{| by reference}3"
9605  "%select{%select{ due to use|}2 here|"
9606  " via initialization of lambda capture %0}1">;
9607def note_init_with_default_member_initalizer : Note<
9608  "initializing field %0 with default member initializer">;
9609
9610// Check for initializing a member variable with the address or a reference to
9611// a constructor parameter.
9612def warn_bind_ref_member_to_parameter : Warning<
9613  "binding reference member %0 to stack allocated "
9614  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9615def warn_init_ptr_member_to_parameter_addr : Warning<
9616  "initializing pointer member %0 with the stack address of "
9617  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9618def note_ref_or_ptr_member_declared_here : Note<
9619  "%select{reference|pointer}0 member declared here">;
9620
9621def err_dangling_member : Error<
9622  "%select{reference|backing array for 'std::initializer_list'}2 "
9623  "%select{|subobject of }1member %0 "
9624  "%select{binds to|is}2 a temporary object "
9625  "whose lifetime would be shorter than the lifetime of "
9626  "the constructed object">;
9627def warn_dangling_member : Warning<
9628  "%select{reference|backing array for 'std::initializer_list'}2 "
9629  "%select{|subobject of }1member %0 "
9630  "%select{binds to|is}2 a temporary object "
9631  "whose lifetime is shorter than the lifetime of the constructed object">,
9632  InGroup<DanglingField>;
9633def warn_dangling_lifetime_pointer_member : Warning<
9634  "initializing pointer member %0 to point to a temporary object "
9635  "whose lifetime is shorter than the lifetime of the constructed object">,
9636  InGroup<DanglingGsl>;
9637def note_lifetime_extending_member_declared_here : Note<
9638  "%select{%select{reference|'std::initializer_list'}0 member|"
9639  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
9640  "declared here">;
9641def warn_dangling_variable : Warning<
9642  "%select{temporary %select{whose address is used as value of|"
9643  "%select{|implicitly }2bound to}4 "
9644  "%select{%select{|reference }4member of local variable|"
9645  "local %select{variable|reference}4}1|"
9646  "array backing "
9647  "%select{initializer list subobject of local variable|"
9648  "local initializer list}1}0 "
9649  "%select{%3 |}2will be destroyed at the end of the full-expression">,
9650  InGroup<Dangling>;
9651def warn_new_dangling_reference : Warning<
9652  "temporary bound to reference member of allocated object "
9653  "will be destroyed at the end of the full-expression">,
9654  InGroup<DanglingField>;
9655def warn_dangling_lifetime_pointer : Warning<
9656  "object backing the pointer "
9657  "will be destroyed at the end of the full-expression">,
9658  InGroup<DanglingGsl>;
9659def warn_new_dangling_initializer_list : Warning<
9660  "array backing "
9661  "%select{initializer list subobject of the allocated object|"
9662  "the allocated initializer list}0 "
9663  "will be destroyed at the end of the full-expression">,
9664  InGroup<DanglingInitializerList>;
9665def warn_unsupported_lifetime_extension : Warning<
9666  "sorry, lifetime extension of "
9667  "%select{temporary|backing array of initializer list}0 created "
9668  "by aggregate initialization using default member initializer "
9669  "is not supported; lifetime of %select{temporary|backing array}0 "
9670  "will end at the end of the full-expression">, InGroup<Dangling>;
9671
9672// For non-floating point, expressions of the form x == x or x != x
9673// should result in a warning, since these always evaluate to a constant.
9674// Array comparisons have similar warnings
9675def warn_comparison_always : Warning<
9676  "%select{self-|array }0comparison always evaluates to "
9677  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
9678  InGroup<TautologicalCompare>;
9679def warn_comparison_bitwise_always : Warning<
9680  "bitwise comparison always evaluates to %select{false|true}0">,
9681  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9682def warn_comparison_bitwise_or : Warning<
9683  "bitwise or with non-zero value always evaluates to true">,
9684  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9685def warn_tautological_overlap_comparison : Warning<
9686  "overlapping comparisons always evaluate to %select{false|true}0">,
9687  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
9688def warn_depr_array_comparison : Warning<
9689  "comparison between two arrays is deprecated; "
9690  "to compare array addresses, use unary '+' to decay operands to pointers">,
9691  InGroup<DeprecatedArrayCompare>;
9692
9693def warn_stringcompare : Warning<
9694  "result of comparison against %select{a string literal|@encode}0 is "
9695  "unspecified (use an explicit string comparison function instead)">,
9696  InGroup<StringCompare>;
9697
9698def warn_identity_field_assign : Warning<
9699  "assigning %select{field|instance variable}0 to itself">,
9700  InGroup<SelfAssignmentField>;
9701
9702// Type safety attributes
9703def err_type_tag_for_datatype_not_ice : Error<
9704  "'type_tag_for_datatype' attribute requires the initializer to be "
9705  "an %select{integer|integral}0 constant expression">;
9706def err_type_tag_for_datatype_too_large : Error<
9707  "'type_tag_for_datatype' attribute requires the initializer to be "
9708  "an %select{integer|integral}0 constant expression "
9709  "that can be represented by a 64 bit integer">;
9710def err_tag_index_out_of_range : Error<
9711  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
9712def warn_type_tag_for_datatype_wrong_kind : Warning<
9713  "this type tag was not designed to be used with this function">,
9714  InGroup<TypeSafety>;
9715def warn_type_safety_type_mismatch : Warning<
9716  "argument type %0 doesn't match specified %1 type tag "
9717  "%select{that requires %3|}2">, InGroup<TypeSafety>;
9718def warn_type_safety_null_pointer_required : Warning<
9719  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
9720
9721// Generic selections.
9722def err_assoc_type_incomplete : Error<
9723  "type %0 in generic association incomplete">;
9724def err_assoc_type_nonobject : Error<
9725  "type %0 in generic association not an object type">;
9726def err_assoc_type_variably_modified : Error<
9727  "type %0 in generic association is a variably modified type">;
9728def err_assoc_compatible_types : Error<
9729  "type %0 in generic association compatible with previously specified type %1">;
9730def note_compat_assoc : Note<
9731  "compatible type %0 specified here">;
9732def err_generic_sel_no_match : Error<
9733  "controlling expression type %0 not compatible with any generic association type">;
9734def err_generic_sel_multi_match : Error<
9735  "controlling expression type %0 compatible with %1 generic association types">;
9736
9737
9738// Blocks
9739def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
9740  " or %select{pick a deployment target that supports them|for OpenCL C 2.0"
9741  " or OpenCL C 3.0 with __opencl_c_device_enqueue feature}0">;
9742def err_block_returning_array_function : Error<
9743  "block cannot return %select{array|function}0 type %1">;
9744
9745// Builtin annotation
9746def err_builtin_annotation_first_arg : Error<
9747  "first argument to __builtin_annotation must be an integer">;
9748def err_builtin_annotation_second_arg : Error<
9749  "second argument to __builtin_annotation must be a non-wide string constant">;
9750def err_msvc_annotation_wide_str : Error<
9751  "arguments to __annotation must be wide string constants">;
9752
9753// CFString checking
9754def err_cfstring_literal_not_string_constant : Error<
9755  "CFString literal is not a string constant">;
9756def warn_cfstring_truncated : Warning<
9757  "input conversion stopped due to an input byte that does not "
9758  "belong to the input codeset UTF-8">,
9759  InGroup<DiagGroup<"CFString-literal">>;
9760
9761// os_log checking
9762// TODO: separate diagnostic for os_trace()
9763def err_os_log_format_not_string_constant : Error<
9764  "os_log() format argument is not a string constant">;
9765def err_os_log_argument_too_big : Error<
9766  "os_log() argument %0 is too big (%1 bytes, max %2)">;
9767def warn_os_log_format_narg : Error<
9768 "os_log() '%%n' format specifier is not allowed">, DefaultError;
9769
9770// Statements.
9771def err_continue_not_in_loop : Error<
9772  "'continue' statement not in loop statement">;
9773def err_break_not_in_loop_or_switch : Error<
9774  "'break' statement not in loop or switch statement">;
9775def warn_loop_ctrl_binds_to_inner : Warning<
9776  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
9777  InGroup<GccCompat>;
9778def warn_break_binds_to_switch : Warning<
9779  "'break' is bound to loop, GCC binds it to switch">,
9780  InGroup<GccCompat>;
9781def err_default_not_in_switch : Error<
9782  "'default' statement not in switch statement">;
9783def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
9784def warn_bool_switch_condition : Warning<
9785  "switch condition has boolean value">, InGroup<SwitchBool>;
9786def warn_case_value_overflow : Warning<
9787  "overflow converting case value to switch condition type (%0 to %1)">,
9788  InGroup<Switch>;
9789def err_duplicate_case : Error<"duplicate case value '%0'">;
9790def err_duplicate_case_differing_expr : Error<
9791  "duplicate case value: '%0' and '%1' both equal '%2'">;
9792def warn_case_empty_range : Warning<"empty case range specified">;
9793def warn_missing_case_for_condition :
9794  Warning<"no case matching constant switch condition '%0'">;
9795
9796def warn_def_missing_case : Warning<"%plural{"
9797  "1:enumeration value %1 not explicitly handled in switch|"
9798  "2:enumeration values %1 and %2 not explicitly handled in switch|"
9799  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
9800  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
9801  InGroup<SwitchEnum>, DefaultIgnore;
9802
9803def warn_missing_case : Warning<"%plural{"
9804  "1:enumeration value %1 not handled in switch|"
9805  "2:enumeration values %1 and %2 not handled in switch|"
9806  "3:enumeration values %1, %2, and %3 not handled in switch|"
9807  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
9808  InGroup<Switch>;
9809
9810def warn_unannotated_fallthrough : Warning<
9811  "unannotated fall-through between switch labels">,
9812  InGroup<ImplicitFallthrough>, DefaultIgnore;
9813def warn_unannotated_fallthrough_per_function : Warning<
9814  "unannotated fall-through between switch labels in partly-annotated "
9815  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
9816def note_insert_fallthrough_fixit : Note<
9817  "insert '%0;' to silence this warning">;
9818def note_insert_break_fixit : Note<
9819  "insert 'break;' to avoid fall-through">;
9820def err_fallthrough_attr_wrong_target : Error<
9821  "%0 attribute is only allowed on empty statements">;
9822def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
9823def err_fallthrough_attr_outside_switch : Error<
9824  "fallthrough annotation is outside switch statement">;
9825def err_fallthrough_attr_invalid_placement : Error<
9826  "fallthrough annotation does not directly precede switch label">;
9827
9828def warn_unreachable_default : Warning<
9829  "default label in switch which covers all enumeration values">,
9830  InGroup<CoveredSwitchDefault>, DefaultIgnore;
9831def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
9832  InGroup<Switch>;
9833def warn_not_in_enum_assignment : Warning<"integer constant not in range "
9834  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
9835def err_typecheck_statement_requires_scalar : Error<
9836  "statement requires expression of scalar type (%0 invalid)">;
9837def err_typecheck_statement_requires_integer : Error<
9838  "statement requires expression of integer type (%0 invalid)">;
9839def err_multiple_default_labels_defined : Error<
9840  "multiple default labels in one switch">;
9841def err_switch_multiple_conversions : Error<
9842  "multiple conversions from switch condition type %0 to an integral or "
9843  "enumeration type">;
9844def note_switch_conversion : Note<
9845  "conversion to %select{integral|enumeration}0 type %1">;
9846def err_switch_explicit_conversion : Error<
9847  "switch condition type %0 requires explicit conversion to %1">;
9848def err_switch_incomplete_class_type : Error<
9849  "switch condition has incomplete class type %0">;
9850
9851def warn_empty_if_body : Warning<
9852  "if statement has empty body">, InGroup<EmptyBody>;
9853def warn_empty_for_body : Warning<
9854  "for loop has empty body">, InGroup<EmptyBody>;
9855def warn_empty_range_based_for_body : Warning<
9856  "range-based for loop has empty body">, InGroup<EmptyBody>;
9857def warn_empty_while_body : Warning<
9858  "while loop has empty body">, InGroup<EmptyBody>;
9859def warn_empty_switch_body : Warning<
9860  "switch statement has empty body">, InGroup<EmptyBody>;
9861def note_empty_body_on_separate_line : Note<
9862  "put the semicolon on a separate line to silence this warning">;
9863
9864def err_va_start_captured_stmt : Error<
9865  "'va_start' cannot be used in a captured statement">;
9866def err_va_start_outside_function : Error<
9867  "'va_start' cannot be used outside a function">;
9868def err_va_start_fixed_function : Error<
9869  "'va_start' used in function with fixed args">;
9870def err_va_start_used_in_wrong_abi_function : Error<
9871  "'va_start' used in %select{System V|Win64}0 ABI function">;
9872def err_ms_va_start_used_in_sysv_function : Error<
9873  "'__builtin_ms_va_start' used in System V ABI function">;
9874def warn_second_arg_of_va_start_not_last_named_param : Warning<
9875  "second argument to 'va_start' is not the last named parameter">,
9876  InGroup<Varargs>;
9877def warn_c17_compat_ellipsis_only_parameter : Warning<
9878  "'...' as the only parameter of a function is incompatible with C standards "
9879  "before C2x">, DefaultIgnore, InGroup<CPre2xCompat>;
9880def warn_va_start_type_is_undefined : Warning<
9881  "passing %select{an object that undergoes default argument promotion|"
9882  "an object of reference type|a parameter declared with the 'register' "
9883  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
9884def err_first_argument_to_va_arg_not_of_type_va_list : Error<
9885  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
9886def err_second_parameter_to_va_arg_incomplete: Error<
9887  "second argument to 'va_arg' is of incomplete type %0">;
9888def err_second_parameter_to_va_arg_abstract: Error<
9889  "second argument to 'va_arg' is of abstract type %0">;
9890def warn_second_parameter_to_va_arg_not_pod : Warning<
9891  "second argument to 'va_arg' is of non-POD type %0">,
9892  InGroup<NonPODVarargs>, DefaultError;
9893def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
9894  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
9895  InGroup<NonPODVarargs>, DefaultError;
9896def warn_second_parameter_to_va_arg_never_compatible : Warning<
9897  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
9898  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
9899
9900def warn_return_missing_expr : Warning<
9901  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9902  InGroup<ReturnType>;
9903def ext_return_missing_expr : ExtWarn<
9904  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9905  InGroup<ReturnType>;
9906def ext_return_has_expr : ExtWarn<
9907  "%select{void function|void method|constructor|destructor}1 %0 "
9908  "should not return a value">,
9909  DefaultError, InGroup<ReturnType>;
9910def ext_return_has_void_expr : Extension<
9911  "void %select{function|method|block}1 %0 should not return void expression">;
9912def err_return_init_list : Error<
9913  "%select{void function|void method|constructor|destructor}1 %0 "
9914  "must not return a value">;
9915def err_ctor_dtor_returns_void : Error<
9916  "%select{constructor|destructor}1 %0 must not return void expression">;
9917def warn_noreturn_function_has_return_expr : Warning<
9918  "function %0 declared 'noreturn' should not return">,
9919  InGroup<InvalidNoreturn>;
9920def warn_falloff_noreturn_function : Warning<
9921  "function declared 'noreturn' should not return">,
9922  InGroup<InvalidNoreturn>;
9923def err_noreturn_block_has_return_expr : Error<
9924  "block declared 'noreturn' should not return">;
9925def err_carries_dependency_missing_on_first_decl : Error<
9926  "%select{function|parameter}0 declared '[[carries_dependency]]' "
9927  "after its first declaration">;
9928def note_carries_dependency_missing_first_decl : Note<
9929  "declaration missing '[[carries_dependency]]' attribute is here">;
9930def err_carries_dependency_param_not_function_decl : Error<
9931  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
9932  "declaration or lambda">;
9933def err_block_on_nonlocal : Error<
9934  "__block attribute not allowed, only allowed on local variables">;
9935def err_block_on_vm : Error<
9936  "__block attribute not allowed on declaration with a variably modified type">;
9937def err_sizeless_nonlocal : Error<
9938  "non-local variable with sizeless type %0">;
9939
9940def err_vec_builtin_non_vector : Error<
9941 "first two arguments to %0 must be vectors">;
9942def err_vec_builtin_incompatible_vector : Error<
9943  "first two arguments to %0 must have the same type">;
9944def err_vsx_builtin_nonconstant_argument : Error<
9945  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
9946
9947def err_shufflevector_nonconstant_argument : Error<
9948  "index for __builtin_shufflevector must be a constant integer">;
9949def err_shufflevector_argument_too_large : Error<
9950  "index for __builtin_shufflevector must be less than the total number "
9951  "of vector elements">;
9952
9953def err_convertvector_non_vector : Error<
9954  "first argument to __builtin_convertvector must be a vector">;
9955def err_convertvector_non_vector_type : Error<
9956  "second argument to __builtin_convertvector must be a vector type">;
9957def err_convertvector_incompatible_vector : Error<
9958  "first two arguments to __builtin_convertvector must have the same number of elements">;
9959
9960def err_first_argument_to_cwsc_not_call : Error<
9961  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
9962def err_first_argument_to_cwsc_block_call : Error<
9963  "first argument to __builtin_call_with_static_chain must not be a block call">;
9964def err_first_argument_to_cwsc_builtin_call : Error<
9965  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
9966def err_first_argument_to_cwsc_pdtor_call : Error<
9967  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
9968def err_second_argument_to_cwsc_not_pointer : Error<
9969  "second argument to __builtin_call_with_static_chain must be of pointer type">;
9970
9971def err_vector_incorrect_num_initializers : Error<
9972  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
9973def err_altivec_empty_initializer : Error<"expected initializer">;
9974
9975def err_invalid_neon_type_code : Error<
9976  "incompatible constant for this __builtin_neon function">;
9977def err_argument_invalid_range : Error<
9978  "argument value %0 is outside the valid range [%1, %2]">;
9979def warn_argument_invalid_range : Warning<
9980  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
9981  InGroup<DiagGroup<"argument-outside-range">>;
9982def warn_argument_undefined_behaviour : Warning<
9983  "argument value %0 will result in undefined behaviour">,
9984  InGroup<DiagGroup<"argument-undefined-behaviour">>;
9985def err_argument_not_multiple : Error<
9986  "argument should be a multiple of %0">;
9987def err_argument_not_power_of_2 : Error<
9988  "argument should be a power of 2">;
9989def err_argument_not_shifted_byte : Error<
9990  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
9991def err_argument_not_shifted_byte_or_xxff : Error<
9992  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9993def err_argument_not_contiguous_bit_field : Error<
9994  "argument %0 value should represent a contiguous bit field">;
9995def err_rotation_argument_to_cadd : Error<
9996  "argument should be the value 90 or 270">;
9997def err_rotation_argument_to_cmla : Error<
9998  "argument should be the value 0, 90, 180 or 270">;
9999def warn_neon_vector_initializer_non_portable : Warning<
10000  "vector initializers are not compatible with NEON intrinsics in big endian "
10001  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
10002def note_neon_vector_initializer_non_portable : Note<
10003  "consider using vld1_%0%1() to initialize a vector from memory, or "
10004  "vcreate_%0%1() to initialize from an integer constant">;
10005def note_neon_vector_initializer_non_portable_q : Note<
10006  "consider using vld1q_%0%1() to initialize a vector from memory, or "
10007  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
10008  "constants">;
10009def err_systemz_invalid_tabort_code : Error<
10010  "invalid transaction abort code">;
10011def err_64_bit_builtin_32_bit_tgt : Error<
10012  "this builtin is only available on 64-bit targets">;
10013def err_32_bit_builtin_64_bit_tgt : Error<
10014  "this builtin is only available on 32-bit targets">;
10015def err_builtin_x64_aarch64_only : Error<
10016  "this builtin is only available on x86-64 and aarch64 targets">;
10017def err_mips_builtin_requires_dsp : Error<
10018  "this builtin requires 'dsp' ASE, please use -mdsp">;
10019def err_mips_builtin_requires_dspr2 : Error<
10020  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
10021def err_mips_builtin_requires_msa : Error<
10022  "this builtin requires 'msa' ASE, please use -mmsa">;
10023def err_ppc_builtin_only_on_arch : Error<
10024  "this builtin is only valid on POWER%0 or later CPUs">;
10025def err_ppc_builtin_requires_vsx : Error<
10026  "this builtin requires VSX to be enabled">;
10027def err_ppc_builtin_requires_htm : Error<
10028  "this builtin requires HTM to be enabled">;
10029def err_ppc_builtin_requires_abi : Error<
10030  "this builtin requires ABI -mabi=%0">;
10031def err_ppc_invalid_use_mma_type : Error<
10032  "invalid use of PPC MMA type">;
10033def err_ppc_invalid_test_data_class_type : Error<
10034  "expected a 'float', 'double' or '__float128' for the first argument">;
10035def err_x86_builtin_invalid_rounding : Error<
10036  "invalid rounding argument">;
10037def err_x86_builtin_invalid_scale : Error<
10038  "scale argument must be 1, 2, 4, or 8">;
10039def err_x86_builtin_tile_arg_duplicate : Error<
10040  "tile arguments must refer to different tiles">;
10041
10042def err_builtin_target_unsupported : Error<
10043  "builtin is not supported on this target">;
10044def err_builtin_longjmp_unsupported : Error<
10045  "__builtin_longjmp is not supported for the current target">;
10046def err_builtin_setjmp_unsupported : Error<
10047  "__builtin_setjmp is not supported for the current target">;
10048
10049def err_builtin_longjmp_invalid_val : Error<
10050  "argument to __builtin_longjmp must be a constant 1">;
10051def err_builtin_requires_language : Error<"'%0' is only available in %1">;
10052
10053def err_constant_integer_arg_type : Error<
10054  "argument to %0 must be a constant integer">;
10055
10056def ext_mixed_decls_code : Extension<
10057  "mixing declarations and code is a C99 extension">,
10058  InGroup<DeclarationAfterStatement>;
10059def warn_mixed_decls_code : Warning<
10060  "mixing declarations and code is incompatible with standards before C99">,
10061  InGroup<DeclarationAfterStatement>, DefaultIgnore;
10062
10063def err_non_local_variable_decl_in_for : Error<
10064  "declaration of non-local variable in 'for' loop">;
10065def err_non_variable_decl_in_for : Error<
10066  "non-variable declaration in 'for' loop">;
10067def err_toomany_element_decls : Error<
10068  "only one element declaration is allowed">;
10069def err_selector_element_not_lvalue : Error<
10070  "selector element is not a valid lvalue">;
10071def err_selector_element_type : Error<
10072  "selector element type %0 is not a valid object">;
10073def err_selector_element_const_type : Error<
10074  "selector element of type %0 cannot be a constant lvalue expression">;
10075def err_collection_expr_type : Error<
10076  "the type %0 is not a pointer to a fast-enumerable object">;
10077def warn_collection_expr_type : Warning<
10078  "collection expression type %0 may not respond to %1">;
10079
10080def err_invalid_conversion_between_ext_vectors : Error<
10081  "invalid conversion between ext-vector type %0 and %1">;
10082
10083def warn_duplicate_attribute_exact : Warning<
10084  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
10085
10086def warn_duplicate_attribute : Warning<
10087  "attribute %0 is already applied with different arguments">,
10088  InGroup<IgnoredAttributes>;
10089def err_disallowed_duplicate_attribute : Error<
10090  "attribute %0 cannot appear more than once on a declaration">;
10091
10092def warn_sync_fetch_and_nand_semantics_change : Warning<
10093  "the semantics of this intrinsic changed with GCC "
10094  "version 4.4 - the newer semantics are provided here">,
10095  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
10096
10097// Type
10098def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
10099  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
10100def warn_receiver_forward_class : Warning<
10101  "receiver %0 is a forward class and corresponding @interface may not exist">,
10102  InGroup<ForwardClassReceiver>;
10103def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
10104def ext_missing_type_specifier : ExtWarn<
10105  "type specifier missing, defaults to 'int'; ISO C99 and later do not support "
10106  "implicit int">, InGroup<ImplicitInt>, DefaultError;
10107def err_missing_type_specifier : Error<
10108  "a type specifier is required for all declarations">;
10109def err_decimal_unsupported : Error<
10110  "GNU decimal type extension not supported">;
10111def err_objc_array_of_interfaces : Error<
10112  "array of interface %0 is invalid (probably should be an array of pointers)">;
10113def ext_c99_array_usage : Extension<
10114  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
10115  "feature">, InGroup<C99>;
10116def err_c99_array_usage_cxx : Error<
10117  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
10118  "feature, not permitted in C++">;
10119def err_type_unsupported : Error<
10120  "%0 is not supported on this target">;
10121def err_nsconsumed_attribute_mismatch : Error<
10122  "overriding method has mismatched ns_consumed attribute on its"
10123  " parameter">;
10124def err_nsreturns_retained_attribute_mismatch : Error<
10125  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
10126  " attributes">;
10127def err_nserrordomain_invalid_decl : Error<
10128  "domain argument %select{|%1 }0does not refer to global constant">;
10129def err_nserrordomain_wrong_type : Error<
10130  "domain argument %0 does not point to an NSString or CFString constant">;
10131
10132def warn_nsconsumed_attribute_mismatch : Warning<
10133  err_nsconsumed_attribute_mismatch.Summary>, InGroup<NSConsumedMismatch>;
10134def warn_nsreturns_retained_attribute_mismatch : Warning<
10135  err_nsreturns_retained_attribute_mismatch.Summary>, InGroup<NSReturnsMismatch>;
10136
10137def note_getter_unavailable : Note<
10138  "or because setter is declared here, but no getter method %0 is found">;
10139def err_invalid_protocol_qualifiers : Error<
10140  "invalid protocol qualifiers on non-ObjC type">;
10141def warn_ivar_use_hidden : Warning<
10142  "local declaration of %0 hides instance variable">,
10143   InGroup<ShadowIvar>;
10144def warn_direct_initialize_call : Warning<
10145  "explicit call to +initialize results in duplicate call to +initialize">,
10146   InGroup<ExplicitInitializeCall>;
10147def warn_direct_super_initialize_call : Warning<
10148  "explicit call to [super initialize] should only be in implementation "
10149  "of +initialize">,
10150   InGroup<ExplicitInitializeCall>;
10151def err_ivar_use_in_class_method : Error<
10152  "instance variable %0 accessed in class method">;
10153def err_private_ivar_access : Error<"instance variable %0 is private">,
10154  AccessControl;
10155def err_protected_ivar_access : Error<"instance variable %0 is protected">,
10156  AccessControl;
10157def warn_maynot_respond : Warning<"%0 may not respond to %1">;
10158def ext_typecheck_base_super : Warning<
10159  "method parameter type "
10160  "%diff{$ does not match super class method parameter type $|"
10161  "does not match super class method parameter type}0,1">,
10162   InGroup<SuperSubClassMismatch>, DefaultIgnore;
10163def warn_missing_method_return_type : Warning<
10164  "method has no return type specified; defaults to 'id'">,
10165  InGroup<MissingMethodReturnType>, DefaultIgnore;
10166def warn_direct_ivar_access : Warning<"instance variable %0 is being "
10167  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
10168
10169// Spell-checking diagnostics
10170def err_unknown_typename : Error<
10171  "unknown type name %0">;
10172def err_unknown_type_or_class_name_suggest : Error<
10173  "unknown %select{type|class}1 name %0; did you mean %2?">;
10174def err_unknown_typename_suggest : Error<
10175  "unknown type name %0; did you mean %1?">;
10176def err_unknown_nested_typename_suggest : Error<
10177  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
10178def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
10179def err_undeclared_use_suggest : Error<
10180  "use of undeclared %0; did you mean %1?">;
10181def err_undeclared_var_use_suggest : Error<
10182  "use of undeclared identifier %0; did you mean %1?">;
10183def err_no_template : Error<"no template named %0">;
10184def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
10185def err_no_member_template : Error<"no template named %0 in %1">;
10186def err_no_member_template_suggest : Error<
10187  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
10188def err_non_template_in_template_id : Error<
10189  "%0 does not name a template but is followed by template arguments">;
10190def err_non_template_in_template_id_suggest : Error<
10191  "%0 does not name a template but is followed by template arguments; "
10192  "did you mean %1?">;
10193def err_non_template_in_member_template_id_suggest : Error<
10194  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
10195def note_non_template_in_template_id_found : Note<
10196  "non-template declaration found by name lookup">;
10197def err_mem_init_not_member_or_class_suggest : Error<
10198  "initializer %0 does not name a non-static data member or base "
10199  "class; did you mean the %select{base class|member}1 %2?">;
10200def err_field_designator_unknown_suggest : Error<
10201  "field designator %0 does not refer to any field in type %1; did you mean "
10202  "%2?">;
10203def err_typecheck_member_reference_ivar_suggest : Error<
10204  "%0 does not have a member named %1; did you mean %2?">;
10205def err_property_not_found_suggest : Error<
10206  "property %0 not found on object of type %1; did you mean %2?">;
10207def err_class_property_found : Error<
10208  "property %0 is a class property; did you mean to access it with class '%1'?">;
10209def err_ivar_access_using_property_syntax_suggest : Error<
10210  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
10211def warn_property_access_suggest : Warning<
10212"property %0 not found on object of type %1; did you mean to access property %2?">,
10213InGroup<PropertyAccessDotSyntax>;
10214def err_property_found_suggest : Error<
10215  "property %0 found on object of type %1; did you mean to access "
10216  "it with the \".\" operator?">;
10217def err_undef_interface_suggest : Error<
10218  "cannot find interface declaration for %0; did you mean %1?">;
10219def warn_undef_interface_suggest : Warning<
10220  "cannot find interface declaration for %0; did you mean %1?">;
10221def err_undef_superclass_suggest : Error<
10222  "cannot find interface declaration for %0, superclass of %1; did you mean "
10223  "%2?">;
10224def err_undeclared_protocol_suggest : Error<
10225  "cannot find protocol declaration for %0; did you mean %1?">;
10226def note_base_class_specified_here : Note<
10227  "base class %0 specified here">;
10228def err_using_directive_suggest : Error<
10229  "no namespace named %0; did you mean %1?">;
10230def err_using_directive_member_suggest : Error<
10231  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
10232def note_namespace_defined_here : Note<"namespace %0 defined here">;
10233def err_sizeof_pack_no_pack_name_suggest : Error<
10234  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
10235def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
10236
10237def err_uncasted_use_of_unknown_any : Error<
10238  "%0 has unknown type; cast it to its declared type to use it">;
10239def err_uncasted_call_of_unknown_any : Error<
10240  "%0 has unknown return type; cast the call to its declared return type">;
10241def err_uncasted_send_to_unknown_any_method : Error<
10242  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
10243  "message send to the method's return type">;
10244def err_unsupported_unknown_any_decl : Error<
10245  "%0 has unknown type, which is not supported for this kind of declaration">;
10246def err_unsupported_unknown_any_expr : Error<
10247  "unsupported expression with unknown type">;
10248def err_unsupported_unknown_any_call : Error<
10249  "call to unsupported expression with unknown type">;
10250def err_unknown_any_addrof : Error<
10251  "the address of a declaration with unknown type "
10252  "can only be cast to a pointer type">;
10253def err_unknown_any_addrof_call : Error<
10254  "address-of operator cannot be applied to a call to a function with "
10255  "unknown return type">;
10256def err_unknown_any_var_function_type : Error<
10257  "variable %0 with unknown type cannot be given a function type">;
10258def err_unknown_any_function : Error<
10259  "function %0 with unknown type must be given a function type">;
10260
10261def err_filter_expression_integral : Error<
10262  "filter expression has non-integral type %0">;
10263
10264def err_non_asm_stmt_in_naked_function : Error<
10265  "non-ASM statement in naked function is not supported">;
10266def err_asm_naked_this_ref : Error<
10267  "'this' pointer references not allowed in naked functions">;
10268def err_asm_naked_parm_ref : Error<
10269  "parameter references not allowed in naked functions">;
10270
10271// OpenCL warnings and errors.
10272def err_invalid_astype_of_different_size : Error<
10273  "invalid reinterpretation: sizes of %0 and %1 must match">;
10274def err_static_kernel : Error<
10275  "kernel functions cannot be declared static">;
10276def err_method_kernel : Error<
10277  "kernel functions cannot be class members">;
10278def err_template_kernel : Error<
10279  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
10280def err_opencl_ptrptr_kernel_param : Error<
10281  "kernel parameter cannot be declared as a pointer to a pointer">;
10282def err_kernel_arg_address_space : Error<
10283  "pointer arguments to kernel functions must reside in '__global', "
10284  "'__constant' or '__local' address space">;
10285def err_opencl_ext_vector_component_invalid_length : Error<
10286  "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
10287def err_opencl_function_variable : Error<
10288  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
10289def err_opencl_addrspace_scope : Error<
10290  "variables in the %0 address space can only be declared in the outermost "
10291  "scope of a kernel function">;
10292def err_static_function_scope : Error<
10293  "variables in function scope cannot be declared static">;
10294def err_opencl_bitfields : Error<
10295  "bit-fields are not supported in OpenCL">;
10296def err_opencl_vla : Error<
10297  "variable length arrays are not supported in OpenCL">;
10298def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
10299    "scalar operand type has greater rank than the type of the vector "
10300    "element. (%0 and %1)">;
10301def err_bad_kernel_param_type : Error<
10302  "%0 cannot be used as the type of a kernel parameter">;
10303def err_record_with_pointers_kernel_param : Error<
10304  "%select{struct|union}0 kernel parameters may not contain pointers">;
10305def note_within_field_of_type : Note<
10306  "within field of type %0 declared here">;
10307def note_illegal_field_declared_here : Note<
10308  "field of illegal %select{type|pointer type}0 %1 declared here">;
10309def err_opencl_type_struct_or_union_field : Error<
10310  "the %0 type cannot be used to declare a structure or union field">;
10311def err_event_t_addr_space_qual : Error<
10312  "the event_t type can only be used with __private address space qualifier">;
10313def err_expected_kernel_void_return_type : Error<
10314  "kernel must have void return type">;
10315def err_sampler_initializer_not_integer : Error<
10316  "sampler_t initialization requires 32-bit integer, not %0">;
10317def warn_sampler_initializer_invalid_bits : Warning<
10318  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
10319def err_sampler_argument_required : Error<
10320  "sampler_t variable required - got %0">;
10321def err_wrong_sampler_addressspace: Error<
10322  "sampler type cannot be used with the __local and __global address space qualifiers">;
10323def err_opencl_nonconst_global_sampler : Error<
10324  "global sampler requires a const or constant address space qualifier">;
10325def err_opencl_cast_non_zero_to_event_t : Error<
10326  "cannot cast non-zero value '%0' to 'event_t'">;
10327def err_opencl_global_invalid_addr_space : Error<
10328  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
10329def err_missing_actual_pipe_type : Error<
10330  "missing actual type specifier for pipe">;
10331def err_reference_pipe_type : Error <
10332  "pipes packet types cannot be of reference type">;
10333def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
10334def err_opencl_kernel_attr :
10335  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
10336def err_return_value_with_address_space : Error<
10337  "return type cannot be qualified with address space">;
10338def err_opencl_constant_no_init : Error<
10339  "variable in constant address space must be initialized">;
10340def err_opencl_atomic_init: Error<
10341  "atomic variable can be %select{assigned|initialized}0 to a variable only "
10342  "in global address space">;
10343def err_opencl_implicit_vector_conversion : Error<
10344  "implicit conversions between vector types (%0 and %1) are not permitted">;
10345def err_opencl_invalid_type_array : Error<
10346  "array of %0 type is invalid in OpenCL">;
10347def err_opencl_ternary_with_block : Error<
10348  "block type cannot be used as expression in ternary expression in OpenCL">;
10349def err_opencl_pointer_to_type : Error<
10350  "pointer to type %0 is invalid in OpenCL">;
10351def err_opencl_type_can_only_be_used_as_function_parameter : Error <
10352  "type %0 can only be used as a function parameter in OpenCL">;
10353def err_opencl_type_not_found : Error<
10354  "%0 type %1 not found; include the base header with -finclude-default-header">;
10355def warn_opencl_attr_deprecated_ignored : Warning <
10356  "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>;
10357def err_opencl_variadic_function : Error<
10358  "invalid prototype, variadic arguments are not allowed in OpenCL">;
10359def err_opencl_requires_extension : Error<
10360  "use of %select{type|declaration}0 %1 requires %2 support">;
10361def ext_opencl_double_without_pragma : Extension<
10362  "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
10363  " supported">;
10364def warn_opencl_generic_address_space_arg : Warning<
10365  "passing non-generic address space pointer to %0"
10366  " may cause dynamic conversion affecting performance">,
10367  InGroup<Conversion>, DefaultIgnore;
10368
10369// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
10370def err_opencl_builtin_pipe_first_arg : Error<
10371  "first argument to %0 must be a pipe type">;
10372def err_opencl_builtin_pipe_arg_num : Error<
10373  "invalid number of arguments to function: %0">;
10374def err_opencl_builtin_pipe_invalid_arg : Error<
10375  "invalid argument type to function %0 (expecting %1 having %2)">;
10376def err_opencl_builtin_pipe_invalid_access_modifier : Error<
10377  "invalid pipe access modifier (expecting %0)">;
10378
10379// OpenCL access qualifier
10380def err_opencl_invalid_access_qualifier : Error<
10381  "access qualifier can only be used for pipe and image type">;
10382def err_opencl_invalid_read_write : Error<
10383  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 "
10384  "and without __opencl_c_read_write_images feature}2">;
10385def err_opencl_multiple_access_qualifiers : Error<
10386  "multiple access qualifiers">;
10387def note_opencl_typedef_access_qualifier : Note<
10388  "previously declared '%0' here">;
10389
10390// OpenCL v2.0 s6.12.5 Blocks restrictions
10391def err_opencl_block_storage_type : Error<
10392  "the __block storage type is not permitted">;
10393def err_opencl_invalid_block_declaration : Error<
10394  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
10395def err_opencl_extern_block_declaration : Error<
10396  "invalid block variable declaration - using 'extern' storage class is disallowed">;
10397def err_opencl_block_ref_block : Error<
10398  "cannot refer to a block inside block">;
10399
10400// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
10401def err_opencl_builtin_to_addr_invalid_arg : Error<
10402  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
10403
10404// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
10405def err_opencl_enqueue_kernel_incorrect_args : Error<
10406  "illegal call to enqueue_kernel, incorrect argument types">;
10407def err_opencl_enqueue_kernel_local_size_args : Error<
10408  "mismatch in number of block parameters and local size arguments passed">;
10409def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
10410  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
10411def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
10412  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
10413def err_opencl_enqueue_kernel_blocks_no_args : Error<
10414  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
10415
10416def err_opencl_builtin_expected_type : Error<
10417  "illegal call to %0, expected %1 argument type">;
10418
10419// OpenCL v3.0 s6.3.7 - Vector Components
10420def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
10421  "vector component name '%0' is a feature from OpenCL version 3.0 onwards">,
10422  InGroup<OpenCLUnsupportedRGBA>;
10423
10424def err_openclcxx_placement_new : Error<
10425  "use of placement new requires explicit declaration">;
10426
10427// MIG routine annotations.
10428def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
10429  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
10430  InGroup<IgnoredAttributes>;
10431
10432def warn_imp_cast_drops_unaligned : Warning<
10433  "implicit cast from type %0 to type %1 drops __unaligned qualifier">,
10434  InGroup<DiagGroup<"unaligned-qualifier-implicit-cast">>;
10435
10436} // end of sema category
10437
10438let CategoryName = "OpenMP Issue" in {
10439// OpenMP support.
10440def err_omp_expected_var_arg : Error<
10441  "%0 is not a global variable, static local variable or static data member">;
10442def err_omp_expected_var_arg_suggest : Error<
10443  "%0 is not a global variable, static local variable or static data member; "
10444  "did you mean %1">;
10445def err_omp_global_var_arg : Error<
10446  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
10447def err_omp_ref_type_arg : Error<
10448  "arguments of '#pragma omp %0' cannot be of reference type %1">;
10449def err_omp_region_not_file_context : Error<
10450  "directive must be at file or namespace scope">;
10451def err_omp_var_scope : Error<
10452  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
10453def err_omp_var_used : Error<
10454  "'#pragma omp %0' must precede all references to variable %q1">;
10455def err_omp_var_thread_local : Error<
10456  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
10457def err_omp_private_incomplete_type : Error<
10458  "a private variable with incomplete type %0">;
10459def err_omp_firstprivate_incomplete_type : Error<
10460  "a firstprivate variable with incomplete type %0">;
10461def err_omp_lastprivate_incomplete_type : Error<
10462  "a lastprivate variable with incomplete type %0">;
10463def err_omp_reduction_incomplete_type : Error<
10464  "a reduction list item with incomplete type %0">;
10465def err_omp_unexpected_clause_value : Error<
10466  "expected %0 in OpenMP clause '%1'">;
10467def err_omp_unexpected_call_to_omp_runtime_api
10468    : Error<"calls to OpenMP runtime API are not allowed within a region that "
10469            "corresponds to a construct with an order clause that specifies "
10470            "concurrent">;
10471def err_omp_expected_var_name_member_expr : Error<
10472  "expected variable name%select{| or data member of current class}0">;
10473def err_omp_expected_var_name_member_expr_with_type : Error<
10474  "expected variable%select{| or static data member|, static data member, "
10475  "or non-static data member of current class}0 of type '%1'">;
10476def err_omp_expected_var_name_member_expr_or_array_item : Error<
10477  "expected variable name%select{|, data member of current class}0, array element or array section">;
10478def err_omp_expected_addressable_lvalue_or_array_item : Error<
10479  "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">;
10480def err_omp_expected_named_var_member_or_array_expression: Error<
10481  "expected expression containing only member accesses and/or array sections based on named variables">;
10482def err_omp_bit_fields_forbidden_in_clause : Error<
10483  "bit fields cannot be used to specify storage in a '%0' clause">;
10484def err_array_section_does_not_specify_contiguous_storage : Error<
10485  "array section does not specify contiguous storage">;
10486def err_array_section_does_not_specify_length : Error<
10487  "array section does not specify length for outermost dimension">;
10488def err_omp_union_type_not_allowed : Error<
10489  "mapping of union members is not allowed">;
10490def err_omp_expected_access_to_data_field : Error<
10491  "expected access to data field">;
10492def err_omp_multiple_array_items_in_map_clause : Error<
10493  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
10494def err_omp_duplicate_map_type_modifier : Error<
10495  "same map type modifier has been specified more than once">;
10496def err_omp_duplicate_motion_modifier : Error<
10497  "same motion modifier has been specified more than once">;
10498def err_omp_pointer_mapped_along_with_derived_section : Error<
10499  "pointer cannot be mapped along with a section derived from itself">;
10500def err_omp_original_storage_is_shared_and_does_not_contain : Error<
10501  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
10502def err_omp_same_pointer_dereferenced : Error<
10503  "same pointer dereferenced in multiple different ways in map clause expressions">;
10504def note_omp_task_predetermined_firstprivate_here : Note<
10505  "predetermined as a firstprivate in a task construct here">;
10506def err_omp_threadprivate_incomplete_type : Error<
10507  "threadprivate variable with incomplete type %0">;
10508def err_omp_no_dsa_for_variable : Error<
10509  "variable %0 must have explicitly specified data sharing attributes">;
10510def err_omp_defaultmap_no_attr_for_variable : Error<
10511  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
10512def note_omp_default_dsa_none : Note<
10513  "explicit data sharing attribute requested here">;
10514def note_omp_defaultmap_attr_none : Note<
10515  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
10516def err_omp_wrong_dsa : Error<
10517  "%0 variable cannot be %1">;
10518def err_omp_variably_modified_type_not_supported : Error<
10519  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
10520def note_omp_explicit_dsa : Note<
10521  "defined as %0">;
10522def note_omp_predetermined_dsa : Note<
10523  "%select{static data member is predetermined as shared|"
10524  "variable with static storage duration is predetermined as shared|"
10525  "loop iteration variable is predetermined as private|"
10526  "loop iteration variable is predetermined as linear|"
10527  "loop iteration variable is predetermined as lastprivate|"
10528  "constant variable is predetermined as shared|"
10529  "global variable is predetermined as shared|"
10530  "non-shared variable in a task construct is predetermined as firstprivate|"
10531  "variable with automatic storage duration is predetermined as private}0"
10532  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
10533def note_omp_implicit_dsa : Note<
10534  "implicitly determined as %0">;
10535def err_omp_loop_var_dsa : Error<
10536  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
10537def err_omp_not_for : Error<
10538  "%select{statement after '#pragma omp %1' must be a for loop|"
10539  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
10540def note_omp_collapse_ordered_expr : Note<
10541  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
10542def err_omp_negative_expression_in_clause : Error<
10543  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
10544def err_omp_not_integral : Error<
10545  "expression must have integral or unscoped enumeration "
10546  "type, not %0">;
10547def err_omp_threadprivate_in_target : Error<
10548  "threadprivate variables cannot be used in target constructs">;
10549def err_omp_incomplete_type : Error<
10550  "expression has incomplete class type %0">;
10551def err_omp_explicit_conversion : Error<
10552  "expression requires explicit conversion from %0 to %1">;
10553def note_omp_conversion_here : Note<
10554  "conversion to %select{integral|enumeration}0 type %1 declared here">;
10555def err_omp_ambiguous_conversion : Error<
10556  "ambiguous conversion from type %0 to an integral or unscoped "
10557  "enumeration type">;
10558def err_omp_iterator_not_integral_or_pointer : Error<
10559  "expected integral or pointer type as the iterator-type, not %0">;
10560def err_omp_iterator_step_not_integral : Error<
10561  "iterator step expression %0 is not the integral expression">;
10562def err_omp_iterator_step_constant_zero : Error<
10563  "iterator step expression %0 evaluates to 0">;
10564def err_omp_required_access : Error<
10565  "%0 variable must be %1">;
10566def err_omp_const_variable : Error<
10567  "const-qualified variable cannot be %0">;
10568def err_omp_const_not_mutable_variable : Error<
10569  "const-qualified variable without mutable fields cannot be %0">;
10570def err_omp_const_list_item : Error<
10571  "const-qualified list item cannot be %0">;
10572def err_omp_linear_incomplete_type : Error<
10573  "a linear variable with incomplete type %0">;
10574def err_omp_linear_expected_int_or_ptr : Error<
10575  "argument of a linear clause should be of integral or pointer "
10576  "type, not %0">;
10577def warn_omp_linear_step_zero : Warning<
10578  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
10579  InGroup<OpenMPClauses>;
10580def warn_omp_alignment_not_power_of_two : Warning<
10581  "aligned clause will be ignored because the requested alignment is not a power of 2">,
10582  InGroup<OpenMPClauses>;
10583def err_omp_invalid_target_decl : Error<
10584  "%0 used in declare target directive is not a variable or a function name">;
10585def err_omp_declare_target_to_and_link : Error<
10586  "%0 must not appear in both clauses 'to' and 'link'">;
10587def warn_omp_not_in_target_context : Warning<
10588  "declaration is not declared in any declare target region">,
10589  InGroup<OpenMPTarget>;
10590def err_omp_function_in_link_clause : Error<
10591  "function name is not allowed in 'link' clause">;
10592def err_omp_aligned_expected_array_or_ptr : Error<
10593  "argument of aligned clause should be array"
10594  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
10595  ", not %0">;
10596def err_omp_used_in_clause_twice : Error<
10597  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
10598def err_omp_local_var_in_threadprivate_init : Error<
10599  "variable with local storage in initial value of threadprivate variable">;
10600def err_omp_loop_not_canonical_init : Error<
10601  "initialization clause of OpenMP for loop is not in canonical form "
10602  "('var = init' or 'T var = init')">;
10603def ext_omp_loop_not_canonical_init : ExtWarn<
10604  "initialization clause of OpenMP for loop is not in canonical form "
10605  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
10606def err_omp_loop_not_canonical_cond : Error<
10607  "condition of OpenMP for loop must be a relational comparison "
10608  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
10609def err_omp_loop_not_canonical_incr : Error<
10610  "increment clause of OpenMP for loop must perform simple addition "
10611  "or subtraction on loop variable %0">;
10612def err_omp_loop_variable_type : Error<
10613  "variable must be of integer or %select{pointer|random access iterator}0 type">;
10614def err_omp_loop_incr_not_compatible : Error<
10615  "increment expression must cause %0 to %select{decrease|increase}1 "
10616  "on each iteration of OpenMP for loop">;
10617def note_omp_loop_cond_requres_compatible_incr : Note<
10618  "loop step is expected to be %select{negative|positive}0 due to this condition">;
10619def err_omp_loop_diff_cxx : Error<
10620  "could not calculate number of iterations calling 'operator-' with "
10621  "upper and lower loop bounds">;
10622def err_omp_loop_cannot_use_stmt : Error<
10623  "'%0' statement cannot be used in OpenMP for loop">;
10624def err_omp_simd_region_cannot_use_stmt : Error<
10625  "'%0' statement cannot be used in OpenMP simd region">;
10626def warn_omp_loop_64_bit_var : Warning<
10627  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
10628  InGroup<OpenMPLoopForm>;
10629def err_omp_unknown_reduction_identifier : Error<
10630  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
10631  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
10632def err_omp_not_resolved_reduction_identifier : Error<
10633  "unable to resolve declare reduction construct for type %0">;
10634def err_omp_reduction_ref_type_arg : Error<
10635  "argument of OpenMP clause '%0' must reference the same object in all threads">;
10636def err_omp_clause_not_arithmetic_type_arg : Error<
10637  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
10638def err_omp_clause_floating_type_arg : Error<
10639  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
10640def err_omp_once_referenced : Error<
10641  "variable can appear only once in OpenMP '%0' clause">;
10642def err_omp_once_referenced_in_target_update : Error<
10643  "variable can appear only once in OpenMP 'target update' construct">;
10644def note_omp_referenced : Note<
10645  "previously referenced here">;
10646def err_omp_reduction_in_task : Error<
10647  "reduction variables may not be accessed in an explicit task">;
10648def err_omp_reduction_id_not_compatible : Error<
10649  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
10650def err_omp_reduction_identifier_mismatch : Error<
10651  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
10652def note_omp_previous_reduction_identifier : Note<
10653  "previously marked as task_reduction with different reduction operation">;
10654def err_omp_prohibited_region : Error<
10655  "region cannot be%select{| closely}0 nested inside '%1' region"
10656  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
10657  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
10658  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
10659  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
10660  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
10661def err_omp_prohibited_region_simd : Error<
10662  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
10663def err_omp_prohibited_region_atomic : Error<
10664  "OpenMP constructs may not be nested inside an atomic region">;
10665def err_omp_prohibited_region_order
10666    : Error<"construct '%0' not allowed in a region associated with a "
10667            "directive with 'order' clause">;
10668def err_omp_prohibited_region_critical_same_name : Error<
10669  "cannot nest 'critical' regions having the same name %0">;
10670def note_omp_previous_critical_region : Note<
10671  "previous 'critical' region starts here">;
10672def err_omp_several_directives_in_region : Error<
10673  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
10674def note_omp_previous_directive : Note<
10675  "previous '%0' directive used here">;
10676def err_omp_sections_not_compound_stmt : Error<
10677  "the statement for '#pragma omp sections' must be a compound statement">;
10678def err_omp_parallel_sections_not_compound_stmt : Error<
10679  "the statement for '#pragma omp parallel sections' must be a compound statement">;
10680def err_omp_orphaned_section_directive : Error<
10681  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
10682  " must be closely nested to a sections region%select{|, not a %1 region}0">;
10683def err_omp_sections_substmt_not_section : Error<
10684  "statement in 'omp sections' directive must be enclosed into a section region">;
10685def err_omp_parallel_sections_substmt_not_section : Error<
10686  "statement in 'omp parallel sections' directive must be enclosed into a section region">;
10687def err_omp_parallel_reduction_in_task_firstprivate : Error<
10688  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
10689def err_omp_atomic_read_not_expression_statement : Error<
10690  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
10691  " where v and x are both lvalue expressions with scalar type">;
10692def note_omp_atomic_read_write: Note<
10693  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
10694def err_omp_atomic_write_not_expression_statement : Error<
10695  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
10696  " where x is a lvalue expression with scalar type">;
10697def err_omp_atomic_update_not_expression_statement : Error<
10698  "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',"
10699  " where x is an lvalue expression with scalar type">;
10700def err_omp_atomic_not_expression_statement : Error<
10701  "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',"
10702  " where x is an lvalue expression with scalar type">;
10703def note_omp_atomic_update: Note<
10704  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
10705  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
10706  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
10707def err_omp_atomic_capture_not_expression_statement : Error<
10708  "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',"
10709  " where x and v are both lvalue expressions with scalar type">;
10710def err_omp_atomic_capture_not_compound_statement : Error<
10711  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
10712  " '{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;}',"
10713  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
10714  " where x is an lvalue expression with scalar type">;
10715def note_omp_atomic_capture: Note<
10716  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
10717def err_omp_atomic_compare : Error<
10718  "the statement for 'atomic compare' must be a compound statement of form '{x = expr ordop x ? expr : x;}', '{x = x ordop expr? expr : x;}',"
10719  " '{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;}',"
10720  " 'if(e == x) {x = d;}' where 'x' is an lvalue expression with scalar type, 'expr', 'e', and 'd' are expressions with scalar type,"
10721  " and 'ordop' is one of '<' or '>'.">;
10722def err_omp_atomic_compare_capture : Error<
10723  "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;}}',"
10724  " '{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;}',"
10725  " '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,"
10726  " and 'ordop' is one of '<' or '>'.">;
10727def note_omp_atomic_compare: Note<
10728  "%select{expected compound statement|expected exactly one expression statement|expected assignment statement|expected conditional operator|expect result value to be at false expression|"
10729  "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'|"
10730  "expect lvalue for result value|expect scalar value|expect integer value|unexpected 'else' statement|expect '==' operator|expect an assignment statement 'v = x'|"
10731  "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">;
10732def err_omp_atomic_several_clauses : Error<
10733  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update', 'capture', or 'compare' clause">;
10734def err_omp_several_mem_order_clauses : Error<
10735  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
10736def err_omp_atomic_incompatible_mem_order_clause : Error<
10737  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
10738def note_omp_previous_mem_order_clause : Note<
10739  "'%0' clause used here">;
10740def err_omp_target_contains_not_only_teams : Error<
10741  "target construct with nested teams region contains statements outside of the teams construct">;
10742def note_omp_nested_teams_construct_here : Note<
10743  "nested teams construct here">;
10744def note_omp_nested_statement_here : Note<
10745  "%select{statement|directive}0 outside teams construct here">;
10746def err_omp_single_copyprivate_with_nowait : Error<
10747  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
10748def err_omp_nowait_clause_without_depend: Error<
10749  "directive '#pragma omp taskwait' cannot use 'nowait' clause without 'depend' clause">;
10750def note_omp_nowait_clause_here : Note<
10751  "'nowait' clause is here">;
10752def err_omp_single_decl_in_declare_simd_variant : Error<
10753  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
10754def err_omp_function_expected : Error<
10755  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
10756def err_omp_wrong_cancel_region : Error<
10757  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
10758def err_omp_parent_cancel_region_nowait : Error<
10759  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
10760def err_omp_parent_cancel_region_ordered : Error<
10761  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
10762def 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">;
10763def 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">;
10764def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
10765def err_omp_mapper_wrong_type : Error<
10766  "mapper type must be of struct, union or class type">;
10767def err_omp_declare_mapper_wrong_var : Error<
10768  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
10769def err_omp_declare_mapper_redefinition : Error<
10770  "redefinition of user-defined mapper for type %0 with name %1">;
10771def err_omp_invalid_mapper: Error<
10772  "cannot find a valid user-defined mapper for type %0 with name %1">;
10773def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
10774def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
10775def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
10776def err_omp_typecheck_section_value : Error<
10777  "subscripted value is not an array or pointer">;
10778def err_omp_typecheck_section_not_integer : Error<
10779  "array section %select{lower bound|length}0 is not an integer">;
10780def err_omp_typecheck_shaping_not_integer : Error<
10781  "array shaping operation dimension is not an integer">;
10782def err_omp_shaping_dimension_not_positive : Error<
10783  "array shaping dimension is evaluated to a non-positive value %0">;
10784def err_omp_section_function_type : Error<
10785  "section of pointer to function type %0">;
10786def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
10787  InGroup<CharSubscript>, DefaultIgnore;
10788def err_omp_section_incomplete_type : Error<
10789  "section of pointer to incomplete type %0">;
10790def err_omp_section_not_subset_of_array : Error<
10791  "array section must be a subset of the original array">;
10792def err_omp_section_length_negative : Error<
10793  "section length is evaluated to a negative value %0">;
10794def err_omp_section_stride_non_positive : Error<
10795  "section stride is evaluated to a non-positive value %0">;
10796def err_omp_section_length_undefined : Error<
10797  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
10798def err_omp_wrong_linear_modifier : Error<
10799  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
10800def err_omp_wrong_linear_modifier_non_reference : Error<
10801  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
10802def err_omp_wrong_simdlen_safelen_values : Error<
10803  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
10804def err_omp_wrong_if_directive_name_modifier : Error<
10805  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
10806def err_omp_no_more_if_clause : Error<
10807  "no more 'if' clause is allowed">;
10808def err_omp_unnamed_if_clause : Error<
10809  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
10810def note_omp_previous_named_if_clause : Note<
10811  "previous clause with directive name modifier specified here">;
10812def err_omp_ordered_directive_with_param : Error<
10813  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
10814def err_omp_ordered_directive_without_param : Error<
10815  "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
10816def note_omp_ordered_param : Note<
10817  "'ordered' clause%select{| with specified parameter}0">;
10818def err_omp_expected_base_var_name : Error<
10819  "expected variable name as a base of the array %select{subscript|section}0">;
10820def err_omp_map_shared_storage : Error<
10821  "variable already marked as mapped in current construct">;
10822def err_omp_invalid_map_type_for_directive : Error<
10823  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
10824def err_omp_invalid_map_type_modifier_for_directive : Error<
10825  "map type modifier '%0' is not allowed for '#pragma omp %1'">;
10826def err_omp_no_clause_for_directive : Error<
10827  "expected at least one %0 clause for '#pragma omp %1'">;
10828def err_omp_threadprivate_in_clause : Error<
10829  "threadprivate variables are not allowed in '%0' clause">;
10830def err_omp_wrong_ordered_loop_count : Error<
10831  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
10832def note_collapse_loop_count : Note<
10833  "parameter of the 'collapse' clause">;
10834def err_omp_clauses_mutually_exclusive : Error<
10835  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
10836def note_omp_previous_clause : Note<
10837  "'%0' clause is specified here">;
10838def err_omp_hint_clause_no_name : Error<
10839  "the name of the construct must be specified in presence of 'hint' clause">;
10840def err_omp_critical_with_hint : Error<
10841  "constructs with the same name must have a 'hint' clause with the same value">;
10842def note_omp_critical_hint_here : Note<
10843  "%select{|previous }0'hint' clause with value '%1'">;
10844def note_omp_critical_no_hint : Note<
10845  "%select{|previous }0directive with no 'hint' clause specified">;
10846def err_omp_depend_clause_thread_simd : Error<
10847  "'depend' clauses cannot be mixed with '%0' clause">;
10848def err_omp_depend_sink_expected_loop_iteration : Error<
10849  "expected%select{| %1}0 loop iteration variable">;
10850def err_omp_depend_sink_unexpected_expr : Error<
10851  "unexpected expression: number of expressions is larger than the number of associated loops">;
10852def err_omp_depend_sink_expected_plus_minus : Error<
10853  "expected '+' or '-' operation">;
10854def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error<
10855  "'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">;
10856def err_omp_depend_sink_source_not_allowed : Error<
10857  "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
10858def err_omp_depend_zero_length_array_section_not_allowed : Error<
10859  "zero-length array section is not allowed in 'depend' clause">;
10860def err_omp_depend_sink_source_with_modifier : Error<
10861  "depend modifier cannot be used with 'sink' or 'source' depend type">;
10862def err_omp_depend_modifier_not_iterator : Error<
10863  "expected iterator specification as depend modifier">;
10864def err_omp_map_modifier_not_iterator : Error<
10865  "expected iterator specification as map modifier">;
10866def err_omp_linear_ordered : Error<
10867  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
10868def err_omp_unexpected_schedule_modifier : Error<
10869  "modifier '%0' cannot be used along with modifier '%1'">;
10870def err_omp_schedule_nonmonotonic_static : Error<
10871  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
10872def err_omp_simple_clause_incompatible_with_ordered : Error<
10873  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
10874def err_omp_ordered_simd : Error<
10875  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
10876def err_omp_variable_in_given_clause_and_dsa : Error<
10877  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
10878def err_omp_param_or_this_in_clause : Error<
10879  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
10880def err_omp_expected_uniform_param : Error<
10881  "expected a reference to a parameter specified in a 'uniform' clause">;
10882def err_omp_expected_int_param : Error<
10883  "expected a reference to an integer-typed parameter">;
10884def err_omp_at_least_one_motion_clause_required : Error<
10885  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
10886def err_omp_cannot_update_with_internal_linkage : Error<
10887  "the host cannot update a declare target variable that is not externally visible.">;
10888def err_omp_usedeviceptr_not_a_pointer : Error<
10889  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
10890def err_omp_argument_type_isdeviceptr : Error <
10891  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
10892def warn_omp_nesting_simd : Warning<
10893  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
10894  InGroup<SourceUsesOpenMP>;
10895def err_omp_orphaned_device_directive : Error<
10896  "orphaned 'omp %0' directives are prohibited"
10897  "; perhaps you forget to enclose the directive into a "
10898  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
10899def err_omp_reduction_non_addressable_expression : Error<
10900  "expected addressable reduction item for the task-based directives">;
10901def err_omp_reduction_with_nogroup : Error<
10902  "'reduction' clause cannot be used with 'nogroup' clause">;
10903def err_omp_reduction_vla_unsupported : Error<
10904  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
10905def err_omp_linear_distribute_var_non_loop_iteration : Error<
10906  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
10907def warn_omp_non_trivial_type_mapped : Warning<
10908  "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
10909  InGroup<OpenMPMapping>;
10910def err_omp_requires_clause_redeclaration : Error <
10911  "Only one %0 clause can appear on a requires directive in a single translation unit">;
10912def note_omp_requires_previous_clause : Note <
10913  "%0 clause previously used here">;
10914def err_omp_directive_before_requires : Error <
10915  "'%0' region encountered before requires directive with '%1' clause">;
10916def note_omp_requires_encountered_directive : Note <
10917  "'%0' previously encountered here">;
10918def err_omp_device_ancestor_without_requires_reverse_offload : Error <
10919  "Device clause with ancestor device-modifier used without specifying 'requires reverse_offload'">;
10920def err_omp_invalid_scope : Error <
10921  "'#pragma omp %0' directive must appear only in file scope">;
10922def note_omp_invalid_length_on_this_ptr_mapping : Note <
10923  "expected length on mapping of 'this' array section expression to be '1'">;
10924def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
10925  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
10926def note_omp_invalid_subscript_on_this_ptr_map : Note <
10927  "expected 'this' subscript expression on map clause to be 'this[0]'">;
10928def err_omp_invalid_map_this_expr : Error <
10929  "invalid 'this' expression on 'map' clause">;
10930def err_omp_implied_type_not_found : Error<
10931  "'%0' type not found; include <omp.h>">;
10932def err_omp_expected_omp_depend_t_lvalue : Error<
10933  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
10934def err_omp_depobj_expected : Error<
10935  "expected depobj expression">;
10936def err_omp_depobj_single_clause_expected : Error<
10937  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
10938def err_omp_scan_single_clause_expected : Error<
10939  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
10940def err_omp_inclusive_exclusive_not_reduction : Error<
10941  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
10942  "of the parent directive">;
10943def err_omp_reduction_not_inclusive_exclusive : Error<
10944  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
10945  " 'exclusive' clause on an inner 'omp scan' directive">;
10946def err_omp_wrong_inscan_reduction : Error<
10947  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
10948  " 'omp parallel for', or 'omp parallel for simd' directive">;
10949def err_omp_inscan_reduction_expected : Error<
10950  "expected 'reduction' clause with the 'inscan' modifier">;
10951def note_omp_previous_inscan_reduction : Note<
10952  "'reduction' clause with 'inscan' modifier is used here">;
10953def err_omp_expected_predefined_allocator : Error<
10954  "expected one of the predefined allocators for the variables with the static "
10955  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
10956  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
10957  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
10958def warn_omp_used_different_allocator : Warning<
10959  "allocate directive specifies %select{default|'%1'}0 allocator while "
10960  "previously used %select{default|'%3'}2">,
10961  InGroup<OpenMPClauses>;
10962def note_omp_previous_allocator : Note<
10963  "previous allocator is specified here">;
10964def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
10965  "inside of the target region; provide an 'allocator' clause or use 'requires'"
10966  " directive with the 'dynamic_allocators' clause">;
10967def err_expected_allocator_expression : Error<"expected an allocator expression "
10968  "inside of the target region; provide an allocator expression or use 'requires'"
10969  " directive with the 'dynamic_allocators' clause">;
10970def warn_omp_allocate_thread_on_task_target_directive : Warning<
10971  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
10972  InGroup<OpenMPClauses>;
10973def err_omp_expected_private_copy_for_allocate : Error<
10974  "the referenced item is not found in any private clause on the same directive">;
10975def err_omp_stmt_depends_on_loop_counter : Error<
10976  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
10977def err_omp_invariant_dependency : Error<
10978  "expected loop invariant expression">;
10979def err_omp_invariant_or_linear_dependency : Error<
10980  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
10981def err_omp_wrong_dependency_iterator_type : Error<
10982  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
10983def err_target_unsupported_type
10984    : Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support,"
10985            " but target '%5' does not support it">;
10986def err_omp_lambda_capture_in_declare_target_not_to : Error<
10987  "variable captured in declare target region must appear in a to clause">;
10988def err_omp_device_type_mismatch : Error<
10989  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
10990def err_omp_wrong_device_function_call : Error<
10991  "function with 'device_type(%0)' is not available on %select{device|host}1">;
10992def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
10993def warn_omp_declare_target_after_first_use : Warning<
10994  "declaration marked as declare target after first use, it may lead to incorrect results">,
10995  InGroup<OpenMPTarget>;
10996def err_omp_declare_variant_incompat_attributes : Error<
10997  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
10998def warn_omp_declare_variant_score_not_constant
10999    : Warning<"score expressions in the OpenMP context selector need to be "
11000              "constant; %0 is not and will be ignored">,
11001      InGroup<SourceUsesOpenMP>;
11002def err_omp_declare_variant_user_condition_not_constant
11003    : Error<"the user condition in the OpenMP context selector needs to be "
11004            "constant; %0 is not">;
11005def warn_omp_declare_variant_after_used : Warning<
11006  "'#pragma omp declare variant' cannot be applied for function after first "
11007  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
11008def warn_omp_declare_variant_after_emitted : Warning<
11009  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
11010  " the original function might be used">, InGroup<SourceUsesOpenMP>;
11011def err_omp_declare_variant_doesnt_support : Error<
11012  "'#pragma omp declare variant' does not "
11013  "support %select{function templates|virtual functions|"
11014  "deduced return types|constructors|destructors|deleted functions|"
11015  "defaulted functions|constexpr functions|consteval function}0">;
11016def err_omp_declare_variant_diff : Error<
11017  "function with '#pragma omp declare variant' has a different %select{calling convention"
11018  "|return type|constexpr specification|inline specification|storage class|"
11019  "linkage}0">;
11020def err_omp_declare_variant_prototype_required : Error<
11021  "function with '#pragma omp declare variant' must have a prototype when "
11022  "'append_args' is used">;
11023def err_omp_interop_type_not_found : Error<
11024  "'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">;
11025def err_omp_declare_variant_incompat_types : Error<
11026  "variant in '#pragma omp declare variant' with type %0 is incompatible with"
11027  " type %1%select{| with appended arguments}2">;
11028def err_omp_declare_variant_same_base_function : Error<
11029  "variant in '#pragma omp declare variant' is the same as the base function">;
11030def warn_omp_declare_variant_marked_as_declare_variant : Warning<
11031  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
11032  >, InGroup<SourceUsesOpenMP>;
11033def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
11034def err_omp_one_defaultmap_each_category: Error<
11035  "at most one defaultmap clause for each variable-category can appear on the directive">;
11036def err_omp_lastprivate_conditional_non_scalar : Error<
11037  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
11038  >;
11039def err_omp_flush_order_clause_and_list : Error<
11040  "'flush' directive with memory order clause '%0' cannot have the list">;
11041def note_omp_flush_order_clause_here : Note<
11042  "memory order clause '%0' is specified here">;
11043def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
11044  "expected addressable lvalue in '%0' clause">;
11045def err_omp_var_expected : Error<
11046  "expected variable of the '%0' type%select{|, not %2}1">;
11047def err_omp_non_pointer_type_array_shaping_base : Error<
11048  "expected expression with a pointer to a complete type as a base of an array "
11049  "shaping operation">;
11050def err_omp_reduction_task_not_parallel_or_worksharing : Error<
11051  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
11052  " worksharing constructs">;
11053def err_omp_expected_array_alloctraits : Error<
11054  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
11055def err_omp_predefined_allocator_with_traits : Error<
11056  "predefined allocator cannot have traits specified">;
11057def note_omp_predefined_allocator : Note<
11058  "predefined trait '%0' used here">;
11059def err_omp_nonpredefined_allocator_without_traits : Error<
11060  "non-predefined allocator must have traits specified">;
11061def err_omp_allocator_used_in_clauses : Error<
11062  "allocators used in 'uses_allocators' clause cannot appear in other "
11063  "data-sharing or data-mapping attribute clauses">;
11064def err_omp_allocator_not_in_uses_allocators : Error<
11065  "allocator must be specified in the 'uses_allocators' clause">;
11066def note_omp_protected_structured_block
11067    : Note<"jump bypasses OpenMP structured block">;
11068def note_omp_exits_structured_block
11069    : Note<"jump exits scope of OpenMP structured block">;
11070def err_omp_lastprivate_loop_var_non_loop_iteration : Error<
11071  "only loop iteration variables are allowed in 'lastprivate' clause in "
11072  "'omp %0' directives">;
11073def err_omp_interop_variable_expected : Error<
11074  "expected%select{| non-const}0 variable of type 'omp_interop_t'">;
11075def err_omp_interop_variable_wrong_type : Error<
11076  "interop variable must be of type 'omp_interop_t'">;
11077def err_omp_interop_prefer_type : Error<
11078  "prefer_list item must be a string literal or constant integral "
11079  "expression">;
11080def err_omp_interop_bad_depend_clause : Error<
11081  "'depend' clause requires the 'targetsync' interop type">;
11082def err_omp_interop_var_multiple_actions : Error<
11083  "interop variable %0 used in multiple action clauses">;
11084def err_omp_dispatch_statement_call
11085    : Error<"statement after '#pragma omp dispatch' must be a direct call"
11086            " to a target function or an assignment to one">;
11087def err_omp_unroll_full_variable_trip_count : Error<
11088  "loop to be fully unrolled must have a constant trip count">;
11089def note_omp_directive_here : Note<"'%0' directive found here">;
11090def err_omp_instantiation_not_supported
11091    : Error<"instantiation of '%0' not supported yet">;
11092def err_omp_adjust_arg_multiple_clauses : Error<
11093  "'adjust_arg' argument %0 used in multiple clauses">;
11094def err_omp_clause_requires_dispatch_construct : Error<
11095  "'%0' clause requires 'dispatch' context selector">;
11096def err_omp_append_args_with_varargs : Error<
11097  "'append_args' is not allowed with varargs functions">;
11098def err_openmp_vla_in_task_untied : Error<
11099  "variable length arrays are not supported in OpenMP tasking regions with 'untied' clause">;
11100def warn_omp_unterminated_declare_target : Warning<
11101  "expected '#pragma omp end declare target' at end of file to match '#pragma omp %0'">,
11102  InGroup<SourceUsesOpenMP>;
11103} // end of OpenMP category
11104
11105let CategoryName = "Related Result Type Issue" in {
11106// Objective-C related result type compatibility
11107def warn_related_result_type_compatibility_class : Warning<
11108  "method is expected to return an instance of its class type "
11109  "%diff{$, but is declared to return $|"
11110  ", but is declared to return different type}0,1">;
11111def warn_related_result_type_compatibility_protocol : Warning<
11112  "protocol method is expected to return an instance of the implementing "
11113  "class, but is declared to return %0">;
11114def note_related_result_type_family : Note<
11115  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
11116  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
11117  "self}1' method family%select{| and is expected to return an instance of its "
11118  "class type}0">;
11119def note_related_result_type_overridden : Note<
11120  "overridden method returns an instance of its class type">;
11121def note_related_result_type_inferred : Note<
11122  "%select{class|instance}0 method %1 is assumed to return an instance of "
11123  "its receiver type (%2)">;
11124def note_related_result_type_explicit : Note<
11125  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
11126  "%select{| and is expected to return an instance of its class type}0">;
11127def err_invalid_type_for_program_scope_var : Error<
11128  "the %0 type cannot be used to declare a program scope variable">;
11129
11130}
11131
11132let CategoryName = "Modules Issue" in {
11133def err_module_decl_in_module_map_module : Error<
11134  "'module' declaration found while building module from module map">;
11135def err_module_decl_in_header_unit : Error<
11136  "'module' declaration found while building header unit">;
11137def err_module_interface_implementation_mismatch : Error<
11138  "missing 'export' specifier in module declaration while "
11139  "building module interface">;
11140def err_current_module_name_mismatch : Error<
11141  "module name '%0' specified on command line does not match name of module">;
11142def err_module_redefinition : Error<
11143  "redefinition of module '%0'">;
11144def note_prev_module_definition : Note<"previously defined here">;
11145def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
11146def err_module_not_defined : Error<
11147  "definition of module '%0' is not available; use -fmodule-file= to specify "
11148  "path to precompiled module interface">;
11149def err_module_redeclaration : Error<
11150  "translation unit contains multiple module declarations">;
11151def note_prev_module_declaration : Note<"previous module declaration is here">;
11152def err_module_declaration_missing : Error<
11153  "missing 'export module' declaration in module interface unit">;
11154def err_module_declaration_missing_after_global_module_introducer : Error<
11155  "missing 'module' declaration at end of global module fragment "
11156  "introduced here">;
11157def err_module_private_specialization : Error<
11158  "%select{template|partial|member}0 specialization cannot be "
11159  "declared __module_private__">;
11160def err_module_private_local : Error<
11161  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
11162  "__module_private__">;
11163def err_module_private_local_class : Error<
11164  "local %select{struct|interface|union|class|enum}0 cannot be declared "
11165  "__module_private__">;
11166def err_module_unimported_use : Error<
11167  "%select{declaration|definition|default argument|"
11168  "explicit specialization|partial specialization}0 of %1 must be imported "
11169  "from module '%2' before it is required">;
11170def err_module_unimported_use_header : Error<
11171  "%select{missing '#include'|missing '#include %3'}2; "
11172  "%select{||default argument of |explicit specialization of |"
11173  "partial specialization of }0%1 must be "
11174  "%select{declared|defined|defined|declared|declared}0 "
11175  "before it is used">;
11176def err_module_unimported_use_multiple : Error<
11177  "%select{declaration|definition|default argument|"
11178  "explicit specialization|partial specialization}0 of %1 must be imported "
11179  "from one of the following modules before it is required:%2">;
11180def note_unreachable_entity : Note<
11181  "%select{declaration|definition|default argument declared|"
11182  "explicit specialization declared|partial specialization declared}0 here "
11183  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
11184def ext_module_import_in_extern_c : ExtWarn<
11185  "import of C++ module '%0' appears within extern \"C\" language linkage "
11186  "specification">, DefaultError,
11187  InGroup<DiagGroup<"module-import-in-extern-c">>;
11188def err_module_import_not_at_top_level_fatal : Error<
11189  "import of module '%0' appears within %1">, DefaultFatal;
11190def ext_module_import_not_at_top_level_noop : ExtWarn<
11191  "redundant #include of module '%0' appears within %1">, DefaultError,
11192  InGroup<DiagGroup<"modules-import-nested-redundant">>;
11193def note_module_import_not_at_top_level : Note<"%0 begins here">;
11194def err_module_self_import : Error<
11195  "import of module '%0' appears within same top-level module '%1'">;
11196def err_module_self_import_cxx20 : Error<
11197  "import of module '%0' appears within its own %select{interface|implementation}1">;
11198def err_module_import_in_implementation : Error<
11199  "@import of module '%0' in implementation of '%1'; use #import">;
11200
11201// C++ Modules
11202def err_module_decl_not_at_start : Error<
11203  "module declaration must occur at the start of the translation unit">;
11204def note_global_module_introducer_missing : Note<
11205  "add 'module;' to the start of the file to introduce a "
11206  "global module fragment">;
11207def err_export_within_anonymous_namespace : Error<
11208  "export declaration appears within anonymous namespace">;
11209def note_anonymous_namespace : Note<"anonymous namespace begins here">;
11210def ext_export_no_name_block : ExtWarn<
11211  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
11212  "to appear in an export block">, InGroup<ExportUnnamed>;
11213def ext_export_no_names : ExtWarn<
11214  "ISO C++20 does not permit a declaration that does not introduce any names "
11215  "to be exported">, InGroup<ExportUnnamed>;
11216def introduces_no_names : Error<
11217  "declaration does not introduce any names to be exported">;
11218def note_export : Note<"export block begins here">;
11219def err_export_no_name : Error<
11220  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
11221def ext_export_using_directive : ExtWarn<
11222  "ISO C++20 does not permit using directive to be exported">,
11223  InGroup<DiagGroup<"export-using-directive">>;
11224def err_export_within_export : Error<
11225  "export declaration appears within another export declaration">;
11226def err_export_internal : Error<
11227  "declaration of %0 with internal linkage cannot be exported">;
11228def err_export_using_internal : Error<
11229  "using declaration referring to %1 with %select{internal|module|unknown}0 "
11230  "linkage cannot be exported">;
11231def err_export_not_in_module_interface : Error<
11232  "export declaration can only be used within a module interface unit"
11233  "%select{ after the module declaration|}0">;
11234def err_export_inline_not_defined : Error<
11235  "inline function not defined%select{| before the private module fragment}0">;
11236def err_export_partition_impl : Error<
11237  "module partition implementations cannot be exported">;
11238def err_export_in_private_module_fragment : Error<
11239  "export declaration cannot be used in a private module fragment">;
11240def note_private_module_fragment : Note<
11241  "private module fragment begins here">;
11242def err_private_module_fragment_not_module : Error<
11243  "private module fragment declaration with no preceding module declaration">;
11244def err_private_module_fragment_redefined : Error<
11245  "private module fragment redefined">;
11246def err_private_module_fragment_not_module_interface : Error<
11247  "private module fragment in module implementation unit">;
11248def note_not_module_interface_add_export : Note<
11249  "add 'export' here if this is intended to be a module interface unit">;
11250def err_invalid_module_name : Error<
11251  "%0 is %select{an invalid|a reserved}1 name for a module">;
11252def err_extern_def_in_header_unit : Error<
11253  "non-inline external definitions are not permitted in C++ header units">;
11254
11255def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
11256  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
11257  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
11258def note_equivalent_internal_linkage_decl : Note<
11259  "declared here%select{ in module '%1'|}0">;
11260
11261def note_redefinition_modules_same_file : Note<
11262  "'%0' included multiple times, additional include site in header from module '%1'">;
11263def note_redefinition_include_same_file : Note<
11264  "'%0' included multiple times, additional include site here">;
11265}
11266
11267let CategoryName = "Coroutines Issue" in {
11268def err_return_in_coroutine : Error<
11269  "return statement not allowed in coroutine; did you mean 'co_return'?">;
11270def note_declared_coroutine_here : Note<
11271  "function is a coroutine due to use of '%0' here">;
11272def err_coroutine_objc_method : Error<
11273  "Objective-C methods as coroutines are not yet supported">;
11274def err_coroutine_unevaluated_context : Error<
11275  "'%0' cannot be used in an unevaluated context">;
11276def err_coroutine_within_handler : Error<
11277  "'%0' cannot be used in the handler of a try block">;
11278def err_coroutine_outside_function : Error<
11279  "'%0' cannot be used outside a function">;
11280def err_coroutine_invalid_func_context : Error<
11281  "'%1' cannot be used in %select{a constructor|a destructor"
11282  "|the 'main' function|a constexpr function"
11283  "|a function with a deduced return type|a varargs function"
11284  "|a consteval function}0">;
11285def err_implied_coroutine_type_not_found : Error<
11286  "%0 type was not found; include <coroutine> before defining "
11287  "a coroutine; include <experimental/coroutine> if your version "
11288  "of libcxx is less than 14.0">;
11289def warn_deprecated_coroutine_namespace : Warning<
11290  "support for 'std::experimental::%0' will be removed in Clang 17; "
11291  "use 'std::%0' instead">,
11292  InGroup<DeprecatedExperimentalCoroutine>;
11293def err_mixed_use_std_and_experimental_namespace_for_coroutine : Error<
11294  "conflicting mixed use of std and std::experimental namespaces for "
11295  "coroutine components">;
11296def err_implicit_coroutine_std_nothrow_type_not_found : Error<
11297  "std::nothrow was not found; include <new> before defining a coroutine which "
11298  "uses get_return_object_on_allocation_failure()">;
11299def err_malformed_std_nothrow : Error<
11300  "std::nothrow must be a valid variable declaration">;
11301def err_malformed_std_coroutine_handle : Error<
11302  "std::coroutine_handle isn't a class template">;
11303def err_coroutine_handle_missing_member : Error<
11304  "std::coroutine_handle must have a member named '%0'">;
11305def err_malformed_std_coroutine_traits : Error<
11306  "std::coroutine_traits isn't a class template">;
11307def err_implied_std_coroutine_traits_promise_type_not_found : Error<
11308  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
11309def err_implied_std_coroutine_traits_promise_type_not_class : Error<
11310  "this function cannot be a coroutine: %0 is not a class">;
11311def err_coroutine_promise_type_incomplete : Error<
11312  "this function cannot be a coroutine: %0 is an incomplete type">;
11313def err_coroutine_type_missing_specialization : Error<
11314  "this function cannot be a coroutine: missing definition of "
11315  "specialization %0">;
11316def err_coroutine_promise_incompatible_return_functions : Error<
11317  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
11318def note_coroutine_promise_implicit_await_transform_required_here : Note<
11319  "call to 'await_transform' implicitly required by 'co_await' here">;
11320def note_coroutine_promise_suspend_implicitly_required : Note<
11321  "call to '%select{initial_suspend|final_suspend}0' implicitly "
11322  "required by the %select{initial suspend point|final suspend point}0">;
11323def err_coroutine_promise_unhandled_exception_required : Error<
11324  "%0 is required to declare the member 'unhandled_exception()'">;
11325def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
11326  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
11327  InGroup<CoroutineMissingUnhandledException>;
11328def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
11329  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
11330def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
11331  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
11332def err_coroutine_promise_new_requires_nothrow : Error<
11333  "%0 is required to have a non-throwing noexcept specification when the promise "
11334   "type declares 'get_return_object_on_allocation_failure()'">;
11335def note_coroutine_promise_call_implicitly_required : Note<
11336  "call to %0 implicitly required by coroutine function here">;
11337def err_await_suspend_invalid_return_type : Error<
11338  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
11339>;
11340def note_await_ready_no_bool_conversion : Note<
11341  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
11342>;
11343def warn_coroutine_handle_address_invalid_return_type : Warning <
11344  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">,
11345  InGroup<Coroutine>;
11346def err_coroutine_promise_final_suspend_requires_nothrow : Error<
11347  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
11348>;
11349def note_coroutine_function_declare_noexcept : Note<
11350  "must be declared with 'noexcept'"
11351>;
11352def warn_always_inline_coroutine : Warning<
11353  "this coroutine may be split into pieces; not every piece is guaranteed to be inlined"
11354  >,
11355  InGroup<AlwaysInlineCoroutine>;
11356def err_coroutine_unusable_new : Error<
11357  "'operator new' provided by %0 is not usable with the function signature of %1"
11358>;
11359def err_coroutine_unfound_nothrow_new : Error <
11360  "unable to find %select{'::operator new(size_t, nothrow_t)'|"
11361  "'::operator new(size_t, align_val_t, nothrow_t)'}1 for %0"
11362>;
11363def warn_non_aligned_allocation_function : Warning <
11364  "under -fcoro-aligned-allocation, the non-aligned allocation function "
11365  "for the promise type %0 has higher precedence than the global aligned "
11366  "allocation function">,
11367  InGroup<CoroNonAlignedAllocationFunction>;
11368def err_conflicting_aligned_options : Error <
11369  "conflicting option '-fcoro-aligned-allocation' and '-fno-aligned-allocation'"
11370>;
11371def err_coro_invalid_addr_of_label : Error<
11372  "the GNU address of label extension is not allowed in coroutines."
11373>;
11374} // end of coroutines issue category
11375
11376let CategoryName = "Documentation Issue" in {
11377def warn_not_a_doxygen_trailing_member_comment : Warning<
11378  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
11379} // end of documentation issue category
11380
11381let CategoryName = "Nullability Issue" in {
11382
11383def warn_mismatched_nullability_attr : Warning<
11384  "nullability specifier %0 conflicts with existing specifier %1">,
11385  InGroup<Nullability>;
11386
11387def warn_nullability_declspec : Warning<
11388  "nullability specifier %0 cannot be applied "
11389  "to non-pointer type %1; did you mean to apply the specifier to the "
11390  "%select{pointer|block pointer|member pointer|function pointer|"
11391  "member function pointer}2?">,
11392  InGroup<NullabilityDeclSpec>,
11393  DefaultError;
11394
11395def note_nullability_here : Note<"%0 specified here">;
11396
11397def err_nullability_nonpointer : Error<
11398  "nullability specifier %0 cannot be applied to non-pointer type %1">;
11399
11400def warn_nullability_lost : Warning<
11401  "implicit conversion from nullable pointer %0 to non-nullable pointer "
11402  "type %1">,
11403  InGroup<NullableToNonNullConversion>, DefaultIgnore;
11404def warn_zero_as_null_pointer_constant : Warning<
11405  "zero as null pointer constant">,
11406  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
11407
11408def err_nullability_cs_multilevel : Error<
11409  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
11410def note_nullability_type_specifier : Note<
11411  "use nullability type specifier %0 to affect the innermost "
11412  "pointer type of %1">;
11413
11414def warn_null_resettable_setter : Warning<
11415  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
11416  InGroup<Nullability>;
11417
11418def warn_nullability_missing : Warning<
11419  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
11420  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
11421  InGroup<NullabilityCompleteness>;
11422def warn_nullability_missing_array : Warning<
11423  "array parameter is missing a nullability type specifier (_Nonnull, "
11424  "_Nullable, or _Null_unspecified)">,
11425  InGroup<NullabilityCompletenessOnArrays>;
11426def note_nullability_fix_it : Note<
11427  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
11428  "%select{pointer|block pointer|member pointer|array parameter}1 "
11429  "%select{should never be null|may be null|should not declare nullability}0">;
11430
11431def warn_nullability_inferred_on_nested_type : Warning<
11432  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
11433  "deprecated">,
11434  InGroup<NullabilityInferredOnNestedType>;
11435
11436def err_objc_type_arg_explicit_nullability : Error<
11437  "type argument %0 cannot explicitly specify nullability">;
11438
11439def err_objc_type_param_bound_explicit_nullability : Error<
11440  "type parameter %0 bound %1 cannot explicitly specify nullability">;
11441
11442}
11443
11444let CategoryName = "Generics Issue" in {
11445
11446def err_objc_type_param_bound_nonobject : Error<
11447  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
11448
11449def err_objc_type_param_bound_missing_pointer : Error<
11450  "missing '*' in type bound %0 for type parameter %1">;
11451def err_objc_type_param_bound_qualified : Error<
11452  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
11453
11454def err_objc_type_param_redecl : Error<
11455  "redeclaration of type parameter %0">;
11456
11457def err_objc_type_param_arity_mismatch : Error<
11458  "%select{forward class declaration|class definition|category|extension}0 has "
11459  "too %select{few|many}1 type parameters (expected %2, have %3)">;
11460
11461def err_objc_type_param_bound_conflict : Error<
11462  "type bound %0 for type parameter %1 conflicts with "
11463  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
11464
11465def err_objc_type_param_variance_conflict : Error<
11466  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
11467  "%select{in|co|contra}2variant type parameter %3">;
11468
11469def note_objc_type_param_here : Note<"type parameter %0 declared here">;
11470
11471def err_objc_type_param_bound_missing : Error<
11472  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
11473
11474def err_objc_parameterized_category_nonclass : Error<
11475  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
11476  "parameters">;
11477
11478def err_objc_parameterized_forward_class : Error<
11479  "forward declaration of non-parameterized class %0 cannot have type "
11480  "parameters">;
11481
11482def err_objc_parameterized_forward_class_first : Error<
11483  "class %0 previously declared with type parameters">;
11484
11485def err_objc_type_arg_missing_star : Error<
11486  "type argument %0 must be a pointer (requires a '*')">;
11487def err_objc_type_arg_qualified : Error<
11488  "type argument %0 cannot be qualified with '%1'">;
11489
11490def err_objc_type_arg_missing : Error<
11491  "no type or protocol named %0">;
11492
11493def err_objc_type_args_and_protocols : Error<
11494  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
11495  "%select{protocol|type}0 (%2)">;
11496
11497def err_objc_type_args_non_class : Error<
11498  "type arguments cannot be applied to non-class type %0">;
11499
11500def err_objc_type_args_non_parameterized_class : Error<
11501  "type arguments cannot be applied to non-parameterized class %0">;
11502
11503def err_objc_type_args_specialized_class : Error<
11504  "type arguments cannot be applied to already-specialized class type %0">;
11505
11506def err_objc_type_args_wrong_arity : Error<
11507  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
11508}
11509
11510def err_objc_type_arg_not_id_compatible : Error<
11511  "type argument %0 is neither an Objective-C object nor a block type">;
11512
11513def err_objc_type_arg_does_not_match_bound : Error<
11514  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
11515
11516def warn_objc_redundant_qualified_class_type : Warning<
11517  "parameterized class %0 already conforms to the protocols listed; did you "
11518  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
11519
11520def warn_block_literal_attributes_on_omitted_return_type : Warning<
11521  "attribute %0 ignored, because it cannot be applied to omitted return type">,
11522  InGroup<IgnoredAttributes>;
11523
11524def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
11525  "'%0' qualifier on omitted return type %1 has no effect">,
11526  InGroup<IgnoredQualifiers>;
11527
11528def warn_shadow_field : Warning<
11529  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
11530  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
11531def note_shadow_field : Note<"declared here">;
11532
11533def err_multiversion_required_in_redecl : Error<
11534  "function declaration is missing %select{'target'|'cpu_specific' or "
11535  "'cpu_dispatch'|'target_version'}0 attribute in a multiversioned function">;
11536def note_multiversioning_caused_here : Note<
11537  "function multiversioning caused by this declaration">;
11538def err_multiversion_after_used : Error<
11539  "function declaration cannot become a multiversioned function after first "
11540  "usage">;
11541def err_bad_multiversion_option : Error<
11542  "function multiversioning doesn't support %select{feature|architecture}0 "
11543  "'%1'">;
11544def err_multiversion_duplicate : Error<
11545  "multiversioned function redeclarations require identical target attributes">;
11546def err_multiversion_noproto : Error<
11547  "multiversioned function must have a prototype">;
11548def err_multiversion_disallowed_other_attr
11549    : Error<"attribute "
11550            "'%select{|target|cpu_specific|cpu_dispatch|target_clones|target_version}0' "
11551            "multiversioning cannot be combined"
11552            " with attribute %1">;
11553def err_multiversion_diff : Error<
11554  "multiversioned function declaration has a different %select{calling convention"
11555  "|return type|constexpr specification|inline specification|linkage|"
11556  "language linkage}0">;
11557def err_multiversion_doesnt_support
11558    : Error<"attribute "
11559            "'%select{|target|cpu_specific|cpu_dispatch|target_clones|target_version}0' "
11560            "multiversioned functions do not "
11561            "yet support %select{function templates|virtual functions|"
11562            "deduced return types|constructors|destructors|deleted functions|"
11563            "defaulted functions|constexpr functions|consteval "
11564            "function|lambdas}1">;
11565def err_multiversion_not_allowed_on_main : Error<
11566  "'main' cannot be a multiversioned function">;
11567def err_multiversion_not_supported : Error<
11568 "function multiversioning is not supported on the current target">;
11569def err_multiversion_types_mixed : Error<
11570  "multiversioning attributes cannot be combined">;
11571def err_cpu_dispatch_mismatch : Error<
11572 "'cpu_dispatch' function redeclared with different CPUs">;
11573def err_cpu_specific_multiple_defs : Error<
11574 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
11575def warn_multiversion_duplicate_entries : Warning<
11576 "CPU list contains duplicate entries; attribute ignored">,
11577  InGroup<FunctionMultiVersioning>;
11578def warn_dispatch_body_ignored : Warning<
11579  "body of cpu_dispatch function will be ignored">,
11580  InGroup<FunctionMultiVersioning>;
11581def err_target_clone_must_have_default
11582    : Error<"'target_clones' multiversioning requires a default target">;
11583def err_target_clone_doesnt_match
11584    : Error<"'target_clones' attribute does not match previous declaration">;
11585def warn_target_clone_mixed_values
11586    : ExtWarn<
11587          "mixing 'target_clones' specifier mechanisms is permitted for GCC "
11588          "compatibility; use a comma separated sequence of string literals, "
11589          "or a string literal containing a comma-separated list of versions">,
11590      InGroup<TargetClonesMixedSpecifiers>;
11591def warn_target_clone_duplicate_options
11592    : Warning<"version list contains duplicate entries">,
11593      InGroup<FunctionMultiVersioning>;
11594def warn_target_clone_no_impact_options
11595    : Warning<"version list contains entries that don't impact code generation">,
11596      InGroup<FunctionMultiVersioning>;
11597
11598// three-way comparison operator diagnostics
11599def err_implied_comparison_category_type_not_found : Error<
11600  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
11601  "because type '%0' was not found; include <compare>">;
11602def err_spaceship_argument_narrowing : Error<
11603  "argument to 'operator<=>' "
11604  "%select{cannot be narrowed from type %1 to %2|"
11605  "evaluates to %1, which cannot be narrowed to type %2}0">;
11606def err_std_compare_type_not_supported : Error<
11607  "standard library implementation of %0 is not supported; "
11608   "%select{member '%2' does not have expected form|"
11609   "member '%2' is missing|"
11610   "the type is not trivially copyable|"
11611   "the type does not have the expected form}1">;
11612def note_rewriting_operator_as_spaceship : Note<
11613  "while rewriting comparison as call to 'operator<=>' declared here">;
11614def err_three_way_vector_comparison : Error<
11615  "three-way comparison between vectors is not supported">;
11616
11617// Memory Tagging Extensions (MTE) diagnostics
11618def err_memtag_arg_null_or_pointer : Error<
11619  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
11620def err_memtag_any2arg_pointer : Error<
11621  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
11622def err_memtag_arg_must_be_pointer : Error<
11623  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
11624def err_memtag_arg_must_be_integer : Error<
11625  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
11626
11627def warn_dereference_of_noderef_type : Warning<
11628  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
11629def warn_dereference_of_noderef_type_no_decl : Warning<
11630  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
11631def warn_noderef_on_non_pointer_or_array : Warning<
11632  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
11633def warn_noderef_to_dereferenceable_pointer : Warning<
11634  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
11635
11636def err_builtin_launder_invalid_arg : Error<
11637  "%select{non-pointer|function pointer|void pointer}0 argument to "
11638  "'__builtin_launder' is not allowed">;
11639
11640def err_builtin_invalid_arg_type: Error <
11641  "%ordinal0 argument must be a "
11642  "%select{vector, integer or floating point type|matrix|"
11643  "pointer to a valid matrix element type|"
11644  "signed integer or floating point type|vector type|"
11645  "floating point type|"
11646  "vector of integers}1 (was %2)">;
11647
11648def err_builtin_matrix_disabled: Error<
11649  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
11650def err_matrix_index_not_integer: Error<
11651  "matrix %select{row|column}0 index is not an integer">;
11652def err_matrix_index_outside_range: Error<
11653  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
11654def err_matrix_incomplete_index: Error<
11655  "single subscript expressions are not allowed for matrix values">;
11656def err_matrix_separate_incomplete_index: Error<
11657  "matrix row and column subscripts cannot be separated by any expression">;
11658def err_matrix_subscript_comma: Error<
11659  "comma expressions are not allowed as indices in matrix subscript expressions">;
11660def err_builtin_matrix_scalar_unsigned_arg: Error<
11661  "%0 argument must be a constant unsigned integer expression">;
11662def err_builtin_matrix_pointer_arg_mismatch: Error<
11663  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
11664def err_builtin_matrix_store_to_const: Error<
11665  "cannot store matrix to read-only pointer">;
11666def err_builtin_matrix_stride_too_small: Error<
11667  "stride must be greater or equal to the number of rows">;
11668def err_builtin_matrix_invalid_dimension: Error<
11669  "%0 dimension is outside the allowed range [1, %1]">;
11670
11671def warn_mismatched_import : Warning<
11672  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
11673  "previous declaration">,
11674  InGroup<IgnoredAttributes>;
11675def warn_import_on_definition : Warning<
11676  "import %select{module|name}0 cannot be applied to a function with a definition">,
11677  InGroup<IgnoredAttributes>;
11678
11679def err_preserve_field_info_not_field : Error<
11680  "__builtin_preserve_field_info argument %0 not a field access">;
11681def err_preserve_field_info_not_const: Error<
11682  "__builtin_preserve_field_info argument %0 not a constant">;
11683def err_btf_type_id_not_const: Error<
11684  "__builtin_btf_type_id argument %0 not a constant">;
11685def err_preserve_type_info_invalid : Error<
11686  "__builtin_preserve_type_info argument %0 invalid">;
11687def err_preserve_type_info_not_const: Error<
11688  "__builtin_preserve_type_info argument %0 not a constant">;
11689def err_preserve_enum_value_invalid : Error<
11690  "__builtin_preserve_enum_value argument %0 invalid">;
11691def err_preserve_enum_value_not_const: Error<
11692  "__builtin_preserve_enum_value argument %0 not a constant">;
11693
11694def err_bit_cast_non_trivially_copyable : Error<
11695  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
11696def err_bit_cast_type_size_mismatch : Error<
11697  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
11698
11699// SYCL-specific diagnostics
11700def warn_sycl_kernel_num_of_template_params : Warning<
11701  "'sycl_kernel' attribute only applies to a function template with at least"
11702  " two template parameters">, InGroup<IgnoredAttributes>;
11703def warn_sycl_kernel_invalid_template_param_type : Warning<
11704  "template parameter of a function template with the 'sycl_kernel' attribute"
11705  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
11706def warn_sycl_kernel_num_of_function_params : Warning<
11707  "function template with 'sycl_kernel' attribute must have a single parameter">,
11708  InGroup<IgnoredAttributes>;
11709def warn_sycl_kernel_return_type : Warning<
11710  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
11711  InGroup<IgnoredAttributes>;
11712def err_sycl_special_type_num_init_method : Error<
11713  "types with 'sycl_special_class' attribute must have one and only one '__init' "
11714  "method defined">;
11715
11716def err_bit_int_bad_size : Error<"%select{signed|unsigned}0 _BitInt must "
11717                                 "have a bit size of at least %select{2|1}0">;
11718def err_bit_int_max_size : Error<"%select{signed|unsigned}0 _BitInt of bit "
11719                                 "sizes greater than %1 not supported">;
11720
11721// errors of expect.with.probability
11722def err_probability_not_constant_float : Error<
11723   "probability argument to __builtin_expect_with_probability must be constant "
11724   "floating-point expression">;
11725def err_probability_out_of_range : Error<
11726   "probability argument to __builtin_expect_with_probability is outside the "
11727   "range [0.0, 1.0]">;
11728
11729// TCB warnings
11730def err_tcb_conflicting_attributes : Error<
11731  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
11732def warn_tcb_enforcement_violation : Warning<
11733  "calling %0 is a violation of trusted computing base '%1'">,
11734  InGroup<DiagGroup<"tcb-enforcement">>;
11735
11736// RISC-V builtin required extension warning
11737def err_riscv_builtin_requires_extension : Error<
11738  "builtin requires%select{| at least one of the following extensions to be enabled}0: %1">;
11739def err_riscv_builtin_invalid_lmul : Error<
11740  "LMUL argument must be in the range [0,3] or [5,7]">;
11741
11742def err_std_source_location_impl_not_found : Error<
11743  "'std::source_location::__impl' was not found; it must be defined before '__builtin_source_location' is called">;
11744def err_std_source_location_impl_malformed : Error<
11745  "'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'">;
11746
11747// HLSL Diagnostics
11748def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in %select{Pixel|Vertex|Geometry|Hull|Domain|Compute|Library|RayGeneration|Intersection|AnyHit|ClosestHit|Miss|Callable|Mesh|Amplification|Invalid}1 shaders, requires %2">;
11749def err_hlsl_attr_invalid_type : Error<
11750   "attribute %0 only applies to a field or parameter of type '%1'">;
11751def err_hlsl_attr_invalid_ast_node : Error<
11752   "attribute %0 only applies to %1">;
11753def err_hlsl_numthreads_argument_oor : Error<"argument '%select{X|Y|Z}0' to numthreads attribute cannot exceed %1">;
11754def err_hlsl_numthreads_invalid : Error<"total number of threads cannot exceed %0">;
11755def err_hlsl_missing_numthreads : Error<"missing numthreads attribute for %0 shader entry">;
11756def err_hlsl_attribute_param_mismatch : Error<"%0 attribute parameters do not match the previous declaration">;
11757def err_hlsl_missing_semantic_annotation : Error<
11758  "semantic annotations must be present for all parameters of an entry "
11759  "function or patch constant function">;
11760def err_hlsl_init_priority_unsupported : Error<
11761  "initializer priorities are not supported in HLSL">;
11762
11763def err_hlsl_unsupported_register_type : Error<"invalid resource class specifier '%0' used; expected 'b', 's', 't', or 'u'">;
11764def err_hlsl_unsupported_register_number : Error<"register number should be an integer">;
11765def err_hlsl_expected_space : Error<"invalid space specifier '%0' used; expected 'space' followed by an integer, like space1">;
11766def err_hlsl_pointers_unsupported : Error<
11767  "%select{pointers|references}0 are unsupported in HLSL">;
11768
11769def err_hlsl_operator_unsupported : Error<
11770  "the '%select{&|*|->}0' operator is unsupported in HLSL">;
11771
11772// Layout randomization diagnostics.
11773def err_non_designated_init_used : Error<
11774  "a randomized struct can only be initialized with a designated initializer">;
11775def err_cast_from_randomized_struct : Error<
11776  "casting from randomized structure pointer type %0 to %1">;
11777
11778// LoongArch-specific Diagnostics
11779def err_loongarch_builtin_requires_la64 : Error<
11780  "this builtin requires target: loongarch64">;
11781
11782// Unsafe buffer usage diagnostics.
11783def warn_unsafe_buffer_variable : Warning<
11784  "%0 is an %select{unsafe pointer used for buffer access|unsafe buffer that "
11785  "does not perform bounds checks}1">,
11786  InGroup<UnsafeBufferUsage>, DefaultIgnore;
11787def warn_unsafe_buffer_operation : Warning<
11788  "%select{unsafe pointer operation|unsafe pointer arithmetic|"
11789  "unsafe buffer access}0">,
11790  InGroup<UnsafeBufferUsage>, DefaultIgnore;
11791def note_unsafe_buffer_operation : Note<
11792  "used%select{| in pointer arithmetic| in buffer access}0 here">;
11793def err_loongarch_builtin_requires_la32 : Error<
11794  "this builtin requires target: loongarch32">;
11795} // end of sema component.
11796