xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td (revision 734e82fe33aa764367791a7d603b383996c6b40b)
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>;
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>;
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|a "
2128  "structured binding|a member subobject}0 "
2129  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2130  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2131  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2132  "|: different number of parameters (%5 vs %6)"
2133  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2134  "|: different return type%diff{ ($ vs $)|}5,6"
2135  "|: different qualifiers (%5 vs %6)"
2136  "|: different exception specifications}4">;
2137def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2138  "declared here; conversion would be valid if it was derived from %1">;
2139
2140def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2141  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2142def err_lvalue_reference_bind_to_initlist : Error<
2143  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2144  "initializer list temporary">;
2145def err_lvalue_reference_bind_to_temporary : Error<
2146  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2147  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2148def err_lvalue_reference_bind_to_unrelated : Error<
2149  "%select{non-const|volatile}0 lvalue reference "
2150  "%diff{to type $ cannot bind to a value of unrelated type $|"
2151  "cannot bind to a value of unrelated type}1,2">;
2152def err_reference_bind_drops_quals : Error<
2153  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2154  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2155  "not permitted due to incompatible qualifiers}2">;
2156def err_reference_bind_failed : Error<
2157  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2158  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2159  "incompatible type}0,3">;
2160def err_reference_bind_temporary_addrspace : Error<
2161  "reference of type %0 cannot bind to a temporary object because of "
2162  "address space mismatch">;
2163def err_reference_bind_init_list : Error<
2164  "reference to type %0 cannot bind to an initializer list">;
2165def err_init_list_bad_dest_type : Error<
2166  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2167  "list">;
2168def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2169  "aggregate initialization of type %0 with user-declared constructors "
2170  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2171def warn_cxx17_compat_aggregate_init_paren_list : Warning<
2172  "aggregate initialization of type %0 from a parenthesized list of values "
2173  "is a C++20 extension">, DefaultIgnore, InGroup<CXX20>;
2174
2175def err_reference_bind_to_bitfield : Error<
2176  "%select{non-const|volatile}0 reference cannot bind to "
2177  "bit-field%select{| %1}2">;
2178def err_reference_bind_to_vector_element : Error<
2179  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2180def err_reference_bind_to_matrix_element : Error<
2181  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2182def err_reference_var_requires_init : Error<
2183  "declaration of reference variable %0 requires an initializer">;
2184def err_reference_without_init : Error<
2185  "reference to type %0 requires an initializer">;
2186def note_value_initialization_here : Note<
2187  "in value-initialization of type %0 here">;
2188def err_reference_has_multiple_inits : Error<
2189  "reference cannot be initialized with multiple values">;
2190def err_init_non_aggr_init_list : Error<
2191  "initialization of non-aggregate type %0 with an initializer list">;
2192def err_init_reference_member_uninitialized : Error<
2193  "reference member of type %0 uninitialized">;
2194def note_uninit_reference_member : Note<
2195  "uninitialized reference member is here">;
2196def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2197  InGroup<Uninitialized>;
2198def warn_base_class_is_uninit : Warning<
2199  "base class %0 is uninitialized when used here to access %q1">,
2200  InGroup<Uninitialized>;
2201def warn_reference_field_is_uninit : Warning<
2202  "reference %0 is not yet bound to a value when used here">,
2203  InGroup<Uninitialized>;
2204def note_uninit_in_this_constructor : Note<
2205  "during field initialization in %select{this|the implicit default}0 "
2206  "constructor">;
2207def warn_static_self_reference_in_init : Warning<
2208  "static variable %0 is suspiciously used within its own initialization">,
2209  InGroup<UninitializedStaticSelfInit>;
2210def warn_uninit_self_reference_in_init : Warning<
2211  "variable %0 is uninitialized when used within its own initialization">,
2212  InGroup<Uninitialized>;
2213def warn_uninit_self_reference_in_reference_init : Warning<
2214  "reference %0 is not yet bound to a value when used within its own"
2215  " initialization">,
2216  InGroup<Uninitialized>;
2217def warn_uninit_var : Warning<
2218  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2219  InGroup<Uninitialized>, DefaultIgnore;
2220def warn_sometimes_uninit_var : Warning<
2221  "variable %0 is %select{used|captured}1 uninitialized whenever "
2222  "%select{'%3' condition is %select{true|false}4|"
2223  "'%3' loop %select{is entered|exits because its condition is false}4|"
2224  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2225  "switch %3 is taken|"
2226  "its declaration is reached|"
2227  "%3 is called}2">,
2228  InGroup<UninitializedSometimes>, DefaultIgnore;
2229def warn_maybe_uninit_var : Warning<
2230  "variable %0 may be uninitialized when "
2231  "%select{used here|captured by block}1">,
2232  InGroup<UninitializedMaybe>, DefaultIgnore;
2233def note_var_declared_here : Note<"variable %0 is declared here">;
2234def note_uninit_var_use : Note<
2235  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2236def warn_uninit_byref_blockvar_captured_by_block : Warning<
2237  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2238  "block">, InGroup<Uninitialized>, DefaultIgnore;
2239def note_block_var_fixit_add_initialization : Note<
2240  "did you mean to use __block %0?">;
2241def note_in_omitted_aggregate_initializer : Note<
2242  "in implicit initialization of %select{"
2243  "array element %1 with omitted initializer|"
2244  "field %1 with omitted initializer|"
2245  "trailing array elements in runtime-sized array new}0">;
2246def note_in_reference_temporary_list_initializer : Note<
2247  "in initialization of temporary of type %0 created to "
2248  "list-initialize this reference">;
2249def note_var_fixit_add_initialization : Note<
2250  "initialize the variable %0 to silence this warning">;
2251def note_uninit_fixit_remove_cond : Note<
2252  "remove the %select{'%1' if its condition|condition if it}0 "
2253  "is always %select{false|true}2">;
2254def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2255def err_list_init_in_parens : Error<
2256  "cannot initialize %select{non-class|reference}0 type %1 with a "
2257  "parenthesized initializer list">;
2258
2259def warn_uninit_const_reference : Warning<
2260  "variable %0 is uninitialized when passed as a const reference argument "
2261  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2262
2263def warn_unsequenced_mod_mod : Warning<
2264  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2265def warn_unsequenced_mod_use : Warning<
2266  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2267
2268def select_initialized_entity_kind : TextSubstitution<
2269  "%select{copying variable|copying parameter|initializing template parameter|"
2270  "returning object|initializing statement expression result|"
2271  "throwing object|copying member subobject|copying array element|"
2272  "allocating object|copying temporary|initializing base subobject|"
2273  "initializing vector element|capturing value}0">;
2274
2275def err_temp_copy_no_viable : Error<
2276  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2277def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2278  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2279  "C++98 requires a copy constructor when binding a reference to a temporary">,
2280  InGroup<BindToTemporaryCopy>;
2281def err_temp_copy_ambiguous : Error<
2282  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2283  "of type %1">;
2284def err_temp_copy_deleted : Error<
2285  "%sub{select_initialized_entity_kind}0 of type %1 "
2286  "invokes deleted constructor">;
2287def err_temp_copy_incomplete : Error<
2288  "copying a temporary object of incomplete type %0">;
2289def warn_cxx98_compat_temp_copy : Warning<
2290  "%sub{select_initialized_entity_kind}1 "
2291  "of type %2 when binding a reference to a temporary would %select{invoke "
2292  "an inaccessible constructor|find no viable constructor|find ambiguous "
2293  "constructors|invoke a deleted constructor}0 in C++98">,
2294  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2295def err_selected_explicit_constructor : Error<
2296  "chosen constructor is explicit in copy-initialization">;
2297def note_explicit_ctor_deduction_guide_here : Note<
2298  "explicit %select{constructor|deduction guide}0 declared here">;
2299
2300// C++11 decltype
2301def err_decltype_in_declarator : Error<
2302    "'decltype' cannot be used to name a declaration">;
2303
2304// C++11 auto
2305def warn_cxx98_compat_auto_type_specifier : Warning<
2306  "'auto' type specifier is incompatible with C++98">,
2307  InGroup<CXX98Compat>, DefaultIgnore;
2308def err_auto_variable_cannot_appear_in_own_initializer : Error<
2309  "variable %0 declared with deduced type %1 "
2310  "cannot appear in its own initializer">;
2311def err_binding_cannot_appear_in_own_initializer : Error<
2312  "binding %0 cannot appear in the initializer of its own "
2313  "decomposition declaration">;
2314def err_illegal_decl_array_of_auto : Error<
2315  "'%0' declared as array of %1">;
2316def err_new_array_of_auto : Error<
2317  "cannot allocate array of 'auto'">;
2318def err_auto_not_allowed : Error<
2319  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2320  "use of "
2321  "%select{class template|function template|variable template|alias template|"
2322  "template template parameter|concept|template}2 %3 requires template "
2323  "arguments; argument deduction}0 not allowed "
2324  "%select{in function prototype"
2325  "|in non-static struct member|in struct member"
2326  "|in non-static union member|in union member"
2327  "|in non-static class member|in interface member"
2328  "|in exception declaration|in template parameter until C++17|in block literal"
2329  "|in template argument|in typedef|in type alias|in function return type"
2330  "|in conversion function type|here|in lambda parameter"
2331  "|in type allocated by 'new'|in K&R-style function parameter"
2332  "|in template parameter|in friend declaration|in function prototype that is "
2333  "not a function declaration|in requires expression parameter}1">;
2334def err_dependent_deduced_tst : Error<
2335  "typename specifier refers to "
2336  "%select{class template|function template|variable template|alias template|"
2337  "template template parameter|template}0 member in %1; "
2338  "argument deduction not allowed here">;
2339def err_deduced_tst : Error<
2340  "typename specifier refers to "
2341  "%select{class template|function template|variable template|alias template|"
2342  "template template parameter|template}0; argument deduction not allowed "
2343  "here">;
2344def err_auto_not_allowed_var_inst : Error<
2345  "'auto' variable template instantiation is not allowed">;
2346def err_auto_var_requires_init : Error<
2347  "declaration of variable %0 with deduced type %1 requires an initializer">;
2348def err_auto_new_requires_ctor_arg : Error<
2349  "new expression for type %0 requires a constructor argument">;
2350def ext_auto_new_list_init : Extension<
2351  "ISO C++ standards before C++17 do not allow new expression for "
2352  "type %0 to use list-initialization">, InGroup<CXX17>;
2353def err_auto_var_init_no_expression : Error<
2354  "initializer for variable %0 with type %1 is empty">;
2355def err_auto_expr_init_no_expression : Error<
2356  "initializer for functional-style cast to %0 is empty">;
2357def err_auto_var_init_multiple_expressions : Error<
2358  "initializer for variable %0 with type %1 contains multiple expressions">;
2359def err_auto_expr_init_multiple_expressions : Error<
2360  "initializer for functional-style cast to %0 contains multiple expressions">;
2361def err_auto_var_init_paren_braces : Error<
2362  "cannot deduce type for variable %1 with type %2 from "
2363  "%select{parenthesized|nested}0 initializer list">;
2364def err_auto_new_ctor_multiple_expressions : Error<
2365  "new expression for type %0 contains multiple constructor arguments">;
2366def err_auto_expr_init_paren_braces : Error<
2367  "cannot deduce actual type for %1 from "
2368  "%select{parenthesized|nested}0 initializer list">;
2369def warn_cxx20_compat_auto_expr : Warning<
2370  "'auto' as a functional-style cast is incompatible with C++ standards "
2371  "before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore;
2372def err_auto_missing_trailing_return : Error<
2373  "'auto' return without trailing return type; deduced return types are a "
2374  "C++14 extension">;
2375def err_deduced_return_type : Error<
2376  "deduced return types are a C++14 extension">;
2377def err_trailing_return_without_auto : Error<
2378  "function with trailing return type must specify return type 'auto', not %0">;
2379def err_trailing_return_in_parens : Error<
2380  "trailing return type may not be nested within parentheses">;
2381def err_auto_var_deduction_failure : Error<
2382  "variable %0 with type %1 has incompatible initializer of type %2">;
2383def err_auto_var_deduction_failure_from_init_list : Error<
2384  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2385def err_auto_expr_deduction_failure : Error<
2386  "functional-style cast to %0 has incompatible initializer of type %1">;
2387def err_auto_new_deduction_failure : Error<
2388  "new expression for type %0 has incompatible constructor argument of type %1">;
2389def err_auto_inconsistent_deduction : Error<
2390  "deduced conflicting types %diff{($ vs $) |}0,1"
2391  "for initializer list element type">;
2392def err_auto_different_deductions : Error<
2393  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2394  "deduced as %1 in declaration of %2 and "
2395  "deduced as %3 in declaration of %4">;
2396def err_auto_non_deduced_not_alone : Error<
2397  "%select{function with deduced return type|"
2398  "declaration with trailing return type}0 "
2399  "must be the only declaration in its group">;
2400def err_implied_std_initializer_list_not_found : Error<
2401  "cannot deduce type of initializer list because std::initializer_list was "
2402  "not found; include <initializer_list>">;
2403def err_malformed_std_initializer_list : Error<
2404  "std::initializer_list must be a class template with a single type parameter">;
2405def err_auto_init_list_from_c : Error<
2406  "cannot use __auto_type with initializer list in C">;
2407def err_auto_bitfield : Error<
2408  "cannot pass bit-field as __auto_type initializer in C">;
2409
2410// C++1y decltype(auto) type
2411def err_decltype_auto_invalid : Error<
2412  "'decltype(auto)' not allowed here">;
2413def err_decltype_auto_cannot_be_combined : Error<
2414  "'decltype(auto)' cannot be combined with other type specifiers">;
2415def err_decltype_auto_function_declarator_not_declaration : Error<
2416  "'decltype(auto)' can only be used as a return type "
2417  "in a function declaration">;
2418def err_decltype_auto_compound_type : Error<
2419  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2420def err_decltype_auto_initializer_list : Error<
2421  "cannot deduce 'decltype(auto)' from initializer list">;
2422
2423// C++17 deduced class template specialization types
2424def err_deduced_class_template_compound_type : Error<
2425  "cannot %select{form pointer to|form reference to|form array of|"
2426  "form function returning|use parentheses when declaring variable with}0 "
2427  "deduced class template specialization type">;
2428def err_deduced_non_class_template_specialization_type : Error<
2429  "%select{<error>|function template|variable template|alias template|"
2430  "template template parameter|concept|template}0 %1 requires template "
2431  "arguments; argument deduction only allowed for class templates">;
2432def err_deduced_class_template_ctor_ambiguous : Error<
2433  "ambiguous deduction for template arguments of %0">;
2434def err_deduced_class_template_ctor_no_viable : Error<
2435  "no viable constructor or deduction guide for deduction of "
2436  "template arguments of %0">;
2437def err_deduced_class_template_incomplete : Error<
2438  "template %0 has no definition and no %select{|viable }1deduction guides "
2439  "for deduction of template arguments">;
2440def err_deduced_class_template_deleted : Error<
2441  "class template argument deduction for %0 selected a deleted constructor">;
2442def err_deduced_class_template_explicit : Error<
2443  "class template argument deduction for %0 selected an explicit "
2444  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2445def err_deduction_guide_no_trailing_return_type : Error<
2446  "deduction guide declaration without trailing return type">;
2447def err_deduction_guide_bad_trailing_return_type : Error<
2448  "deduced type %1 of deduction guide is not %select{|written as }2"
2449  "a specialization of template %0">;
2450def err_deduction_guide_with_complex_decl : Error<
2451  "cannot specify any part of a return type in the "
2452  "declaration of a deduction guide">;
2453def err_deduction_guide_invalid_specifier : Error<
2454  "deduction guide cannot be declared '%0'">;
2455def err_deduction_guide_name_not_class_template : Error<
2456  "cannot specify deduction guide for "
2457  "%select{<error>|function template|variable template|alias template|"
2458  "template template parameter|concept|dependent template name}0 %1">;
2459def err_deduction_guide_wrong_scope : Error<
2460  "deduction guide must be declared in the same scope as template %q0">;
2461def err_deduction_guide_defines_function : Error<
2462  "deduction guide cannot have a function definition">;
2463def err_deduction_guide_redeclared : Error<
2464  "redeclaration of deduction guide">;
2465def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2466  "%select{explicitly instantiated|explicitly specialized}0">;
2467def err_deduction_guide_template_not_deducible : Error<
2468  "deduction guide template contains "
2469  "%select{a template parameter|template parameters}0 that cannot be "
2470  "deduced">;
2471def err_deduction_guide_wrong_access : Error<
2472  "deduction guide has different access from the corresponding "
2473  "member template">;
2474def note_deduction_guide_template_access : Note<
2475  "member template declared %0 here">;
2476def note_deduction_guide_access : Note<
2477  "deduction guide declared %0 by intervening access specifier">;
2478def warn_cxx14_compat_class_template_argument_deduction : Warning<
2479  "class template argument deduction is incompatible with C++ standards "
2480  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2481  InGroup<CXXPre17Compat>, DefaultIgnore;
2482def warn_ctad_maybe_unsupported : Warning<
2483  "%0 may not intend to support class template argument deduction">,
2484  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2485def note_suppress_ctad_maybe_unsupported : Note<
2486  "add a deduction guide to suppress this warning">;
2487
2488
2489// C++14 deduced return types
2490def err_auto_fn_deduction_failure : Error<
2491  "cannot deduce return type %0 from returned value of type %1">;
2492def err_auto_fn_different_deductions : Error<
2493  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2494  "deduced as %2 in earlier return statement">;
2495def err_auto_fn_used_before_defined : Error<
2496  "function %0 with deduced return type cannot be used before it is defined">;
2497def err_auto_fn_no_return_but_not_auto : Error<
2498  "cannot deduce return type %0 for function with no return statements">;
2499def err_auto_fn_return_void_but_not_auto : Error<
2500  "cannot deduce return type %0 from omitted return expression">;
2501def err_auto_fn_return_init_list : Error<
2502  "cannot deduce return type from initializer list">;
2503def err_auto_fn_virtual : Error<
2504  "function with deduced return type cannot be virtual">;
2505def warn_cxx11_compat_deduced_return_type : Warning<
2506  "return type deduction is incompatible with C++ standards before C++14">,
2507  InGroup<CXXPre14Compat>, DefaultIgnore;
2508
2509// C++11 override control
2510def override_keyword_only_allowed_on_virtual_member_functions : Error<
2511  "only virtual member functions can be marked '%0'">;
2512def override_keyword_hides_virtual_member_function : Error<
2513  "non-virtual member function marked '%0' hides virtual member "
2514  "%select{function|functions}1">;
2515def err_function_marked_override_not_overriding : Error<
2516  "%0 marked 'override' but does not override any member functions">;
2517def warn_destructor_marked_not_override_overriding : TextSubstitution <
2518  "%0 overrides a destructor but is not marked 'override'">;
2519def warn_function_marked_not_override_overriding : TextSubstitution <
2520  "%0 overrides a member function but is not marked 'override'">;
2521def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2522  "%sub{warn_destructor_marked_not_override_overriding}0">,
2523  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2524def warn_inconsistent_function_marked_not_override_overriding : Warning <
2525  "%sub{warn_function_marked_not_override_overriding}0">,
2526  InGroup<CXX11WarnInconsistentOverrideMethod>;
2527def warn_suggest_destructor_marked_not_override_overriding : Warning <
2528  "%sub{warn_destructor_marked_not_override_overriding}0">,
2529  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2530def warn_suggest_function_marked_not_override_overriding : Warning <
2531  "%sub{warn_function_marked_not_override_overriding}0">,
2532  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2533def err_class_marked_final_used_as_base : Error<
2534  "base %0 is marked '%select{final|sealed}1'">;
2535def warn_abstract_final_class : Warning<
2536  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2537def warn_final_dtor_non_final_class : Warning<
2538  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2539  InGroup<FinalDtorNonFinalClass>;
2540def note_final_dtor_non_final_class_silence : Note<
2541  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2542
2543// C++11 attributes
2544def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2545
2546// C++11 final
2547def err_final_function_overridden : Error<
2548  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2549
2550// C++11 scoped enumerations
2551def err_enum_invalid_underlying : Error<
2552  "non-integral type %0 is an invalid underlying type">;
2553def err_enumerator_too_large : Error<
2554  "enumerator value is not representable in the underlying type %0">;
2555def ext_enumerator_too_large : Extension<
2556  "enumerator value is not representable in the underlying type %0">,
2557  InGroup<MicrosoftEnumValue>;
2558def err_enumerator_wrapped : Error<
2559  "enumerator value %0 is not representable in the underlying type %1">;
2560def err_enum_redeclare_type_mismatch : Error<
2561  "enumeration redeclared with different underlying type %0 (was %1)">;
2562def err_enum_redeclare_fixed_mismatch : Error<
2563  "enumeration previously declared with %select{non|}0fixed underlying type">;
2564def err_enum_redeclare_scoped_mismatch : Error<
2565  "enumeration previously declared as %select{un|}0scoped">;
2566def err_only_enums_have_underlying_types : Error<
2567  "only enumeration types have underlying types">;
2568def err_underlying_type_of_incomplete_enum : Error<
2569  "cannot determine underlying type of incomplete enumeration type %0">;
2570
2571// C++11 delegating constructors
2572def err_delegating_ctor : Error<
2573  "delegating constructors are permitted only in C++11">;
2574def warn_cxx98_compat_delegating_ctor : Warning<
2575  "delegating constructors are incompatible with C++98">,
2576  InGroup<CXX98Compat>, DefaultIgnore;
2577def err_delegating_initializer_alone : Error<
2578  "an initializer for a delegating constructor must appear alone">;
2579def warn_delegating_ctor_cycle : Warning<
2580  "constructor for %0 creates a delegation cycle">, DefaultError,
2581  InGroup<DelegatingCtorCycles>;
2582def note_it_delegates_to : Note<"it delegates to">;
2583def note_which_delegates_to : Note<"which delegates to">;
2584
2585// C++11 range-based for loop
2586def err_for_range_decl_must_be_var : Error<
2587  "for range declaration must declare a variable">;
2588def err_for_range_storage_class : Error<
2589  "loop variable %0 may not be declared %select{'extern'|'static'|"
2590  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2591def err_type_defined_in_for_range : Error<
2592  "types may not be defined in a for range declaration">;
2593def err_for_range_deduction_failure : Error<
2594  "cannot use type %0 as a range">;
2595def err_for_range_incomplete_type : Error<
2596  "cannot use incomplete type %0 as a range">;
2597def err_for_range_iter_deduction_failure : Error<
2598  "cannot use type %0 as an iterator">;
2599def ext_for_range_begin_end_types_differ : ExtWarn<
2600  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2601  InGroup<CXX17>;
2602def warn_for_range_begin_end_types_differ : Warning<
2603  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2604  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2605def note_in_for_range: Note<
2606  "when looking up '%select{begin|end}0' function for range expression "
2607  "of type %1">;
2608def err_for_range_invalid: Error<
2609  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2610  "function available">;
2611def note_for_range_member_begin_end_ignored : Note<
2612  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2613def err_range_on_array_parameter : Error<
2614  "cannot build range expression with array function parameter %0 since "
2615  "parameter with array type %1 is treated as pointer type %2">;
2616def err_for_range_dereference : Error<
2617  "invalid range expression of type %0; did you mean to dereference it "
2618  "with '*'?">;
2619def note_for_range_invalid_iterator : Note <
2620  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2621def note_for_range_begin_end : Note<
2622  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2623def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2624  "loop variable %0 "
2625  "%diff{of type $ binds to a temporary constructed from type $"
2626  "|binds to a temporary constructed from a different type}1,2">,
2627  InGroup<RangeLoopConstruct>, DefaultIgnore;
2628def note_use_type_or_non_reference : Note<
2629  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2630def warn_for_range_ref_binds_ret_temp : Warning<
2631  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2632  InGroup<RangeLoopBindReference>, DefaultIgnore;
2633def note_use_non_reference_type : Note<"use non-reference type %0">;
2634def warn_for_range_copy : Warning<
2635  "loop variable %0 creates a copy from type %1">,
2636  InGroup<RangeLoopConstruct>, DefaultIgnore;
2637def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2638def err_objc_for_range_init_stmt : Error<
2639  "initialization statement is not supported when iterating over Objective-C "
2640  "collection">;
2641
2642// C++11 constexpr
2643def warn_cxx98_compat_constexpr : Warning<
2644  "'constexpr' specifier is incompatible with C++98">,
2645  InGroup<CXX98Compat>, DefaultIgnore;
2646// FIXME: Maybe this should also go in -Wc++14-compat?
2647def warn_cxx14_compat_constexpr_not_const : Warning<
2648  "'constexpr' non-static member function will not be implicitly 'const' "
2649  "in C++14; add 'const' to avoid a change in behavior">,
2650  InGroup<DiagGroup<"constexpr-not-const">>;
2651def err_invalid_consteval_take_address : Error<
2652  "cannot take address of consteval function %0 outside"
2653  " of an immediate invocation">;
2654def err_invalid_consteval_call : Error<
2655  "call to consteval function %q0 is not a constant expression">;
2656def note_invalid_consteval_initializer : Note<
2657  "in the default initalizer of %0">;
2658def note_invalid_consteval_initializer_here : Note<
2659  "initialized here %0">;
2660def err_invalid_consteval_decl_kind : Error<
2661  "%0 cannot be declared consteval">;
2662def err_invalid_constexpr : Error<
2663  "%select{function parameter|typedef}0 "
2664  "cannot be %sub{select_constexpr_spec_kind}1">;
2665def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2666  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2667def err_constexpr_tag : Error<
2668  "%select{class|struct|interface|union|enum}0 "
2669  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2670def err_constexpr_dtor : Error<
2671  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2672def err_constexpr_dtor_subobject : Error<
2673  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2674  "%select{data member %2|base class %3}1 does not have a "
2675  "constexpr destructor">;
2676def note_constexpr_dtor_subobject : Note<
2677  "%select{data member %1|base class %2}0 declared here">;
2678def err_constexpr_wrong_decl_kind : Error<
2679  "%sub{select_constexpr_spec_kind}0 can only be used "
2680  "in %select{|variable and function|function|variable}0 declarations">;
2681def err_invalid_constexpr_var_decl : Error<
2682  "constexpr variable declaration must be a definition">;
2683def err_constexpr_static_mem_var_requires_init : Error<
2684  "declaration of constexpr static data member %0 requires an initializer">;
2685def err_constexpr_var_non_literal : Error<
2686  "constexpr variable cannot have non-literal type %0">;
2687def err_constexpr_var_requires_const_init : Error<
2688  "constexpr variable %0 must be initialized by a constant expression">;
2689def err_constexpr_var_requires_const_destruction : Error<
2690  "constexpr variable %0 must have constant destruction">;
2691def err_constexpr_redecl_mismatch : Error<
2692  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2693  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2694def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2695def warn_cxx17_compat_constexpr_virtual : Warning<
2696  "virtual constexpr functions are incompatible with "
2697  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2698def err_constexpr_virtual_base : Error<
2699  "constexpr %select{member function|constructor}0 not allowed in "
2700  "%select{struct|interface|class}1 with virtual base "
2701  "%plural{1:class|:classes}2">;
2702def note_non_literal_incomplete : Note<
2703  "incomplete type %0 is not a literal type">;
2704def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2705  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2706def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2707def err_constexpr_non_literal_return : Error<
2708  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2709def err_constexpr_non_literal_param : Error<
2710  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2711  "not a literal type">;
2712def err_constexpr_body_invalid_stmt : Error<
2713  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2714def ext_constexpr_body_invalid_stmt : ExtWarn<
2715  "use of this statement in a constexpr %select{function|constructor}0 "
2716  "is a C++14 extension">, InGroup<CXX14>;
2717def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2718  "use of this statement in a constexpr %select{function|constructor}0 "
2719  "is incompatible with C++ standards before C++14">,
2720  InGroup<CXXPre14Compat>, DefaultIgnore;
2721def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2722  "use of this statement in a constexpr %select{function|constructor}0 "
2723  "is a C++20 extension">, InGroup<CXX20>;
2724def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2725  "use of this statement in a constexpr %select{function|constructor}0 "
2726  "is incompatible with C++ standards before C++20">,
2727  InGroup<CXXPre20Compat>, DefaultIgnore;
2728def ext_constexpr_body_invalid_stmt_cxx2b : ExtWarn<
2729  "use of this statement in a constexpr %select{function|constructor}0 "
2730  "is a C++2b extension">, InGroup<CXX2b>;
2731def warn_cxx20_compat_constexpr_body_invalid_stmt : Warning<
2732  "use of this statement in a constexpr %select{function|constructor}0 "
2733  "is incompatible with C++ standards before C++2b">,
2734  InGroup<CXXPre2bCompat>, DefaultIgnore;
2735def ext_constexpr_type_definition : ExtWarn<
2736  "type definition in a constexpr %select{function|constructor}0 "
2737  "is a C++14 extension">, InGroup<CXX14>;
2738def warn_cxx11_compat_constexpr_type_definition : Warning<
2739  "type definition in a constexpr %select{function|constructor}0 "
2740  "is incompatible with C++ standards before C++14">,
2741  InGroup<CXXPre14Compat>, DefaultIgnore;
2742def err_constexpr_vla : Error<
2743  "variably-modified type %0 cannot be used in a constexpr "
2744  "%select{function|constructor}1">;
2745def ext_constexpr_local_var : ExtWarn<
2746  "variable declaration in a constexpr %select{function|constructor}0 "
2747  "is a C++14 extension">, InGroup<CXX14>;
2748def warn_cxx11_compat_constexpr_local_var : Warning<
2749  "variable declaration in a constexpr %select{function|constructor}0 "
2750  "is incompatible with C++ standards before C++14">,
2751  InGroup<CXXPre14Compat>, DefaultIgnore;
2752def ext_constexpr_static_var : ExtWarn<
2753  "definition of a %select{static|thread_local}1 variable "
2754  "in a constexpr %select{function|constructor}0 "
2755  "is a C++2b extension">, InGroup<CXX2b>;
2756def warn_cxx20_compat_constexpr_var : Warning<
2757  "definition of a %select{static variable|thread_local variable|variable "
2758  "of non-literal type}1 in a constexpr %select{function|constructor}0 "
2759  "is incompatible with C++ standards before C++2b">,
2760  InGroup<CXXPre2bCompat>, DefaultIgnore;
2761def err_constexpr_local_var_non_literal_type : Error<
2762  "variable of non-literal type %1 cannot be defined in a constexpr "
2763  "%select{function|constructor}0 before C++2b">;
2764def ext_constexpr_local_var_no_init : ExtWarn<
2765  "uninitialized variable in a constexpr %select{function|constructor}0 "
2766  "is a C++20 extension">, InGroup<CXX20>;
2767def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2768  "uninitialized variable in a constexpr %select{function|constructor}0 "
2769  "is incompatible with C++ standards before C++20">,
2770  InGroup<CXXPre20Compat>, DefaultIgnore;
2771def ext_constexpr_function_never_constant_expr : ExtWarn<
2772  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2773  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2774def err_attr_cond_never_constant_expr : Error<
2775  "%0 attribute expression never produces a constant expression">;
2776def err_diagnose_if_invalid_diagnostic_type : Error<
2777  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2778  "instead">;
2779def err_constexpr_body_no_return : Error<
2780  "no return statement in %select{constexpr|consteval}0 function">;
2781def err_constexpr_return_missing_expr : Error<
2782  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2783def warn_cxx11_compat_constexpr_body_no_return : Warning<
2784  "constexpr function with no return statements is incompatible with C++ "
2785  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2786def ext_constexpr_body_multiple_return : ExtWarn<
2787  "multiple return statements in constexpr function is a C++14 extension">,
2788  InGroup<CXX14>;
2789def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2790  "multiple return statements in constexpr function "
2791  "is incompatible with C++ standards before C++14">,
2792  InGroup<CXXPre14Compat>, DefaultIgnore;
2793def note_constexpr_body_previous_return : Note<
2794  "previous return statement is here">;
2795
2796// C++20 function try blocks in constexpr
2797def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2798  "function try block in constexpr %select{function|constructor}0 is "
2799  "a C++20 extension">, InGroup<CXX20>;
2800def warn_cxx17_compat_constexpr_function_try_block : Warning<
2801  "function try block in constexpr %select{function|constructor}0 is "
2802  "incompatible with C++ standards before C++20">,
2803  InGroup<CXXPre20Compat>, DefaultIgnore;
2804
2805def ext_constexpr_union_ctor_no_init : ExtWarn<
2806  "constexpr union constructor that does not initialize any member "
2807  "is a C++20 extension">, InGroup<CXX20>;
2808def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2809  "constexpr union constructor that does not initialize any member "
2810  "is incompatible with C++ standards before C++20">,
2811  InGroup<CXXPre20Compat>, DefaultIgnore;
2812def ext_constexpr_ctor_missing_init : ExtWarn<
2813  "constexpr constructor that does not initialize all members "
2814  "is a C++20 extension">, InGroup<CXX20>;
2815def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2816  "constexpr constructor that does not initialize all members "
2817  "is incompatible with C++ standards before C++20">,
2818  InGroup<CXXPre20Compat>, DefaultIgnore;
2819def note_constexpr_ctor_missing_init : Note<
2820  "member not initialized by constructor">;
2821def note_non_literal_no_constexpr_ctors : Note<
2822  "%0 is not literal because it is not an aggregate and has no constexpr "
2823  "constructors other than copy or move constructors">;
2824def note_non_literal_base_class : Note<
2825  "%0 is not literal because it has base class %1 of non-literal type">;
2826def note_non_literal_field : Note<
2827  "%0 is not literal because it has data member %1 of "
2828  "%select{non-literal|volatile}3 type %2">;
2829def note_non_literal_user_provided_dtor : Note<
2830  "%0 is not literal because it has a user-provided destructor">;
2831def note_non_literal_nontrivial_dtor : Note<
2832  "%0 is not literal because it has a non-trivial destructor">;
2833def note_non_literal_non_constexpr_dtor : Note<
2834  "%0 is not literal because its destructor is not constexpr">;
2835def note_non_literal_lambda : Note<
2836  "lambda closure types are non-literal types before C++17">;
2837def warn_private_extern : Warning<
2838  "use of __private_extern__ on a declaration may not produce external symbol "
2839  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2840def note_private_extern : Note<
2841  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2842
2843// C++ Concepts
2844def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2845  "concept declarations may only appear in global or namespace scope">;
2846def err_concept_no_parameters : Error<
2847  "concept template parameter list must have at least one parameter; explicit "
2848  "specialization of concepts is not allowed">;
2849def err_concept_extra_headers : Error<
2850  "extraneous template parameter list in concept definition">;
2851def err_concept_no_associated_constraints : Error<
2852  "concept cannot have associated constraints">;
2853def err_non_constant_constraint_expression : Error<
2854  "substitution into constraint expression resulted in a non-constant "
2855  "expression">;
2856def err_non_bool_atomic_constraint : Error<
2857  "atomic constraint must be of type 'bool' (found %0)">;
2858def err_template_arg_list_constraints_not_satisfied : Error<
2859  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
2860  "template template parameter|template}0 %1%2">;
2861def note_substituted_constraint_expr_is_ill_formed : Note<
2862  "because substituted constraint expression is ill-formed%0">;
2863def note_constraint_references_error
2864    : Note<"constraint depends on a previously diagnosed expression">;
2865def note_atomic_constraint_evaluated_to_false : Note<
2866  "%select{and|because}0 '%1' evaluated to false">;
2867def note_concept_specialization_constraint_evaluated_to_false : Note<
2868  "%select{and|because}0 '%1' evaluated to false">;
2869def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
2870  "%select{and|because}0 %1 does not satisfy %2">;
2871def note_atomic_constraint_evaluated_to_false_elaborated : Note<
2872  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
2873def err_constrained_virtual_method : Error<
2874  "virtual function cannot have a requires clause">;
2875def err_trailing_requires_clause_on_deduction_guide : Error<
2876  "deduction guide cannot have a requires clause">;
2877def err_constrained_non_templated_function
2878    : Error<"non-templated function cannot have a requires clause">;
2879def err_reference_to_function_with_unsatisfied_constraints : Error<
2880  "invalid reference to function %0: constraints not satisfied">;
2881def err_requires_expr_local_parameter_default_argument : Error<
2882  "default arguments not allowed for parameters of a requires expression">;
2883def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
2884  "constraint variable %0 cannot be used in an evaluated context">;
2885def note_expr_requirement_expr_substitution_error : Note<
2886  "%select{and|because}0 '%1' would be invalid: %2">;
2887def note_expr_requirement_expr_unknown_substitution_error : Note<
2888  "%select{and|because}0 '%1' would be invalid">;
2889def note_expr_requirement_noexcept_not_met : Note<
2890  "%select{and|because}0 '%1' may throw an exception">;
2891def note_expr_requirement_type_requirement_substitution_error : Note<
2892  "%select{and|because}0 '%1' would be invalid: %2">;
2893def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
2894  "%select{and|because}0 '%1' would be invalid">;
2895def note_expr_requirement_constraints_not_satisfied : Note<
2896  "%select{and|because}0 type constraint '%1' was not satisfied:">;
2897def note_expr_requirement_constraints_not_satisfied_simple : Note<
2898  "%select{and|because}0 %1 does not satisfy %2:">;
2899def note_type_requirement_substitution_error : Note<
2900  "%select{and|because}0 '%1' would be invalid: %2">;
2901def note_type_requirement_unknown_substitution_error : Note<
2902  "%select{and|because}0 '%1' would be invalid">;
2903def note_nested_requirement_substitution_error : Note<
2904  "%select{and|because}0 '%1' would be invalid%2">;
2905def note_nested_requirement_unknown_substitution_error : Note<
2906  "%select{and|because}0 '%1' would be invalid">;
2907def note_ambiguous_atomic_constraints : Note<
2908  "similar constraint expressions not considered equivalent; constraint "
2909  "expressions cannot be considered equivalent unless they originate from the "
2910  "same concept">;
2911def note_ambiguous_atomic_constraints_similar_expression : Note<
2912  "similar constraint expression here">;
2913def err_unsupported_placeholder_constraint : Error<
2914  "constrained placeholder types other than simple 'auto' on non-type template "
2915  "parameters not supported yet">;
2916
2917def err_template_different_requires_clause : Error<
2918  "requires clause differs in template redeclaration">;
2919def err_template_different_type_constraint : Error<
2920  "type constraint differs in template redeclaration">;
2921def err_template_template_parameter_not_at_least_as_constrained : Error<
2922  "template template argument %0 is more constrained than template template "
2923  "parameter %1">;
2924
2925def err_type_constraint_non_type_concept : Error<
2926  "concept named in type constraint is not a type concept">;
2927def err_type_constraint_missing_arguments : Error<
2928  "%0 requires more than 1 template argument; provide the remaining arguments "
2929  "explicitly to use it here">;
2930def err_placeholder_constraints_not_satisfied : Error<
2931  "deduced type %0 does not satisfy %1">;
2932
2933// C++11 char16_t/char32_t
2934def warn_cxx98_compat_unicode_type : Warning<
2935  "'%0' type specifier is incompatible with C++98">,
2936  InGroup<CXX98Compat>, DefaultIgnore;
2937def warn_cxx17_compat_unicode_type : Warning<
2938  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2939  InGroup<CXXPre20Compat>, DefaultIgnore;
2940
2941// __make_integer_seq
2942def err_integer_sequence_negative_length : Error<
2943  "integer sequences must have non-negative sequence length">;
2944def err_integer_sequence_integral_element_type : Error<
2945  "integer sequences must have integral element type">;
2946
2947// __type_pack_element
2948def err_type_pack_element_out_of_bounds : Error<
2949  "a parameter pack may not be accessed at an out of bounds index">;
2950
2951// Objective-C++
2952def err_objc_decls_may_only_appear_in_global_scope : Error<
2953  "Objective-C declarations may only appear in global scope">;
2954def warn_auto_var_is_id : Warning<
2955  "'auto' deduced as 'id' in declaration of %0">,
2956  InGroup<DiagGroup<"auto-var-id">>;
2957
2958// Attributes
2959def warn_attribute_ignored_no_calls_in_stmt: Warning<
2960  "%0 attribute is ignored because there exists no call expression inside the "
2961  "statement">,
2962  InGroup<IgnoredAttributes>;
2963
2964def warn_function_attribute_ignored_in_stmt : Warning<
2965  "attribute is ignored on this statement as it only applies to functions; "
2966  "use '%0' on statements">,
2967  InGroup<IgnoredAttributes>;
2968
2969def err_musttail_needs_trivial_args : Error<
2970  "tail call requires that the return value, all parameters, and any "
2971  "temporaries created by the expression are trivially destructible">;
2972def err_musttail_needs_call : Error<
2973  "%0 attribute requires that the return value is the result of a function call"
2974  >;
2975def err_musttail_needs_prototype : Error<
2976  "%0 attribute requires that both caller and callee functions have a "
2977  "prototype">;
2978def note_musttail_fix_non_prototype : Note<
2979  "add 'void' to the parameter list to turn an old-style K&R function "
2980  "declaration into a prototype">;
2981def err_musttail_structors_forbidden : Error<"cannot perform a tail call "
2982  "%select{from|to}0 a %select{constructor|destructor}1">;
2983def note_musttail_structors_forbidden : Note<"target "
2984  "%select{constructor|destructor}0 is declared here">;
2985def err_musttail_forbidden_from_this_context : Error<
2986  "%0 attribute cannot be used from "
2987  "%select{a block|an Objective-C function|this context}1">;
2988def err_musttail_member_mismatch : Error<
2989  "%select{non-member|static member|non-static member}0 "
2990  "function cannot perform a tail call to "
2991  "%select{non-member|static member|non-static member|pointer-to-member}1 "
2992  "function%select{| %3}2">;
2993def note_musttail_callee_defined_here : Note<"%0 declared here">;
2994def note_tail_call_required : Note<"tail call required by %0 attribute here">;
2995def err_musttail_mismatch : Error<
2996  "cannot perform a tail call to function%select{| %1}0 because its signature "
2997  "is incompatible with the calling function">;
2998def note_musttail_mismatch : Note<
2999    "target function "
3000    "%select{is a member of different class%diff{ (expected $ but has $)|}1,2"
3001    "|has different number of parameters (expected %1 but has %2)"
3002    "|has type mismatch at %ordinal3 parameter"
3003    "%diff{ (expected $ but has $)|}1,2"
3004    "|has different return type%diff{ ($ expected but has $)|}1,2}0">;
3005def err_musttail_callconv_mismatch : Error<
3006  "cannot perform a tail call to function%select{| %1}0 because it uses an "
3007  "incompatible calling convention">;
3008def note_musttail_callconv_mismatch : Note<
3009  "target function has calling convention %1 (expected %0)">;
3010def err_musttail_scope : Error<
3011  "cannot perform a tail call from this return statement">;
3012def err_musttail_no_variadic : Error<
3013  "%0 attribute may not be used with variadic functions">;
3014
3015def err_nsobject_attribute : Error<
3016  "'NSObject' attribute is for pointer types only">;
3017def err_attributes_are_not_compatible : Error<
3018  "%0 and %1 attributes are not compatible">;
3019def err_attribute_invalid_argument : Error<
3020  "%select{a reference type|an array type|a non-vector or "
3021  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
3022def err_attribute_wrong_number_arguments : Error<
3023  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
3024  ":requires exactly %1 arguments}1">;
3025def err_attribute_wrong_number_arguments_for : Error <
3026  "%0 attribute references function %1, which %plural{0:takes no arguments|1:takes one argument|"
3027  ":takes exactly %2 arguments}2">;
3028def err_attribute_bounds_for_function : Error<
3029  "%0 attribute references parameter %1, but the function %2 has only %3 parameters">;
3030def err_attribute_no_member_function : Error<
3031  "%0 attribute cannot be applied to non-static member functions">;
3032def err_attribute_parameter_types : Error<
3033  "%0 attribute parameter types do not match: parameter %1 of function %2 has type %3, "
3034  "but parameter %4 of function %5 has type %6">;
3035
3036def err_attribute_too_many_arguments : Error<
3037  "%0 attribute takes no more than %1 argument%s1">;
3038def err_attribute_too_few_arguments : Error<
3039  "%0 attribute takes at least %1 argument%s1">;
3040def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
3041def err_attribute_invalid_bitint_vector_type : Error<
3042  "'_BitInt' vector element width must be %select{a power of 2|"
3043  "at least as wide as 'CHAR_BIT'}0">;
3044def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
3045def err_attribute_bad_neon_vector_size : Error<
3046  "Neon vector size must be 64 or 128 bits">;
3047def err_attribute_invalid_sve_type : Error<
3048  "%0 attribute applied to non-SVE type %1">;
3049def err_attribute_bad_sve_vector_size : Error<
3050  "invalid SVE vector size '%0', must match value set by "
3051  "'-msve-vector-bits' ('%1')">;
3052def err_attribute_arm_feature_sve_bits_unsupported : Error<
3053  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
3054  "value of 128, 256, 512, 1024 or 2048.">;
3055def err_sve_vector_in_non_sve_target : Error<
3056  "SVE vector type %0 cannot be used in a target without sve">;
3057def err_attribute_requires_positive_integer : Error<
3058  "%0 attribute requires a %select{positive|non-negative}1 "
3059  "integral compile time constant expression">;
3060def err_attribute_requires_opencl_version : Error<
3061  "attribute %0 is supported in the OpenCL version %1%select{| onwards}2">;
3062def err_invalid_branch_protection_spec : Error<
3063  "invalid or misplaced branch protection specification '%0'">;
3064def warn_unsupported_branch_protection_spec : Warning<
3065  "unsupported branch protection specification '%0'">, InGroup<BranchProtection>;
3066
3067def warn_unsupported_target_attribute
3068    : Warning<"%select{unsupported|duplicate|unknown}0%select{| CPU|"
3069              " tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' "
3070              "attribute string; '%select{target|target_clones|target_version}3' "
3071              "attribute ignored">,
3072      InGroup<IgnoredAttributes>;
3073def err_attribute_unsupported
3074    : Error<"%0 attribute is not supported on targets missing %1;"
3075            " specify an appropriate -march= or -mcpu=">;
3076// The err_*_attribute_argument_not_int are separate because they're used by
3077// VerifyIntegerConstantExpression.
3078def err_aligned_attribute_argument_not_int : Error<
3079  "'aligned' attribute requires integer constant">;
3080def err_align_value_attribute_argument_not_int : Error<
3081  "'align_value' attribute requires integer constant">;
3082def err_alignas_attribute_wrong_decl_type : Error<
3083  "%0 attribute cannot be applied to %select{a function parameter|"
3084  "a variable with 'register' storage class|a 'catch' variable|a bit-field|"
3085  "an enumeration}1">;
3086def err_alignas_missing_on_definition : Error<
3087  "%0 must be specified on definition if it is specified on any declaration">;
3088def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
3089def err_alignas_mismatch : Error<
3090  "redeclaration has different alignment requirement (%1 vs %0)">;
3091def err_alignas_underaligned : Error<
3092  "requested alignment is less than minimum alignment of %1 for type %0">;
3093def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Summary>,
3094  InGroup<IgnoredAttributes>;
3095def err_attribute_sizeless_type : Error<
3096  "%0 attribute cannot be applied to sizeless type %1">;
3097def err_attribute_argument_n_type : Error<
3098  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
3099  "constant|a string|an identifier|a constant expression|a builtin function}2">;
3100def err_attribute_argument_type : Error<
3101  "%0 attribute requires %select{int or bool|an integer "
3102  "constant|a string|an identifier}1">;
3103def err_attribute_argument_out_of_range : Error<
3104  "%0 attribute requires integer constant between %1 and %2 inclusive">;
3105def err_init_priority_object_attr : Error<
3106  "can only use 'init_priority' attribute on file-scope definitions "
3107  "of objects of class type">;
3108def err_attribute_argument_out_of_bounds : Error<
3109  "%0 attribute parameter %1 is out of bounds">;
3110def err_attribute_only_once_per_parameter : Error<
3111  "%0 attribute can only be applied once per parameter">;
3112def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
3113def note_previous_uuid : Note<"previous uuid specified here">;
3114def warn_attribute_pointers_only : Warning<
3115  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
3116  InGroup<IgnoredAttributes>;
3117def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Summary>;
3118def err_attribute_integers_only : Error<
3119  "%0 attribute argument may only refer to a function parameter of integer "
3120  "type">;
3121def warn_attribute_return_pointers_only : Warning<
3122  "%0 attribute only applies to return values that are pointers">,
3123  InGroup<IgnoredAttributes>;
3124def warn_attribute_return_pointers_refs_only : Warning<
3125  "%0 attribute only applies to return values that are pointers or references">,
3126  InGroup<IgnoredAttributes>;
3127def warn_attribute_pointer_or_reference_only : Warning<
3128  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
3129  InGroup<IgnoredAttributes>;
3130def err_attribute_no_member_pointers : Error<
3131  "%0 attribute cannot be used with pointers to members">;
3132def err_attribute_invalid_implicit_this_argument : Error<
3133  "%0 attribute is invalid for the implicit this argument">;
3134def err_ownership_type : Error<
3135  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
3136def err_ownership_returns_index_mismatch : Error<
3137  "'ownership_returns' attribute index does not match; here it is %0">;
3138def note_ownership_returns_index_mismatch : Note<
3139  "declared with index %0 here">;
3140def err_format_strftime_third_parameter : Error<
3141  "strftime format attribute requires 3rd parameter to be 0">;
3142def err_format_attribute_not : Error<"format argument not a string type">;
3143def err_format_attribute_result_not : Error<"function does not return %0">;
3144def err_format_attribute_implicit_this_format_string : Error<
3145  "format attribute cannot specify the implicit this argument as the format "
3146  "string">;
3147def err_callback_attribute_no_callee : Error<
3148  "'callback' attribute specifies no callback callee">;
3149def err_callback_attribute_invalid_callee : Error<
3150  "'callback' attribute specifies invalid callback callee">;
3151def err_callback_attribute_multiple : Error<
3152  "multiple 'callback' attributes specified">;
3153def err_callback_attribute_argument_unknown : Error<
3154  "'callback' attribute argument %0 is not a known function parameter">;
3155def err_callback_callee_no_function_type : Error<
3156  "'callback' attribute callee does not have function type">;
3157def err_callback_callee_is_variadic : Error<
3158  "'callback' attribute callee may not be variadic">;
3159def err_callback_implicit_this_not_available : Error<
3160  "'callback' argument at position %0 references unavailable implicit 'this'">;
3161def err_init_method_bad_return_type : Error<
3162  "init methods must return an object pointer type, not %0">;
3163def err_attribute_invalid_size : Error<
3164  "vector size not an integral multiple of component size">;
3165def err_attribute_zero_size : Error<"zero %0 size">;
3166def err_attribute_size_too_large : Error<"%0 size too large">;
3167def err_typecheck_sve_ambiguous : Error<
3168  "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">;
3169def err_typecheck_sve_gnu_ambiguous : Error<
3170  "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">;
3171def err_typecheck_vector_not_convertable_implict_truncation : Error<
3172   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
3173   " %2 as implicit conversion would cause truncation">;
3174def err_typecheck_vector_not_convertable : Error<
3175  "cannot convert between vector values of different size (%0 and %1)">;
3176def err_typecheck_vector_not_convertable_non_scalar : Error<
3177  "cannot convert between vector and non-scalar values (%0 and %1)">;
3178def err_typecheck_vector_lengths_not_equal : Error<
3179  "vector operands do not have the same number of elements (%0 and %1)">;
3180def warn_typecheck_vector_element_sizes_not_equal : Warning<
3181  "vector operands do not have the same elements sizes (%0 and %1)">,
3182  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
3183def err_ext_vector_component_exceeds_length : Error<
3184  "vector component access exceeds type %0">;
3185def err_ext_vector_component_name_illegal : Error<
3186  "illegal vector component name '%0'">;
3187def err_attribute_address_space_negative : Error<
3188  "address space is negative">;
3189def err_attribute_address_space_too_high : Error<
3190  "address space is larger than the maximum supported (%0)">;
3191def err_attribute_address_multiple_qualifiers : Error<
3192  "multiple address spaces specified for type">;
3193def warn_attribute_address_multiple_identical_qualifiers : Warning<
3194  "multiple identical address spaces specified for type">,
3195  InGroup<DuplicateDeclSpecifier>;
3196def err_attribute_not_clinkage : Error<
3197  "function type with %0 attribute must have C linkage">;
3198def err_function_decl_cmse_ns_call : Error<
3199  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
3200def err_attribute_address_function_type : Error<
3201  "function type may not be qualified with an address space">;
3202def err_as_qualified_auto_decl : Error<
3203  "automatic variable qualified with an%select{| invalid}0 address space">;
3204def err_arg_with_address_space : Error<
3205  "parameter may not be qualified with an address space">;
3206def err_field_with_address_space : Error<
3207  "field may not be qualified with an address space">;
3208def err_compound_literal_with_address_space : Error<
3209  "compound literal in function scope may not be qualified with an address space">;
3210def err_address_space_mismatch_templ_inst : Error<
3211  "conflicting address space qualifiers are provided between types %0 and %1">;
3212def err_attr_objc_ownership_redundant : Error<
3213  "the type %0 is already explicitly ownership-qualified">;
3214def err_invalid_nsnumber_type : Error<
3215  "%0 is not a valid literal type for NSNumber">;
3216def err_objc_illegal_boxed_expression_type : Error<
3217  "illegal type %0 used in a boxed expression">;
3218def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3219  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3220def err_objc_incomplete_boxed_expression_type : Error<
3221  "incomplete type %0 used in a boxed expression">;
3222def err_undeclared_objc_literal_class : Error<
3223  "definition of class %0 must be available to use Objective-C "
3224  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3225  "string literals}1">;
3226def err_undeclared_boxing_method : Error<
3227  "declaration of %0 is missing in %1 class">;
3228def err_objc_literal_method_sig : Error<
3229  "literal construction method %0 has incompatible signature">;
3230def note_objc_literal_method_param : Note<
3231  "%select{first|second|third}0 parameter has unexpected type %1 "
3232  "(should be %2)">;
3233def note_objc_literal_method_return : Note<
3234  "method returns unexpected type %0 (should be an object type)">;
3235def err_invalid_collection_element : Error<
3236  "collection element of type %0 is not an Objective-C object">;
3237def err_box_literal_collection : Error<
3238  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3239  "in a collection">;
3240def warn_objc_literal_comparison : Warning<
3241  "direct comparison of %select{an array literal|a dictionary literal|"
3242  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3243  InGroup<ObjCLiteralComparison>;
3244def err_missing_atsign_prefix : Error<
3245  "%select{string|numeric}0 literal must be prefixed by '@'">;
3246def warn_objc_string_literal_comparison : Warning<
3247  "direct comparison of a string literal has undefined behavior">,
3248  InGroup<ObjCStringComparison>;
3249def warn_concatenated_literal_array_init : Warning<
3250  "suspicious concatenation of string literals in an array initialization; "
3251  "did you mean to separate the elements with a comma?">,
3252  InGroup<StringConcatation>, DefaultIgnore;
3253def warn_concatenated_nsarray_literal : Warning<
3254  "concatenated NSString literal for an NSArray expression - "
3255  "possibly missing a comma">,
3256  InGroup<ObjCStringConcatenation>;
3257def note_objc_literal_comparison_isequal : Note<
3258  "use 'isEqual:' instead">;
3259def warn_objc_collection_literal_element : Warning<
3260  "object of type %0 is not compatible with "
3261  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3262  InGroup<ObjCLiteralConversion>;
3263def warn_nsdictionary_duplicate_key : Warning<
3264  "duplicate key in dictionary literal">,
3265  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3266def note_nsdictionary_duplicate_key_here : Note<
3267  "previous equal key is here">;
3268def err_swift_param_attr_not_swiftcall : Error<
3269  "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 "
3270  "calling convention%select{|s}1">;
3271def err_swift_indirect_result_not_first : Error<
3272  "'swift_indirect_result' parameters must be first parameters of function">;
3273def err_swift_error_result_not_after_swift_context : Error<
3274  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3275def err_swift_abi_parameter_wrong_type : Error<
3276  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3277  "type here is %2">;
3278
3279def err_attribute_argument_invalid : Error<
3280  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3281  "min must not be greater than max}1">;
3282def err_attribute_argument_is_zero : Error<
3283  "%0 attribute must be greater than 0">;
3284def warn_attribute_argument_n_negative : Warning<
3285  "%0 attribute parameter %1 is negative and will be ignored">,
3286  InGroup<CudaCompat>;
3287def err_property_function_in_objc_container : Error<
3288  "use of Objective-C property in function nested in Objective-C "
3289  "container not supported, move function outside its container">;
3290
3291let CategoryName = "Cocoa API Issue" in {
3292def warn_objc_redundant_literal_use : Warning<
3293  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3294}
3295
3296def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3297  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3298
3299def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
3300
3301def err_tls_var_aligned_over_maximum : Error<
3302  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3303  "alignment (%2) for a thread-local variable on this target">;
3304
3305def err_only_annotate_after_access_spec : Error<
3306  "access specifier can only have annotation attributes">;
3307
3308def err_attribute_section_invalid_for_target : Error<
3309  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3310def err_pragma_section_invalid_for_target : Error<
3311  "argument to #pragma section is not valid for this target: %0">;
3312def warn_attribute_section_drectve : Warning<
3313  "#pragma %0(\".drectve\") has undefined behavior, "
3314  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3315def warn_mismatched_section : Warning<
3316  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3317def warn_attribute_section_on_redeclaration : Warning<
3318  "section attribute is specified on redeclared variable">, InGroup<Section>;
3319def err_mismatched_code_seg_base : Error<
3320  "derived class must specify the same code segment as its base classes">;
3321def err_mismatched_code_seg_override : Error<
3322  "overriding virtual function must specify the same code segment as its overridden function">;
3323def err_conflicting_codeseg_attribute : Error<
3324  "conflicting code segment specifiers">;
3325def warn_duplicate_codeseg_attribute : Warning<
3326  "duplicate code segment specifiers">, InGroup<Section>;
3327
3328def err_anonymous_property: Error<
3329  "anonymous property is not supported">;
3330def err_property_is_variably_modified : Error<
3331  "property %0 has a variably modified type">;
3332def err_no_accessor_for_property : Error<
3333  "no %select{getter|setter}0 defined for property %1">;
3334def err_cannot_find_suitable_accessor : Error<
3335  "cannot find suitable %select{getter|setter}0 for property %1">;
3336
3337def warn_alloca : Warning<
3338  "use of function %0 is discouraged; there is no way to check for failure but "
3339  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3340  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3341
3342def warn_alloca_align_alignof : Warning<
3343  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3344  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3345
3346def err_alignment_too_small : Error<
3347  "requested alignment must be %0 or greater">;
3348def err_alignment_too_big : Error<
3349  "requested alignment must be %0 or smaller">;
3350def err_alignment_not_power_of_two : Error<
3351  "requested alignment is not a power of 2">;
3352def warn_alignment_not_power_of_two : Warning<
3353  err_alignment_not_power_of_two.Summary>,
3354  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3355def err_alignment_dependent_typedef_name : Error<
3356  "requested alignment is dependent but declaration is not dependent">;
3357
3358def warn_alignment_builtin_useless : Warning<
3359  "%select{aligning a value|the result of checking whether a value is aligned}0"
3360  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3361def err_attribute_aligned_too_great : Error<
3362  "requested alignment must be %0 bytes or smaller">;
3363def warn_assume_aligned_too_great
3364    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3365              "alignment assumed">,
3366      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3367def warn_not_xl_compatible
3368    : Warning<"alignment of 16 bytes for a struct member is not binary "
3369              "compatible with IBM XL C/C++ for AIX 16.1.0 or older">,
3370      InGroup<AIXCompat>;
3371def note_misaligned_member_used_here : Note<
3372    "passing byval argument %0 with potentially incompatible alignment here">;
3373def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3374  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3375  InGroup<MicrosoftInconsistentDllImport>;
3376def warn_redeclaration_without_import_attribute : Warning<
3377  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3378  InGroup<MicrosoftInconsistentDllImport>;
3379def warn_dllimport_dropped_from_inline_function : Warning<
3380  "%q0 redeclared inline; %1 attribute ignored">,
3381  InGroup<IgnoredAttributes>;
3382def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3383  " exception specification; attribute ignored">,
3384  InGroup<IgnoredAttributes>;
3385def warn_attribute_ignored_on_non_definition :
3386  Warning<"%0 attribute ignored on a non-definition declaration">,
3387  InGroup<IgnoredAttributes>;
3388def warn_attribute_ignored_on_inline :
3389  Warning<"%0 attribute ignored on inline function">,
3390  InGroup<IgnoredAttributes>;
3391def warn_nocf_check_attribute_ignored :
3392  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3393  InGroup<IgnoredAttributes>;
3394def warn_attribute_after_definition_ignored : Warning<
3395  "attribute %0 after definition is ignored">,
3396   InGroup<IgnoredAttributes>;
3397def warn_attributes_likelihood_ifstmt_conflict
3398    : Warning<"conflicting attributes %0 are ignored">,
3399      InGroup<IgnoredAttributes>;
3400def warn_cxx11_gnu_attribute_on_type : Warning<
3401  "attribute %0 ignored, because it cannot be applied to a type">,
3402  InGroup<IgnoredAttributes>;
3403def warn_unhandled_ms_attribute_ignored : Warning<
3404  "__declspec attribute %0 is not supported">,
3405  InGroup<IgnoredAttributes>;
3406def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3407  "attribute %0 has no effect when annotating an infinite loop">,
3408   InGroup<IgnoredAttributes>;
3409def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3410  "annotating the infinite loop here">;
3411def warn_attribute_has_no_effect_on_compile_time_if : Warning<
3412  "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">,
3413   InGroup<IgnoredAttributes>;
3414def note_attribute_has_no_effect_on_compile_time_if_here : Note<
3415  "annotating the 'if %select{constexpr|consteval}0' statement here">;
3416def err_decl_attribute_invalid_on_stmt : Error<
3417  "%0 attribute cannot be applied to a statement">;
3418def err_attribute_invalid_on_decl : Error<
3419  "%0 attribute cannot be applied to a declaration">;
3420def warn_type_attribute_deprecated_on_decl : Warning<
3421  "applying attribute %0 to a declaration is deprecated; apply it to the type instead">,
3422  InGroup<DeprecatedAttributes>;
3423def warn_declspec_attribute_ignored : Warning<
3424  "attribute %0 is ignored, place it after "
3425  "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
3426  "type declaration">, InGroup<IgnoredAttributes>;
3427def warn_attribute_precede_definition : Warning<
3428  "attribute declaration must precede definition">,
3429  InGroup<IgnoredAttributes>;
3430def warn_attribute_void_function_method : Warning<
3431  "attribute %0 cannot be applied to "
3432  "%select{functions|Objective-C method}1 without return value">,
3433  InGroup<IgnoredAttributes>;
3434def warn_attribute_weak_on_field : Warning<
3435  "__weak attribute cannot be specified on a field declaration">,
3436  InGroup<IgnoredAttributes>;
3437def warn_gc_attribute_weak_on_local : Warning<
3438  "Objective-C GC does not allow weak variables on the stack">,
3439  InGroup<IgnoredAttributes>;
3440def warn_nsobject_attribute : Warning<
3441  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3442  InGroup<NSobjectAttribute>;
3443def warn_independentclass_attribute : Warning<
3444  "'objc_independent_class' attribute may be put on a typedef only; "
3445  "attribute is ignored">,
3446  InGroup<IndependentClassAttribute>;
3447def warn_ptr_independentclass_attribute : Warning<
3448  "'objc_independent_class' attribute may be put on Objective-C object "
3449  "pointer type only; attribute is ignored">,
3450  InGroup<IndependentClassAttribute>;
3451def warn_attribute_weak_on_local : Warning<
3452  "__weak attribute cannot be specified on an automatic variable when ARC "
3453  "is not enabled">,
3454  InGroup<IgnoredAttributes>;
3455def warn_weak_identifier_undeclared : Warning<
3456  "weak identifier %0 never declared">;
3457def warn_attribute_cmse_entry_static : Warning<
3458  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3459  InGroup<IgnoredAttributes>;
3460def warn_cmse_nonsecure_union : Warning<
3461  "passing union across security boundary via %select{parameter %1|return value}0 "
3462  "may leak information">,
3463  InGroup<DiagGroup<"cmse-union-leak">>;
3464def err_attribute_weak_static : Error<
3465  "weak declaration cannot have internal linkage">;
3466def err_attribute_selectany_non_extern_data : Error<
3467  "'selectany' can only be applied to data items with external linkage">;
3468def err_declspec_thread_on_thread_variable : Error<
3469  "'__declspec(thread)' applied to variable that already has a "
3470  "thread-local storage specifier">;
3471def err_attribute_dll_not_extern : Error<
3472  "%q0 must have external linkage when declared %q1">;
3473def err_attribute_dll_thread_local : Error<
3474  "%q0 cannot be thread local when declared %q1">;
3475def err_attribute_dll_lambda : Error<
3476  "lambda cannot be declared %0">;
3477def warn_attribute_invalid_on_definition : Warning<
3478  "'%0' attribute cannot be specified on a definition">,
3479  InGroup<IgnoredAttributes>;
3480def err_attribute_dll_redeclaration : Error<
3481  "redeclaration of %q0 cannot add %q1 attribute">;
3482def warn_attribute_dll_redeclaration : Warning<
3483  "redeclaration of %q0 should not add %q1 attribute">,
3484  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3485def err_attribute_dllimport_function_definition : Error<
3486  "dllimport cannot be applied to non-inline function definition">;
3487def err_attribute_dllimport_function_specialization_definition : Error<
3488  "cannot define non-inline dllimport template specialization">;
3489def err_attribute_dll_deleted : Error<
3490  "attribute %q0 cannot be applied to a deleted function">;
3491def err_attribute_dllimport_data_definition : Error<
3492  "definition of dllimport data">;
3493def err_attribute_dllimport_static_field_definition : Error<
3494  "definition of dllimport static field not allowed">;
3495def warn_attribute_dllimport_static_field_definition : Warning<
3496  "definition of dllimport static field">,
3497  InGroup<DiagGroup<"dllimport-static-field-def">>;
3498def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3499  "explicit instantiation declaration should not be 'dllexport'">,
3500  InGroup<DllexportExplicitInstantiationDecl>;
3501def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3502  "'dllexport' attribute ignored on explicit instantiation definition">,
3503  InGroup<IgnoredAttributes>;
3504def warn_invalid_initializer_from_system_header : Warning<
3505  "invalid constructor from class in system header, should not be explicit">,
3506  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3507def note_used_in_initialization_here : Note<"used in initialization here">;
3508def err_attribute_dll_member_of_dll_class : Error<
3509  "attribute %q0 cannot be applied to member of %q1 class">;
3510def warn_attribute_dll_instantiated_base_class : Warning<
3511  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3512  "base class template without dll attribute is not supported">,
3513  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3514def err_attribute_dll_ambiguous_default_ctor : Error<
3515  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3516def err_attribute_weakref_not_static : Error<
3517  "weakref declaration must have internal linkage">;
3518def err_attribute_weakref_not_global_context : Error<
3519  "weakref declaration of %0 must be in a global context">;
3520def err_attribute_weakref_without_alias : Error<
3521  "weakref declaration of %0 must also have an alias attribute">;
3522def err_alias_not_supported_on_darwin : Error <
3523  "aliases are not supported on darwin">;
3524def warn_attribute_wrong_decl_type_str : Warning<
3525  "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
3526def err_attribute_wrong_decl_type_str : Error<
3527  warn_attribute_wrong_decl_type_str.Summary>;
3528def warn_attribute_wrong_decl_type : Warning<
3529  "%0 attribute only applies to %select{"
3530  "functions"
3531  "|unions"
3532  "|variables and functions"
3533  "|functions and methods"
3534  "|functions, methods and blocks"
3535  "|functions, methods, and parameters"
3536  "|variables"
3537  "|variables and fields"
3538  "|variables, data members and tag types"
3539  "|types and namespaces"
3540  "|variables, functions and classes"
3541  "|kernel functions"
3542  "|non-K&R-style functions}1">,
3543  InGroup<IgnoredAttributes>;
3544def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Summary>;
3545def warn_type_attribute_wrong_type : Warning<
3546  "'%0' only applies to %select{function|pointer|"
3547  "Objective-C object or block pointer}1 types; type here is %2">,
3548  InGroup<IgnoredAttributes>;
3549def warn_incomplete_encoded_type : Warning<
3550  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3551  InGroup<DiagGroup<"encode-type">>;
3552def warn_gnu_inline_attribute_requires_inline : Warning<
3553  "'gnu_inline' attribute requires function to be marked 'inline',"
3554  " attribute ignored">,
3555  InGroup<IgnoredAttributes>;
3556def warn_gnu_inline_cplusplus_without_extern : Warning<
3557  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3558  " available, this changed in Clang 10">,
3559  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3560def err_attribute_vecreturn_only_vector_member : Error<
3561  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3562def err_attribute_vecreturn_only_pod_record : Error<
3563  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3564def err_cconv_change : Error<
3565  "function declared '%0' here was previously declared "
3566  "%select{'%2'|without calling convention}1">;
3567def warn_cconv_unsupported : Warning<
3568  "%0 calling convention is not supported %select{"
3569  // Use CallingConventionIgnoredReason Enum to specify these.
3570  "for this target"
3571  "|on variadic function"
3572  "|on constructor/destructor"
3573  "|on builtin function"
3574  "}1">,
3575  InGroup<IgnoredAttributes>;
3576def error_cconv_unsupported : Error<warn_cconv_unsupported.Summary>;
3577def err_cconv_knr : Error<
3578  "function with no prototype cannot use the %0 calling convention">;
3579def warn_cconv_knr : Warning<
3580  err_cconv_knr.Summary>,
3581  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3582def err_cconv_varargs : Error<
3583  "variadic function cannot use %0 calling convention">;
3584def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3585  "attribute was previously declared "
3586  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3587def err_function_attribute_mismatch : Error<
3588  "function declared with %0 attribute "
3589  "was previously declared without the %0 attribute">;
3590def err_objc_precise_lifetime_bad_type : Error<
3591  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3592def warn_objc_precise_lifetime_meaningless : Error<
3593  "objc_precise_lifetime is not meaningful for "
3594  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3595def err_invalid_pcs : Error<"invalid PCS type">;
3596def warn_attribute_not_on_decl : Warning<
3597  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3598def err_base_specifier_attribute : Error<
3599  "%0 attribute cannot be applied to a base specifier">;
3600def warn_declspec_allocator_nonpointer : Warning<
3601  "ignoring __declspec(allocator) because the function return type %0 is not "
3602  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3603def err_cconv_incomplete_param_type : Error<
3604  "parameter %0 must have a complete type to use function %1 with the %2 "
3605  "calling convention">;
3606def err_attribute_output_parameter : Error<
3607  "attribute only applies to output parameters">;
3608
3609def ext_cannot_use_trivial_abi : ExtWarn<
3610  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3611def note_cannot_use_trivial_abi_reason : Note<
3612  "'trivial_abi' is disallowed on %0 because %select{"
3613  "its copy constructors and move constructors are all deleted|"
3614  "it is polymorphic|"
3615  "it has a base of a non-trivial class type|it has a virtual base|"
3616  "it has a __weak field|it has a field of a non-trivial class type}1">;
3617
3618// Availability attribute
3619def warn_availability_unknown_platform : Warning<
3620  "unknown platform %0 in availability macro">, InGroup<Availability>;
3621def warn_availability_version_ordering : Warning<
3622  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3623  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3624  "attribute ignored">, InGroup<Availability>;
3625def warn_mismatched_availability: Warning<
3626  "availability does not match previous declaration">, InGroup<Availability>;
3627def warn_mismatched_availability_override : Warning<
3628  "%select{|overriding }4method %select{introduced after|"
3629  "deprecated before|obsoleted before}0 "
3630  "%select{the protocol method it implements|overridden method}4 "
3631  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3632def warn_mismatched_availability_override_unavail : Warning<
3633  "%select{|overriding }1method cannot be unavailable on %0 when "
3634  "%select{the protocol method it implements|its overridden method}1 is "
3635  "available">,
3636  InGroup<Availability>;
3637def warn_availability_on_static_initializer : Warning<
3638  "ignoring availability attribute %select{on '+load' method|"
3639  "with constructor attribute|with destructor attribute}0">,
3640  InGroup<Availability>;
3641def note_overridden_method : Note<
3642  "overridden method is here">;
3643def warn_availability_swift_unavailable_deprecated_only : Warning<
3644  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3645  InGroup<Availability>;
3646def note_protocol_method : Note<
3647  "protocol method is here">;
3648def warn_availability_fuchsia_unavailable_minor : Warning<
3649  "Fuchsia API Level prohibits specifying a minor or sub-minor version">,
3650  InGroup<Availability>;
3651
3652def warn_unguarded_availability :
3653  Warning<"%0 is only available on %1 %2 or newer">,
3654  InGroup<UnguardedAvailability>, DefaultIgnore;
3655def warn_unguarded_availability_new :
3656  Warning<warn_unguarded_availability.Summary>,
3657  InGroup<UnguardedAvailabilityNew>;
3658def note_decl_unguarded_availability_silence : Note<
3659  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3660def note_unguarded_available_silence : Note<
3661  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3662  " this warning">;
3663def warn_at_available_unchecked_use : Warning<
3664  "%select{@available|__builtin_available}0 does not guard availability here; "
3665  "use if (%select{@available|__builtin_available}0) instead">,
3666  InGroup<DiagGroup<"unsupported-availability-guard">>;
3667
3668def warn_missing_sdksettings_for_availability_checking : Warning<
3669  "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
3670  InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
3671
3672// Thread Safety Attributes
3673def warn_thread_attribute_ignored : Warning<
3674  "ignoring %0 attribute because its argument is invalid">,
3675  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3676def warn_thread_attribute_not_on_non_static_member : Warning<
3677  "%0 attribute without capability arguments can only be applied to non-static "
3678  "methods of a class">,
3679  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3680def warn_thread_attribute_not_on_capability_member : Warning<
3681  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3682  "annotated with 'capability' or 'scoped_lockable' attribute">,
3683  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3684def warn_thread_attribute_argument_not_lockable : Warning<
3685  "%0 attribute requires arguments whose type is annotated "
3686  "with 'capability' attribute; type here is %1">,
3687  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3688def warn_thread_attribute_decl_not_lockable : Warning<
3689  "%0 attribute can only be applied in a context annotated "
3690  "with 'capability' attribute">,
3691  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3692def warn_thread_attribute_decl_not_pointer : Warning<
3693  "%0 only applies to pointer types; type here is %1">,
3694  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3695def err_attribute_argument_out_of_bounds_extra_info : Error<
3696  "%0 attribute parameter %1 is out of bounds: "
3697  "%plural{0:no parameters to index into|"
3698  "1:can only be 1, since there is one parameter|"
3699  ":must be between 1 and %2}2">;
3700
3701// Thread Safety Analysis
3702def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3703  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3704def warn_unlock_kind_mismatch : Warning<
3705  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3706  "%select{shared|exclusive}3 access">,
3707  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3708def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3709  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3710def warn_no_unlock : Warning<
3711  "%0 '%1' is still held at the end of function">,
3712  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3713def warn_expecting_locked : Warning<
3714  "expecting %0 '%1' to be held at the end of function">,
3715  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3716// FIXME: improve the error message about locks not in scope
3717def warn_lock_some_predecessors : Warning<
3718  "%0 '%1' is not held on every path through here">,
3719  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3720def warn_expecting_lock_held_on_loop : Warning<
3721  "expecting %0 '%1' to be held at start of each loop">,
3722  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3723def note_locked_here : Note<"%0 acquired here">;
3724def note_unlocked_here : Note<"%0 released here">;
3725def warn_lock_exclusive_and_shared : Warning<
3726  "%0 '%1' is acquired exclusively and shared in the same scope">,
3727  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3728def note_lock_exclusive_and_shared : Note<
3729  "the other acquisition of %0 '%1' is here">;
3730def warn_variable_requires_any_lock : Warning<
3731  "%select{reading|writing}1 variable %0 requires holding "
3732  "%select{any mutex|any mutex exclusively}1">,
3733  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3734def warn_var_deref_requires_any_lock : Warning<
3735  "%select{reading|writing}1 the value pointed to by %0 requires holding "
3736  "%select{any mutex|any mutex exclusively}1">,
3737  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3738def warn_fun_excludes_mutex : Warning<
3739  "cannot call function '%1' while %0 '%2' is held">,
3740  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3741def warn_cannot_resolve_lock : Warning<
3742  "cannot resolve lock expression">,
3743  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3744def warn_acquired_before : Warning<
3745  "%0 '%1' must be acquired before '%2'">,
3746  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3747def warn_acquired_before_after_cycle : Warning<
3748  "Cycle in acquired_before/after dependencies, starting with '%0'">,
3749  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3750
3751
3752// Thread safety warnings negative capabilities
3753def warn_acquire_requires_negative_cap : Warning<
3754  "acquiring %0 '%1' requires negative capability '%2'">,
3755  InGroup<ThreadSafetyNegative>, DefaultIgnore;
3756def warn_fun_requires_negative_cap : Warning<
3757  "calling function %0 requires negative capability '%1'">,
3758  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3759
3760// Thread safety warnings on pass by reference
3761def warn_guarded_pass_by_reference : Warning<
3762  "passing variable %1 by reference requires holding %0 "
3763  "%select{'%2'|'%2' exclusively}3">,
3764  InGroup<ThreadSafetyReference>, DefaultIgnore;
3765def warn_pt_guarded_pass_by_reference : Warning<
3766  "passing the value that %1 points to by reference requires holding %0 "
3767  "%select{'%2'|'%2' exclusively}3">,
3768  InGroup<ThreadSafetyReference>, DefaultIgnore;
3769
3770// Imprecise thread safety warnings
3771def warn_variable_requires_lock : Warning<
3772  "%select{reading|writing}3 variable %1 requires holding %0 "
3773  "%select{'%2'|'%2' exclusively}3">,
3774  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3775def warn_var_deref_requires_lock : Warning<
3776  "%select{reading|writing}3 the value pointed to by %1 requires "
3777  "holding %0 %select{'%2'|'%2' exclusively}3">,
3778  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3779def warn_fun_requires_lock : Warning<
3780  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3781  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3782
3783// Precise thread safety warnings
3784def warn_variable_requires_lock_precise :
3785  Warning<warn_variable_requires_lock.Summary>,
3786  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3787def warn_var_deref_requires_lock_precise :
3788  Warning<warn_var_deref_requires_lock.Summary>,
3789  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3790def warn_fun_requires_lock_precise :
3791  Warning<warn_fun_requires_lock.Summary>,
3792  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3793def note_found_mutex_near_match : Note<"found near match '%0'">;
3794
3795// Verbose thread safety warnings
3796def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
3797  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3798def note_thread_warning_in_fun : Note<"thread warning in function %0">;
3799def note_guarded_by_declared_here : Note<"guarded_by declared here">;
3800
3801// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3802def warn_thread_safety_beta : Warning<"thread safety beta warning">,
3803  InGroup<ThreadSafetyBeta>, DefaultIgnore;
3804
3805// Consumed warnings
3806def warn_use_in_invalid_state : Warning<
3807  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3808  "state">, InGroup<Consumed>, DefaultIgnore;
3809def warn_use_of_temp_in_invalid_state : Warning<
3810  "invalid invocation of method '%0' on a temporary object while it is in the "
3811  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3812def warn_attr_on_unconsumable_class : Warning<
3813  "consumed analysis attribute is attached to member of class %0 which isn't "
3814  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3815def warn_return_typestate_for_unconsumable_type : Warning<
3816  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3817  DefaultIgnore;
3818def warn_return_typestate_mismatch : Warning<
3819  "return value not in expected state; expected '%0', observed '%1'">,
3820  InGroup<Consumed>, DefaultIgnore;
3821def warn_loop_state_mismatch : Warning<
3822  "state of variable '%0' must match at the entry and exit of loop">,
3823  InGroup<Consumed>, DefaultIgnore;
3824def warn_param_return_typestate_mismatch : Warning<
3825  "parameter '%0' not in expected state when the function returns: expected "
3826  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3827def warn_param_typestate_mismatch : Warning<
3828  "argument not in expected state; expected '%0', observed '%1'">,
3829  InGroup<Consumed>, DefaultIgnore;
3830
3831// no_sanitize attribute
3832def warn_unknown_sanitizer_ignored : Warning<
3833  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3834
3835def warn_impcast_vector_scalar : Warning<
3836  "implicit conversion turns vector to scalar: %0 to %1">,
3837  InGroup<Conversion>, DefaultIgnore;
3838def warn_impcast_complex_scalar : Warning<
3839  "implicit conversion discards imaginary component: %0 to %1">,
3840  InGroup<Conversion>, DefaultIgnore;
3841def err_impcast_complex_scalar : Error<
3842  "implicit conversion from %0 to %1 is not permitted in C++">;
3843def warn_impcast_float_precision : Warning<
3844  "implicit conversion loses floating-point precision: %0 to %1">,
3845  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3846def warn_impcast_float_result_precision : Warning<
3847  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3848  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3849def warn_impcast_double_promotion : Warning<
3850  "implicit conversion increases floating-point precision: %0 to %1">,
3851  InGroup<DoublePromotion>, DefaultIgnore;
3852def warn_impcast_integer_sign : Warning<
3853  "implicit conversion changes signedness: %0 to %1">,
3854  InGroup<SignConversion>, DefaultIgnore;
3855def warn_impcast_integer_sign_conditional : Warning<
3856  "operand of ? changes signedness: %0 to %1">,
3857  InGroup<SignConversion>, DefaultIgnore;
3858def warn_impcast_integer_precision : Warning<
3859  "implicit conversion loses integer precision: %0 to %1">,
3860  InGroup<ImplicitIntConversion>, DefaultIgnore;
3861def warn_impcast_high_order_zero_bits : Warning<
3862  "higher order bits are zeroes after implicit conversion">,
3863  InGroup<ImplicitIntConversion>, DefaultIgnore;
3864def warn_impcast_nonnegative_result : Warning<
3865  "the resulting value is always non-negative after implicit conversion">,
3866  InGroup<SignConversion>, DefaultIgnore;
3867def warn_impcast_integer_64_32 : Warning<
3868  "implicit conversion loses integer precision: %0 to %1">,
3869  InGroup<Shorten64To32>, DefaultIgnore;
3870def warn_impcast_integer_precision_constant : Warning<
3871  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3872  InGroup<ConstantConversion>;
3873def warn_impcast_single_bit_bitield_precision_constant : Warning<
3874  "implicit truncation from %2 to a one-bit wide bit-field changes value from "
3875  "%0 to %1">, InGroup<SingleBitBitFieldConstantConversion>;
3876def warn_impcast_bitfield_precision_constant : Warning<
3877  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3878  InGroup<BitFieldConstantConversion>;
3879def warn_impcast_constant_value_to_objc_bool : Warning<
3880  "implicit conversion from constant value %0 to 'BOOL'; "
3881  "the only well defined values for 'BOOL' are YES and NO">,
3882  InGroup<ObjCBoolConstantConversion>;
3883
3884def warn_impcast_fixed_point_range : Warning<
3885  "implicit conversion from %0 cannot fit within the range of values for %1">,
3886  InGroup<ImplicitFixedPointConversion>;
3887
3888def warn_impcast_literal_float_to_integer : Warning<
3889  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3890  InGroup<LiteralConversion>;
3891def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3892  "implicit conversion of out of range value from %0 to %1 is undefined">,
3893  InGroup<LiteralConversion>;
3894def warn_impcast_float_integer : Warning<
3895  "implicit conversion turns floating-point number into integer: %0 to %1">,
3896  InGroup<FloatConversion>, DefaultIgnore;
3897def warn_impcast_float_to_objc_signed_char_bool : Warning<
3898  "implicit conversion from floating-point type %0 to 'BOOL'">,
3899  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
3900def warn_impcast_int_to_objc_signed_char_bool : Warning<
3901  "implicit conversion from integral type %0 to 'BOOL'">,
3902  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
3903
3904// Implicit int -> float conversion precision loss warnings.
3905def warn_impcast_integer_float_precision : Warning<
3906  "implicit conversion from %0 to %1 may lose precision">,
3907  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
3908def warn_impcast_integer_float_precision_constant : Warning<
3909  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3910  InGroup<ImplicitConstIntFloatConversion>;
3911
3912def warn_impcast_float_to_integer : Warning<
3913  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3914  InGroup<FloatOverflowConversion>, DefaultIgnore;
3915def warn_impcast_float_to_integer_out_of_range : Warning<
3916  "implicit conversion of out of range value from %0 to %1 is undefined">,
3917  InGroup<FloatOverflowConversion>, DefaultIgnore;
3918def warn_impcast_float_to_integer_zero : Warning<
3919  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3920  InGroup<FloatZeroConversion>, DefaultIgnore;
3921
3922def warn_impcast_string_literal_to_bool : Warning<
3923  "implicit conversion turns string literal into bool: %0 to %1">,
3924  InGroup<StringConversion>, DefaultIgnore;
3925def warn_impcast_different_enum_types : Warning<
3926  "implicit conversion from enumeration type %0 to different enumeration type "
3927  "%1">, InGroup<EnumConversion>;
3928def warn_impcast_bool_to_null_pointer : Warning<
3929    "initialization of pointer of type %0 to null from a constant boolean "
3930    "expression">, InGroup<BoolConversion>;
3931def warn_non_literal_null_pointer : Warning<
3932    "expression which evaluates to zero treated as a null pointer constant of "
3933    "type %0">, InGroup<NonLiteralNullConversion>;
3934def warn_pointer_compare : Warning<
3935    "comparing a pointer to a null character constant; did you mean "
3936    "to compare to %select{NULL|(void *)0}0?">,
3937    InGroup<DiagGroup<"pointer-compare">>;
3938def warn_impcast_null_pointer_to_integer : Warning<
3939    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3940    InGroup<NullConversion>;
3941def warn_impcast_floating_point_to_bool : Warning<
3942    "implicit conversion turns floating-point number into bool: %0 to %1">,
3943    InGroup<ImplicitConversionFloatingPointToBool>;
3944def ext_ms_impcast_fn_obj : ExtWarn<
3945  "implicit conversion between pointer-to-function and pointer-to-object is a "
3946  "Microsoft extension">, InGroup<MicrosoftCast>;
3947
3948def warn_impcast_pointer_to_bool : Warning<
3949    "address of%select{| function| array}0 '%1' will always evaluate to "
3950    "'true'">,
3951    InGroup<PointerBoolConversion>;
3952def warn_cast_nonnull_to_bool : Warning<
3953    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3954    "'true' on first encounter">,
3955    InGroup<PointerBoolConversion>;
3956def warn_this_bool_conversion : Warning<
3957  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3958  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3959def warn_address_of_reference_bool_conversion : Warning<
3960  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3961  "code; pointer may be assumed to always convert to true">,
3962  InGroup<UndefinedBoolConversion>;
3963
3964def warn_xor_used_as_pow : Warning<
3965  "result of '%0' is %1; did you mean exponentiation?">,
3966  InGroup<XorUsedAsPow>;
3967def warn_xor_used_as_pow_base_extra : Warning<
3968  "result of '%0' is %1; did you mean '%2' (%3)?">,
3969  InGroup<XorUsedAsPow>;
3970def warn_xor_used_as_pow_base : Warning<
3971  "result of '%0' is %1; did you mean '%2'?">,
3972  InGroup<XorUsedAsPow>;
3973def note_xor_used_as_pow_silence : Note<
3974  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
3975
3976def warn_null_pointer_compare : Warning<
3977    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3978    "equal to a null pointer is always %select{true|false}2">,
3979    InGroup<TautologicalPointerCompare>;
3980def warn_nonnull_expr_compare : Warning<
3981    "comparison of nonnull %select{function call|parameter}0 '%1' "
3982    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3983    "encounter">,
3984    InGroup<TautologicalPointerCompare>;
3985def warn_this_null_compare : Warning<
3986  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3987  "assumed to always evaluate to %select{true|false}0">,
3988  InGroup<TautologicalUndefinedCompare>;
3989def warn_address_of_reference_null_compare : Warning<
3990  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3991  "code; comparison may be assumed to always evaluate to "
3992  "%select{true|false}0">,
3993  InGroup<TautologicalUndefinedCompare>;
3994def note_reference_is_return_value : Note<"%0 returns a reference">;
3995
3996def note_pointer_declared_here : Note<
3997  "pointer %0 declared here">;
3998def warn_division_sizeof_ptr : Warning<
3999  "'%0' will return the size of the pointer, not the array itself">,
4000  InGroup<DiagGroup<"sizeof-pointer-div">>;
4001def warn_division_sizeof_array : Warning<
4002  "expression does not compute the number of elements in this array; element "
4003  "type is %0, not %1">,
4004  InGroup<DiagGroup<"sizeof-array-div">>;
4005
4006def note_function_warning_silence : Note<
4007    "prefix with the address-of operator to silence this warning">;
4008def note_function_to_function_call : Note<
4009    "suffix with parentheses to turn this into a function call">;
4010def warn_impcast_objective_c_literal_to_bool : Warning<
4011    "implicit boolean conversion of Objective-C object literal always "
4012    "evaluates to true">,
4013    InGroup<ObjCLiteralConversion>;
4014
4015def warn_cast_align : Warning<
4016  "cast from %0 to %1 increases required alignment from %2 to %3">,
4017  InGroup<CastAlign>, DefaultIgnore;
4018def warn_old_style_cast : Warning<
4019  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore,
4020  SuppressInSystemMacro;
4021
4022// Separate between casts to void* and non-void* pointers.
4023// Some APIs use (abuse) void* for something like a user context,
4024// and often that value is an integer even if it isn't a pointer itself.
4025// Having a separate warning flag allows users to control the warning
4026// for their workflow.
4027def warn_int_to_pointer_cast : Warning<
4028  "cast to %1 from smaller integer type %0">,
4029  InGroup<IntToPointerCast>;
4030def warn_int_to_void_pointer_cast : Warning<
4031  "cast to %1 from smaller integer type %0">,
4032  InGroup<IntToVoidPointerCast>;
4033def warn_pointer_to_int_cast : Warning<
4034  "cast to smaller integer type %1 from %0">,
4035  InGroup<PointerToIntCast>;
4036def warn_pointer_to_enum_cast : Warning<
4037  warn_pointer_to_int_cast.Summary>,
4038  InGroup<PointerToEnumCast>;
4039def warn_void_pointer_to_int_cast : Warning<
4040  "cast to smaller integer type %1 from %0">,
4041  InGroup<VoidPointerToIntCast>;
4042def warn_void_pointer_to_enum_cast : Warning<
4043  warn_void_pointer_to_int_cast.Summary>,
4044  InGroup<VoidPointerToEnumCast>;
4045
4046def warn_attribute_ignored_for_field_of_type : Warning<
4047  "%0 attribute ignored for field of type %1">,
4048  InGroup<IgnoredAttributes>;
4049def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
4050  "enums in the Microsoft ABI are signed integers by default; consider giving "
4051  "the enum %0 an unsigned underlying type to make this code portable">,
4052  InGroup<SignedEnumBitfield>, DefaultIgnore;
4053def warn_attribute_packed_for_bitfield : Warning<
4054  "'packed' attribute was ignored on bit-fields with single-byte alignment "
4055  "in older versions of GCC and Clang">,
4056  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
4057def warn_transparent_union_attribute_field_size_align : Warning<
4058  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
4059  "%select{alignment|size}0 of the first field in transparent union; "
4060  "transparent_union attribute ignored">,
4061  InGroup<IgnoredAttributes>;
4062def note_transparent_union_first_field_size_align : Note<
4063  "%select{alignment|size}0 of first field is %1 bits">;
4064def warn_transparent_union_attribute_not_definition : Warning<
4065  "transparent_union attribute can only be applied to a union definition; "
4066  "attribute ignored">,
4067  InGroup<IgnoredAttributes>;
4068def warn_transparent_union_attribute_floating : Warning<
4069  "first field of a transparent union cannot have %select{floating point|"
4070  "vector}0 type %1; transparent_union attribute ignored">,
4071  InGroup<IgnoredAttributes>;
4072def warn_transparent_union_attribute_zero_fields : Warning<
4073  "transparent union definition must contain at least one field; "
4074  "transparent_union attribute ignored">,
4075  InGroup<IgnoredAttributes>;
4076def warn_attribute_type_not_supported : Warning<
4077  "%0 attribute argument not supported: %1">,
4078  InGroup<IgnoredAttributes>;
4079def warn_attribute_type_not_supported_global : Warning<
4080  "%0 attribute argument '%1' not supported on a global variable">,
4081  InGroup<IgnoredAttributes>;
4082def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
4083  InGroup<IgnoredAttributes>;
4084def warn_attribute_protected_visibility :
4085  Warning<"target does not support 'protected' visibility; using 'default'">,
4086  InGroup<DiagGroup<"unsupported-visibility">>;
4087def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
4088def note_previous_attribute : Note<"previous attribute is here">;
4089def note_conflicting_attribute : Note<"conflicting attribute is here">;
4090def note_attribute : Note<"attribute is here">;
4091def err_mismatched_ms_inheritance : Error<
4092  "inheritance model does not match %select{definition|previous declaration}0">;
4093def warn_ignored_ms_inheritance : Warning<
4094  "inheritance model ignored on %select{primary template|partial specialization}0">,
4095  InGroup<IgnoredAttributes>;
4096def note_previous_ms_inheritance : Note<
4097  "previous inheritance model specified here">;
4098def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
4099def err_mode_not_primitive : Error<
4100  "mode attribute only supported for integer and floating-point types">;
4101def err_mode_wrong_type : Error<
4102  "type of machine mode does not match type of base type">;
4103def warn_vector_mode_deprecated : Warning<
4104  "specifying vector types with the 'mode' attribute is deprecated; "
4105  "use the 'vector_size' attribute instead">,
4106  InGroup<DeprecatedAttributes>;
4107def warn_deprecated_noreturn_spelling : Warning<
4108  "the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use "
4109  "'[[noreturn]]' instead">, InGroup<DeprecatedAttributes>;
4110def err_complex_mode_vector_type : Error<
4111  "type of machine mode does not support base vector types">;
4112def err_enum_mode_vector_type : Error<
4113  "mode %0 is not supported for enumeration types">;
4114def warn_attribute_nonnull_no_pointers : Warning<
4115  "'nonnull' attribute applied to function with no pointer arguments">,
4116  InGroup<IgnoredAttributes>;
4117def warn_attribute_nonnull_parm_no_args : Warning<
4118  "'nonnull' attribute when used on parameters takes no arguments">,
4119  InGroup<IgnoredAttributes>;
4120def warn_function_stmt_attribute_precedence : Warning<
4121  "statement attribute %0 has higher precedence than function attribute "
4122  "'%select{always_inline|flatten|noinline}1'">,
4123  InGroup<IgnoredAttributes>;
4124def note_declared_nonnull : Note<
4125  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
4126def warn_attribute_sentinel_named_arguments : Warning<
4127  "'sentinel' attribute requires named arguments">,
4128  InGroup<IgnoredAttributes>;
4129def warn_attribute_sentinel_not_variadic : Warning<
4130  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
4131  InGroup<IgnoredAttributes>;
4132def warn_deprecated_ignored_on_using : Warning<
4133  "%0 currently has no effect on a using declaration">,
4134  InGroup<IgnoredAttributes>;
4135def err_attribute_sentinel_less_than_zero : Error<
4136  "'sentinel' parameter 1 less than zero">;
4137def err_attribute_sentinel_not_zero_or_one : Error<
4138  "'sentinel' parameter 2 not 0 or 1">;
4139def warn_cleanup_ext : Warning<
4140  "GCC does not allow the 'cleanup' attribute argument to be anything other "
4141  "than a simple identifier">,
4142  InGroup<GccCompat>;
4143def err_attribute_cleanup_arg_not_function : Error<
4144  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
4145def err_attribute_cleanup_func_must_take_one_arg : Error<
4146  "'cleanup' function %0 must take 1 parameter">;
4147def err_attribute_cleanup_func_arg_incompatible_type : Error<
4148  "'cleanup' function %0 parameter has "
4149  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
4150def err_attribute_regparm_wrong_platform : Error<
4151  "'regparm' is not valid on this platform">;
4152def err_attribute_regparm_invalid_number : Error<
4153  "'regparm' parameter must be between 0 and %0 inclusive">;
4154def err_attribute_not_supported_in_lang : Error<
4155  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
4156def err_attribute_not_supported_on_arch
4157    : Error<"%0 attribute is not supported on '%1'">;
4158def warn_gcc_ignores_type_attr : Warning<
4159  "GCC does not allow the %0 attribute to be written on a type">,
4160  InGroup<GccCompat>;
4161def warn_gcc_requires_variadic_function : Warning<
4162  "GCC requires a function with the %0 attribute to be variadic">,
4163  InGroup<GccCompat>;
4164
4165// Clang-Specific Attributes
4166def warn_attribute_iboutlet : Warning<
4167  "%0 attribute can only be applied to instance variables or properties">,
4168  InGroup<IgnoredAttributes>;
4169def err_iboutletcollection_type : Error<
4170  "invalid type %0 as argument of iboutletcollection attribute">;
4171def err_iboutletcollection_builtintype : Error<
4172  "type argument of iboutletcollection attribute cannot be a builtin type">;
4173def warn_iboutlet_object_type : Warning<
4174  "%select{instance variable|property}2 with %0 attribute must "
4175  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
4176def warn_iboutletcollection_property_assign : Warning<
4177  "IBOutletCollection properties should be copy/strong and not assign">,
4178  InGroup<ObjCInvalidIBOutletProperty>;
4179
4180def err_attribute_overloadable_mismatch : Error<
4181  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
4182def note_attribute_overloadable_prev_overload : Note<
4183  "previous %select{unmarked |}0overload of function is here">;
4184def err_attribute_overloadable_no_prototype : Error<
4185  "'overloadable' function %0 must have a prototype">;
4186def err_attribute_overloadable_multiple_unmarked_overloads : Error<
4187  "at most one overload for a given name may lack the 'overloadable' "
4188  "attribute">;
4189def warn_attribute_no_builtin_invalid_builtin_name : Warning<
4190  "'%0' is not a valid builtin name for %1">,
4191  InGroup<DiagGroup<"invalid-no-builtin-names">>;
4192def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
4193  "empty %0 cannot be composed with named ones">;
4194def err_attribute_no_builtin_on_non_definition : Error<
4195  "%0 attribute is permitted on definitions only">;
4196def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
4197  "%0 attribute has no effect on defaulted or deleted functions">;
4198def warn_ns_attribute_wrong_return_type : Warning<
4199  "%0 attribute only applies to %select{functions|methods|properties}1 that "
4200  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
4201  InGroup<IgnoredAttributes>;
4202def err_ns_attribute_wrong_parameter_type : Error<
4203  "%0 attribute only applies to "
4204  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
4205def warn_ns_attribute_wrong_parameter_type : Warning<
4206  "%0 attribute only applies to "
4207  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
4208  InGroup<IgnoredAttributes>;
4209def warn_objc_requires_super_protocol : Warning<
4210  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
4211  InGroup<DiagGroup<"requires-super-attribute">>;
4212def note_protocol_decl : Note<
4213  "protocol is declared here">;
4214def note_protocol_decl_undefined : Note<
4215  "protocol %0 has no definition">;
4216def err_attribute_preferred_name_arg_invalid : Error<
4217  "argument %0 to 'preferred_name' attribute is not a typedef for "
4218  "a specialization of %1">;
4219def err_attribute_builtin_alias : Error<
4220  "%0 attribute can only be applied to a ARM, HLSL or RISC-V builtin">;
4221
4222// called-once attribute diagnostics.
4223def err_called_once_attribute_wrong_type : Error<
4224  "'called_once' attribute only applies to function-like parameters">;
4225
4226def warn_completion_handler_never_called : Warning<
4227  "%select{|captured }1completion handler is never called">,
4228  InGroup<CompletionHandler>, DefaultIgnore;
4229def warn_called_once_never_called : Warning<
4230  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
4231  InGroup<CalledOnceParameter>;
4232
4233def warn_completion_handler_never_called_when : Warning<
4234  "completion handler is never %select{used|called}1 when "
4235  "%select{taking true branch|taking false branch|"
4236  "handling this case|none of the cases applies|"
4237  "entering the loop|skipping the loop|taking one of the branches}2">,
4238  InGroup<CompletionHandler>, DefaultIgnore;
4239def warn_called_once_never_called_when : Warning<
4240  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
4241  "%select{taking true branch|taking false branch|"
4242  "handling this case|none of the cases applies|"
4243  "entering the loop|skipping the loop|taking one of the branches}2">,
4244  InGroup<CalledOnceParameter>;
4245
4246def warn_completion_handler_called_twice : Warning<
4247  "completion handler is called twice">,
4248  InGroup<CompletionHandler>, DefaultIgnore;
4249def warn_called_once_gets_called_twice : Warning<
4250  "%0 parameter marked 'called_once' is called twice">,
4251  InGroup<CalledOnceParameter>;
4252def note_called_once_gets_called_twice : Note<
4253  "previous call is here%select{; set to nil to indicate "
4254  "it cannot be called afterwards|}0">;
4255
4256// objc_designated_initializer attribute diagnostics.
4257def warn_objc_designated_init_missing_super_call : Warning<
4258  "designated initializer missing a 'super' call to a designated initializer of the super class">,
4259  InGroup<ObjCDesignatedInit>;
4260def note_objc_designated_init_marked_here : Note<
4261  "method marked as designated initializer of the class here">;
4262def warn_objc_designated_init_non_super_designated_init_call : Warning<
4263  "designated initializer should only invoke a designated initializer on 'super'">,
4264  InGroup<ObjCDesignatedInit>;
4265def warn_objc_designated_init_non_designated_init_call : Warning<
4266  "designated initializer invoked a non-designated initializer">,
4267  InGroup<ObjCDesignatedInit>;
4268def warn_objc_secondary_init_super_init_call : Warning<
4269  "convenience initializer should not invoke an initializer on 'super'">,
4270  InGroup<ObjCDesignatedInit>;
4271def warn_objc_secondary_init_missing_init_call : Warning<
4272  "convenience initializer missing a 'self' call to another initializer">,
4273  InGroup<ObjCDesignatedInit>;
4274def warn_objc_implementation_missing_designated_init_override : Warning<
4275  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4276  InGroup<ObjCDesignatedInit>;
4277def err_designated_init_attr_non_init : Error<
4278  "'objc_designated_initializer' attribute only applies to init methods "
4279  "of interface or class extension declarations">;
4280
4281// objc_bridge attribute diagnostics.
4282def err_objc_attr_not_id : Error<
4283  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4284def err_objc_attr_typedef_not_id : Error<
4285  "parameter of %0 attribute must be 'id' when used on a typedef">;
4286def err_objc_attr_typedef_not_void_pointer : Error<
4287  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4288def err_objc_cf_bridged_not_interface : Error<
4289  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4290def err_objc_ns_bridged_invalid_cfobject : Error<
4291  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
4292def warn_objc_invalid_bridge : Warning<
4293  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4294def warn_objc_invalid_bridge_to_cf : Warning<
4295  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4296
4297// objc_bridge_related attribute diagnostics.
4298def err_objc_bridged_related_invalid_class : Error<
4299  "could not find Objective-C class %0 to convert %1 to %2">;
4300def err_objc_bridged_related_invalid_class_name : Error<
4301  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4302def err_objc_bridged_related_known_method : Error<
4303 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4304 "method for this conversion">;
4305
4306def err_objc_attr_protocol_requires_definition : Error<
4307  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4308
4309// Swift attributes.
4310def warn_attr_swift_name_function
4311  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4312    InGroup<SwiftNameAttribute>;
4313def warn_attr_swift_name_invalid_identifier
4314  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4315    InGroup<SwiftNameAttribute>;
4316def warn_attr_swift_name_decl_kind
4317  : Warning<"%0 attribute cannot be applied to this declaration">,
4318    InGroup<SwiftNameAttribute>;
4319def warn_attr_swift_name_subscript_invalid_parameter
4320  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4321        "have at least one parameter|"
4322        "have a 'self:' parameter}1">,
4323    InGroup<SwiftNameAttribute>;
4324def warn_attr_swift_name_missing_parameters
4325  : Warning<"%0 attribute is missing parameter label clause">,
4326    InGroup<SwiftNameAttribute>;
4327def warn_attr_swift_name_setter_parameters
4328  : Warning<"%0 attribute for setter must have one parameter for new value">,
4329    InGroup<SwiftNameAttribute>;
4330def warn_attr_swift_name_multiple_selfs
4331  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4332    InGroup<SwiftNameAttribute>;
4333def warn_attr_swift_name_getter_parameters
4334  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4335    InGroup<SwiftNameAttribute>;
4336def warn_attr_swift_name_subscript_setter_no_newValue
4337  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4338    InGroup<SwiftNameAttribute>;
4339def warn_attr_swift_name_subscript_setter_multiple_newValues
4340  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4341    InGroup<SwiftNameAttribute>;
4342def warn_attr_swift_name_subscript_getter_newValue
4343  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4344    InGroup<SwiftNameAttribute>;
4345def warn_attr_swift_name_num_params
4346  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4347            "the %1 attribute (expected %2; got %3)">,
4348    InGroup<SwiftNameAttribute>;
4349def warn_attr_swift_name_decl_missing_params
4350  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4351            "with no parameters">,
4352    InGroup<SwiftNameAttribute>;
4353
4354def err_attr_swift_error_no_error_parameter : Error<
4355  "%0 attribute can only be applied to a %select{function|method}1 with an "
4356  "error parameter">;
4357def err_attr_swift_error_return_type : Error<
4358  "%0 attribute with '%1' convention can only be applied to a "
4359  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4360
4361def err_swift_async_no_access : Error<
4362  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4363  "'not_swift_private'">;
4364def err_swift_async_bad_block_type : Error<
4365  "'swift_async' completion handler parameter must have block type returning"
4366  " 'void', type here is %0">;
4367
4368def err_swift_async_error_without_swift_async : Error<
4369  "%0 attribute must be applied to a %select{function|method}1 annotated "
4370  "with non-'none' attribute 'swift_async'">;
4371def err_swift_async_error_no_error_parameter : Error<
4372  "%0 attribute with 'nonnull_error' convention can only be applied to a "
4373  "%select{function|method}1 with a completion handler with an error "
4374  "parameter">;
4375def err_swift_async_error_non_integral : Error<
4376  "%0 attribute with '%1' convention must have an integral-typed parameter "
4377  "in completion handler at index %2, type here is %3">;
4378
4379def warn_ignored_objc_externally_retained : Warning<
4380  "'objc_externally_retained' can only be applied to local variables "
4381  "%select{of retainable type|with strong ownership}0">,
4382  InGroup<IgnoredAttributes>;
4383
4384// Function Parameter Semantic Analysis.
4385def err_param_with_void_type : Error<"argument may not have 'void' type">;
4386def err_void_only_param : Error<
4387  "'void' must be the first and only parameter if specified">;
4388def err_void_param_qualified : Error<
4389  "'void' as parameter must not have type qualifiers">;
4390def err_ident_list_in_fn_declaration : Error<
4391  "a parameter list without types is only allowed in a function definition">;
4392def ext_param_not_declared : ExtWarn<
4393  "parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not "
4394  "support implicit int">, InGroup<ImplicitInt>;
4395def err_param_default_argument : Error<
4396  "C does not support default arguments">;
4397def err_param_default_argument_redefinition : Error<
4398  "redefinition of default argument">;
4399def ext_param_default_argument_redefinition : ExtWarn<
4400  err_param_default_argument_redefinition.Summary>,
4401  InGroup<MicrosoftDefaultArgRedefinition>;
4402def err_param_default_argument_missing : Error<
4403  "missing default argument on parameter">;
4404def err_param_default_argument_missing_name : Error<
4405  "missing default argument on parameter %0">;
4406def err_param_default_argument_references_param : Error<
4407  "default argument references parameter %0">;
4408def err_param_default_argument_references_local : Error<
4409  "default argument references local variable %0 of enclosing function">;
4410def err_param_default_argument_references_this : Error<
4411  "default argument references 'this'">;
4412def err_param_default_argument_nonfunc : Error<
4413  "default arguments can only be specified for parameters in a function "
4414  "declaration">;
4415def err_param_default_argument_template_redecl : Error<
4416  "default arguments cannot be added to a function template that has already "
4417  "been declared">;
4418def err_param_default_argument_member_template_redecl : Error<
4419  "default arguments cannot be added to an out-of-line definition of a member "
4420  "of a %select{class template|class template partial specialization|nested "
4421  "class in a template}0">;
4422def err_param_default_argument_on_parameter_pack : Error<
4423  "parameter pack cannot have a default argument">;
4424def err_uninitialized_member_for_assign : Error<
4425  "cannot define the implicit copy assignment operator for %0, because "
4426  "non-static %select{reference|const}1 member %2 cannot use copy "
4427  "assignment operator">;
4428def err_uninitialized_member_in_ctor : Error<
4429  "%select{constructor for %1|"
4430  "implicit default constructor for %1|"
4431  "cannot use constructor inherited from %1:}0 must explicitly "
4432  "initialize the %select{reference|const}2 member %3">;
4433def err_default_arg_makes_ctor_special : Error<
4434  "addition of default argument on redeclaration makes this constructor a "
4435  "%select{default|copy|move}0 constructor">;
4436def err_stmt_expr_in_default_arg : Error<
4437  "default %select{argument|non-type template argument}0 may not use a GNU "
4438  "statement expression">;
4439
4440def err_use_of_default_argument_to_function_declared_later : Error<
4441  "use of default argument to function %0 that is declared later in class %1">;
4442def note_default_argument_declared_here : Note<
4443  "default argument declared here">;
4444def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4445def note_recursive_default_argument_used_here : Note<
4446  "default argument used here">;
4447
4448def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4449  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4450  "parameter type $|promoted type of K&R function parameter is not compatible "
4451  "with parameter type}0,1 declared in a previous prototype">,
4452  InGroup<KNRPromotedParameter>;
4453
4454
4455// C++ Overloading Semantic Analysis.
4456def err_ovl_diff_return_type : Error<
4457  "functions that differ only in their return type cannot be overloaded">;
4458def err_ovl_static_nonstatic_member : Error<
4459  "static and non-static member functions with the same parameter types "
4460  "cannot be overloaded">;
4461
4462let Deferrable = 1 in {
4463
4464def err_ovl_no_viable_function_in_call : Error<
4465  "no matching function for call to %0">;
4466def err_ovl_no_viable_member_function_in_call : Error<
4467  "no matching member function for call to %0">;
4468def err_ovl_ambiguous_call : Error<
4469  "call to %0 is ambiguous">;
4470def err_ovl_deleted_call : Error<"call to deleted function %0">;
4471def err_ovl_ambiguous_member_call : Error<
4472  "call to member function %0 is ambiguous">;
4473def err_ovl_deleted_member_call : Error<
4474  "call to deleted member function %0">;
4475def note_ovl_too_many_candidates : Note<
4476    "remaining %0 candidate%s0 omitted; "
4477    "pass -fshow-overloads=all to show them">;
4478
4479def select_ovl_candidate_kind : TextSubstitution<
4480  "%select{function|function|function (with reversed parameter order)|"
4481    "constructor|"
4482    "constructor (the implicit default constructor)|"
4483    "constructor (the implicit copy constructor)|"
4484    "constructor (the implicit move constructor)|"
4485    "function (the implicit copy assignment operator)|"
4486    "function (the implicit move assignment operator)|"
4487    "function (the implicit 'operator==' for this 'operator<=>)'|"
4488    "inherited constructor}0%select{| template| %2}1">;
4489
4490def note_ovl_candidate : Note<
4491    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4492    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4493    "| has different number of parameters (expected %5 but has %6)"
4494    "| has type mismatch at %ordinal5 parameter"
4495    "%diff{ (expected $ but has $)|}6,7"
4496    "| has different return type%diff{ ($ expected but has $)|}5,6"
4497    "| has different qualifiers (expected %5 but found %6)"
4498    "| has different exception specification}4">;
4499
4500def note_ovl_candidate_explicit : Note<
4501    "explicit %select{constructor|conversion function|deduction guide}0 "
4502    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4503def note_ovl_candidate_inherited_constructor : Note<
4504    "constructor from base class %0 inherited here">;
4505def note_ovl_candidate_inherited_constructor_slice : Note<
4506    "candidate %select{constructor|template}0 ignored: "
4507    "inherited constructor cannot be used to %select{copy|move}1 object">;
4508def note_ovl_candidate_illegal_constructor : Note<
4509    "candidate %select{constructor|template}0 ignored: "
4510    "instantiation %select{takes|would take}0 its own class type by value">;
4511def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4512    "candidate constructor ignored: cannot be used to construct an object "
4513    "in address space %0">;
4514def note_ovl_candidate_bad_deduction : Note<
4515    "candidate template ignored: failed template argument deduction">;
4516def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4517    "couldn't infer template argument %0">;
4518def note_ovl_candidate_incomplete_deduction_pack : Note<
4519    "candidate template ignored: "
4520    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4521    "expanded parameter in deduced argument pack %2">;
4522def note_ovl_candidate_inconsistent_deduction : Note<
4523    "candidate template ignored: deduced %select{conflicting types|"
4524    "conflicting values|conflicting templates|packs of different lengths}0 "
4525    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4526def note_ovl_candidate_inconsistent_deduction_types : Note<
4527    "candidate template ignored: deduced values %diff{"
4528    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4529    "%1 and %3 of conflicting types for parameter %0}2,4">;
4530def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4531    "candidate template ignored: invalid explicitly-specified argument "
4532    "for template parameter %0">;
4533def note_ovl_candidate_unsatisfied_constraints : Note<
4534    "candidate template ignored: constraints not satisfied%0">;
4535def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4536    "candidate template ignored: invalid explicitly-specified argument "
4537    "for %ordinal0 template parameter">;
4538def note_ovl_candidate_instantiation_depth : Note<
4539    "candidate template ignored: substitution exceeded maximum template "
4540    "instantiation depth">;
4541def note_ovl_candidate_underqualified : Note<
4542    "candidate template ignored: cannot deduce a type for %0 that would "
4543    "make %2 equal %1">;
4544def note_ovl_candidate_substitution_failure : Note<
4545    "candidate template ignored: substitution failure%0%1">;
4546def note_ovl_candidate_disabled_by_enable_if : Note<
4547    "candidate template ignored: disabled by %0%1">;
4548def note_ovl_candidate_disabled_by_requirement : Note<
4549    "candidate template ignored: requirement '%0' was not satisfied%1">;
4550def note_ovl_candidate_has_pass_object_size_params: Note<
4551    "candidate address cannot be taken because parameter %0 has "
4552    "pass_object_size attribute">;
4553def err_diagnose_if_succeeded : Error<"%0">;
4554def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4555    ShowInSystemHeader;
4556def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4557    "candidate disabled: %0">;
4558def err_addrof_function_disabled_by_enable_if_attr : Error<
4559    "cannot take address of function %0 because it has one or more "
4560    "non-tautological enable_if conditions">;
4561def err_addrof_function_constraints_not_satisfied : Error<
4562    "cannot take address of function %0 because its constraints are not "
4563    "satisfied">;
4564def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4565    "candidate function made ineligible by enable_if">;
4566def note_ovl_candidate_deduced_mismatch : Note<
4567    "candidate template ignored: deduced type "
4568    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4569    "adjusted type $ of %select{|element of }4argument"
4570    "|of %select{|element of }4%ordinal0 parameter does not match "
4571    "adjusted type of %select{|element of }4argument}1,2%3">;
4572def note_ovl_candidate_non_deduced_mismatch : Note<
4573    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4574// This note is needed because the above note would sometimes print two
4575// different types with the same name.  Remove this note when the above note
4576// can handle that case properly.
4577def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4578    "candidate template ignored: could not match %q0 against %q1">;
4579
4580// Note that we don't treat templates differently for this diagnostic.
4581def note_ovl_candidate_arity : Note<"candidate "
4582    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4583    "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
4584    "%plural{1:was|:were}5 provided">;
4585
4586def note_ovl_candidate_arity_one : Note<"candidate "
4587    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4588    "%select{requires at least|allows at most single|requires single}3 "
4589    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4590
4591def note_ovl_candidate_deleted : Note<
4592    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4593    "%select{explicitly made unavailable|explicitly deleted|"
4594    "implicitly deleted}3">;
4595
4596// Giving the index of the bad argument really clutters this message, and
4597// it's relatively unimportant because 1) it's generally obvious which
4598// argument(s) are of the given object type and 2) the fix is usually
4599// to complete the type, which doesn't involve changes to the call line
4600// anyway.  If people complain, we can change it.
4601def note_ovl_candidate_bad_conv_incomplete : Note<
4602    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4603    "cannot convert argument of incomplete type "
4604    "%diff{$ to $|to parameter type}3,4 for "
4605    "%select{%ordinal6 argument|object argument}5"
4606    "%select{|; dereference the argument with *|"
4607    "; take the address of the argument with &|"
4608    "; remove *|"
4609    "; remove &}7">;
4610def note_ovl_candidate_bad_list_argument : Note<
4611    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4612    "%select{cannot convert initializer list|too few initializers in list"
4613    "|too many initializers in list}7 argument to %4">;
4614def note_ovl_candidate_bad_overload : Note<
4615    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4616    "no overload of %4 matching %3 for %ordinal5 argument">;
4617def note_ovl_candidate_bad_conv : Note<
4618    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4619    "no known conversion "
4620    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4621    "%select{%ordinal6 argument|object argument}5"
4622    "%select{|; dereference the argument with *|"
4623    "; take the address of the argument with &|"
4624    "; remove *|"
4625    "; remove &}7">;
4626def note_ovl_candidate_bad_arc_conv : Note<
4627    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4628    "cannot implicitly convert argument "
4629    "%diff{of type $ to $|type to parameter type}3,4 for "
4630    "%select{%ordinal6 argument|object argument}5 under ARC">;
4631def note_ovl_candidate_bad_value_category : Note<
4632    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4633    "expects an %select{lvalue|rvalue}5 for "
4634    "%select{%ordinal4 argument|object argument}3">;
4635def note_ovl_candidate_bad_addrspace : Note<
4636    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4637    "cannot %select{pass pointer to|bind reference in}5 %3 "
4638    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4639    "argument">;
4640def note_ovl_candidate_bad_addrspace_this : Note<
4641    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4642    "'this' object is in %3, but method expects object in %4">;
4643def note_ovl_candidate_bad_gc : Note<
4644    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4645    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4646    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4647def note_ovl_candidate_bad_ownership : Note<
4648    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4649    "%select{%ordinal7|'this'}6 argument (%3) has "
4650    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4651    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4652    "__autoreleasing}5 ownership">;
4653def note_ovl_candidate_bad_cvr_this : Note<
4654    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4655    "'this' argument has type %3, but method is not marked "
4656    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4657    "volatile or restrict|const, volatile, or restrict}4">;
4658def note_ovl_candidate_bad_cvr : Note<
4659    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4660    "%ordinal5 argument (%3) would lose "
4661    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4662    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4663    "%select{||s||s|s|s}4">;
4664def note_ovl_candidate_bad_unaligned : Note<
4665    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4666    "%ordinal5 argument (%3) would lose __unaligned qualifier">;
4667def note_ovl_candidate_bad_base_to_derived_conv : Note<
4668    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4669    "cannot %select{convert from|convert from|bind}3 "
4670    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4671    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4672    "%ordinal6 argument">;
4673def note_ovl_candidate_bad_target : Note<
4674    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4675    "call to "
4676    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4677    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4678def note_ovl_candidate_constraints_not_satisfied : Note<
4679    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4680    "not satisfied">;
4681def note_implicit_member_target_infer_collision : Note<
4682    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4683    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4684    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4685
4686def note_ambiguous_type_conversion: Note<
4687    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4688def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4689def err_ovl_no_viable_function_in_init : Error<
4690  "no matching constructor for initialization of %0">;
4691def err_ovl_no_conversion_in_cast : Error<
4692  "cannot convert %1 to %2 without a conversion operator">;
4693def err_ovl_no_viable_conversion_in_cast : Error<
4694  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4695  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4696def err_ovl_ambiguous_conversion_in_cast : Error<
4697  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4698  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4699def err_ovl_deleted_conversion_in_cast : Error<
4700  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4701  "functional-style cast|}0 from %1 to %2 uses deleted function">;
4702def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4703def err_ref_init_ambiguous : Error<
4704  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4705def err_ovl_deleted_init : Error<
4706  "call to deleted constructor of %0">;
4707def err_ovl_deleted_special_init : Error<
4708  "call to implicitly-deleted %select{default constructor|copy constructor|"
4709  "move constructor|copy assignment operator|move assignment operator|"
4710  "destructor|function}0 of %1">;
4711def err_ovl_ambiguous_oper_unary : Error<
4712  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4713def err_ovl_ambiguous_oper_binary : Error<
4714  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4715def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4716  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4717  "and %2) to be ambiguous despite there being a unique best viable function"
4718  "%select{ with non-reversed arguments|}3">,
4719  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4720def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4721  "ambiguity is between a regular call to this operator and a call with the "
4722  "argument order reversed">;
4723def note_ovl_ambiguous_eqeq_reversed_self_non_const : Note<
4724  "mark 'operator==' as const or add a matching 'operator!=' to resolve the ambiguity">;
4725def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4726  "candidate function with non-reversed arguments">;
4727def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
4728  "ambiguous candidate function with reversed arguments">;
4729def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
4730def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
4731def err_ovl_deleted_oper : Error<
4732  "overload resolution selected deleted operator '%0'">;
4733def err_ovl_deleted_special_oper : Error<
4734  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
4735  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
4736  "implicitly deleted">;
4737def err_ovl_deleted_comparison : Error<
4738  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
4739def err_ovl_rewrite_equalequal_not_bool : Error<
4740  "return type %0 of selected 'operator==' function for rewritten "
4741  "'%1' comparison is not 'bool'">;
4742def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
4743  "ISO C++20 requires return type of selected 'operator==' function for "
4744  "rewritten '%1' comparison to be 'bool', not %0">,
4745  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
4746def err_ovl_no_viable_subscript :
4747    Error<"no viable overloaded operator[] for type %0">;
4748def err_ovl_no_oper :
4749    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
4750def err_ovl_unresolvable : Error<
4751  "reference to %select{overloaded|multiversioned}1 function could not be "
4752  "resolved; did you mean to call it%select{| with no arguments}0?">;
4753def err_bound_member_function : Error<
4754  "reference to non-static member function must be called"
4755  "%select{|; did you mean to call it with no arguments?}0">;
4756def note_possible_target_of_call : Note<"possible target for call">;
4757def err_no_viable_destructor : Error<
4758  "no viable destructor found for class %0">;
4759def err_ambiguous_destructor : Error<
4760  "destructor of class %0 is ambiguous">;
4761
4762def err_ovl_no_viable_object_call : Error<
4763  "no matching function for call to object of type %0">;
4764def err_ovl_ambiguous_object_call : Error<
4765  "call to object of type %0 is ambiguous">;
4766def err_ovl_ambiguous_subscript_call : Error<
4767  "call to subscript operator of type %0 is ambiguous">;
4768def err_ovl_deleted_object_call : Error<
4769  "call to deleted function call operator in type %0">;
4770def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
4771def err_member_call_without_object : Error<
4772  "call to non-static member function without an object argument">;
4773
4774// C++ Address of Overloaded Function
4775def err_addr_ovl_no_viable : Error<
4776  "address of overloaded function %0 does not match required type %1">;
4777def err_addr_ovl_ambiguous : Error<
4778  "address of overloaded function %0 is ambiguous">;
4779def err_addr_ovl_not_func_ptrref : Error<
4780  "address of overloaded function %0 cannot be converted to type %1">;
4781def err_addr_ovl_no_qualifier : Error<
4782  "cannot form member pointer of type %0 without '&' and class name">;
4783
4784} // let Deferrable
4785
4786// C++11 Literal Operators
4787def err_ovl_no_viable_literal_operator : Error<
4788  "no matching literal operator for call to %0"
4789  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
4790  "%select{| or 'const char *'}4"
4791  "%select{|, and no matching literal operator template}5">;
4792
4793// C++ Template Declarations
4794def err_template_param_shadow : Error<
4795  "declaration of %0 shadows template parameter">;
4796def ext_template_param_shadow : ExtWarn<
4797  err_template_param_shadow.Summary>, InGroup<MicrosoftTemplateShadow>;
4798def note_template_param_here : Note<"template parameter is declared here">;
4799def warn_template_export_unsupported : Warning<
4800  "exported templates are unsupported">;
4801def err_template_outside_namespace_or_class_scope : Error<
4802  "templates can only be declared in namespace or class scope">;
4803def err_template_inside_local_class : Error<
4804  "templates cannot be declared inside of a local class">;
4805def err_template_linkage : Error<"templates must have C++ linkage">;
4806def err_template_typedef : Error<"a typedef cannot be a template">;
4807def err_template_unnamed_class : Error<
4808  "cannot declare a class template with no name">;
4809def err_template_param_list_different_arity : Error<
4810  "%select{too few|too many}0 template parameters in template "
4811  "%select{|template parameter }1redeclaration">;
4812def note_template_param_list_different_arity : Note<
4813  "%select{too few|too many}0 template parameters in template template "
4814  "argument">;
4815def note_template_prev_declaration : Note<
4816  "previous template %select{declaration|template parameter}0 is here">;
4817def err_template_param_different_kind : Error<
4818  "template parameter has a different kind in template "
4819  "%select{|template parameter }0redeclaration">;
4820def note_template_param_different_kind : Note<
4821  "template parameter has a different kind in template argument">;
4822
4823def err_invalid_decl_specifier_in_nontype_parm : Error<
4824  "invalid declaration specifier in template non-type parameter">;
4825
4826def err_template_nontype_parm_different_type : Error<
4827  "template non-type parameter has a different type %0 in template "
4828  "%select{|template parameter }1redeclaration">;
4829
4830def note_template_nontype_parm_different_type : Note<
4831  "template non-type parameter has a different type %0 in template argument">;
4832def note_template_nontype_parm_prev_declaration : Note<
4833  "previous non-type template parameter with type %0 is here">;
4834def err_template_nontype_parm_bad_type : Error<
4835  "a non-type template parameter cannot have type %0">;
4836def err_template_nontype_parm_bad_structural_type : Error<
4837  "a non-type template parameter cannot have type %0 before C++20">;
4838def err_template_nontype_parm_incomplete : Error<
4839  "non-type template parameter has incomplete type %0">;
4840def err_template_nontype_parm_not_literal : Error<
4841  "non-type template parameter has non-literal type %0">;
4842def err_template_nontype_parm_rvalue_ref : Error<
4843  "non-type template parameter has rvalue reference type %0">;
4844def err_template_nontype_parm_not_structural : Error<
4845  "type %0 of non-type template parameter is not a structural type">;
4846def note_not_structural_non_public : Note<
4847  "%0 is not a structural type because it has a "
4848  "%select{non-static data member|base class}1 that is not public">;
4849def note_not_structural_mutable_field : Note<
4850  "%0 is not a structural type because it has a mutable "
4851  "non-static data member">;
4852def note_not_structural_rvalue_ref_field : Note<
4853  "%0 is not a structural type because it has a non-static data member "
4854  "of rvalue reference type">;
4855def note_not_structural_subobject : Note<
4856  "%0 is not a structural type because it has a "
4857  "%select{non-static data member|base class}1 of non-structural type %2">;
4858def warn_cxx17_compat_template_nontype_parm_type : Warning<
4859  "non-type template parameter of type %0 is incompatible with "
4860  "C++ standards before C++20">,
4861  DefaultIgnore, InGroup<CXXPre20Compat>;
4862def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
4863  "non-type template parameters declared with %0 are incompatible with C++ "
4864  "standards before C++17">,
4865  DefaultIgnore, InGroup<CXXPre17Compat>;
4866def err_template_param_default_arg_redefinition : Error<
4867  "template parameter redefines default argument">;
4868def err_template_param_default_arg_inconsistent_redefinition : Error<
4869  "template parameter default argument is inconsistent with previous definition">;
4870def note_template_param_prev_default_arg : Note<
4871  "previous default template argument defined here">;
4872def note_template_param_prev_default_arg_in_other_module : Note<
4873  "previous default template argument defined in module %0">;
4874def err_template_param_default_arg_missing : Error<
4875  "template parameter missing a default argument">;
4876def ext_template_parameter_default_in_function_template : ExtWarn<
4877  "default template arguments for a function template are a C++11 extension">,
4878  InGroup<CXX11>;
4879def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
4880  "default template arguments for a function template are incompatible with C++98">,
4881  InGroup<CXX98Compat>, DefaultIgnore;
4882def err_template_parameter_default_template_member : Error<
4883  "cannot add a default template argument to the definition of a member of a "
4884  "class template">;
4885def err_template_parameter_default_friend_template : Error<
4886  "default template argument not permitted on a friend template">;
4887def err_template_template_parm_no_parms : Error<
4888  "template template parameter must have its own template parameters">;
4889
4890def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4891  InGroup<CXX14>;
4892def warn_cxx11_compat_variable_template : Warning<
4893  "variable templates are incompatible with C++ standards before C++14">,
4894  InGroup<CXXPre14Compat>, DefaultIgnore;
4895def err_template_variable_noparams : Error<
4896  "extraneous 'template<>' in declaration of variable %0">;
4897def err_template_member : Error<"member %0 declared as a template">;
4898def err_member_with_template_arguments : Error<"member %0 cannot have template arguments">;
4899def err_template_member_noparams : Error<
4900  "extraneous 'template<>' in declaration of member %0">;
4901def err_template_tag_noparams : Error<
4902  "extraneous 'template<>' in declaration of %0 %1">;
4903
4904def warn_cxx17_compat_adl_only_template_id : Warning<
4905  "use of function template name with no prior function template "
4906  "declaration in function call with explicit template arguments "
4907  "is incompatible with C++ standards before C++20">,
4908  InGroup<CXXPre20Compat>, DefaultIgnore;
4909def ext_adl_only_template_id : ExtWarn<
4910  "use of function template name with no prior declaration in function call "
4911  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
4912
4913def warn_unqualified_call_to_std_cast_function : Warning<
4914  "unqualified call to '%0'">, InGroup<DiagGroup<"unqualified-std-cast-call">>;
4915
4916// C++ Template Argument Lists
4917def err_template_missing_args : Error<
4918  "use of "
4919  "%select{class template|function template|variable template|alias template|"
4920  "template template parameter|concept|template}0 %1 requires template "
4921  "arguments">;
4922def err_template_arg_list_different_arity : Error<
4923  "%select{too few|too many}0 template arguments for "
4924  "%select{class template|function template|variable template|alias template|"
4925  "template template parameter|concept|template}1 %2">;
4926def note_template_decl_here : Note<"template is declared here">;
4927def err_template_arg_must_be_type : Error<
4928  "template argument for template type parameter must be a type">;
4929def err_template_arg_must_be_type_suggest : Error<
4930  "template argument for template type parameter must be a type; "
4931  "did you forget 'typename'?">;
4932def ext_ms_template_type_arg_missing_typename : ExtWarn<
4933  "template argument for template type parameter must be a type; "
4934  "omitted 'typename' is a Microsoft extension">,
4935  InGroup<MicrosoftTemplate>;
4936def err_template_arg_must_be_expr : Error<
4937  "template argument for non-type template parameter must be an expression">;
4938def err_template_arg_nontype_ambig : Error<
4939  "template argument for non-type template parameter is treated as function type %0">;
4940def err_template_arg_must_be_template : Error<
4941  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4942def ext_template_arg_local_type : ExtWarn<
4943  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4944def ext_template_arg_unnamed_type : ExtWarn<
4945  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4946def warn_cxx98_compat_template_arg_local_type : Warning<
4947  "local type %0 as template argument is incompatible with C++98">,
4948  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4949def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4950  "unnamed type as template argument is incompatible with C++98">,
4951  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4952def note_template_unnamed_type_here : Note<
4953  "unnamed type used in template argument was declared here">;
4954def err_template_arg_overload_type : Error<
4955  "template argument is the type of an unresolved overloaded function">;
4956def err_template_arg_not_valid_template : Error<
4957  "template argument does not refer to a class or alias template, or template "
4958  "template parameter">;
4959def note_template_arg_refers_here_func : Note<
4960  "template argument refers to function template %0, here">;
4961def err_template_arg_template_params_mismatch : Error<
4962  "template template argument has different template parameters than its "
4963  "corresponding template template parameter">;
4964def err_template_arg_not_integral_or_enumeral : Error<
4965  "non-type template argument of type %0 must have an integral or enumeration"
4966  " type">;
4967def err_template_arg_not_ice : Error<
4968  "non-type template argument of type %0 is not an integral constant "
4969  "expression">;
4970def err_template_arg_not_address_constant : Error<
4971  "non-type template argument of type %0 is not a constant expression">;
4972def warn_cxx98_compat_template_arg_null : Warning<
4973  "use of null pointer as non-type template argument is incompatible with "
4974  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4975def err_template_arg_untyped_null_constant : Error<
4976  "null non-type template argument must be cast to template parameter type %0">;
4977def err_template_arg_wrongtype_null_constant : Error<
4978  "null non-type template argument of type %0 does not match template parameter "
4979  "of type %1">;
4980def err_non_type_template_parm_type_deduction_failure : Error<
4981  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4982def err_deduced_non_type_template_arg_type_mismatch : Error<
4983  "deduced non-type template argument does not have the same type as the "
4984  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4985def err_non_type_template_arg_subobject : Error<
4986  "non-type template argument refers to subobject '%0'">;
4987def err_non_type_template_arg_addr_label_diff : Error<
4988  "template argument / label address difference / what did you expect?">;
4989def err_non_type_template_arg_unsupported : Error<
4990  "sorry, non-type template argument of type %0 is not yet supported">;
4991def err_template_arg_not_convertible : Error<
4992  "non-type template argument of type %0 cannot be converted to a value "
4993  "of type %1">;
4994def warn_template_arg_negative : Warning<
4995  "non-type template argument with value '%0' converted to '%1' for unsigned "
4996  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4997def warn_template_arg_too_large : Warning<
4998  "non-type template argument value '%0' truncated to '%1' for "
4999  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
5000def err_template_arg_no_ref_bind : Error<
5001  "non-type template parameter of reference type "
5002  "%diff{$ cannot bind to template argument of type $"
5003  "|cannot bind to template of incompatible argument type}0,1">;
5004def err_template_arg_ref_bind_ignores_quals : Error<
5005  "reference binding of non-type template parameter "
5006  "%diff{of type $ to template argument of type $|to template argument}0,1 "
5007  "ignores qualifiers">;
5008def err_template_arg_not_decl_ref : Error<
5009  "non-type template argument does not refer to any declaration">;
5010def err_template_arg_not_address_of : Error<
5011  "non-type template argument for template parameter of pointer type %0 must "
5012  "have its address taken">;
5013def err_template_arg_address_of_non_pointer : Error<
5014  "address taken in non-type template argument for template parameter of "
5015  "reference type %0">;
5016def err_template_arg_reference_var : Error<
5017  "non-type template argument of reference type %0 is not an object">;
5018def err_template_arg_field : Error<
5019  "non-type template argument refers to non-static data member %0">;
5020def err_template_arg_method : Error<
5021  "non-type template argument refers to non-static member function %0">;
5022def err_template_arg_object_no_linkage : Error<
5023  "non-type template argument refers to %select{function|object}0 %1 that "
5024  "does not have linkage">;
5025def warn_cxx98_compat_template_arg_object_internal : Warning<
5026  "non-type template argument referring to %select{function|object}0 %1 with "
5027  "internal linkage is incompatible with C++98">,
5028  InGroup<CXX98Compat>, DefaultIgnore;
5029def ext_template_arg_object_internal : ExtWarn<
5030  "non-type template argument referring to %select{function|object}0 %1 with "
5031  "internal linkage is a C++11 extension">, InGroup<CXX11>;
5032def err_template_arg_thread_local : Error<
5033  "non-type template argument refers to thread-local object">;
5034def note_template_arg_internal_object : Note<
5035  "non-type template argument refers to %select{function|object}0 here">;
5036def note_template_arg_refers_here : Note<
5037  "non-type template argument refers here">;
5038def err_template_arg_not_object_or_func : Error<
5039  "non-type template argument does not refer to an object or function">;
5040def err_template_arg_not_pointer_to_member_form : Error<
5041  "non-type template argument is not a pointer to member constant">;
5042def err_template_arg_member_ptr_base_derived_not_supported : Error<
5043  "sorry, non-type template argument of pointer-to-member type %1 that refers "
5044  "to member %q0 of a different class is not supported yet">;
5045def err_template_arg_invalid : Error<
5046  "non-type template argument '%0' is invalid">;
5047def ext_template_arg_extra_parens : ExtWarn<
5048  "address non-type template argument cannot be surrounded by parentheses">;
5049def warn_cxx98_compat_template_arg_extra_parens : Warning<
5050  "redundant parentheses surrounding address non-type template argument are "
5051  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5052def err_pointer_to_member_type : Error<
5053  "invalid use of pointer to member type after %select{.*|->*}0">;
5054def err_pointer_to_member_call_drops_quals : Error<
5055  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
5056def err_pointer_to_member_oper_value_classify: Error<
5057  "pointer-to-member function type %0 can only be called on an "
5058  "%select{rvalue|lvalue}1">;
5059def ext_pointer_to_const_ref_member_on_rvalue : Extension<
5060  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
5061  InGroup<CXX20>, SFINAEFailure;
5062def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
5063  "invoking a pointer to a 'const &' member function on an rvalue is "
5064  "incompatible with C++ standards before C++20">,
5065  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
5066def ext_ms_deref_template_argument: ExtWarn<
5067  "non-type template argument containing a dereference operation is a "
5068  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5069def ext_ms_delayed_template_argument: ExtWarn<
5070  "using the undeclared type %0 as a default template argument is a "
5071  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5072def err_template_arg_deduced_incomplete_pack : Error<
5073  "deduced incomplete pack %0 for template parameter %1">;
5074
5075// C++ template specialization
5076def err_template_spec_unknown_kind : Error<
5077  "can only provide an explicit specialization for a class template, function "
5078  "template, variable template, or a member function, static data member, "
5079  "%select{or member class|member class, or member enumeration}0 of a "
5080  "class template">;
5081def note_specialized_entity : Note<
5082  "explicitly specialized declaration is here">;
5083def err_template_spec_decl_function_scope : Error<
5084  "explicit specialization of %0 in function scope">;
5085def err_template_spec_decl_friend : Error<
5086  "cannot declare an explicit specialization in a friend">;
5087def err_template_spec_redecl_out_of_scope : Error<
5088  "%select{class template|class template partial|variable template|"
5089  "variable template partial|function template|member "
5090  "function|static data member|member class|member enumeration}0 "
5091  "specialization of %1 not in %select{a namespace enclosing %2|"
5092  "class %2 or an enclosing namespace}3">;
5093def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
5094  "%select{class template|class template partial|variable template|"
5095  "variable template partial|function template|member "
5096  "function|static data member|member class|member enumeration}0 "
5097  "specialization of %1 not in %select{a namespace enclosing %2|"
5098  "class %2 or an enclosing namespace}3 "
5099  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
5100def err_template_spec_redecl_global_scope : Error<
5101  "%select{class template|class template partial|variable template|"
5102  "variable template partial|function template|member "
5103  "function|static data member|member class|member enumeration}0 "
5104  "specialization of %1 must occur at global scope">;
5105def err_spec_member_not_instantiated : Error<
5106  "specialization of member %q0 does not specialize an instantiated member">;
5107def note_specialized_decl : Note<"attempt to specialize declaration here">;
5108def err_specialization_after_instantiation : Error<
5109  "explicit specialization of %0 after instantiation">;
5110def note_instantiation_required_here : Note<
5111  "%select{implicit|explicit}0 instantiation first required here">;
5112def err_template_spec_friend : Error<
5113  "template specialization declaration cannot be a friend">;
5114def err_template_spec_default_arg : Error<
5115  "default argument not permitted on an explicit "
5116  "%select{instantiation|specialization}0 of function %1">;
5117def err_not_class_template_specialization : Error<
5118  "cannot specialize a %select{dependent template|template template "
5119  "parameter}0">;
5120def ext_explicit_specialization_storage_class : ExtWarn<
5121  "explicit specialization cannot have a storage class">;
5122def err_explicit_specialization_inconsistent_storage_class : Error<
5123  "explicit specialization has extraneous, inconsistent storage class "
5124  "'%select{none|extern|static|__private_extern__|auto|register}0'">;
5125def err_dependent_function_template_spec_no_match : Error<
5126  "no candidate function template was found for dependent"
5127  " friend function template specialization">;
5128def note_dependent_function_template_spec_discard_reason : Note<
5129  "candidate ignored: %select{not a function template"
5130  "|not a member of the enclosing namespace;"
5131  " did you mean to explicitly qualify the specialization?}0">;
5132
5133// C++ class template specializations and out-of-line definitions
5134def err_template_spec_needs_header : Error<
5135  "template specialization requires 'template<>'">;
5136def err_template_spec_needs_template_parameters : Error<
5137  "template specialization or definition requires a template parameter list "
5138  "corresponding to the nested type %0">;
5139def err_template_param_list_matches_nontemplate : Error<
5140  "template parameter list matching the non-templated nested type %0 should "
5141  "be empty ('template<>')">;
5142def err_alias_template_extra_headers : Error<
5143  "extraneous template parameter list in alias template declaration">;
5144def err_template_spec_extra_headers : Error<
5145  "extraneous template parameter list in template specialization or "
5146  "out-of-line template definition">;
5147def warn_template_spec_extra_headers : Warning<
5148  "extraneous template parameter list in template specialization">;
5149def note_explicit_template_spec_does_not_need_header : Note<
5150  "'template<>' header not required for explicitly-specialized class %0 "
5151  "declared here">;
5152def err_template_qualified_declarator_no_match : Error<
5153  "nested name specifier '%0' for declaration does not refer into a class, "
5154  "class template or class template partial specialization">;
5155def err_specialize_member_of_template : Error<
5156  "cannot specialize %select{|(with 'template<>') }0a member of an "
5157  "unspecialized template">;
5158
5159// C++ Class Template Partial Specialization
5160def err_default_arg_in_partial_spec : Error<
5161    "default template argument in a class template partial specialization">;
5162def err_dependent_non_type_arg_in_partial_spec : Error<
5163    "type of specialized non-type template argument depends on a template "
5164    "parameter of the partial specialization">;
5165def note_dependent_non_type_default_arg_in_partial_spec : Note<
5166    "template parameter is used in default argument declared here">;
5167def err_dependent_typed_non_type_arg_in_partial_spec : Error<
5168    "non-type template argument specializes a template parameter with "
5169    "dependent type %0">;
5170def err_partial_spec_args_match_primary_template : Error<
5171    "%select{class|variable}0 template partial specialization does not "
5172    "specialize any template argument; to %select{declare|define}1 the "
5173    "primary template, remove the template argument list">;
5174def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
5175    "%select{class|variable}0 template partial specialization is not "
5176    "more specialized than the primary template">, DefaultError,
5177    InGroup<DiagGroup<"invalid-partial-specialization">>;
5178def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
5179def ext_partial_specs_not_deducible : ExtWarn<
5180    "%select{class|variable}0 template partial specialization contains "
5181    "%select{a template parameter|template parameters}1 that cannot be "
5182    "deduced; this partial specialization will never be used">,
5183    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
5184def note_non_deducible_parameter : Note<
5185    "non-deducible template parameter %0">;
5186def err_partial_spec_ordering_ambiguous : Error<
5187    "ambiguous partial specializations of %0">;
5188def note_partial_spec_match : Note<"partial specialization matches %0">;
5189def err_partial_spec_redeclared : Error<
5190  "class template partial specialization %0 cannot be redeclared">;
5191def note_prev_partial_spec_here : Note<
5192  "previous declaration of class template partial specialization %0 is here">;
5193def err_partial_spec_fully_specialized : Error<
5194  "partial specialization of %0 does not use any of its template parameters">;
5195
5196// C++ Variable Template Partial Specialization
5197def err_var_partial_spec_redeclared : Error<
5198  "variable template partial specialization %0 cannot be redefined">;
5199def note_var_prev_partial_spec_here : Note<
5200  "previous declaration of variable template partial specialization is here">;
5201def err_var_spec_no_template : Error<
5202  "no variable template matches%select{| partial}0 specialization">;
5203def err_var_spec_no_template_but_method : Error<
5204  "no variable template matches specialization; "
5205  "did you mean to use %0 as function template instead?">;
5206
5207// C++ Function template specializations
5208def err_function_template_spec_no_match : Error<
5209    "no function template matches function template specialization %0">;
5210def err_function_template_spec_ambiguous : Error<
5211    "function template specialization %0 ambiguously refers to more than one "
5212    "function template; explicitly specify%select{| additional}1 template "
5213    "arguments to identify a particular function template">;
5214def note_function_template_spec_matched : Note<
5215    "function template %q0 matches specialization %1">;
5216def err_function_template_partial_spec : Error<
5217    "function template partial specialization is not allowed">;
5218
5219// C++ Template Instantiation
5220def err_template_recursion_depth_exceeded : Error<
5221  "recursive template instantiation exceeded maximum depth of %0">,
5222  DefaultFatal, NoSFINAE;
5223def err_constraint_depends_on_self : Error<
5224  "satisfaction of constraint '%0' depends on itself">, NoSFINAE;
5225def note_template_recursion_depth : Note<
5226  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
5227
5228def err_template_instantiate_within_definition : Error<
5229  "%select{implicit|explicit}0 instantiation of template %1 within its"
5230  " own definition">;
5231def err_template_instantiate_undefined : Error<
5232  "%select{implicit|explicit}0 instantiation of undefined template %1">;
5233def err_implicit_instantiate_member_undefined : Error<
5234  "implicit instantiation of undefined member %0">;
5235def note_template_class_instantiation_was_here : Note<
5236  "class template %0 was instantiated here">;
5237def note_template_class_explicit_specialization_was_here : Note<
5238  "class template %0 was explicitly specialized here">;
5239def note_template_class_instantiation_here : Note<
5240  "in instantiation of template class %q0 requested here">;
5241def note_template_member_class_here : Note<
5242  "in instantiation of member class %q0 requested here">;
5243def note_template_member_function_here : Note<
5244  "in instantiation of member function %q0 requested here">;
5245def note_function_template_spec_here : Note<
5246  "in instantiation of function template specialization %q0 requested here">;
5247def note_template_static_data_member_def_here : Note<
5248  "in instantiation of static data member %q0 requested here">;
5249def note_template_variable_def_here : Note<
5250  "in instantiation of variable template specialization %q0 requested here">;
5251def note_template_enum_def_here : Note<
5252  "in instantiation of enumeration %q0 requested here">;
5253def note_template_nsdmi_here : Note<
5254  "in instantiation of default member initializer %q0 requested here">;
5255def note_template_type_alias_instantiation_here : Note<
5256  "in instantiation of template type alias %0 requested here">;
5257def note_template_exception_spec_instantiation_here : Note<
5258  "in instantiation of exception specification for %0 requested here">;
5259def note_template_requirement_instantiation_here : Note<
5260  "in instantiation of requirement here">;
5261def note_template_requirement_params_instantiation_here : Note<
5262  "in instantiation of requirement parameters here">;
5263def warn_var_template_missing : Warning<"instantiation of variable %q0 "
5264  "required here, but no definition is available">,
5265  InGroup<UndefinedVarTemplate>;
5266def warn_func_template_missing : Warning<"instantiation of function %q0 "
5267  "required here, but no definition is available">,
5268  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
5269def note_forward_template_decl : Note<
5270  "forward declaration of template entity is here">;
5271def note_inst_declaration_hint : Note<"add an explicit instantiation "
5272  "declaration to suppress this warning if %q0 is explicitly instantiated in "
5273  "another translation unit">;
5274def note_evaluating_exception_spec_here : Note<
5275  "in evaluation of exception specification for %q0 needed here">;
5276
5277def note_default_arg_instantiation_here : Note<
5278  "in instantiation of default argument for '%0' required here">;
5279def note_default_function_arg_instantiation_here : Note<
5280  "in instantiation of default function argument expression "
5281  "for '%0' required here">;
5282def note_explicit_template_arg_substitution_here : Note<
5283  "while substituting explicitly-specified template arguments into function "
5284  "template %0 %1">;
5285def note_function_template_deduction_instantiation_here : Note<
5286  "while substituting deduced template arguments into function template %0 "
5287  "%1">;
5288def note_deduced_template_arg_substitution_here : Note<
5289  "during template argument deduction for %select{class|variable}0 template "
5290  "%select{partial specialization |}1%2 %3">;
5291def note_prior_template_arg_substitution : Note<
5292  "while substituting prior template arguments into %select{non-type|template}0"
5293  " template parameter%1 %2">;
5294def note_template_default_arg_checking : Note<
5295  "while checking a default template argument used here">;
5296def note_concept_specialization_here : Note<
5297  "while checking the satisfaction of concept '%0' requested here">;
5298def note_nested_requirement_here : Note<
5299  "while checking the satisfaction of nested requirement requested here">;
5300def note_checking_constraints_for_template_id_here : Note<
5301  "while checking constraint satisfaction for template '%0' required here">;
5302def note_checking_constraints_for_var_spec_id_here : Note<
5303  "while checking constraint satisfaction for variable template "
5304  "partial specialization '%0' required here">;
5305def note_checking_constraints_for_class_spec_id_here : Note<
5306  "while checking constraint satisfaction for class template partial "
5307  "specialization '%0' required here">;
5308def note_checking_constraints_for_function_here : Note<
5309  "while checking constraint satisfaction for function '%0' required here">;
5310def note_constraint_substitution_here : Note<
5311  "while substituting template arguments into constraint expression here">;
5312def note_constraint_normalization_here : Note<
5313  "while calculating associated constraint of template '%0' here">;
5314def note_parameter_mapping_substitution_here : Note<
5315  "while substituting into concept arguments here; substitution failures not "
5316  "allowed in concept arguments">;
5317def note_instantiation_contexts_suppressed : Note<
5318  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5319  "see all)">;
5320
5321def err_field_instantiates_to_function : Error<
5322  "data member instantiated with function type %0">;
5323def err_variable_instantiates_to_function : Error<
5324  "%select{variable|static data member}0 instantiated with function type %1">;
5325def err_nested_name_spec_non_tag : Error<
5326  "type %0 cannot be used prior to '::' because it has no members">;
5327
5328def err_using_pack_expansion_empty : Error<
5329  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5330
5331// C++ Explicit Instantiation
5332def err_explicit_instantiation_duplicate : Error<
5333    "duplicate explicit instantiation of %0">;
5334def ext_explicit_instantiation_duplicate : ExtWarn<
5335    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5336    InGroup<MicrosoftTemplate>;
5337def note_previous_explicit_instantiation : Note<
5338    "previous explicit instantiation is here">;
5339def warn_explicit_instantiation_after_specialization : Warning<
5340  "explicit instantiation of %0 that occurs after an explicit "
5341  "specialization has no effect">,
5342  InGroup<DiagGroup<"instantiation-after-specialization">>;
5343def note_previous_template_specialization : Note<
5344    "previous template specialization is here">;
5345def err_explicit_instantiation_nontemplate_type : Error<
5346    "explicit instantiation of non-templated type %0">;
5347def note_nontemplate_decl_here : Note<
5348    "non-templated declaration is here">;
5349def err_explicit_instantiation_in_class : Error<
5350  "explicit instantiation of %0 in class scope">;
5351def err_explicit_instantiation_out_of_scope : Error<
5352  "explicit instantiation of %0 not in a namespace enclosing %1">;
5353def err_explicit_instantiation_must_be_global : Error<
5354  "explicit instantiation of %0 must occur at global scope">;
5355def warn_explicit_instantiation_out_of_scope_0x : Warning<
5356  "explicit instantiation of %0 not in a namespace enclosing %1">,
5357  InGroup<CXX11Compat>, DefaultIgnore;
5358def warn_explicit_instantiation_must_be_global_0x : Warning<
5359  "explicit instantiation of %0 must occur at global scope">,
5360  InGroup<CXX11Compat>, DefaultIgnore;
5361
5362def err_explicit_instantiation_requires_name : Error<
5363  "explicit instantiation declaration requires a name">;
5364def err_explicit_instantiation_of_typedef : Error<
5365  "explicit instantiation of typedef %0">;
5366def err_explicit_instantiation_storage_class : Error<
5367  "explicit instantiation cannot have a storage class">;
5368def err_explicit_instantiation_internal_linkage : Error<
5369  "explicit instantiation declaration of %0 with internal linkage">;
5370def err_explicit_instantiation_not_known : Error<
5371  "explicit instantiation of %0 does not refer to a function template, "
5372  "variable template, member function, member class, or static data member">;
5373def note_explicit_instantiation_here : Note<
5374  "explicit instantiation refers here">;
5375def err_explicit_instantiation_data_member_not_instantiated : Error<
5376  "explicit instantiation refers to static data member %q0 that is not an "
5377  "instantiation">;
5378def err_explicit_instantiation_member_function_not_instantiated : Error<
5379  "explicit instantiation refers to member function %q0 that is not an "
5380  "instantiation">;
5381def err_explicit_instantiation_ambiguous : Error<
5382  "partial ordering for explicit instantiation of %0 is ambiguous">;
5383def note_explicit_instantiation_candidate : Note<
5384  "explicit instantiation candidate function %q0 template here %1">;
5385def err_explicit_instantiation_inline : Error<
5386  "explicit instantiation cannot be 'inline'">;
5387def warn_explicit_instantiation_inline_0x : Warning<
5388  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5389  DefaultIgnore;
5390def err_explicit_instantiation_constexpr : Error<
5391  "explicit instantiation cannot be 'constexpr'">;
5392def ext_explicit_instantiation_without_qualified_id : Extension<
5393  "qualifier in explicit instantiation of %q0 requires a template-id "
5394  "(a typedef is not permitted)">;
5395def err_explicit_instantiation_without_template_id : Error<
5396  "explicit instantiation of %q0 must specify a template argument list">;
5397def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5398  "explicit instantiation of %q0 must occur in namespace %1">;
5399def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5400  "explicit instantiation of %q0 must occur in namespace %1">,
5401  InGroup<CXX11Compat>, DefaultIgnore;
5402def err_explicit_instantiation_undefined_member : Error<
5403  "explicit instantiation of undefined %select{member class|member function|"
5404  "static data member}0 %1 of class template %2">;
5405def err_explicit_instantiation_undefined_func_template : Error<
5406  "explicit instantiation of undefined function template %0">;
5407def err_explicit_instantiation_undefined_var_template : Error<
5408  "explicit instantiation of undefined variable template %q0">;
5409def err_explicit_instantiation_declaration_after_definition : Error<
5410  "explicit instantiation declaration (with 'extern') follows explicit "
5411  "instantiation definition (without 'extern')">;
5412def note_explicit_instantiation_definition_here : Note<
5413  "explicit instantiation definition is here">;
5414def err_invalid_var_template_spec_type : Error<"type %2 "
5415  "of %select{explicit instantiation|explicit specialization|"
5416  "partial specialization|redeclaration}0 of %1 does not match"
5417  " expected type %3">;
5418def err_mismatched_exception_spec_explicit_instantiation : Error<
5419  "exception specification in explicit instantiation does not match "
5420  "instantiated one">;
5421def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5422  err_mismatched_exception_spec_explicit_instantiation.Summary>,
5423  InGroup<MicrosoftExceptionSpec>;
5424def err_explicit_instantiation_dependent : Error<
5425  "explicit instantiation has dependent template arguments">;
5426
5427// C++ typename-specifiers
5428def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5429def err_typename_nested_not_found_enable_if : Error<
5430  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5431  "this declaration">;
5432def err_typename_nested_not_found_requirement : Error<
5433  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5434  "declaration">;
5435def err_typename_nested_not_type : Error<
5436    "typename specifier refers to non-type member %0 in %1">;
5437def err_typename_not_type : Error<
5438    "typename specifier refers to non-type %0">;
5439def note_typename_member_refers_here : Note<
5440    "referenced member %0 is declared here">;
5441def note_typename_refers_here : Note<
5442    "referenced %0 is declared here">;
5443def err_typename_missing : Error<
5444  "missing 'typename' prior to dependent type name '%0%1'">;
5445def err_typename_missing_template : Error<
5446  "missing 'typename' prior to dependent type template name '%0%1'">;
5447def ext_typename_missing : ExtWarn<
5448  "missing 'typename' prior to dependent type name '%0%1'">,
5449  InGroup<DiagGroup<"typename-missing">>;
5450def ext_typename_outside_of_template : ExtWarn<
5451  "'typename' occurs outside of a template">, InGroup<CXX11>;
5452def warn_cxx98_compat_typename_outside_of_template : Warning<
5453  "use of 'typename' outside of a template is incompatible with C++98">,
5454  InGroup<CXX98Compat>, DefaultIgnore;
5455def err_typename_refers_to_using_value_decl : Error<
5456  "typename specifier refers to a dependent using declaration for a value "
5457  "%0 in %1">;
5458def note_using_value_decl_missing_typename : Note<
5459  "add 'typename' to treat this using declaration as a type">;
5460def warn_cxx17_compat_implicit_typename : Warning<"use of implicit 'typename' is "
5461  "incompatible with C++ standards before C++20">, InGroup<CXX20Compat>,
5462  DefaultIgnore;
5463def ext_implicit_typename : ExtWarn<"missing 'typename' prior to dependent "
5464  "type name %0%1; implicit 'typename' is a C++20 extension">,
5465  InGroup<CXX20>;
5466
5467def err_template_kw_refers_to_non_template : Error<
5468  "%0%select{| following the 'template' keyword}1 "
5469  "does not refer to a template">;
5470def note_template_kw_refers_to_non_template : Note<
5471  "declared as a non-template here">;
5472def err_template_kw_refers_to_dependent_non_template : Error<
5473  "%0%select{| following the 'template' keyword}1 "
5474  "cannot refer to a dependent template">;
5475def err_template_kw_refers_to_class_template : Error<
5476  "'%0%1' instantiated to a class template, not a function template">;
5477def note_referenced_class_template : Note<
5478  "class template declared here">;
5479def err_template_kw_missing : Error<
5480  "missing 'template' keyword prior to dependent template name '%0%1'">;
5481def ext_template_outside_of_template : ExtWarn<
5482  "'template' keyword outside of a template">, InGroup<CXX11>;
5483def warn_cxx98_compat_template_outside_of_template : Warning<
5484  "use of 'template' keyword outside of a template is incompatible with C++98">,
5485  InGroup<CXX98Compat>, DefaultIgnore;
5486
5487def err_non_type_template_in_nested_name_specifier : Error<
5488  "qualified name refers into a specialization of %select{function|variable}0 "
5489  "template %1">;
5490def err_template_id_not_a_type : Error<
5491  "template name refers to non-type template %0">;
5492def note_template_declared_here : Note<
5493  "%select{function template|class template|variable template"
5494  "|type alias template|template template parameter}0 "
5495  "%1 declared here">;
5496def err_template_expansion_into_fixed_list : Error<
5497  "pack expansion used as argument for non-pack parameter of %select{alias "
5498  "template|concept}0">;
5499def note_parameter_type : Note<
5500  "parameter of type %0 is declared here">;
5501
5502// C++11 Variadic Templates
5503def err_template_param_pack_default_arg : Error<
5504  "template parameter pack cannot have a default argument">;
5505def err_template_param_pack_must_be_last_template_parameter : Error<
5506  "template parameter pack must be the last template parameter">;
5507
5508def err_template_parameter_pack_non_pack : Error<
5509  "%select{template type|non-type template|template template}0 parameter"
5510  "%select{| pack}1 conflicts with previous %select{template type|"
5511  "non-type template|template template}0 parameter%select{ pack|}1">;
5512def note_template_parameter_pack_non_pack : Note<
5513  "%select{template type|non-type template|template template}0 parameter"
5514  "%select{| pack}1 does not match %select{template type|non-type template"
5515  "|template template}0 parameter%select{ pack|}1 in template argument">;
5516def note_template_parameter_pack_here : Note<
5517  "previous %select{template type|non-type template|template template}0 "
5518  "parameter%select{| pack}1 declared here">;
5519
5520def err_unexpanded_parameter_pack : Error<
5521  "%select{expression|base type|declaration type|data member type|bit-field "
5522  "size|static assertion|fixed underlying type|enumerator value|"
5523  "using declaration|friend declaration|qualifier|initializer|default argument|"
5524  "non-type template parameter type|exception type|partial specialization|"
5525  "__if_exists name|__if_not_exists name|lambda|block|type constraint|"
5526  "requirement|requires clause}0 "
5527  "contains%plural{0: an|:}1 unexpanded parameter pack"
5528  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5529
5530def err_pack_expansion_without_parameter_packs : Error<
5531  "pack expansion does not contain any unexpanded parameter packs">;
5532def err_pack_expansion_length_conflict : Error<
5533  "pack expansion contains parameter packs %0 and %1 that have different "
5534  "lengths (%2 vs. %3)">;
5535def err_pack_expansion_length_conflict_multilevel : Error<
5536  "pack expansion contains parameter pack %0 that has a different "
5537  "length (%1 vs. %2) from outer parameter packs">;
5538def err_pack_expansion_length_conflict_partial : Error<
5539  "pack expansion contains parameter pack %0 that has a different "
5540  "length (at least %1 vs. %2) from outer parameter packs">;
5541def err_pack_expansion_member_init : Error<
5542  "pack expansion for initialization of member %0">;
5543
5544def err_function_parameter_pack_without_parameter_packs : Error<
5545  "type %0 of function parameter pack does not contain any unexpanded "
5546  "parameter packs">;
5547def err_ellipsis_in_declarator_not_parameter : Error<
5548  "only function and template parameters can be parameter packs">;
5549
5550def err_sizeof_pack_no_pack_name : Error<
5551  "%0 does not refer to the name of a parameter pack">;
5552
5553def err_fold_expression_packs_both_sides : Error<
5554  "binary fold expression has unexpanded parameter packs in both operands">;
5555def err_fold_expression_empty : Error<
5556  "unary fold expression has empty expansion for operator '%0' "
5557  "with no fallback value">;
5558def err_fold_expression_bad_operand : Error<
5559  "expression not permitted as operand of fold expression">;
5560def err_fold_expression_limit_exceeded: Error<
5561  "instantiating fold expression with %0 arguments exceeded expression nesting "
5562  "limit of %1">, DefaultFatal, NoSFINAE;
5563
5564def err_unexpected_typedef : Error<
5565  "unexpected type name %0: expected expression">;
5566def err_unexpected_namespace : Error<
5567  "unexpected namespace name %0: expected expression">;
5568def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5569def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5570  "use of undeclared identifier %0; "
5571  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5572  InGroup<MicrosoftTemplate>;
5573def err_found_in_dependent_base : Error<
5574  "explicit qualification required to use member %0 from dependent base class">;
5575def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5576  "found via unqualified lookup into dependent bases of class templates is a "
5577  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5578def err_found_later_in_class : Error<"member %0 used before its declaration">;
5579def ext_found_later_in_class : ExtWarn<
5580  "use of member %0 before its declaration is a Microsoft extension">,
5581  InGroup<MicrosoftTemplate>;
5582def ext_unqualified_base_class : ExtWarn<
5583  "unqualified base initializer of class templates is a Microsoft extension">,
5584  InGroup<MicrosoftTemplate>;
5585def note_dependent_member_use : Note<
5586  "must qualify identifier to find this declaration in dependent base class">;
5587def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5588    "visible in the template definition nor found by argument-dependent lookup">;
5589def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5590    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5591def err_undeclared_use : Error<"use of undeclared %0">;
5592def warn_deprecated : Warning<"%0 is deprecated">,
5593    InGroup<DeprecatedDeclarations>;
5594def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5595def warn_property_method_deprecated :
5596    Warning<"property access is using %0 method which is deprecated">,
5597    InGroup<DeprecatedDeclarations>;
5598def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5599    InGroup<DeprecatedDeclarations>;
5600def warn_deprecated_anonymous_namespace : Warning<
5601  "'deprecated' attribute on anonymous namespace ignored">,
5602  InGroup<IgnoredAttributes>;
5603def warn_deprecated_fwdclass_message : Warning<
5604    "%0 may be deprecated because the receiver type is unknown">,
5605    InGroup<DeprecatedDeclarations>;
5606def warn_deprecated_def : Warning<
5607  "implementing deprecated %select{method|class|category}0">,
5608  InGroup<DeprecatedImplementations>, DefaultIgnore;
5609def warn_unavailable_def : Warning<
5610  "implementing unavailable method">,
5611  InGroup<DeprecatedImplementations>, DefaultIgnore;
5612def warn_deprecated_builtin : Warning<
5613  "builtin %0 is deprecated; use %1 instead">,
5614  InGroup<DeprecatedBuiltins>;
5615def err_unavailable : Error<"%0 is unavailable">;
5616def err_property_method_unavailable :
5617    Error<"property access is using %0 method which is unavailable">;
5618def err_unavailable_message : Error<"%0 is unavailable: %1">;
5619def warn_unavailable_fwdclass_message : Warning<
5620    "%0 may be unavailable because the receiver type is unknown">,
5621    InGroup<UnavailableDeclarations>;
5622def note_availability_specified_here : Note<
5623  "%0 has been explicitly marked "
5624  "%select{unavailable|deleted|deprecated}1 here">;
5625def note_partial_availability_specified_here : Note<
5626  "%0 has been marked as being introduced in %1 %2 here, "
5627  "but the deployment target is %1 %3">;
5628def note_implicitly_deleted : Note<
5629  "explicitly defaulted function was implicitly deleted here">;
5630def warn_not_enough_argument : Warning<
5631  "not enough variable arguments in %0 declaration to fit a sentinel">,
5632  InGroup<Sentinel>;
5633def warn_missing_sentinel : Warning <
5634  "missing sentinel in %select{function call|method dispatch|block call}0">,
5635  InGroup<Sentinel>;
5636def note_sentinel_here : Note<
5637  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5638def warn_strict_uses_without_prototype : Warning<
5639  "passing arguments to %select{a function|%1}0 without a prototype is "
5640  "deprecated in all versions of C and is not supported in C2x">,
5641  InGroup<DeprecatedNonPrototype>;
5642def warn_missing_prototype : Warning<
5643  "no previous prototype for function %0">,
5644  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5645def note_declaration_not_a_prototype : Note<
5646  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5647  "to make it %select{a prototype for a zero-parameter function|one}0">;
5648// This is not actually an extension, but we only want it to be enabled in
5649// -pedantic mode and this is the most direct way of accomplishing that.
5650def warn_strict_prototypes : Extension<
5651  "a %select{function|block}0 declaration without a prototype is deprecated "
5652  "%select{in all versions of C|}0">, InGroup<StrictPrototypes>;
5653def warn_non_prototype_changes_behavior : Warning<
5654  "a function %select{declaration|definition}0 without a prototype is "
5655  "deprecated in all versions of C %select{and is not supported in C2x|and is "
5656  "treated as a zero-parameter prototype in C2x, conflicting with a "
5657  "%select{previous|subsequent}2 %select{declaration|definition}3}1">,
5658  InGroup<DeprecatedNonPrototype>;
5659def note_conflicting_prototype : Note<"conflicting prototype is here">;
5660def warn_missing_variable_declarations : Warning<
5661  "no previous extern declaration for non-static variable %0">,
5662  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5663def note_static_for_internal_linkage : Note<
5664  "declare 'static' if the %select{variable|function}0 is not intended to be "
5665  "used outside of this translation unit">;
5666def err_static_data_member_reinitialization :
5667  Error<"static data member %0 already has an initializer">;
5668def err_redefinition : Error<"redefinition of %0">;
5669def err_alias_after_tentative :
5670  Error<"alias definition of %0 after tentative definition">;
5671def err_alias_is_definition :
5672  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5673def err_definition_of_implicitly_declared_member : Error<
5674  "definition of implicitly declared %select{default constructor|copy "
5675  "constructor|move constructor|copy assignment operator|move assignment "
5676  "operator|destructor|function}1">;
5677def err_definition_of_explicitly_defaulted_member : Error<
5678  "definition of explicitly defaulted %select{default constructor|copy "
5679  "constructor|move constructor|copy assignment operator|move assignment "
5680  "operator|destructor|function}0">;
5681def err_redefinition_extern_inline : Error<
5682  "redefinition of a 'extern inline' function %0 is not supported in "
5683  "%select{C99 mode|C++}1">;
5684def warn_attr_abi_tag_namespace : Warning<
5685  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5686  InGroup<IgnoredAttributes>;
5687def err_abi_tag_on_redeclaration : Error<
5688  "cannot add 'abi_tag' attribute in a redeclaration">;
5689def err_new_abi_tag_on_redeclaration : Error<
5690  "'abi_tag' %0 missing in original declaration">;
5691def note_use_ifdef_guards : Note<
5692  "unguarded header; consider using #ifdef guards or #pragma once">;
5693
5694def warn_var_decl_not_read_only : Warning<
5695  "object of type %0 cannot be placed in read-only memory">,
5696  InGroup<ReadOnlyPlacementChecks>;
5697def note_enforce_read_only_placement : Note<"type was declared read-only here">;
5698
5699
5700def note_deleted_dtor_no_operator_delete : Note<
5701  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5702def note_deleted_special_member_class_subobject : Note<
5703  "%select{default constructor of|copy constructor of|move constructor of|"
5704  "copy assignment operator of|move assignment operator of|destructor of|"
5705  "constructor inherited by}0 "
5706  "%1 is implicitly deleted because "
5707  "%select{base class %3|%select{||||variant }4field %3}2 "
5708  "%select{has "
5709  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
5710  "%select{%select{default constructor|copy constructor|move constructor|copy "
5711  "assignment operator|move assignment operator|destructor|"
5712  "%select{default|corresponding|default|default|default}4 constructor}0|"
5713  "destructor}5"
5714  "%select{||s||}4"
5715  "|is an ObjC pointer}6">;
5716def note_deleted_default_ctor_uninit_field : Note<
5717  "%select{default constructor of|constructor inherited by}0 "
5718  "%1 is implicitly deleted because field %2 of "
5719  "%select{reference|const-qualified}4 type %3 would not be initialized">;
5720def note_deleted_default_ctor_all_const : Note<
5721  "%select{default constructor of|constructor inherited by}0 "
5722  "%1 is implicitly deleted because all "
5723  "%select{data members|data members of an anonymous union member}2"
5724  " are const-qualified">;
5725def note_deleted_copy_ctor_rvalue_reference : Note<
5726  "copy constructor of %0 is implicitly deleted because field %1 is of "
5727  "rvalue reference type %2">;
5728def note_deleted_copy_user_declared_move : Note<
5729  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
5730  " %1 has a user-declared move %select{constructor|assignment operator}2">;
5731def note_deleted_assign_field : Note<
5732  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
5733  "because field %2 is of %select{reference|const-qualified}4 type %3">;
5734
5735// These should be errors.
5736def warn_undefined_internal : Warning<
5737  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
5738  InGroup<DiagGroup<"undefined-internal">>;
5739def err_undefined_internal_type : Error<
5740  "%select{function|variable}0 %q1 is used but not defined in this "
5741  "translation unit, and cannot be defined in any other translation unit "
5742  "because its type does not have linkage">;
5743def ext_undefined_internal_type : Extension<
5744  "ISO C++ requires a definition in this translation unit for "
5745  "%select{function|variable}0 %q1 because its type does not have linkage">,
5746  InGroup<DiagGroup<"undefined-internal-type">>;
5747def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
5748  InGroup<DiagGroup<"undefined-inline">>;
5749def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
5750def note_used_here : Note<"used here">;
5751
5752def err_attribute_missing_on_first_decl : Error<
5753  "%0 attribute does not appear on the first declaration">;
5754def warn_internal_linkage_local_storage : Warning<
5755  "'internal_linkage' attribute on a non-static local variable is ignored">,
5756  InGroup<IgnoredAttributes>;
5757
5758def ext_internal_in_extern_inline : ExtWarn<
5759  "static %select{function|variable}0 %1 is used in an inline function with "
5760  "external linkage">, InGroup<StaticInInline>;
5761def ext_internal_in_extern_inline_quiet : Extension<
5762  "static %select{function|variable}0 %1 is used in an inline function with "
5763  "external linkage">, InGroup<StaticInInline>;
5764def warn_static_local_in_extern_inline : Warning<
5765  "non-constant static local variable in inline function may be different "
5766  "in different files">, InGroup<StaticLocalInInline>;
5767def note_convert_inline_to_static : Note<
5768  "use 'static' to give inline function %0 internal linkage">;
5769
5770def ext_redefinition_of_typedef : ExtWarn<
5771  "redefinition of typedef %0 is a C11 feature">,
5772  InGroup<DiagGroup<"typedef-redefinition"> >;
5773def err_redefinition_variably_modified_typedef : Error<
5774  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
5775
5776def err_inline_decl_follows_def : Error<
5777  "inline declaration of %0 follows non-inline definition">;
5778def err_inline_declaration_block_scope : Error<
5779  "inline declaration of %0 not allowed in block scope">;
5780def err_static_non_static : Error<
5781  "static declaration of %0 follows non-static declaration">;
5782def err_different_language_linkage : Error<
5783  "declaration of %0 has a different language linkage">;
5784def ext_retained_language_linkage : Extension<
5785  "friend function %0 retaining previous language linkage is an extension">,
5786  InGroup<DiagGroup<"retained-language-linkage">>;
5787def err_extern_c_global_conflict : Error<
5788  "declaration of %1 %select{with C language linkage|in global scope}0 "
5789  "conflicts with declaration %select{in global scope|with C language linkage}0">;
5790def note_extern_c_global_conflict : Note<
5791  "declared %select{in global scope|with C language linkage}0 here">;
5792def note_extern_c_begins_here : Note<
5793  "extern \"C\" language linkage specification begins here">;
5794def warn_weak_import : Warning <
5795  "an already-declared variable is made a weak_import declaration %0">;
5796def ext_static_non_static : Extension<
5797  "redeclaring non-static %0 as static is a Microsoft extension">,
5798  InGroup<MicrosoftRedeclareStatic>;
5799def err_non_static_static : Error<
5800  "non-static declaration of %0 follows static declaration">;
5801def err_extern_non_extern : Error<
5802  "extern declaration of %0 follows non-extern declaration">;
5803def err_non_extern_extern : Error<
5804  "non-extern declaration of %0 follows extern declaration">;
5805def err_non_thread_thread : Error<
5806  "non-thread-local declaration of %0 follows thread-local declaration">;
5807def err_thread_non_thread : Error<
5808  "thread-local declaration of %0 follows non-thread-local declaration">;
5809def err_thread_thread_different_kind : Error<
5810  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
5811  "follows declaration with %select{dynamic|static}1 initialization">;
5812def err_mismatched_owning_module : Error<
5813  "declaration of %0 in %select{the global module|module %2}1 follows "
5814  "declaration in %select{the global module|module %4}3">;
5815def err_redefinition_different_type : Error<
5816  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
5817def err_redefinition_different_kind : Error<
5818  "redefinition of %0 as different kind of symbol">;
5819def err_redefinition_different_namespace_alias : Error<
5820  "redefinition of %0 as an alias for a different namespace">;
5821def note_previous_namespace_alias : Note<
5822  "previously defined as an alias for %0">;
5823def warn_forward_class_redefinition : Warning<
5824  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
5825  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
5826def err_redefinition_different_typedef : Error<
5827  "%select{typedef|type alias|type alias template}0 "
5828  "redefinition with different types%diff{ ($ vs $)|}1,2">;
5829def err_redefinition_different_concept : Error<
5830  "redefinition of concept %0 with different template parameters or requirements">;
5831def err_tag_reference_non_tag : Error<
5832  "%select{non-struct type|non-class type|non-union type|non-enum "
5833  "type|typedef|type alias|template|type alias template|template "
5834  "template argument}1 %0 cannot be referenced with a "
5835  "%select{struct|interface|union|class|enum}2 specifier">;
5836def err_tag_reference_conflict : Error<
5837  "implicit declaration introduced by elaborated type conflicts with a "
5838  "%select{non-struct type|non-class type|non-union type|non-enum "
5839  "type|typedef|type alias|template|type alias template|template "
5840  "template argument}0 of the same name">;
5841def err_dependent_tag_decl : Error<
5842  "%select{declaration|definition}0 of "
5843  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
5844def err_tag_definition_of_typedef : Error<
5845  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
5846def err_conflicting_types : Error<"conflicting types for %0">;
5847def err_different_pass_object_size_params : Error<
5848  "conflicting pass_object_size attributes on parameters">;
5849def err_late_asm_label_name : Error<
5850  "cannot apply asm label to %select{variable|function}0 after its first use">;
5851def err_different_asm_label : Error<"conflicting asm label">;
5852def err_nested_redefinition : Error<"nested redefinition of %0">;
5853def err_use_with_wrong_tag : Error<
5854  "use of %0 with tag type that does not match previous declaration">;
5855def warn_struct_class_tag_mismatch : Warning<
5856  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
5857  "declared as a %select{struct|interface|class}3%select{| template}1; "
5858  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5859  InGroup<MismatchedTags>, DefaultIgnore;
5860def warn_struct_class_previous_tag_mismatch : Warning<
5861  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
5862  "here but previously declared as "
5863  "%select{a struct|an interface|a class}3%select{| template}1; "
5864  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5865  InGroup<MismatchedTags>, DefaultIgnore;
5866def note_struct_class_suggestion : Note<
5867  "did you mean %select{struct|interface|class}0 here?">;
5868def ext_forward_ref_enum : Extension<
5869  "ISO C forbids forward references to 'enum' types">;
5870def err_forward_ref_enum : Error<
5871  "ISO C++ forbids forward references to 'enum' types">;
5872def ext_ms_forward_ref_enum : ExtWarn<
5873  "forward references to 'enum' types are a Microsoft extension">,
5874  InGroup<MicrosoftEnumForwardReference>;
5875def ext_forward_ref_enum_def : Extension<
5876  "redeclaration of already-defined enum %0 is a GNU extension">,
5877  InGroup<GNURedeclaredEnum>;
5878
5879def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
5880def err_duplicate_member : Error<"duplicate member %0">;
5881def err_misplaced_ivar : Error<
5882  "instance variables may not be placed in %select{categories|class extension}0">;
5883def warn_ivars_in_interface : Warning<
5884  "declaration of instance variables in the interface is deprecated">,
5885  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
5886def ext_enum_value_not_int : Extension<
5887  "ISO C restricts enumerator values to range of 'int' (%0 is too "
5888  "%select{small|large}1)">;
5889def ext_enum_too_large : ExtWarn<
5890  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
5891def ext_enumerator_increment_too_large : ExtWarn<
5892  "incremented enumerator value %0 is not representable in the "
5893  "largest integer type">, InGroup<EnumTooLarge>;
5894def warn_flag_enum_constant_out_of_range : Warning<
5895  "enumeration value %0 is out of range of flags in enumeration type %1">,
5896  InGroup<FlagEnum>;
5897
5898def err_vm_decl_in_file_scope : Error<
5899  "variably modified type declaration not allowed at file scope">;
5900def err_vm_decl_has_extern_linkage : Error<
5901  "variably modified type declaration cannot have 'extern' linkage">;
5902def err_typecheck_field_variable_size : Error<
5903  "fields must have a constant size: 'variable length array in structure' "
5904  "extension will never be supported">;
5905def err_vm_func_decl : Error<
5906  "function declaration cannot have variably modified type">;
5907def err_array_too_large : Error<
5908  "array is too large (%0 elements)">;
5909
5910def err_typecheck_negative_array_size : Error<"array size is negative">;
5911def warn_typecheck_function_qualifiers_ignored : Warning<
5912  "'%0' qualifier on function type %1 has no effect">,
5913  InGroup<IgnoredQualifiers>;
5914def warn_typecheck_function_qualifiers_unspecified : Warning<
5915  "'%0' qualifier on function type %1 has unspecified behavior">;
5916def warn_typecheck_reference_qualifiers : Warning<
5917  "'%0' qualifier on reference type %1 has no effect">,
5918  InGroup<IgnoredReferenceQualifiers>;
5919def err_typecheck_invalid_restrict_not_pointer : Error<
5920  "restrict requires a pointer or reference (%0 is invalid)">;
5921def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
5922  "restrict requires a pointer or reference">;
5923def err_typecheck_invalid_restrict_invalid_pointee : Error<
5924  "pointer to function type %0 may not be 'restrict' qualified">;
5925def ext_typecheck_zero_array_size : Extension<
5926  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
5927def err_typecheck_zero_array_size : Error<
5928  "zero-length arrays are not permitted in %select{C++|SYCL device code}0">;
5929def err_array_size_non_int : Error<"size of array has non-integer type %0">;
5930def err_init_element_not_constant : Error<
5931  "initializer element is not a compile-time constant">;
5932def ext_aggregate_init_not_constant : Extension<
5933  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
5934def err_local_cant_init : Error<
5935  "'__local' variable cannot have an initializer">;
5936def err_loader_uninitialized_cant_init
5937    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
5938            "initializer">;
5939def err_loader_uninitialized_trivial_ctor
5940    : Error<"variable with 'loader_uninitialized' attribute must have a "
5941            "trivial default constructor">;
5942def err_loader_uninitialized_redeclaration
5943    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
5944def err_loader_uninitialized_extern_decl
5945    : Error<"variable %0 cannot be declared both 'extern' and with the "
5946            "'loader_uninitialized' attribute">;
5947def err_block_extern_cant_init : Error<
5948  "declaration of block scope identifier with linkage cannot have an initializer">;
5949def warn_extern_init : Warning<"'extern' variable has an initializer">,
5950  InGroup<DiagGroup<"extern-initializer">>;
5951def err_variable_object_no_init : Error<
5952  "variable-sized object may not be initialized">;
5953def err_excess_initializers : Error<
5954  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
5955def ext_excess_initializers : ExtWarn<
5956  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
5957  InGroup<ExcessInitializers>;
5958def err_excess_initializers_for_sizeless_type : Error<
5959  "excess elements in initializer for indivisible sizeless type %0">;
5960def ext_excess_initializers_for_sizeless_type : ExtWarn<
5961  "excess elements in initializer for indivisible sizeless type %0">,
5962  InGroup<ExcessInitializers>;
5963def err_excess_initializers_in_char_array_initializer : Error<
5964  "excess elements in char array initializer">;
5965def ext_excess_initializers_in_char_array_initializer : ExtWarn<
5966  "excess elements in char array initializer">,
5967  InGroup<ExcessInitializers>;
5968def err_initializer_string_for_char_array_too_long : Error<
5969  "initializer-string for char array is too long, array size is %0 but initializer has size %1 (including the null terminating character)">;
5970def ext_initializer_string_for_char_array_too_long : ExtWarn<
5971  "initializer-string for char array is too long">,
5972  InGroup<ExcessInitializers>;
5973def warn_missing_field_initializers : Warning<
5974  "missing field %0 initializer">,
5975  InGroup<MissingFieldInitializers>, DefaultIgnore;
5976def warn_braces_around_init : Warning<
5977  "braces around %select{scalar |}0initializer">,
5978  InGroup<DiagGroup<"braced-scalar-init">>;
5979def ext_many_braces_around_init : ExtWarn<
5980  "too many braces around %select{scalar |}0initializer">,
5981  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5982def ext_complex_component_init : Extension<
5983  "complex initialization specifying real and imaginary components "
5984  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5985def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5986def err_empty_sizeless_initializer : Error<
5987  "initializer for sizeless type %0 cannot be empty">;
5988def warn_cxx98_compat_empty_scalar_initializer : Warning<
5989  "scalar initialized from empty initializer list is incompatible with C++98">,
5990  InGroup<CXX98Compat>, DefaultIgnore;
5991def warn_cxx98_compat_empty_sizeless_initializer : Warning<
5992  "initializing %0 from an empty initializer list is incompatible with C++98">,
5993  InGroup<CXX98Compat>, DefaultIgnore;
5994def warn_cxx98_compat_reference_list_init : Warning<
5995  "reference initialized from initializer list is incompatible with C++98">,
5996  InGroup<CXX98Compat>, DefaultIgnore;
5997def warn_cxx98_compat_initializer_list_init : Warning<
5998  "initialization of initializer_list object is incompatible with C++98">,
5999  InGroup<CXX98Compat>, DefaultIgnore;
6000def warn_cxx98_compat_ctor_list_init : Warning<
6001  "constructor call from initializer list is incompatible with C++98">,
6002  InGroup<CXX98Compat>, DefaultIgnore;
6003def err_illegal_initializer : Error<
6004  "illegal initializer (only variables can be initialized)">;
6005def err_illegal_initializer_type : Error<"illegal initializer type %0">;
6006def ext_init_list_type_narrowing : ExtWarn<
6007  "type %0 cannot be narrowed to %1 in initializer list">,
6008  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6009def ext_init_list_variable_narrowing : ExtWarn<
6010  "non-constant-expression cannot be narrowed from type %0 to %1 in "
6011  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6012def ext_init_list_constant_narrowing : ExtWarn<
6013  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
6014  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6015def warn_init_list_type_narrowing : Warning<
6016  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
6017  InGroup<CXX11Narrowing>, DefaultIgnore;
6018def warn_init_list_variable_narrowing : Warning<
6019  "non-constant-expression cannot be narrowed from type %0 to %1 in "
6020  "initializer list in C++11">,
6021  InGroup<CXX11Narrowing>, DefaultIgnore;
6022def warn_init_list_constant_narrowing : Warning<
6023  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
6024  "C++11">,
6025  InGroup<CXX11Narrowing>, DefaultIgnore;
6026def note_init_list_narrowing_silence : Note<
6027  "insert an explicit cast to silence this issue">;
6028def err_init_objc_class : Error<
6029  "cannot initialize Objective-C class type %0">;
6030def err_implicit_empty_initializer : Error<
6031  "initializer for aggregate with no elements requires explicit braces">;
6032def err_bitfield_has_negative_width : Error<
6033  "bit-field %0 has negative width (%1)">;
6034def err_anon_bitfield_has_negative_width : Error<
6035  "anonymous bit-field has negative width (%0)">;
6036def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
6037def err_bitfield_width_exceeds_type_width : Error<
6038  "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the "
6039  "%select{width|size}3 of its type (%4 bit%s4)">;
6040def err_incorrect_number_of_vector_initializers : Error<
6041  "number of elements must be either one or match the size of the vector">;
6042
6043// Used by C++ which allows bit-fields that are wider than the type.
6044def warn_bitfield_width_exceeds_type_width: Warning<
6045  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
6046  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
6047def err_bitfield_too_wide : Error<
6048  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
6049def warn_bitfield_too_small_for_enum : Warning<
6050  "bit-field %0 is not wide enough to store all enumerators of %1">,
6051  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6052def note_widen_bitfield : Note<
6053  "widen this field to %0 bits to store all values of %1">;
6054def warn_unsigned_bitfield_assigned_signed_enum : Warning<
6055  "assigning value of signed enum type %1 to unsigned bit-field %0; "
6056  "negative enumerators of enum %1 will be converted to positive values">,
6057  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6058def warn_signed_bitfield_enum_conversion : Warning<
6059  "signed bit-field %0 needs an extra bit to represent the largest positive "
6060  "enumerators of %1">,
6061  InGroup<BitFieldEnumConversion>, DefaultIgnore;
6062def note_change_bitfield_sign : Note<
6063  "consider making the bitfield type %select{unsigned|signed}0">;
6064
6065def warn_missing_braces : Warning<
6066  "suggest braces around initialization of subobject">,
6067  InGroup<MissingBraces>, DefaultIgnore;
6068
6069def err_redefinition_of_label : Error<"redefinition of label %0">;
6070def err_undeclared_label_use : Error<"use of undeclared label %0">;
6071def err_goto_ms_asm_label : Error<
6072  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
6073def note_goto_ms_asm_label : Note<
6074  "inline assembly label %0 declared here">;
6075def warn_unused_label : Warning<"unused label %0">,
6076  InGroup<UnusedLabel>, DefaultIgnore;
6077
6078def err_continue_from_cond_var_init : Error<
6079  "cannot jump from this continue statement to the loop increment; "
6080  "jump bypasses initialization of loop condition variable">;
6081def err_goto_into_protected_scope : Error<
6082  "cannot jump from this goto statement to its label">;
6083def ext_goto_into_protected_scope : ExtWarn<
6084  "jump from this goto statement to its label is a Microsoft extension">,
6085  InGroup<MicrosoftGoto>;
6086def warn_cxx98_compat_goto_into_protected_scope : Warning<
6087  "jump from this goto statement to its label is incompatible with C++98">,
6088  InGroup<CXX98Compat>, DefaultIgnore;
6089def err_switch_into_protected_scope : Error<
6090  "cannot jump from switch statement to this case label">;
6091def warn_cxx98_compat_switch_into_protected_scope : Warning<
6092  "jump from switch statement to this case label is incompatible with C++98">,
6093  InGroup<CXX98Compat>, DefaultIgnore;
6094def err_indirect_goto_without_addrlabel : Error<
6095  "indirect goto in function with no address-of-label expressions">;
6096def err_indirect_goto_in_protected_scope : Error<
6097  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
6098def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
6099  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
6100  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6101def note_indirect_goto_target : Note<
6102  "possible target of %select{indirect|asm}0 goto statement">;
6103def note_protected_by_variable_init : Note<
6104  "jump bypasses variable initialization">;
6105def note_protected_by_variable_nontriv_destructor : Note<
6106  "jump bypasses variable with a non-trivial destructor">;
6107def note_protected_by_variable_non_pod : Note<
6108  "jump bypasses initialization of non-POD variable">;
6109def note_protected_by_cleanup : Note<
6110  "jump bypasses initialization of variable with __attribute__((cleanup))">;
6111def note_protected_by_vla_typedef : Note<
6112  "jump bypasses initialization of VLA typedef">;
6113def note_protected_by_vla_type_alias : Note<
6114  "jump bypasses initialization of VLA type alias">;
6115def note_protected_by_constexpr_if : Note<
6116  "jump enters controlled statement of constexpr if">;
6117def note_protected_by_consteval_if : Note<
6118  "jump enters controlled statement of consteval if">;
6119def note_protected_by_if_available : Note<
6120  "jump enters controlled statement of if available">;
6121def note_protected_by_vla : Note<
6122  "jump bypasses initialization of variable length array">;
6123def note_protected_by_objc_fast_enumeration : Note<
6124  "jump enters Objective-C fast enumeration loop">;
6125def note_protected_by_objc_try : Note<
6126  "jump bypasses initialization of @try block">;
6127def note_protected_by_objc_catch : Note<
6128  "jump bypasses initialization of @catch block">;
6129def note_protected_by_objc_finally : Note<
6130  "jump bypasses initialization of @finally block">;
6131def note_protected_by_objc_synchronized : Note<
6132  "jump bypasses initialization of @synchronized block">;
6133def note_protected_by_objc_autoreleasepool : Note<
6134  "jump bypasses auto release push of @autoreleasepool block">;
6135def note_protected_by_cxx_try : Note<
6136  "jump bypasses initialization of try block">;
6137def note_protected_by_cxx_catch : Note<
6138  "jump bypasses initialization of catch block">;
6139def note_protected_by_seh_try : Note<
6140  "jump bypasses initialization of __try block">;
6141def note_protected_by_seh_except : Note<
6142  "jump bypasses initialization of __except block">;
6143def note_protected_by_seh_finally : Note<
6144  "jump bypasses initialization of __finally block">;
6145def note_protected_by___block : Note<
6146  "jump bypasses setup of __block variable">;
6147def note_protected_by_objc_strong_init : Note<
6148  "jump bypasses initialization of __strong variable">;
6149def note_protected_by_objc_weak_init : Note<
6150  "jump bypasses initialization of __weak variable">;
6151def note_protected_by_non_trivial_c_struct_init : Note<
6152  "jump bypasses initialization of variable of non-trivial C struct type">;
6153def note_enters_block_captures_cxx_obj : Note<
6154  "jump enters lifetime of block which captures a destructible C++ object">;
6155def note_enters_block_captures_strong : Note<
6156  "jump enters lifetime of block which strongly captures a variable">;
6157def note_enters_block_captures_weak : Note<
6158  "jump enters lifetime of block which weakly captures a variable">;
6159def note_enters_block_captures_non_trivial_c_struct : Note<
6160  "jump enters lifetime of block which captures a C struct that is non-trivial "
6161  "to destroy">;
6162def note_enters_compound_literal_scope : Note<
6163  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
6164
6165def note_exits_cleanup : Note<
6166  "jump exits scope of variable with __attribute__((cleanup))">;
6167def note_exits_dtor : Note<
6168  "jump exits scope of variable with non-trivial destructor">;
6169def note_exits_temporary_dtor : Note<
6170  "jump exits scope of lifetime-extended temporary with non-trivial "
6171  "destructor">;
6172def note_exits___block : Note<
6173  "jump exits scope of __block variable">;
6174def note_exits_objc_try : Note<
6175  "jump exits @try block">;
6176def note_exits_objc_catch : Note<
6177  "jump exits @catch block">;
6178def note_exits_objc_finally : Note<
6179  "jump exits @finally block">;
6180def note_exits_objc_synchronized : Note<
6181  "jump exits @synchronized block">;
6182def note_exits_cxx_try : Note<
6183  "jump exits try block">;
6184def note_exits_cxx_catch : Note<
6185  "jump exits catch block">;
6186def note_exits_seh_try : Note<
6187  "jump exits __try block">;
6188def note_exits_seh_except : Note<
6189  "jump exits __except block">;
6190def note_exits_seh_finally : Note<
6191  "jump exits __finally block">;
6192def note_exits_objc_autoreleasepool : Note<
6193  "jump exits autoreleasepool block">;
6194def note_exits_objc_strong : Note<
6195  "jump exits scope of __strong variable">;
6196def note_exits_objc_weak : Note<
6197  "jump exits scope of __weak variable">;
6198def note_exits_block_captures_cxx_obj : Note<
6199  "jump exits lifetime of block which captures a destructible C++ object">;
6200def note_exits_block_captures_strong : Note<
6201  "jump exits lifetime of block which strongly captures a variable">;
6202def note_exits_block_captures_weak : Note<
6203  "jump exits lifetime of block which weakly captures a variable">;
6204def note_exits_block_captures_non_trivial_c_struct : Note<
6205  "jump exits lifetime of block which captures a C struct that is non-trivial "
6206  "to destroy">;
6207def note_exits_compound_literal_scope : Note<
6208  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
6209
6210def err_func_returning_qualified_void : ExtWarn<
6211  "function cannot return qualified void type %0">,
6212  InGroup<DiagGroup<"qualified-void-return-type">>;
6213def err_func_returning_array_function : Error<
6214  "function cannot return %select{array|function}0 type %1">;
6215def err_field_declared_as_function : Error<"field %0 declared as a function">;
6216def err_field_incomplete_or_sizeless : Error<
6217  "field has %select{incomplete|sizeless}0 type %1">;
6218def ext_variable_sized_type_in_struct : ExtWarn<
6219  "field %0 with variable sized type %1 not at the end of a struct or class is"
6220  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
6221
6222def ext_c99_flexible_array_member : Extension<
6223  "flexible array members are a C99 feature">, InGroup<C99>;
6224def err_flexible_array_virtual_base : Error<
6225  "flexible array member %0 not allowed in "
6226  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
6227def err_flexible_array_empty_aggregate : Error<
6228  "flexible array member %0 not allowed in otherwise empty "
6229  "%select{struct|interface|union|class|enum}1">;
6230def err_flexible_array_has_nontrivial_dtor : Error<
6231  "flexible array member %0 of type %1 with non-trivial destruction">;
6232def ext_flexible_array_in_struct : Extension<
6233  "%0 may not be nested in a struct due to flexible array member">,
6234  InGroup<FlexibleArrayExtensions>;
6235def ext_flexible_array_in_array : Extension<
6236  "%0 may not be used as an array element due to flexible array member">,
6237  InGroup<FlexibleArrayExtensions>;
6238def err_flexible_array_init : Error<
6239  "initialization of flexible array member is not allowed">;
6240def ext_flexible_array_empty_aggregate_ms : Extension<
6241  "flexible array member %0 in otherwise empty "
6242  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
6243  InGroup<MicrosoftFlexibleArray>;
6244def err_flexible_array_union : Error<
6245  "flexible array member %0 in a union is not allowed">;
6246def ext_flexible_array_union_ms : Extension<
6247  "flexible array member %0 in a union is a Microsoft extension">,
6248  InGroup<MicrosoftFlexibleArray>;
6249def ext_flexible_array_empty_aggregate_gnu : Extension<
6250  "flexible array member %0 in otherwise empty "
6251  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
6252  InGroup<GNUEmptyStruct>;
6253def ext_flexible_array_union_gnu : Extension<
6254  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
6255
6256def err_flexible_array_not_at_end : Error<
6257  "flexible array member %0 with type %1 is not at the end of"
6258  " %select{struct|interface|union|class|enum}2">;
6259def err_objc_variable_sized_type_not_at_end : Error<
6260  "field %0 with variable sized type %1 is not at the end of class">;
6261def note_next_field_declaration : Note<
6262  "next field declaration is here">;
6263def note_next_ivar_declaration : Note<
6264  "next %select{instance variable declaration|synthesized instance variable}0"
6265  " is here">;
6266def err_synthesize_variable_sized_ivar : Error<
6267  "synthesized property with variable size type %0"
6268  " requires an existing instance variable">;
6269def err_flexible_array_arc_retainable : Error<
6270  "ARC forbids flexible array members with retainable object type">;
6271def warn_variable_sized_ivar_visibility : Warning<
6272  "field %0 with variable sized type %1 is not visible to subclasses and"
6273  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
6274def warn_superclass_variable_sized_type_not_at_end : Warning<
6275  "field %0 can overwrite instance variable %1 with variable sized type %2"
6276  " in superclass %3">, InGroup<ObjCFlexibleArray>;
6277
6278let CategoryName = "ARC Semantic Issue" in {
6279
6280// ARC-mode diagnostics.
6281
6282let CategoryName = "ARC Weak References" in {
6283
6284def err_arc_weak_no_runtime : Error<
6285  "cannot create __weak reference because the current deployment target "
6286  "does not support weak references">;
6287def err_arc_weak_disabled : Error<
6288  "cannot create __weak reference in file using manual reference counting">;
6289def err_synthesizing_arc_weak_property_disabled : Error<
6290  "cannot synthesize weak property in file using manual reference counting">;
6291def err_synthesizing_arc_weak_property_no_runtime : Error<
6292  "cannot synthesize weak property because the current deployment target "
6293  "does not support weak references">;
6294def err_arc_unsupported_weak_class : Error<
6295  "class is incompatible with __weak references">;
6296def err_arc_weak_unavailable_assign : Error<
6297  "assignment of a weak-unavailable object to a __weak object">;
6298def err_arc_weak_unavailable_property : Error<
6299  "synthesizing __weak instance variable of type %0, which does not "
6300  "support weak references">;
6301def note_implemented_by_class : Note<
6302  "when implemented by class %0">;
6303def err_arc_convesion_of_weak_unavailable : Error<
6304  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
6305  " a __weak object of type %2">;
6306
6307} // end "ARC Weak References" category
6308
6309let CategoryName = "ARC Restrictions" in {
6310
6311def err_unavailable_in_arc : Error<
6312  "%0 is unavailable in ARC">;
6313def note_arc_forbidden_type : Note<
6314  "declaration uses type that is ill-formed in ARC">;
6315def note_performs_forbidden_arc_conversion : Note<
6316  "inline function performs a conversion which is forbidden in ARC">;
6317def note_arc_init_returns_unrelated : Note<
6318  "init method must return a type related to its receiver type">;
6319def note_arc_weak_disabled : Note<
6320  "declaration uses __weak, but ARC is disabled">;
6321def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
6322  "the current deployment target does not support">;
6323def note_arc_field_with_ownership : Note<
6324  "field has non-trivial ownership qualification">;
6325
6326def err_arc_illegal_explicit_message : Error<
6327  "ARC forbids explicit message send of %0">;
6328def err_arc_unused_init_message : Error<
6329  "the result of a delegate init call must be immediately returned "
6330  "or assigned to 'self'">;
6331def err_arc_mismatched_cast : Error<
6332  "%select{implicit conversion|cast}0 of "
6333  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6334  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6335  " to %3 is disallowed with ARC">;
6336def err_arc_nolifetime_behavior : Error<
6337  "explicit ownership qualifier on cast result has no effect">;
6338def err_arc_objc_property_default_assign_on_object : Error<
6339  "ARC forbids synthesizing a property of an Objective-C object "
6340  "with unspecified ownership or storage attribute">;
6341def err_arc_illegal_selector : Error<
6342  "ARC forbids use of %0 in a @selector">;
6343def err_arc_illegal_method_def : Error<
6344  "ARC forbids %select{implementation|synthesis}0 of %1">;
6345def warn_arc_strong_pointer_objc_pointer : Warning<
6346  "method parameter of type %0 with no explicit ownership">,
6347  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6348
6349} // end "ARC Restrictions" category
6350
6351def err_arc_lost_method_convention : Error<
6352  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6353  "method, but its implementation doesn't match because %select{"
6354  "its result type is not an object pointer|"
6355  "its result type is unrelated to its receiver type}1">;
6356def note_arc_lost_method_convention : Note<"declaration in interface">;
6357def err_arc_gained_method_convention : Error<
6358  "method implementation does not match its declaration">;
6359def note_arc_gained_method_convention : Note<
6360  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6361  "family because %select{its result type is not an object pointer|"
6362  "its result type is unrelated to its receiver type}1">;
6363def err_typecheck_arc_assign_self : Error<
6364  "cannot assign to 'self' outside of a method in the init family">;
6365def err_typecheck_arc_assign_self_class_method : Error<
6366  "cannot assign to 'self' in a class method">;
6367def err_typecheck_arr_assign_enumeration : Error<
6368  "fast enumeration variables cannot be modified in ARC by default; "
6369  "declare the variable __strong to allow this">;
6370def err_typecheck_arc_assign_externally_retained : Error<
6371  "variable declared with 'objc_externally_retained' "
6372  "cannot be modified in ARC">;
6373def warn_arc_retained_assign : Warning<
6374  "assigning retained object to %select{weak|unsafe_unretained}0 "
6375  "%select{property|variable}1"
6376  "; object will be released after assignment">,
6377  InGroup<ARCUnsafeRetainedAssign>;
6378def warn_arc_retained_property_assign : Warning<
6379  "assigning retained object to unsafe property"
6380  "; object will be released after assignment">,
6381  InGroup<ARCUnsafeRetainedAssign>;
6382def warn_arc_literal_assign : Warning<
6383  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6384  " to a weak %select{property|variable}1"
6385  "; object will be released after assignment">,
6386  InGroup<ARCUnsafeRetainedAssign>;
6387def err_arc_new_array_without_ownership : Error<
6388  "'new' cannot allocate an array of %0 with no explicit ownership">;
6389def err_arc_autoreleasing_var : Error<
6390  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6391  "__autoreleasing ownership">;
6392def err_arc_autoreleasing_capture : Error<
6393  "cannot capture __autoreleasing variable in a "
6394  "%select{block|lambda by copy}0">;
6395def err_arc_thread_ownership : Error<
6396  "thread-local variable has non-trivial ownership: type is %0">;
6397def err_arc_indirect_no_ownership : Error<
6398  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6399def err_arc_array_param_no_ownership : Error<
6400  "must explicitly describe intended ownership of an object array parameter">;
6401def err_arc_pseudo_dtor_inconstant_quals : Error<
6402  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6403  "type %1">;
6404def err_arc_init_method_unrelated_result_type : Error<
6405  "init methods must return a type related to the receiver type">;
6406def err_arc_nonlocal_writeback : Error<
6407  "passing address of %select{non-local|non-scalar}0 object to "
6408  "__autoreleasing parameter for write-back">;
6409def err_arc_method_not_found : Error<
6410  "no known %select{instance|class}1 method for selector %0">;
6411def err_arc_receiver_forward_class : Error<
6412  "receiver %0 for class message is a forward declaration">;
6413def err_arc_may_not_respond : Error<
6414  "no visible @interface for %0 declares the selector %1">;
6415def err_arc_receiver_forward_instance : Error<
6416  "receiver type %0 for instance message is a forward declaration">;
6417def warn_receiver_forward_instance : Warning<
6418  "receiver type %0 for instance message is a forward declaration">,
6419  InGroup<ForwardClassReceiver>, DefaultIgnore;
6420def err_arc_collection_forward : Error<
6421  "collection expression type %0 is a forward declaration">;
6422def err_arc_multiple_method_decl : Error<
6423  "multiple methods named %0 found with mismatched result, "
6424  "parameter type or attributes">;
6425def warn_arc_lifetime_result_type : Warning<
6426  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6427  "lifetime qualifier on return type is ignored">,
6428  InGroup<IgnoredQualifiers>;
6429
6430let CategoryName = "ARC Retain Cycle" in {
6431
6432def warn_arc_retain_cycle : Warning<
6433  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6434  InGroup<ARCRetainCycles>;
6435def note_arc_retain_cycle_owner : Note<
6436  "block will be retained by %select{the captured object|an object strongly "
6437  "retained by the captured object}0">;
6438
6439} // end "ARC Retain Cycle" category
6440
6441def warn_arc_object_memaccess : Warning<
6442  "%select{destination for|source of}0 this %1 call is a pointer to "
6443  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6444
6445let CategoryName = "ARC and @properties" in {
6446
6447def err_arc_strong_property_ownership : Error<
6448  "existing instance variable %1 for strong property %0 may not be "
6449  "%select{|__unsafe_unretained||__weak}2">;
6450def err_arc_assign_property_ownership : Error<
6451  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6452  "attribute must be __unsafe_unretained">;
6453def err_arc_inconsistent_property_ownership : Error<
6454  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6455  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6456
6457} // end "ARC and @properties" category
6458
6459def warn_block_capture_autoreleasing : Warning<
6460  "block captures an autoreleasing out-parameter, which may result in "
6461  "use-after-free bugs">,
6462  InGroup<BlockCaptureAutoReleasing>;
6463def note_declare_parameter_strong : Note<
6464  "declare the parameter __strong or capture a __block __strong variable to "
6465  "keep values alive across autorelease pools">;
6466
6467def err_arc_atomic_ownership : Error<
6468  "cannot perform atomic operation on a pointer to type %0: type has "
6469  "non-trivial ownership">;
6470
6471let CategoryName = "ARC Casting Rules" in {
6472
6473def err_arc_bridge_cast_incompatible : Error<
6474  "incompatible types casting %0 to %1 with a %select{__bridge|"
6475  "__bridge_transfer|__bridge_retained}2 cast">;
6476def err_arc_bridge_cast_wrong_kind : Error<
6477  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6478  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6479  "__bridge_transfer|__bridge_retained}4">;
6480def err_arc_cast_requires_bridge : Error<
6481  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6482  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6483  "requires a bridged cast">;
6484def note_arc_bridge : Note<
6485  "use __bridge to convert directly (no change in ownership)">;
6486def note_arc_cstyle_bridge : Note<
6487  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6488def note_arc_bridge_transfer : Note<
6489  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6490  "ownership of a +1 %0 into ARC">;
6491def note_arc_cstyle_bridge_transfer : Note<
6492  "use __bridge_transfer with C-style cast to transfer "
6493  "ownership of a +1 %0 into ARC">;
6494def note_arc_bridge_retained : Note<
6495  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6496  "ARC object available as a +1 %0">;
6497def note_arc_cstyle_bridge_retained : Note<
6498  "use __bridge_retained with C-style cast to make an "
6499  "ARC object available as a +1 %0">;
6500
6501} // ARC Casting category
6502
6503} // ARC category name
6504
6505def err_flexible_array_init_needs_braces : Error<
6506  "flexible array requires brace-enclosed initializer">;
6507def err_illegal_decl_array_of_functions : Error<
6508  "'%0' declared as array of functions of type %1">;
6509def err_array_incomplete_or_sizeless_type : Error<
6510  "array has %select{incomplete|sizeless}0 element type %1">;
6511def err_illegal_message_expr_incomplete_type : Error<
6512  "Objective-C message has incomplete result type %0">;
6513def err_illegal_decl_array_of_references : Error<
6514  "'%0' declared as array of references of type %1">;
6515def err_decl_negative_array_size : Error<
6516  "'%0' declared as an array with a negative size">;
6517def err_array_static_outside_prototype : Error<
6518  "%0 used in array declarator outside of function prototype">;
6519def err_array_static_not_outermost : Error<
6520  "%0 used in non-outermost array type derivation">;
6521def err_array_star_outside_prototype : Error<
6522  "star modifier used outside of function prototype">;
6523def err_illegal_decl_pointer_to_reference : Error<
6524  "'%0' declared as a pointer to a reference of type %1">;
6525def err_illegal_decl_mempointer_to_reference : Error<
6526  "'%0' declared as a member pointer to a reference of type %1">;
6527def err_illegal_decl_mempointer_to_void : Error<
6528  "'%0' declared as a member pointer to void">;
6529def err_illegal_decl_mempointer_in_nonclass : Error<
6530  "'%0' does not point into a class">;
6531def err_mempointer_in_nonclass_type : Error<
6532  "member pointer refers into non-class type %0">;
6533def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6534def err_nonfunction_block_type : Error<
6535  "block pointer to non-function type is invalid">;
6536def err_return_block_has_expr : Error<"void block should not return a value">;
6537def err_block_return_missing_expr : Error<
6538  "non-void block should return a value">;
6539def err_func_def_incomplete_result : Error<
6540  "incomplete result type %0 in function definition">;
6541def err_atomic_specifier_bad_type
6542    : Error<"_Atomic cannot be applied to "
6543            "%select{incomplete |array |function |reference |atomic |qualified "
6544            "|sizeless ||integer }0type "
6545            "%1 %select{|||||||which is not trivially copyable|}0">;
6546def warn_atomic_member_access : Warning<
6547  "accessing a member of an atomic structure or union is undefined behavior">,
6548  InGroup<DiagGroup<"atomic-access">>, DefaultError;
6549
6550// Expressions.
6551def ext_sizeof_alignof_function_type : Extension<
6552  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6553def ext_sizeof_alignof_void_type : Extension<
6554  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6555def err_opencl_sizeof_alignof_type : Error<
6556  "invalid application of '%0' to a void type">;
6557def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6558  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6559def err_sizeof_alignof_function_type : Error<
6560  "invalid application of '%0' to a function type">;
6561def err_openmp_default_simd_align_expr : Error<
6562  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6563def err_sizeof_alignof_typeof_bitfield : Error<
6564  "invalid application of '%select{sizeof|alignof|typeof|typeof_unqual}0' to "
6565  "bit-field">;
6566def err_alignof_member_of_incomplete_type : Error<
6567  "invalid application of 'alignof' to a field of a class still being defined">;
6568def err_vecstep_non_scalar_vector_type : Error<
6569  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6570def err_offsetof_incomplete_type : Error<
6571  "offsetof of incomplete type %0">;
6572def err_offsetof_record_type : Error<
6573  "offsetof requires struct, union, or class type, %0 invalid">;
6574def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6575def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6576  InGroup<InvalidOffsetof>;
6577def ext_offsetof_non_standardlayout_type : ExtWarn<
6578  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6579def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6580def err_offsetof_field_of_virtual_base : Error<
6581  "invalid application of 'offsetof' to a field of a virtual base">;
6582def warn_sub_ptr_zero_size_types : Warning<
6583  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6584  InGroup<PointerArith>;
6585def warn_pointer_arith_null_ptr : Warning<
6586  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6587  InGroup<NullPointerArithmetic>, DefaultIgnore;
6588def warn_gnu_null_ptr_arith : Extension<
6589  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6590  InGroup<GNUNullPointerArithmetic>;
6591def warn_pointer_sub_null_ptr : Warning<
6592  "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
6593  InGroup<NullPointerSubtraction>, DefaultIgnore;
6594
6595def warn_floatingpoint_eq : Warning<
6596  "comparing floating point with == or != is unsafe">,
6597  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6598
6599def err_setting_eval_method_used_in_unsafe_context : Error <
6600  "%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used with "
6601  "%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'}1">;
6602
6603def warn_remainder_division_by_zero : Warning<
6604  "%select{remainder|division}0 by zero is undefined">,
6605  InGroup<DivZero>;
6606def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6607  InGroup<DiagGroup<"shift-negative-value">>;
6608def warn_shift_negative : Warning<"shift count is negative">,
6609  InGroup<DiagGroup<"shift-count-negative">>;
6610def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6611  InGroup<DiagGroup<"shift-count-overflow">>;
6612def warn_shift_result_gt_typewidth : Warning<
6613  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6614  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6615def warn_shift_result_sets_sign_bit : Warning<
6616  "signed shift result (%0) sets the sign bit of the shift expression's "
6617  "type (%1) and becomes negative">,
6618  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6619
6620def warn_precedence_bitwise_rel : Warning<
6621  "%0 has lower precedence than %1; %1 will be evaluated first">,
6622  InGroup<Parentheses>;
6623def note_precedence_bitwise_first : Note<
6624  "place parentheses around the %0 expression to evaluate it first">;
6625def note_precedence_silence : Note<
6626  "place parentheses around the '%0' expression to silence this warning">;
6627
6628def warn_precedence_conditional : Warning<
6629  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6630  InGroup<Parentheses>;
6631def warn_precedence_bitwise_conditional : Warning<
6632  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6633  InGroup<BitwiseConditionalParentheses>;
6634def note_precedence_conditional_first : Note<
6635  "place parentheses around the '?:' expression to evaluate it first">;
6636
6637def warn_enum_constant_in_bool_context : Warning<
6638  "converting the enum constant to a boolean">,
6639  InGroup<IntInBoolContext>, DefaultIgnore;
6640def warn_left_shift_in_bool_context : Warning<
6641  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6642  InGroup<IntInBoolContext>, DefaultIgnore;
6643def warn_logical_instead_of_bitwise : Warning<
6644  "use of logical '%0' with constant operand">,
6645  InGroup<DiagGroup<"constant-logical-operand">>;
6646def note_logical_instead_of_bitwise_change_operator : Note<
6647  "use '%0' for a bitwise operation">;
6648def note_logical_instead_of_bitwise_remove_constant : Note<
6649  "remove constant to silence this warning">;
6650
6651def warn_bitwise_op_in_bitwise_op : Warning<
6652  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
6653
6654def warn_logical_and_in_logical_or : Warning<
6655  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
6656
6657def warn_overloaded_shift_in_comparison :Warning<
6658  "overloaded operator %select{>>|<<}0 has higher precedence than "
6659  "comparison operator">,
6660  InGroup<OverloadedShiftOpParentheses>;
6661def note_evaluate_comparison_first :Note<
6662  "place parentheses around comparison expression to evaluate it first">;
6663
6664def note_concatenated_string_literal_silence :Note<
6665  "place parentheses around the string literal to silence warning">;
6666
6667def warn_addition_in_bitshift : Warning<
6668  "operator '%0' has lower precedence than '%1'; "
6669  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
6670
6671def warn_self_assignment_builtin : Warning<
6672  "explicitly assigning value of variable of type %0 to itself%select{|; did "
6673  "you mean to assign to member %2?}1">,
6674  InGroup<SelfAssignment>, DefaultIgnore;
6675def warn_self_assignment_overloaded : Warning<
6676  "explicitly assigning value of variable of type %0 to itself%select{|; did "
6677  "you mean to assign to member %2?}1">,
6678  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
6679def warn_self_move : Warning<
6680  "explicitly moving variable of type %0 to itself%select{|; did you mean to "
6681  "move to member %2?}1">,
6682  InGroup<SelfMove>, DefaultIgnore;
6683
6684def err_builtin_move_forward_unsupported : Error<
6685  "unsupported signature for %q0">;
6686def err_use_of_unaddressable_function : Error<
6687  "taking address of non-addressable standard library function">;
6688// FIXME: This should also be in -Wc++23-compat once we have it.
6689def warn_cxx20_compat_use_of_unaddressable_function : Warning<
6690  "taking address of non-addressable standard library function "
6691  "is incompatible with C++20">, InGroup<CXX20Compat>;
6692
6693def warn_redundant_move_on_return : Warning<
6694  "redundant move in return statement">,
6695  InGroup<RedundantMove>, DefaultIgnore;
6696def warn_pessimizing_move_on_return : Warning<
6697  "moving a local object in a return statement prevents copy elision">,
6698  InGroup<PessimizingMove>, DefaultIgnore;
6699def warn_pessimizing_move_on_initialization : Warning<
6700  "moving a temporary object prevents copy elision">,
6701  InGroup<PessimizingMove>, DefaultIgnore;
6702def note_remove_move : Note<"remove std::move call here">;
6703
6704def warn_string_plus_int : Warning<
6705  "adding %0 to a string does not append to the string">,
6706  InGroup<StringPlusInt>;
6707def warn_string_plus_char : Warning<
6708  "adding %0 to a string pointer does not append to the string">,
6709  InGroup<StringPlusChar>;
6710def note_string_plus_scalar_silence : Note<
6711  "use array indexing to silence this warning">;
6712
6713def warn_sizeof_array_param : Warning<
6714  "sizeof on array function parameter will return size of %0 instead of %1">,
6715  InGroup<SizeofArrayArgument>;
6716
6717def warn_sizeof_array_decay : Warning<
6718  "sizeof on pointer operation will return size of %0 instead of %1">,
6719  InGroup<SizeofArrayDecay>;
6720
6721def err_sizeof_nonfragile_interface : Error<
6722  "application of '%select{alignof|sizeof}1' to interface %0 is "
6723  "not supported on this architecture and platform">;
6724def err_atdef_nonfragile_interface : Error<
6725  "use of @defs is not supported on this architecture and platform">;
6726def err_subscript_nonfragile_interface : Error<
6727  "subscript requires size of interface %0, which is not constant for "
6728  "this architecture and platform">;
6729
6730def err_arithmetic_nonfragile_interface : Error<
6731  "arithmetic on pointer to interface %0, which is not a constant size for "
6732  "this architecture and platform">;
6733
6734def warn_deprecated_comma_subscript : Warning<
6735  "top-level comma expression in array subscript is deprecated "
6736  "in C++20 and unsupported in C++2b">,
6737  InGroup<DeprecatedCommaSubscript>;
6738
6739def ext_subscript_non_lvalue : Extension<
6740  "ISO C90 does not allow subscripting non-lvalue array">;
6741def err_typecheck_subscript_value : Error<
6742  "subscripted value is not an array, pointer, or vector">;
6743def err_typecheck_subscript_not_integer : Error<
6744  "array subscript is not an integer">;
6745def err_subscript_function_type : Error<
6746  "subscript of pointer to function type %0">;
6747def err_subscript_incomplete_or_sizeless_type : Error<
6748  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
6749def err_subscript_svbool_t : Error<
6750  "subscript of svbool_t is not allowed">;
6751def err_dereference_incomplete_type : Error<
6752  "dereference of pointer to incomplete type %0">;
6753def ext_gnu_subscript_void_type : Extension<
6754  "subscript of a pointer to void is a GNU extension">,
6755  InGroup<GNUPointerArith>;
6756def err_typecheck_member_reference_struct_union : Error<
6757  "member reference base type %0 is not a structure or union">;
6758def err_typecheck_member_reference_ivar : Error<
6759  "%0 does not have a member named %1">;
6760def err_arc_weak_ivar_access : Error<
6761  "dereferencing a __weak pointer is not allowed due to possible "
6762  "null value caused by race condition, assign it to strong variable first">;
6763def err_typecheck_member_reference_arrow : Error<
6764  "member reference type %0 is not a pointer">;
6765def err_typecheck_member_reference_suggestion : Error<
6766  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
6767def note_typecheck_member_reference_suggestion : Note<
6768  "did you mean to use '.' instead?">;
6769def note_member_reference_arrow_from_operator_arrow : Note<
6770  "'->' applied to return value of the operator->() declared here">;
6771def err_typecheck_member_reference_type : Error<
6772  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
6773def err_typecheck_member_reference_unknown : Error<
6774  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
6775def err_member_reference_needs_call : Error<
6776  "base of member reference is a function; perhaps you meant to call "
6777  "it%select{| with no arguments}0?">;
6778def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
6779  InGroup<CharSubscript>, DefaultIgnore;
6780
6781def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
6782def err_no_member : Error<"no member named %0 in %1">;
6783def err_no_member_overloaded_arrow : Error<
6784  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
6785
6786def err_member_not_yet_instantiated : Error<
6787  "no member %0 in %1; it has not yet been instantiated">;
6788def note_non_instantiated_member_here : Note<
6789  "not-yet-instantiated member is declared here">;
6790
6791def err_enumerator_does_not_exist : Error<
6792  "enumerator %0 does not exist in instantiation of %1">;
6793def note_enum_specialized_here : Note<
6794  "enum %0 was explicitly specialized here">;
6795
6796def err_specialization_not_primary_template : Error<
6797  "cannot reference member of primary template because deduced class "
6798  "template specialization %0 is %select{instantiated from a partial|"
6799  "an explicit}1 specialization">;
6800
6801def err_member_redeclared : Error<"class member cannot be redeclared">;
6802def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
6803  InGroup<RedeclaredClassMember>;
6804def err_member_redeclared_in_instantiation : Error<
6805  "multiple overloads of %0 instantiate to the same signature %1">;
6806def err_member_name_of_class : Error<"member %0 has the same name as its class">;
6807def err_member_def_undefined_record : Error<
6808  "out-of-line definition of %0 from class %1 without definition">;
6809def err_member_decl_does_not_match : Error<
6810  "out-of-line %select{declaration|definition}2 of %0 "
6811  "does not match any declaration in %1">;
6812def err_friend_decl_with_def_arg_must_be_def : Error<
6813  "friend declaration specifying a default argument must be a definition">;
6814def err_friend_decl_with_def_arg_redeclared : Error<
6815  "friend declaration specifying a default argument must be the only declaration">;
6816def err_friend_decl_does_not_match : Error<
6817  "friend declaration of %0 does not match any declaration in %1">;
6818def err_member_decl_does_not_match_suggest : Error<
6819  "out-of-line %select{declaration|definition}2 of %0 "
6820  "does not match any declaration in %1; did you mean %3?">;
6821def err_member_def_does_not_match_ret_type : Error<
6822  "return type of out-of-line definition of %q0 differs from "
6823  "that in the declaration">;
6824def err_nonstatic_member_out_of_line : Error<
6825  "non-static data member defined out-of-line">;
6826def err_qualified_typedef_declarator : Error<
6827  "typedef declarator cannot be qualified">;
6828def err_qualified_param_declarator : Error<
6829  "parameter declarator cannot be qualified">;
6830def ext_out_of_line_declaration : ExtWarn<
6831  "out-of-line declaration of a member must be a definition">,
6832  InGroup<OutOfLineDeclaration>, DefaultError;
6833def err_member_extra_qualification : Error<
6834  "extra qualification on member %0">;
6835def warn_member_extra_qualification : Warning<
6836  err_member_extra_qualification.Summary>, InGroup<MicrosoftExtraQualification>;
6837def warn_namespace_member_extra_qualification : Warning<
6838  "extra qualification on member %0">,
6839  InGroup<DiagGroup<"extra-qualification">>;
6840def err_member_qualification : Error<
6841  "non-friend class member %0 cannot have a qualified name">;
6842def note_member_def_close_match : Note<"member declaration nearly matches">;
6843def note_member_def_close_const_match : Note<
6844  "member declaration does not match because "
6845  "it %select{is|is not}0 const qualified">;
6846def note_member_def_close_param_match : Note<
6847  "type of %ordinal0 parameter of member declaration does not match definition"
6848  "%diff{ ($ vs $)|}1,2">;
6849def note_local_decl_close_match : Note<"local declaration nearly matches">;
6850def note_local_decl_close_param_match : Note<
6851  "type of %ordinal0 parameter of local declaration does not match definition"
6852  "%diff{ ($ vs $)|}1,2">;
6853def err_typecheck_ivar_variable_size : Error<
6854  "instance variables must have a constant size">;
6855def err_ivar_reference_type : Error<
6856  "instance variables cannot be of reference type">;
6857def err_typecheck_illegal_increment_decrement : Error<
6858  "cannot %select{decrement|increment}1 value of type %0">;
6859def err_typecheck_expect_int : Error<
6860  "used type %0 where integer is required">;
6861def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
6862  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
6863def err_typecheck_pointer_arith_function_type : Error<
6864  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
6865  "function type%select{|s}2 %1%select{| and %3}2">;
6866def err_typecheck_pointer_arith_void_type : Error<
6867  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
6868def err_typecheck_decl_incomplete_type : Error<
6869  "variable has incomplete type %0">;
6870def ext_typecheck_decl_incomplete_type : ExtWarn<
6871  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
6872  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
6873def err_tentative_def_incomplete_type : Error<
6874  "tentative definition has type %0 that is never completed">;
6875def warn_tentative_incomplete_array : Warning<
6876  "tentative array definition assumed to have one element">;
6877def err_typecheck_incomplete_array_needs_initializer : Error<
6878  "definition of variable with array type needs an explicit size "
6879  "or an initializer">;
6880def err_array_init_not_init_list : Error<
6881  "array initializer must be an initializer "
6882  "list%select{| or string literal| or wide string literal}0">;
6883def err_array_init_narrow_string_into_wchar : Error<
6884  "initializing wide char array with non-wide string literal">;
6885def err_array_init_wide_string_into_char : Error<
6886  "initializing char array with wide string literal">;
6887def err_array_init_incompat_wide_string_into_wchar : Error<
6888  "initializing wide char array with incompatible wide string literal">;
6889def err_array_init_plain_string_into_char8_t : Error<
6890  "initializing 'char8_t' array with plain string literal">;
6891def note_array_init_plain_string_into_char8_t : Note<
6892  "add 'u8' prefix to form a 'char8_t' string literal">;
6893def err_array_init_utf8_string_into_char : Error<
6894  "initialization of %select{|signed }0char array with "
6895  "UTF-8 string literal is not permitted by %select{'-fchar8_t'|C++20}1">;
6896def warn_cxx20_compat_utf8_string : Warning<
6897  "type of UTF-8 string literal will change from array of const char to "
6898  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
6899def note_cxx20_compat_utf8_string_remove_u8 : Note<
6900  "remove 'u8' prefix to avoid a change of behavior; "
6901  "Clang encodes unprefixed narrow string literals as UTF-8">;
6902def err_array_init_different_type : Error<
6903  "cannot initialize array %diff{of type $ with array of type $|"
6904  "with different type of array}0,1">;
6905def err_array_init_non_constant_array : Error<
6906  "cannot initialize array %diff{of type $ with non-constant array of type $|"
6907  "with different type of array}0,1">;
6908def ext_array_init_copy : Extension<
6909  "initialization of an array "
6910  "%diff{of type $ from a compound literal of type $|"
6911  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
6912// This is intentionally not disabled by -Wno-gnu.
6913def ext_array_init_parens : ExtWarn<
6914  "parenthesized initialization of a member array is a GNU extension">,
6915  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
6916def warn_deprecated_string_literal_conversion : Warning<
6917  "conversion from string literal to %0 is deprecated">,
6918  InGroup<CXX11CompatDeprecatedWritableStr>;
6919def ext_deprecated_string_literal_conversion : ExtWarn<
6920  "ISO C++11 does not allow conversion from string literal to %0">,
6921  InGroup<WritableStrings>, SFINAEFailure;
6922def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
6923def err_typecheck_sclass_fscope : Error<
6924  "illegal storage class on file-scoped variable">;
6925def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
6926  InGroup<MissingDeclarations>;
6927def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
6928  "of a type">, InGroup<MissingDeclarations>;
6929def err_standalone_class_nested_name_specifier : Error<
6930  "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
6931  "have a nested name specifier">;
6932def err_typecheck_sclass_func : Error<"illegal storage class on function">;
6933def err_static_block_func : Error<
6934  "function declared in block scope cannot have 'static' storage class">;
6935def err_typecheck_address_of : Error<"address of %select{bit-field"
6936  "|vector element|property expression|register variable|matrix element}0 requested">;
6937def ext_typecheck_addrof_void : Extension<
6938  "ISO C forbids taking the address of an expression of type 'void'">;
6939def err_unqualified_pointer_member_function : Error<
6940  "must explicitly qualify name of member function when taking its address">;
6941def err_invalid_form_pointer_member_function : Error<
6942  "cannot create a non-constant pointer to member function">;
6943def err_address_of_function_with_pass_object_size_params: Error<
6944  "cannot take address of function %0 because parameter %1 has "
6945  "pass_object_size attribute">;
6946def err_parens_pointer_member_function : Error<
6947  "cannot parenthesize the name of a method when forming a member pointer">;
6948def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
6949  "extra '&' taking address of overloaded function">;
6950def err_typecheck_invalid_lvalue_addrof : Error<
6951  "cannot take the address of an rvalue of type %0">;
6952def ext_typecheck_addrof_temporary : ExtWarn<
6953  "taking the address of a temporary object of type %0">,
6954  InGroup<AddressOfTemporary>, DefaultError;
6955def err_typecheck_addrof_temporary : Error<
6956  "taking the address of a temporary object of type %0">;
6957def err_typecheck_addrof_dtor : Error<
6958  "taking the address of a destructor">;
6959def err_typecheck_unary_expr : Error<
6960  "invalid argument type %0 to unary expression">;
6961def err_typecheck_indirection_requires_pointer : Error<
6962  "indirection requires pointer operand (%0 invalid)">;
6963def ext_typecheck_indirection_through_void_pointer : ExtWarn<
6964  "ISO C does not allow indirection on operand of type %0">,
6965  InGroup<VoidPointerDeref>;
6966def ext_typecheck_indirection_through_void_pointer_cpp
6967    : ExtWarn<"ISO C++ does not allow indirection on operand of type %0">,
6968      InGroup<VoidPointerDeref>, DefaultError, SFINAEFailure;
6969def warn_indirection_through_null : Warning<
6970  "indirection of non-volatile null pointer will be deleted, not trap">,
6971  InGroup<NullDereference>;
6972def warn_binding_null_to_reference : Warning<
6973  "binding dereferenced null pointer to reference has undefined behavior">,
6974  InGroup<NullDereference>;
6975def note_indirection_through_null : Note<
6976  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
6977def warn_pointer_indirection_from_incompatible_type : Warning<
6978  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
6979  "behavior">,
6980  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6981def warn_taking_address_of_packed_member : Warning<
6982  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
6983  InGroup<DiagGroup<"address-of-packed-member">>;
6984def warn_param_mismatched_alignment : Warning<
6985  "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">,
6986  InGroup<DiagGroup<"align-mismatch">>;
6987
6988def err_objc_object_assignment : Error<
6989  "cannot assign to class object (%0 invalid)">;
6990def err_typecheck_invalid_operands : Error<
6991  "invalid operands to binary expression (%0 and %1)">, Deferrable;
6992def note_typecheck_invalid_operands_converted : Note<
6993  "%select{first|second}0 operand was implicitly converted to type %1">;
6994def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
6995  "logical expression with vector %select{type %1 and non-vector type %2|types"
6996  " %1 and %2}0 is only supported in C++">;
6997def err_typecheck_sub_ptr_compatible : Error<
6998  "%diff{$ and $ are not pointers to compatible types|"
6999  "pointers to incompatible types}0,1">;
7000def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
7001  "ordered comparison between pointer and integer (%0 and %1)">;
7002def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
7003  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
7004def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
7005  "ordered comparison between pointer and zero (%0 and %1)">;
7006def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
7007  "three-way comparison between pointer and zero">;
7008def ext_typecheck_compare_complete_incomplete_pointers : Extension<
7009  "pointer comparisons before C11 "
7010  "need to be between two complete or two incomplete types; "
7011  "%0 is %select{|in}2complete and "
7012  "%1 is %select{|in}3complete">,
7013  InGroup<C11>;
7014def warn_typecheck_ordered_comparison_of_function_pointers : Warning<
7015  "ordered comparison of function pointers (%0 and %1)">,
7016  InGroup<OrderedCompareFunctionPointers>;
7017def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
7018  "ordered comparison of function pointers (%0 and %1)">,
7019  InGroup<OrderedCompareFunctionPointers>;
7020def err_typecheck_ordered_comparison_of_function_pointers : Error<
7021  "ordered comparison of function pointers (%0 and %1)">;
7022def ext_typecheck_comparison_of_fptr_to_void : Extension<
7023  "equality comparison between function pointer and void pointer (%0 and %1)">;
7024def err_typecheck_comparison_of_fptr_to_void : Error<
7025  "equality comparison between function pointer and void pointer (%0 and %1)">;
7026def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
7027  "comparison between pointer and integer (%0 and %1)">,
7028  InGroup<DiagGroup<"pointer-integer-compare">>;
7029def err_typecheck_comparison_of_pointer_integer : Error<
7030  "comparison between pointer and integer (%0 and %1)">;
7031def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
7032  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
7033  InGroup<CompareDistinctPointerType>;
7034def ext_typecheck_cond_incompatible_operands : ExtWarn<
7035  "incompatible operand types (%0 and %1)">;
7036def err_cond_voidptr_arc : Error <
7037  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
7038  "in ARC mode">;
7039def err_typecheck_comparison_of_distinct_pointers : Error<
7040  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
7041def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
7042  "%select{comparison between %diff{ ($ and $)|}0,1"
7043  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
7044  "|conditional operator with the second and third operands of type "
7045  "%diff{ ($ and $)|}0,1}2"
7046  " which are pointers to non-overlapping address spaces">;
7047
7048def select_arith_conv_kind : TextSubstitution<
7049  "%select{arithmetic between|bitwise operation between|comparison of|"
7050  "conditional expression between|compound assignment of}0">;
7051def warn_arith_conv_enum_float : Warning<
7052  "%sub{select_arith_conv_kind}0 "
7053  "%select{floating-point|enumeration}1 type %2 "
7054  "%plural{2:with|4:from|:and}0 "
7055  "%select{enumeration|floating-point}1 type %3">,
7056  InGroup<EnumFloatConversion>, DefaultIgnore;
7057def warn_arith_conv_enum_float_cxx20 : Warning<
7058  "%sub{select_arith_conv_kind}0 "
7059  "%select{floating-point|enumeration}1 type %2 "
7060  "%plural{2:with|4:from|:and}0 "
7061  "%select{enumeration|floating-point}1 type %3 is deprecated">,
7062  InGroup<DeprecatedEnumFloatConversion>;
7063def warn_arith_conv_mixed_enum_types : Warning<
7064  "%sub{select_arith_conv_kind}0 "
7065  "different enumeration types%diff{ ($ and $)|}1,2">,
7066  InGroup<EnumEnumConversion>, DefaultIgnore;
7067def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
7068  "%sub{select_arith_conv_kind}0 "
7069  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
7070  InGroup<DeprecatedEnumEnumConversion>;
7071def warn_arith_conv_mixed_anon_enum_types : Warning<
7072  warn_arith_conv_mixed_enum_types.Summary>,
7073  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
7074def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
7075  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7076  InGroup<DeprecatedAnonEnumEnumConversion>;
7077def warn_conditional_mixed_enum_types : Warning<
7078  warn_arith_conv_mixed_enum_types.Summary>,
7079  InGroup<EnumCompareConditional>, DefaultIgnore;
7080def warn_conditional_mixed_enum_types_cxx20 : Warning<
7081  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7082  InGroup<DeprecatedEnumCompareConditional>;
7083def warn_comparison_mixed_enum_types : Warning<
7084  warn_arith_conv_mixed_enum_types.Summary>,
7085  InGroup<EnumCompare>;
7086def warn_comparison_mixed_enum_types_cxx20 : Warning<
7087  warn_arith_conv_mixed_enum_types_cxx20.Summary>,
7088  InGroup<DeprecatedEnumCompare>;
7089def warn_comparison_of_mixed_enum_types_switch : Warning<
7090  "comparison of different enumeration types in switch statement"
7091  "%diff{ ($ and $)|}0,1">,
7092  InGroup<EnumCompareSwitch>;
7093
7094def err_typecheck_assign_const : Error<
7095  "%select{"
7096  "cannot assign to return value because function %1 returns a const value|"
7097  "cannot assign to variable %1 with const-qualified type %2|"
7098  "cannot assign to %select{non-|}1static data member %2 "
7099  "with const-qualified type %3|"
7100  "cannot assign to non-static data member within const member function %1|"
7101  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
7102  "with %select{|nested }3const-qualified data member %4|"
7103  "read-only variable is not assignable}0">;
7104
7105def note_typecheck_assign_const : Note<
7106  "%select{"
7107  "function %1 which returns const-qualified type %2 declared here|"
7108  "variable %1 declared const here|"
7109  "%select{non-|}1static data member %2 declared const here|"
7110  "member function %q1 is declared const here|"
7111  "%select{|nested }1data member %2 declared const here}0">;
7112
7113def warn_unsigned_always_true_comparison : Warning<
7114  "result of comparison of %select{%3|unsigned expression}0 %2 "
7115  "%select{unsigned expression|%3}0 is always %4">,
7116  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
7117def warn_unsigned_char_always_true_comparison : Warning<
7118  "result of comparison of %select{%3|char expression}0 %2 "
7119  "%select{char expression|%3}0 is always %4, since char is interpreted as "
7120  "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore;
7121def warn_unsigned_enum_always_true_comparison : Warning<
7122  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
7123  "%select{unsigned enum expression|%3}0 is always %4">,
7124  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
7125def warn_tautological_constant_compare : Warning<
7126  "result of comparison %select{%3|%1}0 %2 "
7127  "%select{%1|%3}0 is always %4">,
7128  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
7129def warn_tautological_compare_objc_bool : Warning<
7130  "result of comparison of constant %0 with expression of type 'BOOL'"
7131  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
7132  InGroup<TautologicalObjCBoolCompare>;
7133def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
7134def warn_tautological_compare_value_range : Warning<
7135  "result of comparison of "
7136  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
7137  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
7138  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
7139
7140def warn_mixed_sign_comparison : Warning<
7141  "comparison of integers of different signs: %0 and %1">,
7142  InGroup<SignCompare>, DefaultIgnore;
7143def warn_out_of_range_compare : Warning<
7144  "result of comparison of %select{constant %0|true|false}1 with "
7145  "%select{expression of type %2|boolean expression}3 is always %4">,
7146  InGroup<TautologicalOutOfRangeCompare>;
7147def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Summary>,
7148  InGroup<TautologicalConstantCompare>;
7149def warn_integer_constants_in_conditional_always_true : Warning<
7150  "converting the result of '?:' with integer constants to a boolean always "
7151  "evaluates to 'true'">,
7152  InGroup<TautologicalConstantCompare>;
7153def warn_left_shift_always : Warning<
7154  "converting the result of '<<' to a boolean always evaluates "
7155  "to %select{false|true}0">,
7156  InGroup<TautologicalConstantCompare>;
7157def warn_null_in_arithmetic_operation : Warning<
7158  "use of NULL in arithmetic operation">,
7159  InGroup<NullArithmetic>;
7160def warn_null_in_comparison_operation : Warning<
7161  "comparison between NULL and non-pointer "
7162  "%select{(%1 and NULL)|(NULL and %1)}0">,
7163  InGroup<NullArithmetic>;
7164def err_shift_rhs_only_vector : Error<
7165  "requested shift is a vector of type %0 but the first operand is not a "
7166  "vector (%1)">;
7167
7168def warn_logical_not_on_lhs_of_check : Warning<
7169  "logical not is only applied to the left hand side of this "
7170  "%select{comparison|bitwise operator}0">,
7171  InGroup<LogicalNotParentheses>;
7172def note_logical_not_fix : Note<
7173  "add parentheses after the '!' to evaluate the "
7174  "%select{comparison|bitwise operator}0 first">;
7175def note_logical_not_silence_with_parens : Note<
7176  "add parentheses around left hand side expression to silence this warning">;
7177
7178def err_invalid_this_use : Error<
7179  "invalid use of 'this' outside of a non-static member function">;
7180def err_this_static_member_func : Error<
7181  "'this' cannot be%select{| implicitly}0 used in a static member function "
7182  "declaration">;
7183def err_invalid_member_use_in_static_method : Error<
7184  "invalid use of member %0 in static member function">;
7185def err_invalid_qualified_function_type : Error<
7186  "%select{non-member function|static member function|deduction guide}0 "
7187  "%select{of type %2 |}1cannot have '%3' qualifier">;
7188def err_compound_qualified_function_type : Error<
7189  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
7190  "cannot have '%3' qualifier">;
7191def err_qualified_function_typeid : Error<
7192  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
7193
7194def err_ref_qualifier_overload : Error<
7195  "cannot overload a member function %select{without a ref-qualifier|with "
7196  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
7197  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
7198
7199def err_invalid_non_static_member_use : Error<
7200  "invalid use of non-static data member %0">;
7201def err_nested_non_static_member_use : Error<
7202  "%select{call to non-static member function|use of non-static data member}0 "
7203  "%2 of %1 from nested type %3">;
7204def warn_cxx98_compat_non_static_member_use : Warning<
7205  "use of non-static data member %0 in an unevaluated context is "
7206  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
7207def err_invalid_incomplete_type_use : Error<
7208  "invalid use of incomplete type %0">;
7209def err_builtin_func_cast_more_than_one_arg : Error<
7210  "function-style cast to a builtin type can only take one argument">;
7211def err_value_init_for_array_type : Error<
7212  "array types cannot be value-initialized">;
7213def err_init_for_function_type : Error<
7214  "cannot create object of function type %0">;
7215def warn_format_nonliteral_noargs : Warning<
7216  "format string is not a string literal (potentially insecure)">,
7217  InGroup<FormatSecurity>;
7218def warn_format_nonliteral : Warning<
7219  "format string is not a string literal">,
7220  InGroup<FormatNonLiteral>, DefaultIgnore;
7221
7222def err_unexpected_interface : Error<
7223  "unexpected interface name %0: expected expression">;
7224def err_ref_non_value : Error<"%0 does not refer to a value">;
7225def err_ref_vm_type : Error<
7226  "cannot refer to declaration with a variably modified type inside block">;
7227def err_ref_flexarray_type : Error<
7228  "cannot refer to declaration of structure variable with flexible array member "
7229  "inside block">;
7230def err_ref_array_type : Error<
7231  "cannot refer to declaration with an array type inside block">;
7232def err_property_not_found : Error<
7233  "property %0 not found on object of type %1">;
7234def err_invalid_property_name : Error<
7235  "%0 is not a valid property name (accessing an object of type %1)">;
7236def err_getter_not_found : Error<
7237  "no getter method for read from property">;
7238def err_objc_subscript_method_not_found : Error<
7239  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
7240  "found on object of type %0">;
7241def err_objc_subscript_index_type : Error<
7242  "method index parameter type %0 is not integral type">;
7243def err_objc_subscript_key_type : Error<
7244  "method key parameter type %0 is not object type">;
7245def err_objc_subscript_dic_object_type : Error<
7246  "method object parameter type %0 is not object type">;
7247def err_objc_subscript_object_type : Error<
7248  "cannot assign to this %select{dictionary|array}1 because assigning method's "
7249  "2nd parameter of type %0 is not an Objective-C pointer type">;
7250def err_objc_subscript_base_type : Error<
7251  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
7252def err_objc_multiple_subscript_type_conversion : Error<
7253  "indexing expression is invalid because subscript type %0 has "
7254  "multiple type conversion functions">;
7255def err_objc_subscript_type_conversion : Error<
7256  "indexing expression is invalid because subscript type %0 is not an integral"
7257  " or Objective-C pointer type">;
7258def err_objc_subscript_pointer : Error<
7259  "indexing expression is invalid because subscript type %0 is not an"
7260  " Objective-C pointer">;
7261def err_objc_indexing_method_result_type : Error<
7262  "method for accessing %select{dictionary|array}1 element must have Objective-C"
7263  " object return type instead of %0">;
7264def err_objc_index_incomplete_class_type : Error<
7265  "Objective-C index expression has incomplete class type %0">;
7266def err_illegal_container_subscripting_op : Error<
7267  "illegal operation on Objective-C container subscripting">;
7268def err_property_not_found_forward_class : Error<
7269  "property %0 cannot be found in forward class object %1">;
7270def err_property_not_as_forward_class : Error<
7271  "property %0 refers to an incomplete Objective-C class %1 "
7272  "(with no @interface available)">;
7273def note_forward_class : Note<
7274  "forward declaration of class here">;
7275def err_duplicate_property : Error<
7276  "property has a previous declaration">;
7277def ext_gnu_void_ptr : Extension<
7278  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
7279  InGroup<GNUPointerArith>;
7280def ext_gnu_ptr_func_arith : Extension<
7281  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
7282  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
7283  InGroup<GNUPointerArith>;
7284def err_readonly_message_assignment : Error<
7285  "assigning to 'readonly' return result of an Objective-C message not allowed">;
7286def ext_integer_increment_complex : Extension<
7287  "ISO C does not support '++'/'--' on complex integer type %0">;
7288def ext_integer_complement_complex : Extension<
7289  "ISO C does not support '~' for complex conjugation of %0">;
7290def err_nosetter_property_assignment : Error<
7291  "%select{assignment to readonly property|"
7292  "no setter method %1 for assignment to property}0">;
7293def err_nosetter_property_incdec : Error<
7294  "%select{%select{increment|decrement}1 of readonly property|"
7295  "no setter method %2 for %select{increment|decrement}1 of property}0">;
7296def err_nogetter_property_compound_assignment : Error<
7297  "a getter method is needed to perform a compound assignment on a property">;
7298def err_nogetter_property_incdec : Error<
7299  "no getter method %1 for %select{increment|decrement}0 of property">;
7300def err_no_subobject_property_setting : Error<
7301  "expression is not assignable">;
7302def err_qualified_objc_access : Error<
7303  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
7304
7305def ext_freestanding_complex : Extension<
7306  "complex numbers are an extension in a freestanding C99 implementation">;
7307
7308// FIXME: Remove when we support imaginary.
7309def err_imaginary_not_supported : Error<"imaginary types are not supported">;
7310
7311// Obj-c expressions
7312def warn_root_inst_method_not_found : Warning<
7313  "instance method %0 is being used on 'Class' which is not in the root class">,
7314  InGroup<MethodAccess>;
7315def warn_class_method_not_found : Warning<
7316  "class method %objcclass0 not found (return type defaults to 'id')">,
7317  InGroup<MethodAccess>;
7318def warn_instance_method_on_class_found : Warning<
7319  "instance method %0 found instead of class method %1">,
7320  InGroup<MethodAccess>;
7321def warn_inst_method_not_found : Warning<
7322  "instance method %objcinstance0 not found (return type defaults to 'id')">,
7323  InGroup<MethodAccess>;
7324def warn_instance_method_not_found_with_typo : Warning<
7325  "instance method %objcinstance0 not found (return type defaults to 'id')"
7326  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
7327def warn_class_method_not_found_with_typo : Warning<
7328  "class method %objcclass0 not found (return type defaults to 'id')"
7329  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
7330def err_method_not_found_with_typo : Error<
7331  "%select{instance|class}1 method %0 not found "
7332  "; did you mean %2?">;
7333def err_no_super_class_message : Error<
7334  "no @interface declaration found in class messaging of %0">;
7335def err_root_class_cannot_use_super : Error<
7336  "%0 cannot use 'super' because it is a root class">;
7337def err_invalid_receiver_to_message_super : Error<
7338  "'super' is only valid in a method body">;
7339def err_invalid_receiver_class_message : Error<
7340  "receiver type %0 is not an Objective-C class">;
7341def err_missing_open_square_message_send : Error<
7342  "missing '[' at start of message send expression">;
7343def warn_bad_receiver_type : Warning<
7344  "receiver type %0 is not 'id' or interface pointer, consider "
7345  "casting it to 'id'">,InGroup<ObjCReceiver>;
7346def err_bad_receiver_type : Error<"bad receiver type %0">;
7347def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
7348def err_unknown_receiver_suggest : Error<
7349  "unknown receiver %0; did you mean %1?">;
7350def err_objc_throw_expects_object : Error<
7351  "@throw requires an Objective-C object type (%0 invalid)">;
7352def err_objc_synchronized_expects_object : Error<
7353  "@synchronized requires an Objective-C object type (%0 invalid)">;
7354def err_rethrow_used_outside_catch : Error<
7355  "@throw (rethrow) used outside of a @catch block">;
7356def err_attribute_multiple_objc_gc : Error<
7357  "multiple garbage collection attributes specified for type">;
7358def err_catch_param_not_objc_type : Error<
7359  "@catch parameter is not a pointer to an interface type">;
7360def err_illegal_qualifiers_on_catch_parm : Error<
7361  "illegal qualifiers on @catch parameter">;
7362def err_storage_spec_on_catch_parm : Error<
7363  "@catch parameter cannot have storage specifier '%0'">;
7364def warn_register_objc_catch_parm : Warning<
7365  "'register' storage specifier on @catch parameter will be ignored">;
7366def err_qualified_objc_catch_parm : Error<
7367  "@catch parameter declarator cannot be qualified">;
7368def warn_objc_pointer_cxx_catch_fragile : Warning<
7369  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7370  "exception model">, InGroup<ObjCNonUnifiedException>;
7371def err_objc_object_catch : Error<
7372  "cannot catch an Objective-C object by value">;
7373def err_incomplete_type_objc_at_encode : Error<
7374  "'@encode' of incomplete type %0">;
7375def warn_objc_circular_container : Warning<
7376  "adding %0 to %1 might cause circular dependency in container">,
7377  InGroup<DiagGroup<"objc-circular-container">>;
7378def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7379def warn_objc_unsafe_perform_selector : Warning<
7380  "%0 is incompatible with selectors that return a "
7381  "%select{struct|union|vector}1 type">,
7382  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7383def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7384  "method %0 that returns %1 declared here">;
7385def err_attribute_arm_builtin_alias : Error<
7386  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7387def err_attribute_arm_mve_polymorphism : Error<
7388  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7389
7390def warn_setter_getter_impl_required : Warning<
7391  "property %0 requires method %1 to be defined - "
7392  "use @synthesize, @dynamic or provide a method implementation "
7393  "in this class implementation">,
7394  InGroup<ObjCPropertyImpl>;
7395def warn_setter_getter_impl_required_in_category : Warning<
7396  "property %0 requires method %1 to be defined - "
7397  "use @dynamic or provide a method implementation in this category">,
7398  InGroup<ObjCPropertyImpl>;
7399def note_parameter_named_here : Note<
7400  "passing argument to parameter %0 here">;
7401def note_parameter_here : Note<
7402  "passing argument to parameter here">;
7403def note_method_return_type_change : Note<
7404  "compiler has implicitly changed method %0 return type">;
7405
7406def warn_impl_required_for_class_property : Warning<
7407  "class property %0 requires method %1 to be defined - "
7408  "use @dynamic or provide a method implementation "
7409  "in this class implementation">,
7410  InGroup<ObjCPropertyImpl>;
7411def warn_impl_required_in_category_for_class_property : Warning<
7412  "class property %0 requires method %1 to be defined - "
7413  "use @dynamic or provide a method implementation in this category">,
7414  InGroup<ObjCPropertyImpl>;
7415
7416// C++ casts
7417// These messages adhere to the TryCast pattern: %0 is an int specifying the
7418// cast type, %1 is the source type, %2 is the destination type.
7419def err_bad_reinterpret_cast_overload : Error<
7420  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7421
7422def warn_reinterpret_different_from_static : Warning<
7423  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7424  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7425  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7426def note_reinterpret_updowncast_use_static: Note<
7427  "use 'static_cast' to adjust the pointer correctly while "
7428  "%select{upcasting|downcasting}0">;
7429
7430def err_bad_static_cast_overload : Error<
7431  "address of overloaded function %0 cannot be static_cast to type %1">;
7432
7433def err_bad_cstyle_cast_overload : Error<
7434  "address of overloaded function %0 cannot be cast to type %1">;
7435
7436
7437def err_bad_cxx_cast_generic : Error<
7438  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7439  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7440def err_bad_cxx_cast_unrelated_class : Error<
7441  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7442  "functional-style cast|}0 from %1 to %2, which are not related by "
7443  "inheritance, is not allowed">;
7444def note_type_incomplete : Note<"%0 is incomplete">;
7445def err_bad_cxx_cast_rvalue : Error<
7446  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7447  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7448def err_bad_cxx_cast_bitfield : Error<
7449  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7450  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7451def err_bad_cxx_cast_qualifiers_away : Error<
7452  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7453  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7454def err_bad_cxx_cast_addr_space_mismatch : Error<
7455  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7456  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7457  " spaces">;
7458def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7459  "ISO C++ does not allow "
7460  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7461  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7462  "even though the source and destination types are unrelated">,
7463  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7464def err_bad_const_cast_dest : Error<
7465  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7466  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7467def ext_cast_fn_obj : Extension<
7468  "cast between pointer-to-function and pointer-to-object is an extension">;
7469def ext_ms_cast_fn_obj : ExtWarn<
7470  "static_cast between pointer-to-function and pointer-to-object is a "
7471  "Microsoft extension">, InGroup<MicrosoftCast>;
7472def warn_cxx98_compat_cast_fn_obj : Warning<
7473  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7474  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7475def err_bad_reinterpret_cast_small_int : Error<
7476  "cast from pointer to smaller type %2 loses information">;
7477def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7478  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7479  "to scalar %2 of different size">;
7480def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7481  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7482  "to vector %2 of different size">;
7483def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7484  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7485  "to vector %2 of different size">;
7486def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7487  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7488  "changes address space of nested pointers">,
7489  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7490def err_bad_lvalue_to_rvalue_cast : Error<
7491  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7492  "not compatible">;
7493def err_bad_rvalue_to_rvalue_cast : Error<
7494  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7495  "not compatible">;
7496def err_bad_static_cast_pointer_nonpointer : Error<
7497  "cannot cast from type %1 to pointer type %2">;
7498def err_bad_static_cast_member_pointer_nonmp : Error<
7499  "cannot cast from type %1 to member pointer type %2">;
7500def err_bad_cxx_cast_member_pointer_size : Error<
7501  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7502  "type %1 to member pointer type %2 of different size">;
7503def err_bad_reinterpret_cast_reference : Error<
7504  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7505def warn_undefined_reinterpret_cast : Warning<
7506  "reinterpret_cast from %0 to %1 has undefined behavior">,
7507  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7508
7509// These messages don't adhere to the pattern.
7510// FIXME: Display the path somehow better.
7511def err_ambiguous_base_to_derived_cast : Error<
7512  "ambiguous cast from base %0 to derived %1:%2">;
7513def err_static_downcast_via_virtual : Error<
7514  "cannot cast %0 to %1 via virtual base %2">;
7515def err_downcast_from_inaccessible_base : Error<
7516  "cannot cast %select{private|protected}2 base class %1 to %0">;
7517def err_upcast_to_inaccessible_base : Error<
7518  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7519def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7520  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7521def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7522def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7523def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7524def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7525
7526// Other C++ expressions
7527def err_need_header_before_typeid : Error<
7528  "you need to include <typeinfo> before using the 'typeid' operator">;
7529def err_need_header_before_placement_new : Error<
7530  "no matching %0 function for non-allocating placement new expression; "
7531  "include <new>">;
7532def err_ms___leave_not_in___try : Error<
7533  "'__leave' statement not in __try block">;
7534def err_uuidof_without_guid : Error<
7535  "cannot call operator __uuidof on a type with no GUID">;
7536def err_uuidof_with_multiple_guids : Error<
7537  "cannot call operator __uuidof on a type with multiple GUIDs">;
7538def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7539def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7540def err_static_illegal_in_new : Error<
7541  "the 'static' modifier for the array size is not legal in new expressions">;
7542def err_array_new_needs_size : Error<
7543  "array size must be specified in new expression with no initializer">;
7544def err_bad_new_type : Error<
7545  "cannot allocate %select{function|reference}1 type %0 with new">;
7546def err_new_incomplete_or_sizeless_type : Error<
7547  "allocation of %select{incomplete|sizeless}0 type %1">;
7548def err_new_array_nonconst : Error<
7549  "only the first dimension of an allocated array may have dynamic size">;
7550def err_new_array_size_unknown_from_init : Error<
7551  "cannot determine allocated array size from initializer">;
7552def err_new_array_init_args : Error<
7553  "array 'new' cannot have initialization arguments">;
7554def ext_new_paren_array_nonconst : ExtWarn<
7555  "when type is in parentheses, array cannot have dynamic size">;
7556def err_placement_new_non_placement_delete : Error<
7557  "'new' expression with placement arguments refers to non-placement "
7558  "'operator delete'">;
7559def err_array_size_not_integral : Error<
7560  "array size expression must have integral or %select{|unscoped }0"
7561  "enumeration type, not %1">;
7562def err_array_size_incomplete_type : Error<
7563  "array size expression has incomplete class type %0">;
7564def err_array_size_explicit_conversion : Error<
7565  "array size expression of type %0 requires explicit conversion to type %1">;
7566def note_array_size_conversion : Note<
7567  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7568def err_array_size_ambiguous_conversion : Error<
7569  "ambiguous conversion of array size expression of type %0 to an integral or "
7570  "enumeration type">;
7571def ext_array_size_conversion : Extension<
7572  "implicit conversion from array size expression of type %0 to "
7573  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7574  InGroup<CXX11>;
7575def warn_cxx98_compat_array_size_conversion : Warning<
7576  "implicit conversion from array size expression of type %0 to "
7577  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7578  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7579def err_address_space_qualified_new : Error<
7580  "'new' cannot allocate objects of type %0 in address space '%1'">;
7581def err_address_space_qualified_delete : Error<
7582  "'delete' cannot delete objects of type %0 in address space '%1'">;
7583
7584def err_default_init_const : Error<
7585  "default initialization of an object of const type %0"
7586  "%select{| without a user-provided default constructor}1">;
7587def ext_default_init_const : ExtWarn<
7588  "default initialization of an object of const type %0"
7589  "%select{| without a user-provided default constructor}1 "
7590  "is a Microsoft extension">,
7591  InGroup<MicrosoftConstInit>;
7592def err_delete_operand : Error<"cannot delete expression of type %0">;
7593def ext_delete_void_ptr_operand : ExtWarn<
7594  "cannot delete expression with pointer-to-'void' type %0">,
7595  InGroup<DeleteIncomplete>;
7596def err_ambiguous_delete_operand : Error<
7597  "ambiguous conversion of delete expression of type %0 to a pointer">;
7598def warn_delete_incomplete : Warning<
7599  "deleting pointer to incomplete type %0 may cause undefined behavior">,
7600  InGroup<DeleteIncomplete>;
7601def err_delete_incomplete_class_type : Error<
7602  "deleting incomplete class type %0; no conversions to pointer type">;
7603def err_delete_explicit_conversion : Error<
7604  "converting delete expression from type %0 to type %1 invokes an explicit "
7605  "conversion function">;
7606def note_delete_conversion : Note<"conversion to pointer type %0">;
7607def warn_delete_array_type : Warning<
7608  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
7609def warn_mismatched_delete_new : Warning<
7610  "'delete%select{|[]}0' applied to a pointer that was allocated with "
7611  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
7612  InGroup<DiagGroup<"mismatched-new-delete">>;
7613def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
7614def err_no_suitable_delete_member_function_found : Error<
7615  "no suitable member %0 in %1">;
7616def err_ambiguous_suitable_delete_member_function_found : Error<
7617  "multiple suitable %0 functions in %1">;
7618def warn_ambiguous_suitable_delete_function_found : Warning<
7619  "multiple suitable %0 functions for %1; no 'operator delete' function "
7620  "will be invoked if initialization throws an exception">,
7621  InGroup<DiagGroup<"ambiguous-delete">>;
7622def note_member_declared_here : Note<
7623  "member %0 declared here">;
7624def note_member_first_declared_here : Note<
7625  "member %0 first declared here">;
7626def warn_bitwise_instead_of_logical : Warning<
7627  "use of bitwise '%0' with boolean operands">,
7628  InGroup<BitwiseInsteadOfLogical>, DefaultIgnore;
7629def warn_bitwise_negation_bool : Warning<
7630  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
7631  "did you mean logical negation?">,
7632  InGroup<BoolOperation>, DefaultIgnore;
7633def err_decrement_bool : Error<"cannot decrement expression of type bool">;
7634def warn_increment_bool : Warning<
7635  "incrementing expression of type bool is deprecated and "
7636  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
7637def ext_increment_bool : ExtWarn<
7638  "ISO C++17 does not allow incrementing expression of type bool">,
7639  DefaultError, InGroup<IncrementBool>;
7640def err_increment_decrement_enum : Error<
7641  "cannot %select{decrement|increment}0 expression of enum type %1">;
7642
7643def warn_deprecated_increment_decrement_volatile : Warning<
7644  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
7645  "is deprecated">, InGroup<DeprecatedVolatile>;
7646def warn_deprecated_simple_assign_volatile : Warning<
7647  "use of result of assignment to object of volatile-qualified type %0 "
7648  "is deprecated">, InGroup<DeprecatedVolatile>;
7649def warn_deprecated_volatile_return : Warning<
7650  "volatile-qualified return type %0 is deprecated">,
7651  InGroup<DeprecatedVolatile>;
7652def warn_deprecated_volatile_param : Warning<
7653  "volatile-qualified parameter type %0 is deprecated">,
7654  InGroup<DeprecatedVolatile>;
7655def warn_deprecated_volatile_structured_binding : Warning<
7656  "volatile qualifier in structured binding declaration is deprecated">,
7657  InGroup<DeprecatedVolatile>;
7658
7659def warn_deprecated_altivec_src_compat : Warning<
7660  "Current handling of vector bool and vector pixel types in this context are "
7661  "deprecated. The default behaviour will soon change to that implied by the "
7662  "'-altivec-compat=xl' option">,
7663  InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7664
7665def warn_deprecated_lax_vec_conv_all : Warning<
7666  "Implicit conversion between vector types ('%0' and '%1') is deprecated. "
7667  "In the future, the behavior implied by '-fno-lax-vector-conversions' "
7668  "will be the default.">,
7669  InGroup<DiagGroup<"deprecate-lax-vec-conv-all">>;
7670
7671def err_catch_incomplete_ptr : Error<
7672  "cannot catch pointer to incomplete type %0">;
7673def err_catch_incomplete_ref : Error<
7674  "cannot catch reference to incomplete type %0">;
7675def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
7676def err_catch_sizeless : Error<
7677  "cannot catch %select{|reference to }0sizeless type %1">;
7678def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
7679def err_catch_variably_modified : Error<
7680  "cannot catch variably modified type %0">;
7681def err_qualified_catch_declarator : Error<
7682  "exception declarator cannot be qualified">;
7683def err_early_catch_all : Error<"catch-all handler must come last">;
7684def err_bad_memptr_rhs : Error<
7685  "right hand operand to %0 has non-pointer-to-member type %1">;
7686def err_bad_memptr_lhs : Error<
7687  "left hand operand to %0 must be a %select{|pointer to }1class "
7688  "compatible with the right hand operand, but is %2">;
7689def err_memptr_incomplete : Error<
7690  "member pointer has incomplete base type %0">;
7691def warn_exception_caught_by_earlier_handler : Warning<
7692  "exception of type %0 will be caught by earlier handler">,
7693  InGroup<Exceptions>;
7694def note_previous_exception_handler : Note<"for type %0">;
7695def err_exceptions_disabled : Error<
7696  "cannot use '%0' with exceptions disabled">;
7697def err_objc_exceptions_disabled : Error<
7698  "cannot use '%0' with Objective-C exceptions disabled">;
7699def warn_throw_in_noexcept_func : Warning<
7700  "%0 has a non-throwing exception specification but can still throw">,
7701  InGroup<Exceptions>;
7702def note_throw_in_dtor : Note<
7703  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
7704  "non-throwing}1 exception specification">;
7705def note_throw_in_function : Note<"function declared non-throwing here">;
7706def err_seh_try_outside_functions : Error<
7707  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
7708def err_mixing_cxx_try_seh_try : Error<
7709  "cannot use %select{C++ 'try'|Objective-C '@try'}0 "
7710  "in the same function as SEH '__try'">;
7711def err_seh_try_unsupported : Error<
7712  "SEH '__try' is not supported on this target">;
7713def note_conflicting_try_here : Note<
7714  "conflicting %0 here">;
7715def warn_jump_out_of_seh_finally : Warning<
7716  "jump out of __finally block has undefined behavior">,
7717  InGroup<DiagGroup<"jump-seh-finally">>;
7718def warn_non_virtual_dtor : Warning<
7719  "%0 has virtual functions but non-virtual destructor">,
7720  InGroup<NonVirtualDtor>, DefaultIgnore;
7721def warn_delete_non_virtual_dtor : Warning<
7722  "%select{delete|destructor}0 called on non-final %1 that has "
7723  "virtual functions but non-virtual destructor">,
7724  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
7725def note_delete_non_virtual : Note<
7726  "qualify call to silence this warning">;
7727def warn_delete_abstract_non_virtual_dtor : Warning<
7728  "%select{delete|destructor}0 called on %1 that is abstract but has "
7729  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
7730def warn_overloaded_virtual : Warning<
7731  "%q0 hides overloaded virtual %select{function|functions}1">,
7732  InGroup<OverloadedVirtual>, DefaultIgnore;
7733def note_hidden_overloaded_virtual_declared_here : Note<
7734  "hidden overloaded virtual function %q0 declared here"
7735  "%select{|: different classes%diff{ ($ vs $)|}2,3"
7736  "|: different number of parameters (%2 vs %3)"
7737  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
7738  "|: different return type%diff{ ($ vs $)|}2,3"
7739  "|: different qualifiers (%2 vs %3)"
7740  "|: different exception specifications}1">;
7741def warn_using_directive_in_header : Warning<
7742  "using namespace directive in global context in header">,
7743  InGroup<HeaderHygiene>, DefaultIgnore;
7744def warn_overaligned_type : Warning<
7745  "type %0 requires %1 bytes of alignment and the default allocator only "
7746  "guarantees %2 bytes">,
7747  InGroup<OveralignedType>, DefaultIgnore;
7748def err_array_element_alignment : Error<
7749  "size of array element of type %0 (%1 bytes) isn't a multiple of its alignment (%2 bytes)">;
7750def err_aligned_allocation_unavailable : Error<
7751  "aligned %select{allocation|deallocation}0 function of type '%1' is "
7752  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
7753def note_silence_aligned_allocation_unavailable : Note<
7754  "if you supply your own aligned allocation functions, use "
7755  "-faligned-allocation to silence this diagnostic">;
7756
7757def err_conditional_void_nonvoid : Error<
7758  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
7759  "is of type %0">;
7760def err_conditional_ambiguous : Error<
7761  "conditional expression is ambiguous; "
7762  "%diff{$ can be converted to $ and vice versa|"
7763  "types can be convert to each other}0,1">;
7764def err_conditional_ambiguous_ovl : Error<
7765  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
7766  "can be converted to several common types">;
7767def err_conditional_vector_size : Error<
7768  "vector condition type %0 and result type %1 do not have the same number "
7769  "of elements">;
7770def err_conditional_vector_element_size : Error<
7771  "vector condition type %0 and result type %1 do not have elements of the "
7772  "same size">;
7773def err_conditional_vector_has_void : Error<
7774  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
7775def err_conditional_vector_operand_type
7776    : Error<"enumeration type %0 is not allowed in a vector conditional">;
7777def err_conditional_vector_cond_result_mismatch
7778    : Error<"cannot mix vectors and extended vectors in a vector conditional">;
7779def err_conditional_vector_mismatched
7780    : Error<"vector operands to the vector conditional must be the same type "
7781            "%diff{($ and $)|}0,1}">;
7782
7783def err_throw_incomplete : Error<
7784  "cannot throw object of incomplete type %0">;
7785def err_throw_incomplete_ptr : Error<
7786  "cannot throw pointer to object of incomplete type %0">;
7787def err_throw_sizeless : Error<
7788  "cannot throw object of sizeless type %0">;
7789def warn_throw_underaligned_obj : Warning<
7790  "underaligned exception object thrown">,
7791  InGroup<UnderalignedExceptionObject>;
7792def note_throw_underaligned_obj : Note<
7793  "required alignment of type %0 (%1 bytes) is larger than the supported "
7794  "alignment of C++ exception objects on this target (%2 bytes)">;
7795def err_return_in_constructor_handler : Error<
7796  "return in the catch of a function try block of a constructor is illegal">;
7797def warn_cdtor_function_try_handler_mem_expr : Warning<
7798  "cannot refer to a non-static member from the handler of a "
7799  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
7800
7801let CategoryName = "Lambda Issue" in {
7802  def err_capture_more_than_once : Error<
7803    "%0 can appear only once in a capture list">;
7804  def err_reference_capture_with_reference_default : Error<
7805    "'&' cannot precede a capture when the capture default is '&'">;
7806  def err_copy_capture_with_copy_default : Error<
7807    "'&' must precede a capture when the capture default is '='">;
7808  def err_capture_does_not_name_variable : Error<
7809    "%0 in capture list does not name a variable">;
7810  def err_capture_non_automatic_variable : Error<
7811    "%0 cannot be captured because it does not have automatic storage "
7812    "duration">;
7813  def err_this_capture : Error<
7814    "'this' cannot be %select{implicitly |}0captured in this context">;
7815  def note_lambda_this_capture_fixit : Note<
7816    "explicitly capture 'this'">;
7817  def err_lambda_capture_anonymous_var : Error<
7818    "unnamed variable cannot be implicitly captured in a lambda expression">;
7819  def err_lambda_capture_flexarray_type : Error<
7820    "variable %0 with flexible array member cannot be captured in "
7821    "a lambda expression">;
7822  def err_lambda_impcap : Error<
7823    "variable %0 cannot be implicitly captured in a lambda with no "
7824    "capture-default specified">;
7825  def note_lambda_variable_capture_fixit : Note<
7826    "capture %0 by %select{value|reference}1">;
7827  def note_lambda_default_capture_fixit : Note<
7828    "default capture by %select{value|reference}0">;
7829  def note_lambda_decl : Note<"lambda expression begins here">;
7830  def err_lambda_unevaluated_operand : Error<
7831    "lambda expression in an unevaluated operand">;
7832  def err_lambda_in_constant_expression : Error<
7833    "a lambda expression may not appear inside of a constant expression">;
7834  def err_lambda_in_invalid_context : Error<
7835    "a lambda expression cannot appear in this context">;
7836  def err_lambda_return_init_list : Error<
7837    "cannot deduce lambda return type from initializer list">;
7838  def err_lambda_capture_default_arg : Error<
7839    "lambda expression in default argument cannot capture any entity">;
7840  def err_lambda_incomplete_result : Error<
7841    "incomplete result type %0 in lambda expression">;
7842  def err_noreturn_lambda_has_return_expr : Error<
7843    "lambda declared 'noreturn' should not return">;
7844  def warn_maybe_falloff_nonvoid_lambda : Warning<
7845    "non-void lambda does not return a value in all control paths">,
7846    InGroup<ReturnType>;
7847  def warn_falloff_nonvoid_lambda : Warning<
7848    "non-void lambda does not return a value">,
7849    InGroup<ReturnType>;
7850  def err_access_lambda_capture : Error<
7851    // The ERRORs represent other special members that aren't constructors, in
7852    // hopes that someone will bother noticing and reporting if they appear
7853    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
7854    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
7855    AccessControl;
7856  def note_lambda_to_block_conv : Note<
7857    "implicit capture of lambda object due to conversion to block pointer "
7858    "here">;
7859  def note_var_explicitly_captured_here : Note<"variable %0 is"
7860    "%select{| explicitly}1 captured here">;
7861
7862  // C++14 lambda init-captures.
7863  def warn_cxx11_compat_init_capture : Warning<
7864    "initialized lambda captures are incompatible with C++ standards "
7865    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
7866  def ext_init_capture : ExtWarn<
7867    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
7868  def err_init_capture_no_expression : Error<
7869    "initializer missing for lambda capture %0">;
7870  def err_init_capture_multiple_expressions : Error<
7871    "initializer for lambda capture %0 contains multiple expressions">;
7872  def err_init_capture_paren_braces : Error<
7873    "cannot deduce type for lambda capture %1 from "
7874    "%select{parenthesized|nested}0 initializer list">;
7875  def err_init_capture_deduction_failure : Error<
7876    "cannot deduce type for lambda capture %0 from initializer of type %2">;
7877  def err_init_capture_deduction_failure_from_init_list : Error<
7878    "cannot deduce type for lambda capture %0 from initializer list">;
7879  def warn_cxx17_compat_init_capture_pack : Warning<
7880    "initialized lambda capture packs are incompatible with C++ standards "
7881    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7882  def ext_init_capture_pack : ExtWarn<
7883    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
7884
7885  // C++14 generic lambdas.
7886  def warn_cxx11_compat_generic_lambda : Warning<
7887    "generic lambdas are incompatible with C++11">,
7888    InGroup<CXXPre14Compat>, DefaultIgnore;
7889
7890  // C++17 '*this' captures.
7891  def warn_cxx14_compat_star_this_lambda_capture : Warning<
7892    "by value capture of '*this' is incompatible with C++ standards before C++17">,
7893     InGroup<CXXPre17Compat>, DefaultIgnore;
7894  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
7895    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
7896
7897  // C++17 parameter shadows capture
7898  def err_parameter_shadow_capture : Error<
7899    "a lambda parameter cannot shadow an explicitly captured entity">;
7900
7901  // C++20 [=, this] captures.
7902  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
7903    "explicit capture of 'this' with a capture default of '=' is incompatible "
7904    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7905  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
7906    "explicit capture of 'this' with a capture default of '=' "
7907    "is a C++20 extension">, InGroup<CXX20>;
7908  def warn_deprecated_this_capture : Warning<
7909    "implicit capture of 'this' with a capture default of '=' is deprecated">,
7910    InGroup<DeprecatedThisCapture>, DefaultIgnore;
7911  def note_deprecated_this_capture : Note<
7912    "add an explicit capture of 'this' to capture '*this' by reference">;
7913
7914  // C++20 default constructible / assignable lambdas.
7915  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
7916    "%select{default construction|assignment}0 of lambda is incompatible with "
7917    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7918}
7919
7920def err_return_in_captured_stmt : Error<
7921  "cannot return from %0">;
7922def err_capture_block_variable : Error<
7923  "__block variable %0 cannot be captured in a "
7924  "%select{lambda expression|captured statement}1">;
7925
7926def err_operator_arrow_circular : Error<
7927  "circular pointer delegation detected">;
7928def err_operator_arrow_depth_exceeded : Error<
7929  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
7930  "'operator->' calls">;
7931def note_operator_arrow_here : Note<
7932  "'operator->' declared here produces an object of type %0">;
7933def note_operator_arrows_suppressed : Note<
7934  "(skipping %0 'operator->'%s0 in backtrace)">;
7935def note_operator_arrow_depth : Note<
7936  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
7937
7938def err_pseudo_dtor_base_not_scalar : Error<
7939  "object expression of non-scalar type %0 cannot be used in a "
7940  "pseudo-destructor expression">;
7941def ext_pseudo_dtor_on_void : ExtWarn<
7942  "pseudo-destructors on type void are a Microsoft extension">,
7943  InGroup<MicrosoftVoidPseudoDtor>;
7944def err_pseudo_dtor_type_mismatch : Error<
7945  "the type of object expression "
7946  "%diff{($) does not match the type being destroyed ($)|"
7947  "does not match the type being destroyed}0,1 "
7948  "in pseudo-destructor expression">;
7949def err_pseudo_dtor_call_with_args : Error<
7950  "call to pseudo-destructor cannot have any arguments">;
7951def err_dtor_expr_without_call : Error<
7952  "reference to %select{destructor|pseudo-destructor}0 must be called"
7953  "%select{|; did you mean to call it with no arguments?}1">;
7954def err_pseudo_dtor_destructor_non_type : Error<
7955  "%0 does not refer to a type name in pseudo-destructor expression; expected "
7956  "the name of type %1">;
7957def err_invalid_use_of_function_type : Error<
7958  "a function type is not allowed here">;
7959def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
7960def err_typecheck_bool_condition : Error<
7961  "value of type %0 is not contextually convertible to 'bool'">;
7962def err_typecheck_ambiguous_condition : Error<
7963  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
7964def err_typecheck_nonviable_condition : Error<
7965  "no viable conversion%select{%diff{ from $ to $|}1,2|"
7966  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
7967def err_typecheck_nonviable_condition_incomplete : Error<
7968  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
7969def err_typecheck_deleted_function : Error<
7970  "conversion function %diff{from $ to $|between types}0,1 "
7971  "invokes a deleted function">;
7972
7973def err_expected_class_or_namespace : Error<"%0 is not a class"
7974  "%select{ or namespace|, namespace, or enumeration}1">;
7975def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
7976  "because namespace %1 does not enclose namespace %2">;
7977def err_export_non_namespace_scope_name : Error<
7978  "cannot export %0 as it is not at namespace scope">;
7979def err_redeclaration_non_exported : Error <
7980  "cannot export redeclaration %0 here since the previous declaration "
7981  "%select{is not exported|has internal linkage|has module linkage}1">;
7982def err_invalid_declarator_global_scope : Error<
7983  "definition or redeclaration of %0 cannot name the global scope">;
7984def err_invalid_declarator_in_function : Error<
7985  "definition or redeclaration of %0 not allowed inside a function">;
7986def err_invalid_declarator_in_block : Error<
7987  "definition or redeclaration of %0 not allowed inside a block">;
7988def err_not_tag_in_scope : Error<
7989  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
7990
7991def err_no_typeid_with_fno_rtti : Error<
7992  "use of typeid requires -frtti">;
7993def err_no_dynamic_cast_with_fno_rtti : Error<
7994  "use of dynamic_cast requires -frtti">;
7995def warn_no_dynamic_cast_with_rtti_disabled: Warning<
7996  "dynamic_cast will not work since RTTI data is disabled by "
7997  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7998def warn_no_typeid_with_rtti_disabled: Warning<
7999  "typeid will not work since RTTI data is disabled by "
8000  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
8001
8002def err_cannot_form_pointer_to_member_of_reference_type : Error<
8003  "cannot form a pointer-to-member to member %0 of reference type %1">;
8004def err_incomplete_object_call : Error<
8005  "incomplete type in call to object of type %0">;
8006
8007def warn_condition_is_assignment : Warning<"using the result of an "
8008  "assignment as a condition without parentheses">,
8009  InGroup<Parentheses>;
8010def warn_free_nonheap_object
8011  : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">,
8012    InGroup<FreeNonHeapObject>;
8013
8014// Completely identical except off by default.
8015def warn_condition_is_idiomatic_assignment : Warning<"using the result "
8016  "of an assignment as a condition without parentheses">,
8017  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
8018def note_condition_assign_to_comparison : Note<
8019  "use '==' to turn this assignment into an equality comparison">;
8020def note_condition_or_assign_to_comparison : Note<
8021  "use '!=' to turn this compound assignment into an inequality comparison">;
8022def note_condition_assign_silence : Note<
8023  "place parentheses around the assignment to silence this warning">;
8024
8025def warn_equality_with_extra_parens : Warning<"equality comparison with "
8026  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
8027def note_equality_comparison_to_assign : Note<
8028  "use '=' to turn this equality comparison into an assignment">;
8029def note_equality_comparison_silence : Note<
8030  "remove extraneous parentheses around the comparison to silence this warning">;
8031
8032// assignment related diagnostics (also for argument passing, returning, etc).
8033// In most of these diagnostics the %2 is a value from the
8034// Sema::AssignmentAction enumeration
8035def err_typecheck_convert_incompatible : Error<
8036  "%select{%diff{assigning to $ from incompatible type $|"
8037  "assigning to type from incompatible type}0,1"
8038  "|%diff{passing $ to parameter of incompatible type $|"
8039  "passing type to parameter of incompatible type}0,1"
8040  "|%diff{returning $ from a function with incompatible result type $|"
8041  "returning type from a function with incompatible result type}0,1"
8042  "|%diff{converting $ to incompatible type $|"
8043  "converting type to incompatible type}0,1"
8044  "|%diff{initializing $ with an expression of incompatible type $|"
8045  "initializing type with an expression of incompatible type}0,1"
8046  "|%diff{sending $ to parameter of incompatible type $|"
8047  "sending type to parameter of incompatible type}0,1"
8048  "|%diff{casting $ to incompatible type $|"
8049  "casting type to incompatible type}0,1}2"
8050  "%select{|; dereference with *|"
8051  "; take the address with &|"
8052  "; remove *|"
8053  "; remove &}3"
8054  "%select{|: different classes%diff{ ($ vs $)|}5,6"
8055  "|: different number of parameters (%5 vs %6)"
8056  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
8057  "|: different return type%diff{ ($ vs $)|}5,6"
8058  "|: different qualifiers (%5 vs %6)"
8059  "|: different exception specifications}4">;
8060def err_typecheck_missing_return_type_incompatible : Error<
8061  "%diff{return type $ must match previous return type $|"
8062  "return type must match previous return type}0,1 when %select{block "
8063  "literal|lambda expression}2 has unspecified explicit return type">;
8064
8065def note_incomplete_class_and_qualified_id : Note<
8066  "conformance of forward class %0 to protocol %1 can not be confirmed">;
8067def warn_incompatible_qualified_id : Warning<
8068  "%select{%diff{assigning to $ from incompatible type $|"
8069  "assigning to type from incompatible type}0,1"
8070  "|%diff{passing $ to parameter of incompatible type $|"
8071  "passing type to parameter of incompatible type}0,1"
8072  "|%diff{returning $ from a function with incompatible result type $|"
8073  "returning type from a function with incompatible result type}0,1"
8074  "|%diff{converting $ to incompatible type $|"
8075  "converting type to incompatible type}0,1"
8076  "|%diff{initializing $ with an expression of incompatible type $|"
8077  "initializing type with an expression of incompatible type}0,1"
8078  "|%diff{sending $ to parameter of incompatible type $|"
8079  "sending type to parameter of incompatible type}0,1"
8080  "|%diff{casting $ to incompatible type $|"
8081  "casting type to incompatible type}0,1}2">;
8082def err_incompatible_qualified_id : Error<
8083  "%select{%diff{assigning to $ from incompatible type $|"
8084  "assigning to type from incompatible type}0,1"
8085  "|%diff{passing $ to parameter of incompatible type $|"
8086  "passing type to parameter of incompatible type}0,1"
8087  "|%diff{returning $ from a function with incompatible result type $|"
8088  "returning type from a function with incompatible result type}0,1"
8089  "|%diff{converting $ to incompatible type $|"
8090  "converting type to incompatible type}0,1"
8091  "|%diff{initializing $ with an expression of incompatible type $|"
8092  "initializing type with an expression of incompatible type}0,1"
8093  "|%diff{sending $ to parameter of incompatible type $|"
8094  "sending type to parameter of incompatible type}0,1"
8095  "|%diff{casting $ to incompatible type $|"
8096  "casting type to incompatible type}0,1}2">;
8097def err_typecheck_convert_pointer_int : Error<
8098  "incompatible pointer to integer conversion "
8099  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8100  "|%diff{passing $ to parameter of type $|"
8101  "passing to parameter of different type}0,1"
8102  "|%diff{returning $ from a function with result type $|"
8103  "returning from function with different return type}0,1"
8104  "|%diff{converting $ to type $|converting between types}0,1"
8105  "|%diff{initializing $ with an expression of type $|"
8106  "initializing with expression of different type}0,1"
8107  "|%diff{sending $ to parameter of type $|"
8108  "sending to parameter of different type}0,1"
8109  "|%diff{casting $ to type $|casting between types}0,1}2"
8110  "%select{|; dereference with *|"
8111  "; take the address with &|"
8112  "; remove *|"
8113  "; remove &}3">;
8114def ext_typecheck_convert_pointer_int : ExtWarn<
8115  err_typecheck_convert_pointer_int.Summary>,
8116  InGroup<IntConversion>, DefaultError;
8117def err_typecheck_convert_int_pointer : Error<
8118  "incompatible integer to pointer conversion "
8119  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8120  "|%diff{passing $ to parameter of type $|"
8121  "passing to parameter of different type}0,1"
8122  "|%diff{returning $ from a function with result type $|"
8123  "returning from function with different return type}0,1"
8124  "|%diff{converting $ to type $|converting between types}0,1"
8125  "|%diff{initializing $ with an expression of type $|"
8126  "initializing with expression of different type}0,1"
8127  "|%diff{sending $ to parameter of type $|"
8128  "sending to parameter of different type}0,1"
8129  "|%diff{casting $ to type $|casting between types}0,1}2"
8130  "%select{|; dereference with *|"
8131  "; take the address with &|"
8132  "; remove *|"
8133  "; remove &}3">;
8134def ext_typecheck_convert_int_pointer : ExtWarn<
8135  err_typecheck_convert_int_pointer.Summary>,
8136  InGroup<IntConversion>, DefaultError;
8137def ext_typecheck_convert_pointer_void_func : Extension<
8138  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8139  "|%diff{passing $ to parameter of type $|"
8140  "passing to parameter of different type}0,1"
8141  "|%diff{returning $ from a function with result type $|"
8142  "returning from function with different return type}0,1"
8143  "|%diff{converting $ to type $|converting between types}0,1"
8144  "|%diff{initializing $ with an expression of type $|"
8145  "initializing with expression of different type}0,1"
8146  "|%diff{sending $ to parameter of type $|"
8147  "sending to parameter of different type}0,1"
8148  "|%diff{casting $ to type $|casting between types}0,1}2"
8149  " converts between void pointer and function pointer">;
8150def err_typecheck_convert_pointer_void_func : Error<
8151  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8152  "|%diff{passing $ to parameter of type $|"
8153  "passing to parameter of different type}0,1"
8154  "|%diff{returning $ from a function with result type $|"
8155  "returning from function with different return type}0,1"
8156  "|%diff{converting $ to type $|converting between types}0,1"
8157  "|%diff{initializing $ with an expression of type $|"
8158  "initializing with expression of different type}0,1"
8159  "|%diff{sending $ to parameter of type $|"
8160  "sending to parameter of different type}0,1"
8161  "|%diff{casting $ to type $|casting between types}0,1}2"
8162  " converts between void pointer and function pointer">;
8163def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
8164  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8165  "|%diff{passing $ to parameter of type $|"
8166  "passing to parameter of different type}0,1"
8167  "|%diff{returning $ from a function with result type $|"
8168  "returning from function with different return type}0,1"
8169  "|%diff{converting $ to type $|converting between types}0,1"
8170  "|%diff{initializing $ with an expression of type $|"
8171  "initializing with expression of different type}0,1"
8172  "|%diff{sending $ to parameter of type $|"
8173  "sending to parameter of different type}0,1"
8174  "|%diff{casting $ to type $|casting between types}0,1}2"
8175  " converts between pointers to integer types %select{with different sign|"
8176  "where one is of the unique plain 'char' type and the other is not}3">,
8177  InGroup<DiagGroup<"pointer-sign">>;
8178def err_typecheck_convert_incompatible_pointer_sign :
8179  Error<ext_typecheck_convert_incompatible_pointer_sign.Summary>;
8180def ext_typecheck_convert_incompatible_pointer : ExtWarn<
8181  "incompatible pointer types "
8182  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8183  "|%diff{passing $ to parameter of type $|"
8184  "passing to parameter of different type}0,1"
8185  "|%diff{returning $ from a function with result type $|"
8186  "returning from function with different return type}0,1"
8187  "|%diff{converting $ to type $|converting between types}0,1"
8188  "|%diff{initializing $ with an expression of type $|"
8189  "initializing with expression of different type}0,1"
8190  "|%diff{sending $ to parameter of type $|"
8191  "sending to parameter of different type}0,1"
8192  "|%diff{casting $ to type $|casting between types}0,1}2"
8193  "%select{|; dereference with *|"
8194  "; take the address with &|"
8195  "; remove *|"
8196  "; remove &}3">,
8197  InGroup<IncompatiblePointerTypes>;
8198def err_typecheck_convert_incompatible_pointer : Error<
8199  "incompatible pointer types "
8200  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8201  "|%diff{passing $ to parameter of type $|"
8202  "passing to parameter of different type}0,1"
8203  "|%diff{returning $ from a function with result type $|"
8204  "returning from function with different return type}0,1"
8205  "|%diff{converting $ to type $|converting between types}0,1"
8206  "|%diff{initializing $ with an expression of type $|"
8207  "initializing with expression of different type}0,1"
8208  "|%diff{sending $ to parameter of type $|"
8209  "sending to parameter of different type}0,1"
8210  "|%diff{casting $ to type $|casting between types}0,1}2"
8211  "%select{|; dereference with *|"
8212  "; take the address with &|"
8213  "; remove *|"
8214  "; remove &}3">;
8215def err_typecheck_convert_incompatible_function_pointer : Error<
8216  "incompatible function pointer types "
8217  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8218  "|%diff{passing $ to parameter of type $|"
8219  "passing to parameter of different type}0,1"
8220  "|%diff{returning $ from a function with result type $|"
8221  "returning from function with different return type}0,1"
8222  "|%diff{converting $ to type $|converting between types}0,1"
8223  "|%diff{initializing $ with an expression of type $|"
8224  "initializing with expression of different type}0,1"
8225  "|%diff{sending $ to parameter of type $|"
8226  "sending to parameter of different type}0,1"
8227  "|%diff{casting $ to type $|casting between types}0,1}2"
8228  "%select{|; dereference with *|"
8229  "; take the address with &|"
8230  "; remove *|"
8231  "; remove &}3">;
8232def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
8233  err_typecheck_convert_incompatible_function_pointer.Summary>,
8234  InGroup<IncompatibleFunctionPointerTypes>, DefaultError;
8235def warn_typecheck_convert_incompatible_function_pointer_strict : Warning<
8236  err_typecheck_convert_incompatible_function_pointer.Summary>,
8237  InGroup<DiagGroup<"incompatible-function-pointer-types-strict">>, DefaultIgnore;
8238def ext_typecheck_convert_discards_qualifiers : ExtWarn<
8239  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8240  "|%diff{passing $ to parameter of type $|"
8241  "passing to parameter of different type}0,1"
8242  "|%diff{returning $ from a function with result type $|"
8243  "returning from function with different return type}0,1"
8244  "|%diff{converting $ to type $|converting between types}0,1"
8245  "|%diff{initializing $ with an expression of type $|"
8246  "initializing with expression of different type}0,1"
8247  "|%diff{sending $ to parameter of type $|"
8248  "sending to parameter of different type}0,1"
8249  "|%diff{casting $ to type $|casting between types}0,1}2"
8250  " discards qualifiers">,
8251  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8252def err_typecheck_convert_discards_qualifiers : Error<
8253  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8254  "|%diff{passing $ to parameter of type $|"
8255  "passing to parameter of different type}0,1"
8256  "|%diff{returning $ from a function with result type $|"
8257  "returning from function with different return type}0,1"
8258  "|%diff{converting $ to type $|converting between types}0,1"
8259  "|%diff{initializing $ with an expression of type $|"
8260  "initializing with expression of different type}0,1"
8261  "|%diff{sending $ to parameter of type $|"
8262  "sending to parameter of different type}0,1"
8263  "|%diff{casting $ to type $|casting between types}0,1}2"
8264  " discards qualifiers">;
8265def ext_nested_pointer_qualifier_mismatch : ExtWarn<
8266  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8267  "|%diff{passing $ to parameter of type $|"
8268  "passing to parameter of different type}0,1"
8269  "|%diff{returning $ from a function with result type $|"
8270  "returning from function with different return type}0,1"
8271  "|%diff{converting $ to type $|converting between types}0,1"
8272  "|%diff{initializing $ with an expression of type $|"
8273  "initializing with expression of different type}0,1"
8274  "|%diff{sending $ to parameter of type $|"
8275  "sending to parameter of different type}0,1"
8276  "|%diff{casting $ to type $|casting between types}0,1}2"
8277  " discards qualifiers in nested pointer types">,
8278  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8279def err_nested_pointer_qualifier_mismatch : Error<
8280  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8281  "|%diff{passing $ to parameter of type $|"
8282  "passing to parameter of different type}0,1"
8283  "|%diff{returning $ from a function with result type $|"
8284  "returning from function with different return type}0,1"
8285  "|%diff{converting $ to type $|converting between types}0,1"
8286  "|%diff{initializing $ with an expression of type $|"
8287  "initializing with expression of different type}0,1"
8288  "|%diff{sending $ to parameter of type $|"
8289  "sending to parameter of different type}0,1"
8290  "|%diff{casting $ to type $|casting between types}0,1}2"
8291  " discards qualifiers in nested pointer types">;
8292def warn_incompatible_vectors : Warning<
8293  "incompatible vector types "
8294  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8295  "|%diff{passing $ to parameter of type $|"
8296  "passing to parameter of different type}0,1"
8297  "|%diff{returning $ from a function with result type $|"
8298  "returning from function with different return type}0,1"
8299  "|%diff{converting $ to type $|converting between types}0,1"
8300  "|%diff{initializing $ with an expression of type $|"
8301  "initializing with expression of different type}0,1"
8302  "|%diff{sending $ to parameter of type $|"
8303  "sending to parameter of different type}0,1"
8304  "|%diff{casting $ to type $|casting between types}0,1}2">,
8305  InGroup<VectorConversion>, DefaultIgnore;
8306def err_incompatible_vectors : Error<
8307  "incompatible vector types "
8308  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8309  "|%diff{passing $ to parameter of type $|"
8310  "passing to parameter of different type}0,1"
8311  "|%diff{returning $ from a function with result type $|"
8312  "returning from function with different return type}0,1"
8313  "|%diff{converting $ to type $|converting between types}0,1"
8314  "|%diff{initializing $ with an expression of type $|"
8315  "initializing with expression of different type}0,1"
8316  "|%diff{sending $ to parameter of type $|"
8317  "sending to parameter of different type}0,1"
8318  "|%diff{casting $ to type $|casting between types}0,1}2">;
8319def err_int_to_block_pointer : Error<
8320  "invalid block pointer conversion "
8321  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8322  "|%diff{passing $ to parameter of type $|"
8323  "passing to parameter of different type}0,1"
8324  "|%diff{returning $ from a function with result type $|"
8325  "returning from function with different return type}0,1"
8326  "|%diff{converting $ to type $|converting between types}0,1"
8327  "|%diff{initializing $ with an expression of type $|"
8328  "initializing with expression of different type}0,1"
8329  "|%diff{sending $ to parameter of type $|"
8330  "sending to parameter of different type}0,1"
8331  "|%diff{casting $ to type $|casting between types}0,1}2">;
8332def err_typecheck_convert_incompatible_block_pointer : Error<
8333  "incompatible block pointer types "
8334  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8335  "|%diff{passing $ to parameter of type $|"
8336  "passing to parameter of different type}0,1"
8337  "|%diff{returning $ from a function with result type $|"
8338  "returning from function with different return type}0,1"
8339  "|%diff{converting $ to type $|converting between types}0,1"
8340  "|%diff{initializing $ with an expression of type $|"
8341  "initializing with expression of different type}0,1"
8342  "|%diff{sending $ to parameter of type $|"
8343  "sending to parameter of different type}0,1"
8344  "|%diff{casting $ to type $|casting between types}0,1}2">;
8345def err_typecheck_incompatible_address_space : Error<
8346  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8347  "|%diff{passing $ to parameter of type $|"
8348  "passing to parameter of different type}0,1"
8349  "|%diff{returning $ from a function with result type $|"
8350  "returning from function with different return type}0,1"
8351  "|%diff{converting $ to type $|converting between types}0,1"
8352  "|%diff{initializing $ with an expression of type $|"
8353  "initializing with expression of different type}0,1"
8354  "|%diff{sending $ to parameter of type $|"
8355  "sending to parameter of different type}0,1"
8356  "|%diff{casting $ to type $|casting between types}0,1}2"
8357  " changes address space of pointer">;
8358def err_typecheck_incompatible_nested_address_space : Error<
8359  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8360  "|%diff{passing $ to parameter of type $|"
8361  "passing to parameter of different type}0,1"
8362  "|%diff{returning $ from a function with result type $|"
8363  "returning from function with different return type}0,1"
8364  "|%diff{converting $ to type $|converting between types}0,1"
8365  "|%diff{initializing $ with an expression of type $|"
8366  "initializing with expression of different type}0,1"
8367  "|%diff{sending $ to parameter of type $|"
8368  "sending to parameter of different type}0,1"
8369  "|%diff{casting $ to type $|casting between types}0,1}2"
8370  " changes address space of nested pointer">;
8371def err_typecheck_incompatible_ownership : Error<
8372  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8373  "|%diff{passing $ to parameter of type $|"
8374  "passing to parameter of different type}0,1"
8375  "|%diff{returning $ from a function with result type $|"
8376  "returning from function with different return type}0,1"
8377  "|%diff{converting $ to type $|converting between types}0,1"
8378  "|%diff{initializing $ with an expression of type $|"
8379  "initializing with expression of different type}0,1"
8380  "|%diff{sending $ to parameter of type $|"
8381  "sending to parameter of different type}0,1"
8382  "|%diff{casting $ to type $|casting between types}0,1}2"
8383  " changes retain/release properties of pointer">;
8384def err_typecheck_comparison_of_distinct_blocks : Error<
8385  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8386
8387def err_typecheck_array_not_modifiable_lvalue : Error<
8388  "array type %0 is not assignable">;
8389def err_typecheck_non_object_not_modifiable_lvalue : Error<
8390  "non-object type %0 is not assignable">;
8391def err_typecheck_expression_not_modifiable_lvalue : Error<
8392  "expression is not assignable">;
8393def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8394  "incomplete type %0 is not assignable">;
8395def err_typecheck_lvalue_casts_not_supported : Error<
8396  "assignment to cast is illegal, lvalue casts are not supported">;
8397
8398def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8399  "vector is not assignable (contains duplicate components)">;
8400def err_block_decl_ref_not_modifiable_lvalue : Error<
8401  "variable is not assignable (missing __block type specifier)">;
8402def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8403  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8404def err_typecheck_call_not_function : Error<
8405  "called object type %0 is not a function or function pointer">;
8406def err_call_incomplete_return : Error<
8407  "calling function with incomplete return type %0">;
8408def err_call_function_incomplete_return : Error<
8409  "calling %0 with incomplete return type %1">;
8410def err_call_incomplete_argument : Error<
8411  "argument type %0 is incomplete">;
8412def err_typecheck_call_too_few_args : Error<
8413  "too few %select{|||execution configuration }0arguments to "
8414  "%select{function|block|method|kernel function}0 call, "
8415  "expected %1, have %2">;
8416def err_typecheck_call_too_few_args_one : Error<
8417  "too few %select{|||execution configuration }0arguments to "
8418  "%select{function|block|method|kernel function}0 call, "
8419  "single argument %1 was not specified">;
8420def err_typecheck_call_too_few_args_at_least : Error<
8421  "too few %select{|||execution configuration }0arguments to "
8422  "%select{function|block|method|kernel function}0 call, "
8423  "expected at least %1, have %2">;
8424def err_typecheck_call_too_few_args_at_least_one : Error<
8425  "too few %select{|||execution configuration }0arguments to "
8426  "%select{function|block|method|kernel function}0 call, "
8427  "at least argument %1 must be specified">;
8428def err_typecheck_call_too_few_args_suggest : Error<
8429  "too few %select{|||execution configuration }0arguments to "
8430  "%select{function|block|method|kernel function}0 call, "
8431  "expected %1, have %2; did you mean %3?">;
8432def err_typecheck_call_too_few_args_at_least_suggest : Error<
8433  "too few %select{|||execution configuration }0arguments to "
8434  "%select{function|block|method|kernel function}0 call, "
8435  "expected at least %1, have %2; did you mean %3?">;
8436def err_typecheck_call_too_many_args : Error<
8437  "too many %select{|||execution configuration }0arguments to "
8438  "%select{function|block|method|kernel function}0 call, "
8439  "expected %1, have %2">;
8440def err_typecheck_call_too_many_args_one : Error<
8441  "too many %select{|||execution configuration }0arguments to "
8442  "%select{function|block|method|kernel function}0 call, "
8443  "expected single argument %1, have %2 arguments">;
8444def err_typecheck_call_too_many_args_at_most : Error<
8445  "too many %select{|||execution configuration }0arguments to "
8446  "%select{function|block|method|kernel function}0 call, "
8447  "expected at most %1, have %2">;
8448def err_typecheck_call_too_many_args_at_most_one : Error<
8449  "too many %select{|||execution configuration }0arguments to "
8450  "%select{function|block|method|kernel function}0 call, "
8451  "expected at most single argument %1, have %2 arguments">;
8452def err_typecheck_call_too_many_args_suggest : Error<
8453  "too many %select{|||execution configuration }0arguments to "
8454  "%select{function|block|method|kernel function}0 call, "
8455  "expected %1, have %2; did you mean %3?">;
8456def err_typecheck_call_too_many_args_at_most_suggest : Error<
8457  "too many %select{|||execution configuration }0arguments to "
8458  "%select{function|block|method|kernel function}0 call, "
8459  "expected at most %1, have %2; did you mean %3?">;
8460
8461def err_arc_typecheck_convert_incompatible_pointer : Error<
8462  "incompatible pointer types passing retainable parameter of type %0"
8463  "to a CF function expecting %1 type">;
8464
8465def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8466
8467def warn_call_wrong_number_of_arguments : Warning<
8468  "too %select{few|many}0 arguments in call to %1">;
8469def err_atomic_builtin_must_be_pointer : Error<
8470  "address argument to atomic builtin must be a pointer (%0 invalid)">;
8471def err_atomic_builtin_must_be_pointer_intptr : Error<
8472  "address argument to atomic builtin must be a pointer to integer or pointer"
8473  " (%0 invalid)">;
8474def err_atomic_builtin_cannot_be_const : Error<
8475  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8476def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8477  "address argument to atomic builtin must be a pointer to integer,"
8478  " floating-point or pointer (%0 invalid)">;
8479def err_atomic_builtin_pointer_size : Error<
8480  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8481  "type (%0 invalid)">;
8482def err_atomic_exclusive_builtin_pointer_size : Error<
8483  "address argument to load or store exclusive builtin must be a pointer to"
8484  " 1,2,4 or 8 byte type (%0 invalid)">;
8485def err_atomic_builtin_ext_int_size : Error<
8486  "Atomic memory operand must have a power-of-two size">;
8487def err_atomic_builtin_bit_int_prohibit : Error<
8488  "argument to atomic builtin of type '_BitInt' is not supported">;
8489def err_atomic_op_needs_atomic : Error<
8490  "address argument to atomic operation must be a pointer to _Atomic "
8491  "type (%0 invalid)">;
8492def err_atomic_op_needs_non_const_atomic : Error<
8493  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8494  "type (%1 invalid)">;
8495def err_atomic_op_needs_non_const_pointer : Error<
8496  "address argument to atomic operation must be a pointer to non-const "
8497  "type (%0 invalid)">;
8498def err_atomic_op_needs_trivial_copy : Error<
8499  "address argument to atomic operation must be a pointer to a "
8500  "trivially-copyable type (%0 invalid)">;
8501def err_atomic_op_needs_atomic_int_ptr_or_fp : Error<
8502  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8503  "integer, pointer or supported floating point type (%1 invalid)">;
8504def err_atomic_op_needs_atomic_int_or_ptr : Error<
8505  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8506  "integer or pointer (%1 invalid)">;
8507def err_atomic_op_needs_atomic_int : Error<
8508  "address argument to atomic operation must be a pointer to "
8509  "%select{|atomic }0integer (%1 invalid)">;
8510def warn_atomic_op_has_invalid_memory_order : Warning<
8511  "memory order argument to atomic operation is invalid">,
8512  InGroup<DiagGroup<"atomic-memory-ordering">>;
8513def err_atomic_op_has_invalid_synch_scope : Error<
8514  "synchronization scope argument to atomic operation is invalid">;
8515def warn_atomic_implicit_seq_cst : Warning<
8516  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8517  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8518
8519def err_overflow_builtin_must_be_int : Error<
8520  "operand argument to overflow builtin must be an integer (%0 invalid)">;
8521def err_overflow_builtin_must_be_ptr_int : Error<
8522  "result argument to overflow builtin must be a pointer "
8523  "to a non-const integer (%0 invalid)">;
8524def err_overflow_builtin_bit_int_max_size : Error<
8525  "__builtin_mul_overflow does not support 'signed _BitInt' operands of more "
8526  "than %0 bits">;
8527def err_expected_struct_pointer_argument : Error<
8528  "expected pointer to struct as %ordinal0 argument to %1, found %2">;
8529def err_expected_callable_argument : Error<
8530  "expected a callable expression as %ordinal0 argument to %1, found %2">;
8531def note_building_builtin_dump_struct_call : Note<
8532  "in call to printing function with arguments '(%0)' while dumping struct">;
8533
8534def err_atomic_load_store_uses_lib : Error<
8535  "atomic %select{load|store}0 requires runtime support that is not "
8536  "available for this target">;
8537
8538def err_nontemporal_builtin_must_be_pointer : Error<
8539  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8540def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8541  "address argument to nontemporal builtin must be a pointer to integer, float, "
8542  "pointer, or a vector of such types (%0 invalid)">;
8543
8544def err_deleted_function_use : Error<"attempt to use a deleted function">;
8545def err_deleted_inherited_ctor_use : Error<
8546  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8547
8548def note_called_by : Note<"called by %0">;
8549def err_kern_type_not_void_return : Error<
8550  "kernel function type %0 must have void return type">;
8551def err_kern_is_nonstatic_method : Error<
8552  "kernel function %0 must be a free function or static member function">;
8553def err_config_scalar_return : Error<
8554  "CUDA special function '%0' must have scalar return type">;
8555def err_kern_call_not_global_function : Error<
8556  "kernel call to non-global function %0">;
8557def err_global_call_not_config : Error<
8558  "call to global function %0 not configured">;
8559def err_ref_bad_target : Error<
8560  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8561  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
8562def note_cuda_const_var_unpromoted : Note<
8563  "const variable cannot be emitted on device side due to dynamic initialization">;
8564def note_cuda_host_var : Note<
8565  "host variable declared here">;
8566def err_ref_bad_target_global_initializer : Error<
8567  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8568  "function %1 in global initializer">;
8569def err_capture_bad_target : Error<
8570  "capture host variable %0 by reference in device or host device lambda function">;
8571def warn_maybe_capture_bad_target_this_ptr : Warning<
8572  "capture host side class data member by this pointer in device or host device lambda function "
8573  "may result in invalid memory access if this pointer is not accessible on device side">,
8574  InGroup<DiagGroup<"gpu-maybe-wrong-side">>;
8575def warn_kern_is_method : Extension<
8576  "kernel function %0 is a member function; this may not be accepted by nvcc">,
8577  InGroup<CudaCompat>;
8578def warn_kern_is_inline : Warning<
8579  "ignored 'inline' attribute on kernel function %0">,
8580  InGroup<CudaCompat>;
8581def err_variadic_device_fn : Error<
8582  "CUDA device code does not support variadic functions">;
8583def err_va_arg_in_device : Error<
8584  "CUDA device code does not support va_arg">;
8585def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
8586def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
8587  "constexpr function %0 without __host__ or __device__ attributes cannot "
8588  "overload __device__ function with same signature.  Add a __host__ "
8589  "attribute, or build with -fno-cuda-host-device-constexpr.">;
8590def note_cuda_conflicting_device_function_declared_here : Note<
8591  "conflicting __device__ function declared here">;
8592def err_cuda_device_exceptions : Error<
8593  "cannot use '%0' in "
8594  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
8595def err_dynamic_var_init : Error<
8596    "dynamic initialization is not supported for "
8597    "__device__, __constant__, __shared__, and __managed__ variables.">;
8598def err_shared_var_init : Error<
8599    "initialization is not supported for __shared__ variables.">;
8600def err_cuda_vla : Error<
8601    "cannot use variable-length arrays in "
8602    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8603def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
8604def err_cuda_host_shared : Error<
8605    "__shared__ local variables not allowed in "
8606    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8607def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
8608    "__managed__ are not allowed on non-static local variables">;
8609def err_cuda_ovl_target : Error<
8610  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
8611  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
8612def note_cuda_ovl_candidate_target_mismatch : Note<
8613    "candidate template ignored: target attributes do not match">;
8614
8615def err_cuda_device_builtin_surftex_cls_template : Error<
8616    "illegal device builtin %select{surface|texture}0 reference "
8617    "class template %1 declared here">;
8618def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
8619    "%0 needs to have exactly %1 template parameters">;
8620def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
8621    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
8622    "%select{a type|an integer or enum value}2">;
8623
8624def err_cuda_device_builtin_surftex_ref_decl : Error<
8625    "illegal device builtin %select{surface|texture}0 reference "
8626    "type %1 declared here">;
8627def note_cuda_device_builtin_surftex_should_be_template_class : Note<
8628    "%0 needs to be instantiated from a class template with proper "
8629    "template arguments">;
8630
8631def err_hip_invalid_args_builtin_mangled_name : Error<
8632    "invalid argument: symbol must be a device-side function or global variable">;
8633
8634def warn_non_pod_vararg_with_format_string : Warning<
8635  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
8636  "%select{function|block|method|constructor}2; expected type from format "
8637  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
8638// The arguments to this diagnostic should match the warning above.
8639def err_cannot_pass_objc_interface_to_vararg_format : Error<
8640  "cannot pass object with interface type %1 by value to variadic "
8641  "%select{function|block|method|constructor}2; expected type from format "
8642  "string was %3">;
8643def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
8644  "cannot pass non-trivial C object of type %0 by value to variadic "
8645  "%select{function|block|method|constructor}1">;
8646
8647
8648def err_cannot_pass_objc_interface_to_vararg : Error<
8649  "cannot pass object with interface type %0 by value through variadic "
8650  "%select{function|block|method|constructor}1">;
8651def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
8652  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
8653  " %select{function|block|method|constructor}2; call will abort at runtime">,
8654  InGroup<NonPODVarargs>, DefaultError;
8655def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
8656  "passing object of trivial but non-POD type %0 through variadic"
8657  " %select{function|block|method|constructor}1 is incompatible with C++98">,
8658  InGroup<CXX98Compat>, DefaultIgnore;
8659def warn_pass_class_arg_to_vararg : Warning<
8660  "passing object of class type %0 through variadic "
8661  "%select{function|block|method|constructor}1"
8662  "%select{|; did you mean to call '%3'?}2">,
8663  InGroup<ClassVarargs>, DefaultIgnore;
8664def err_cannot_pass_to_vararg : Error<
8665  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8666  "%select{function|block|method|constructor}2">;
8667def err_cannot_pass_to_vararg_format : Error<
8668  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8669  "%select{function|block|method|constructor}2; expected type from format "
8670  "string was %3">;
8671
8672def err_typecheck_call_invalid_ordered_compare : Error<
8673  "ordered compare requires two args of floating point type"
8674  "%diff{ ($ and $)|}0,1">;
8675def err_typecheck_call_invalid_unary_fp : Error<
8676  "floating point classification requires argument of floating point type "
8677  "(passed in %0)">;
8678def err_typecheck_cond_expect_int_float : Error<
8679  "used type %0 where integer or floating point type is required">;
8680def err_typecheck_cond_expect_scalar : Error<
8681  "used type %0 where arithmetic or pointer type is required">;
8682def err_typecheck_cond_expect_nonfloat : Error<
8683  "used type %0 where floating point type is not allowed">;
8684def ext_typecheck_cond_one_void : Extension<
8685  "C99 forbids conditional expressions with only one void side">;
8686def err_typecheck_cast_to_incomplete : Error<
8687  "cast to incomplete type %0">;
8688def ext_typecheck_cast_nonscalar : Extension<
8689  "C99 forbids casting nonscalar type %0 to the same type">;
8690def ext_typecheck_cast_to_union : Extension<
8691  "cast to union type is a GNU extension">,
8692  InGroup<GNUUnionCast>;
8693def err_typecheck_cast_to_union_no_type : Error<
8694  "cast to union type from type %0 not present in union">;
8695def err_cast_pointer_from_non_pointer_int : Error<
8696  "operand of type %0 cannot be cast to a pointer type">;
8697def warn_cast_pointer_from_sel : Warning<
8698  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
8699  InGroup<SelTypeCast>;
8700def warn_function_def_in_objc_container : Warning<
8701  "function definition inside an Objective-C container is deprecated">,
8702  InGroup<FunctionDefInObjCContainer>;
8703def err_typecheck_call_requires_real_fp : Error<
8704  "argument type %0 is not a real floating point type">;
8705def err_typecheck_call_different_arg_types : Error<
8706  "arguments are of different types%diff{ ($ vs $)|}0,1">;
8707
8708def warn_cast_calling_conv : Warning<
8709  "cast between incompatible calling conventions '%0' and '%1'; "
8710  "calls through this pointer may abort at runtime">,
8711  InGroup<DiagGroup<"cast-calling-convention">>;
8712def note_change_calling_conv_fixit : Note<
8713  "consider defining %0 with the '%1' calling convention">;
8714def warn_bad_function_cast : Warning<
8715  "cast from function call of type %0 to non-matching type %1">,
8716  InGroup<BadFunctionCast>, DefaultIgnore;
8717def warn_cast_function_type : Warning<
8718  "cast %diff{from $ to $ |}0,1converts to incompatible function type">,
8719  InGroup<CastFunctionType>, DefaultIgnore;
8720def warn_cast_function_type_strict : Warning<warn_cast_function_type.Summary>,
8721  InGroup<CastFunctionTypeStrict>, DefaultIgnore;
8722def err_cast_pointer_to_non_pointer_int : Error<
8723  "pointer cannot be cast to type %0">;
8724def err_nullptr_cast : Error<
8725  "cannot cast an object of type %select{'nullptr_t' to %1|%1 to 'nullptr_t'}0"
8726>;
8727def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">;
8728def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">;
8729def err_typecheck_expect_scalar_operand : Error<
8730  "operand of type %0 where arithmetic or pointer type is required">;
8731def err_typecheck_cond_incompatible_operands : Error<
8732  "incompatible operand types%diff{ ($ and $)|}0,1">;
8733def err_typecheck_expect_flt_or_vector : Error<
8734  "invalid operand of type %0 where floating, complex or "
8735  "a vector of such types is required">;
8736def err_cast_selector_expr : Error<
8737  "cannot type cast @selector expression">;
8738def err_make_signed_integral_only : Error<
8739  "'%select{make_unsigned|make_signed}0' is only compatible with "
8740  "non-%select{bool|_BitInt(1)}1 integers and enum types, but was given "
8741  "%2%select{| whose underlying type is %4}3">;
8742def ext_typecheck_cond_incompatible_pointers : ExtWarn<
8743  "pointer type mismatch%diff{ ($ and $)|}0,1">,
8744  InGroup<DiagGroup<"pointer-type-mismatch">>;
8745def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
8746  "pointer/integer type mismatch in conditional expression"
8747  "%diff{ ($ and $)|}0,1">,
8748  InGroup<DiagGroup<"conditional-type-mismatch">>;
8749def err_typecheck_choose_expr_requires_constant : Error<
8750  "'__builtin_choose_expr' requires a constant expression">;
8751def warn_unused_expr : Warning<"expression result unused">,
8752  InGroup<UnusedValue>;
8753def warn_unused_comma_left_operand : Warning<
8754  "left operand of comma operator has no effect">,
8755  InGroup<UnusedValue>;
8756def warn_unused_voidptr : Warning<
8757  "expression result unused; should this cast be to 'void'?">,
8758  InGroup<UnusedValue>;
8759def warn_unused_property_expr : Warning<
8760 "property access result unused - getters should not be used for side effects">,
8761  InGroup<UnusedGetterReturnValue>;
8762def warn_unused_container_subscript_expr : Warning<
8763 "container access result unused - container access should not be used for side effects">,
8764  InGroup<UnusedValue>;
8765def warn_unused_call : Warning<
8766  "ignoring return value of function declared with %0 attribute">,
8767  InGroup<UnusedValue>;
8768def warn_unused_constructor : Warning<
8769  "ignoring temporary created by a constructor declared with %0 attribute">,
8770  InGroup<UnusedValue>;
8771def warn_unused_constructor_msg : Warning<
8772  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
8773  InGroup<UnusedValue>;
8774def warn_side_effects_unevaluated_context : Warning<
8775  "expression with side effects has no effect in an unevaluated context">,
8776  InGroup<UnevaluatedExpression>;
8777def warn_side_effects_typeid : Warning<
8778  "expression with side effects will be evaluated despite being used as an "
8779  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
8780def warn_unused_result : Warning<
8781  "ignoring return value of function declared with %0 attribute">,
8782  InGroup<UnusedResult>;
8783def warn_unused_result_msg : Warning<
8784  "ignoring return value of function declared with %0 attribute: %1">,
8785  InGroup<UnusedResult>;
8786def warn_unused_result_typedef_unsupported_spelling : Warning<
8787  "'[[%select{nodiscard|gnu::warn_unused_result}0]]' attribute ignored when "
8788  "applied to a typedef; consider using '__attribute__((warn_unused_result))' "
8789  "or '[[clang::warn_unused_result]]' instead">, InGroup<IgnoredAttributes>;
8790def warn_unused_volatile : Warning<
8791  "expression result unused; assign into a variable to force a volatile load">,
8792  InGroup<DiagGroup<"unused-volatile-lvalue">>;
8793
8794def ext_cxx14_attr : Extension<
8795  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14Attrs>;
8796def ext_cxx17_attr : Extension<
8797  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17Attrs>;
8798def ext_cxx20_attr : Extension<
8799  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20Attrs>;
8800
8801def warn_unused_comparison : Warning<
8802  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
8803  InGroup<UnusedComparison>;
8804def note_inequality_comparison_to_or_assign : Note<
8805  "use '|=' to turn this inequality comparison into an or-assignment">;
8806
8807def err_incomplete_type_used_in_type_trait_expr : Error<
8808  "incomplete type %0 used in type trait expression">;
8809
8810// C++20 constinit and require_constant_initialization attribute
8811def warn_cxx20_compat_constinit : Warning<
8812  "'constinit' specifier is incompatible with C++ standards before C++20">,
8813  InGroup<CXX20Compat>, DefaultIgnore;
8814def err_constinit_local_variable : Error<
8815  "local variable cannot be declared 'constinit'">;
8816def err_require_constant_init_failed : Error<
8817  "variable does not have a constant initializer">;
8818def note_declared_required_constant_init_here : Note<
8819  "required by %select{'require_constant_initialization' attribute|"
8820  "'constinit' specifier}0 here">;
8821def ext_constinit_missing : ExtWarn<
8822  "'constinit' specifier missing on initializing declaration of %0">,
8823  InGroup<DiagGroup<"missing-constinit">>;
8824def note_constinit_specified_here : Note<"variable declared constinit here">;
8825def err_constinit_added_too_late : Error<
8826  "'constinit' specifier added after initialization of variable">;
8827def warn_require_const_init_added_too_late : Warning<
8828  "'require_constant_initialization' attribute added after initialization "
8829  "of variable">, InGroup<IgnoredAttributes>;
8830def note_constinit_missing_here : Note<
8831  "add the "
8832  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
8833  "to the initializing declaration here">;
8834
8835def err_dimension_expr_not_constant_integer : Error<
8836  "dimension expression does not evaluate to a constant unsigned int">;
8837
8838def err_typecheck_cond_incompatible_operands_null : Error<
8839  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
8840def ext_empty_struct_union : Extension<
8841  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
8842def ext_no_named_members_in_struct_union : Extension<
8843  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
8844def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
8845  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8846  InGroup<CXXCompat>, DefaultIgnore;
8847def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
8848  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8849  InGroup<ExternCCompat>;
8850def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
8851  "volatile qualifiers|const qualifier|volatile qualifier}2">,
8852  InGroup<CastQual>, DefaultIgnore;
8853def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
8854  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
8855def warn_redefine_extname_not_applied : Warning<
8856  "#pragma redefine_extname is applicable to external C declarations only; "
8857  "not applied to %select{function|variable}0 %1">,
8858  InGroup<Pragmas>;
8859} // End of general sema category.
8860
8861// inline asm.
8862let CategoryName = "Inline Assembly Issue" in {
8863  def err_asm_pmf_through_constraint_not_permitted
8864    : Error<"cannot pass a pointer-to-member through register-constrained "
8865            "inline assembly parameter">;
8866  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
8867  def err_asm_invalid_output_constraint : Error<
8868    "invalid output constraint '%0' in asm">;
8869  def err_asm_invalid_lvalue_in_input : Error<
8870    "invalid lvalue in asm input for constraint '%0'">;
8871  def err_asm_invalid_input_constraint : Error<
8872    "invalid input constraint '%0' in asm">;
8873  def err_asm_tying_incompatible_types : Error<
8874    "unsupported inline asm: input with type "
8875    "%diff{$ matching output with type $|}0,1">;
8876  def err_asm_unexpected_constraint_alternatives : Error<
8877    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
8878  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
8879  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
8880  def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">;
8881  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
8882    "global register variables on this target">;
8883  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
8884    "match variable size">;
8885  def err_asm_bad_register_type : Error<"bad type for named register variable">;
8886  def err_asm_invalid_input_size : Error<
8887    "invalid input size for constraint '%0'">;
8888  def err_asm_invalid_output_size : Error<
8889    "invalid output size for constraint '%0'">;
8890  def err_invalid_asm_cast_lvalue : Error<
8891    "invalid use of a cast in a inline asm context requiring an lvalue: "
8892    "remove the cast or build with -fheinous-gnu-extensions">;
8893  def err_invalid_asm_value_for_constraint
8894      : Error <"value '%0' out of range for constraint '%1'">;
8895  def err_asm_non_addr_value_in_memory_constraint : Error <
8896    "reference to a %select{bit-field|vector element|global register variable}0"
8897    " in asm %select{input|output}1 with a memory constraint '%2'">;
8898  def err_asm_input_duplicate_match : Error<
8899    "more than one input constraint matches the same output '%0'">;
8900  def err_store_value_to_reg : Error<
8901    "impossible constraint in asm: can't store value into a register">;
8902
8903  def warn_asm_label_on_auto_decl : Warning<
8904    "ignored asm label '%0' on automatic variable">;
8905  def warn_invalid_asm_cast_lvalue : Warning<
8906    "invalid use of a cast in an inline asm context requiring an lvalue: "
8907    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
8908    "for this in the future">;
8909  def warn_asm_mismatched_size_modifier : Warning<
8910    "value size does not match register size specified by the constraint "
8911    "and modifier">,
8912    InGroup<ASMOperandWidths>;
8913
8914  def note_asm_missing_constraint_modifier : Note<
8915    "use constraint modifier \"%0\"">;
8916  def note_asm_input_duplicate_first : Note<
8917    "constraint '%0' is already present here">;
8918 def error_duplicate_asm_operand_name : Error<
8919    "duplicate use of asm operand name \"%0\"">;
8920 def note_duplicate_asm_operand_name : Note<
8921    "asm operand name \"%0\" first referenced here">;
8922}
8923
8924  def error_inoutput_conflict_with_clobber : Error<
8925    "asm-specifier for input or output variable conflicts with asm"
8926    " clobber list">;
8927
8928let CategoryName = "Semantic Issue" in {
8929
8930def err_invalid_conversion_between_matrixes : Error<
8931  "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">;
8932
8933def err_invalid_conversion_between_matrix_and_type : Error<
8934  "conversion between matrix type %0 and incompatible type %1 is not allowed">;
8935
8936def err_invalid_conversion_between_vectors : Error<
8937  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
8938  "size">;
8939def err_invalid_conversion_between_vector_and_integer : Error<
8940  "invalid conversion between vector type %0 and integer type %1 "
8941  "of different size">;
8942
8943def err_opencl_function_pointer : Error<
8944  "%select{pointers|references}0 to functions are not allowed">;
8945
8946def err_opencl_taking_address_capture : Error<
8947  "taking address of a capture is not allowed">;
8948
8949def err_invalid_conversion_between_vector_and_scalar : Error<
8950  "invalid conversion between vector type %0 and scalar type %1">;
8951
8952// C++ member initializers.
8953def err_only_constructors_take_base_inits : Error<
8954  "only constructors take base initializers">;
8955
8956def err_multiple_mem_initialization : Error <
8957  "multiple initializations given for non-static member %0">;
8958def err_multiple_mem_union_initialization : Error <
8959  "initializing multiple members of union">;
8960def err_multiple_base_initialization : Error <
8961  "multiple initializations given for base %0">;
8962
8963def err_mem_init_not_member_or_class : Error<
8964  "member initializer %0 does not name a non-static data member or base "
8965  "class">;
8966
8967def warn_initializer_out_of_order : Warning<
8968  "%select{field|base class}0 %1 will be initialized after "
8969  "%select{field|base}2 %3">,
8970  InGroup<ReorderCtor>, DefaultIgnore;
8971
8972def warn_some_initializers_out_of_order : Warning<
8973  "initializer order does not match the declaration order">,
8974  InGroup<ReorderCtor>, DefaultIgnore;
8975
8976def note_initializer_out_of_order : Note<
8977  "%select{field|base class}0 %1 will be initialized after "
8978  "%select{field|base}2 %3">;
8979
8980def warn_abstract_vbase_init_ignored : Warning<
8981  "initializer for virtual base class %0 of abstract class %1 "
8982  "will never be used">,
8983  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
8984
8985def err_base_init_does_not_name_class : Error<
8986  "constructor initializer %0 does not name a class">;
8987def err_base_init_direct_and_virtual : Error<
8988  "base class initializer %0 names both a direct base class and an "
8989  "inherited virtual base class">;
8990def err_not_direct_base_or_virtual : Error<
8991  "type %0 is not a direct or virtual base of %1">;
8992
8993def err_in_class_initializer_non_const : Error<
8994  "non-const static data member must be initialized out of line">;
8995def err_in_class_initializer_volatile : Error<
8996  "static const volatile data member must be initialized out of line">;
8997def err_in_class_initializer_bad_type : Error<
8998  "static data member of type %0 must be initialized out of line">;
8999def ext_in_class_initializer_float_type : ExtWarn<
9000  "in-class initializer for static data member of type %0 is a GNU extension">,
9001  InGroup<GNUStaticFloatInit>;
9002def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
9003  "in-class initializer for static data member of type %0 requires "
9004  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
9005def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
9006def err_in_class_initializer_literal_type : Error<
9007  "in-class initializer for static data member of type %0 requires "
9008  "'constexpr' specifier">;
9009def err_in_class_initializer_non_constant : Error<
9010  "in-class initializer for static data member is not a constant expression">;
9011def err_default_member_initializer_not_yet_parsed : Error<
9012  "default member initializer for %1 needed within definition of enclosing "
9013  "class %0 outside of member functions">;
9014def note_default_member_initializer_not_yet_parsed : Note<
9015  "default member initializer declared here">;
9016def err_default_member_initializer_cycle
9017    : Error<"default member initializer for %0 uses itself">;
9018
9019def ext_in_class_initializer_non_constant : Extension<
9020  "in-class initializer for static data member is not a constant expression; "
9021  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
9022
9023def err_thread_dynamic_init : Error<
9024  "initializer for thread-local variable must be a constant expression">;
9025def err_thread_nontrivial_dtor : Error<
9026  "type of thread-local variable has non-trivial destruction">;
9027def note_use_thread_local : Note<
9028  "use 'thread_local' to allow this">;
9029
9030// C++ anonymous unions and GNU anonymous structs/unions
9031def ext_anonymous_union : Extension<
9032  "anonymous unions are a C11 extension">, InGroup<C11>;
9033def ext_gnu_anonymous_struct : Extension<
9034  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
9035def ext_c11_anonymous_struct : Extension<
9036  "anonymous structs are a C11 extension">, InGroup<C11>;
9037def err_anonymous_union_not_static : Error<
9038  "anonymous unions at namespace or global scope must be declared 'static'">;
9039def err_anonymous_union_with_storage_spec : Error<
9040  "anonymous union at class scope must not have a storage specifier">;
9041def err_anonymous_struct_not_member : Error<
9042  "anonymous %select{structs|structs and classes}0 must be "
9043  "%select{struct or union|class}0 members">;
9044def err_anonymous_record_member_redecl : Error<
9045  "member of anonymous %select{struct|union}0 redeclares %1">;
9046def err_anonymous_record_with_type : Error<
9047  "types cannot be declared in an anonymous %select{struct|union}0">;
9048def ext_anonymous_record_with_type : Extension<
9049  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
9050  "extension">, InGroup<MicrosoftAnonTag>;
9051def ext_anonymous_record_with_anonymous_type : Extension<
9052  "anonymous types declared in an anonymous %select{struct|union}0 "
9053  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
9054def err_anonymous_record_with_function : Error<
9055  "functions cannot be declared in an anonymous %select{struct|union}0">;
9056def err_anonymous_record_with_static : Error<
9057  "static members cannot be declared in an anonymous %select{struct|union}0">;
9058def err_anonymous_record_bad_member : Error<
9059  "anonymous %select{struct|union}0 can only contain non-static data members">;
9060def err_anonymous_record_nonpublic_member : Error<
9061  "anonymous %select{struct|union}0 cannot contain a "
9062  "%select{private|protected}1 data member">;
9063def ext_ms_anonymous_record : ExtWarn<
9064  "anonymous %select{structs|unions}0 are a Microsoft extension">,
9065  InGroup<MicrosoftAnonTag>;
9066
9067// C++ local classes
9068def err_reference_to_local_in_enclosing_context : Error<
9069  "reference to local %select{variable|binding}1 %0 declared in enclosing "
9070  "%select{%3|block literal|lambda expression|context}2">;
9071def err_capture_binding_openmp : Error<
9072  "capturing a structured binding is not yet supported in OpenMP">;
9073def ext_capture_binding : ExtWarn<
9074  "captured structured bindings are a C++20 extension">, InGroup<CXX20>;
9075def warn_cxx17_compat_capture_binding : Warning<
9076  "captured structured bindings are incompatible with "
9077  "C++ standards before C++20">,
9078  InGroup<CXXPre20Compat>, DefaultIgnore;
9079
9080def err_static_data_member_not_allowed_in_local_class : Error<
9081  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
9082
9083// C++ derived classes
9084def err_base_clause_on_union : Error<"unions cannot have base classes">;
9085def err_base_must_be_class : Error<"base specifier must name a class">;
9086def err_union_as_base_class : Error<"unions cannot be base classes">;
9087def err_circular_inheritance : Error<
9088  "circular inheritance between %0 and %1">;
9089def err_base_class_has_flexible_array_member : Error<
9090  "base class %0 has a flexible array member">;
9091def err_incomplete_base_class : Error<"base class has incomplete type">;
9092def err_duplicate_base_class : Error<
9093  "base class %0 specified more than once as a direct base class">;
9094def warn_inaccessible_base_class : Warning<
9095  "direct base %0 is inaccessible due to ambiguity:%1">,
9096  InGroup<DiagGroup<"inaccessible-base">>;
9097// FIXME: better way to display derivation?  Pass entire thing into diagclient?
9098def err_ambiguous_derived_to_base_conv : Error<
9099  "ambiguous conversion from derived class %0 to base class %1:%2">;
9100def err_ambiguous_memptr_conv : Error<
9101  "ambiguous conversion from pointer to member of %select{base|derived}0 "
9102  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
9103def ext_ms_ambiguous_direct_base : ExtWarn<
9104  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
9105  InGroup<MicrosoftInaccessibleBase>;
9106
9107def err_memptr_conv_via_virtual : Error<
9108  "conversion from pointer to member of class %0 to pointer to member "
9109  "of class %1 via virtual base %2 is not allowed">;
9110
9111// C++ member name lookup
9112def err_ambiguous_member_multiple_subobjects : Error<
9113  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
9114def err_ambiguous_member_multiple_subobject_types : Error<
9115  "member %0 found in multiple base classes of different types">;
9116def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
9117def note_ambiguous_member_type_found : Note<
9118  "member type %0 found by ambiguous name lookup">;
9119def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
9120def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
9121def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
9122  "declaration in a different namespace">;
9123def note_hidden_tag : Note<"type declaration hidden">;
9124def note_hiding_object : Note<"declaration hides type">;
9125
9126// C++ operator overloading
9127def err_operator_overload_needs_class_or_enum : Error<
9128  "overloaded %0 must have at least one parameter of class "
9129  "or enumeration type">;
9130
9131def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
9132def warn_cxx20_compat_operator_overload_static : Warning<
9133  "declaring overloaded %0 as 'static' is incompatible with C++ standards "
9134  "before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore;
9135def ext_operator_overload_static : ExtWarn<
9136  "declaring overloaded %0 as 'static' is a C++2b extension">, InGroup<CXX2b>;
9137def err_operator_overload_static : Error<
9138  "overloaded %0 cannot be a static member function">;
9139def err_operator_overload_default_arg : Error<
9140  "parameter of overloaded %0 cannot have a default argument">;
9141
9142def ext_subscript_overload : Warning<
9143  "overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a "
9144  "C++2b extension">, InGroup<CXXPre2bCompat>, DefaultIgnore;
9145def error_subscript_overload : Error<
9146  "overloaded %0 cannot have %select{no|a defaulted|more than one}1 parameter before C++2b">;
9147
9148def err_operator_overload_must_be : Error<
9149  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
9150  "(has %1 parameter%s1)">;
9151
9152def err_operator_overload_must_be_member : Error<
9153  "overloaded %0 must be a non-static member function">;
9154def err_operator_overload_post_incdec_must_be_int : Error<
9155  "parameter of overloaded post-%select{increment|decrement}1 operator must "
9156  "have type 'int' (not %0)">;
9157
9158// C++ allocation and deallocation functions.
9159def err_operator_new_delete_declared_in_namespace : Error<
9160  "%0 cannot be declared inside a namespace">;
9161def err_operator_new_delete_declared_static : Error<
9162  "%0 cannot be declared static in global scope">;
9163def ext_operator_new_delete_declared_inline : ExtWarn<
9164  "replacement function %0 cannot be declared 'inline'">,
9165  InGroup<DiagGroup<"inline-new-delete">>;
9166def err_operator_new_delete_invalid_result_type : Error<
9167  "%0 must return type %1">;
9168def err_operator_new_delete_dependent_result_type : Error<
9169  "%0 cannot have a dependent return type; use %1 instead">;
9170def err_operator_new_delete_too_few_parameters : Error<
9171  "%0 must have at least one parameter">;
9172def err_operator_new_delete_template_too_few_parameters : Error<
9173  "%0 template must have at least two parameters">;
9174def warn_operator_new_returns_null : Warning<
9175  "%0 should not return a null pointer unless it is declared 'throw()'"
9176  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
9177
9178def err_operator_new_dependent_param_type : Error<
9179  "%0 cannot take a dependent type as first parameter; "
9180  "use size_t (%1) instead">;
9181def err_operator_new_param_type : Error<
9182  "%0 takes type size_t (%1) as first parameter">;
9183def err_operator_new_default_arg: Error<
9184  "parameter of %0 cannot have a default argument">;
9185def err_operator_delete_dependent_param_type : Error<
9186  "%0 cannot take a dependent type as first parameter; use %1 instead">;
9187def err_operator_delete_param_type : Error<
9188  "first parameter of %0 must have type %1">;
9189def err_destroying_operator_delete_not_usual : Error<
9190  "destroying operator delete can have only an optional size and optional "
9191  "alignment parameter">;
9192def note_implicit_delete_this_in_destructor_here : Note<
9193  "while checking implicit 'delete this' for virtual destructor">;
9194def err_builtin_operator_new_delete_not_usual : Error<
9195  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
9196  "selects non-usual %select{allocation|deallocation}0 function">;
9197def note_non_usual_function_declared_here : Note<
9198  "non-usual %0 declared here">;
9199
9200// C++ literal operators
9201def err_literal_operator_outside_namespace : Error<
9202  "literal operator %0 must be in a namespace or global scope">;
9203def err_literal_operator_id_outside_namespace : Error<
9204  "non-namespace scope '%0' cannot have a literal operator member">;
9205def err_literal_operator_default_argument : Error<
9206  "literal operator cannot have a default argument">;
9207def err_literal_operator_bad_param_count : Error<
9208  "non-template literal operator must have one or two parameters">;
9209def err_literal_operator_invalid_param : Error<
9210  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
9211def err_literal_operator_param : Error<
9212  "invalid literal operator parameter type %0, did you mean %1?">;
9213def err_literal_operator_template_with_params : Error<
9214  "literal operator template cannot have any parameters">;
9215def err_literal_operator_template : Error<
9216  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
9217def err_literal_operator_extern_c : Error<
9218  "literal operator must have C++ linkage">;
9219def ext_string_literal_operator_template : ExtWarn<
9220  "string literal operator templates are a GNU extension">,
9221  InGroup<GNUStringLiteralOperatorTemplate>;
9222def warn_user_literal_reserved : Warning<
9223  "user-defined literal suffixes not starting with '_' are reserved"
9224  "%select{; no literal will invoke this operator|}0">,
9225  InGroup<UserDefinedLiterals>;
9226
9227// C++ conversion functions
9228def err_conv_function_not_member : Error<
9229  "conversion function must be a non-static member function">;
9230def err_conv_function_return_type : Error<
9231  "conversion function cannot have a return type">;
9232def err_conv_function_with_params : Error<
9233  "conversion function cannot have any parameters">;
9234def err_conv_function_variadic : Error<
9235  "conversion function cannot be variadic">;
9236def err_conv_function_to_array : Error<
9237  "conversion function cannot convert to an array type">;
9238def err_conv_function_to_function : Error<
9239  "conversion function cannot convert to a function type">;
9240def err_conv_function_with_complex_decl : Error<
9241  "cannot specify any part of a return type in the "
9242  "declaration of a conversion function"
9243  "%select{"
9244  "; put the complete type after 'operator'|"
9245  "; use a typedef to declare a conversion to %1|"
9246  "; use an alias template to declare a conversion to %1|"
9247  "}0">;
9248def err_conv_function_redeclared : Error<
9249  "conversion function cannot be redeclared">;
9250def warn_conv_to_self_not_used : Warning<
9251  "conversion function converting %0 to itself will never be used">,
9252  InGroup<ClassConversion>;
9253def warn_conv_to_base_not_used : Warning<
9254  "conversion function converting %0 to its base class %1 will never be used">,
9255  InGroup<ClassConversion>;
9256def warn_conv_to_void_not_used : Warning<
9257  "conversion function converting %0 to %1 will never be used">,
9258  InGroup<ClassConversion>;
9259
9260def warn_not_compound_assign : Warning<
9261  "use of unary operator that may be intended as compound assignment (%0=)">;
9262
9263// C++11 explicit conversion operators
9264def ext_explicit_conversion_functions : ExtWarn<
9265  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
9266def warn_cxx98_compat_explicit_conversion_functions : Warning<
9267  "explicit conversion functions are incompatible with C++98">,
9268  InGroup<CXX98Compat>, DefaultIgnore;
9269
9270// C++11 defaulted functions
9271def err_defaulted_special_member_params : Error<
9272  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9273  "have default arguments">;
9274def err_defaulted_special_member_variadic : Error<
9275  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9276  "be variadic">;
9277def err_defaulted_special_member_return_type : Error<
9278  "explicitly-defaulted %select{copy|move}0 assignment operator must "
9279  "return %1">;
9280def err_defaulted_special_member_quals : Error<
9281  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
9282  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
9283def err_defaulted_special_member_volatile_param : Error<
9284  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
9285  "may not be volatile">;
9286def err_defaulted_special_member_move_const_param : Error<
9287  "the parameter for an explicitly-defaulted move "
9288  "%select{constructor|assignment operator}0 may not be const">;
9289def err_defaulted_special_member_copy_const_param : Error<
9290  "the parameter for this explicitly-defaulted copy "
9291  "%select{constructor|assignment operator}0 is const, but a member or base "
9292  "requires it to be non-const">;
9293def err_defaulted_copy_assign_not_ref : Error<
9294  "the parameter for an explicitly-defaulted copy assignment operator must be an "
9295  "lvalue reference type">;
9296def err_incorrect_defaulted_constexpr : Error<
9297  "defaulted definition of %sub{select_special_member_kind}0 "
9298  "is not constexpr">;
9299def err_incorrect_defaulted_consteval : Error<
9300  "defaulted declaration of %sub{select_special_member_kind}0 "
9301  "cannot be consteval because implicit definition is not constexpr">;
9302def warn_defaulted_method_deleted : Warning<
9303  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
9304  "deleted">, InGroup<DefaultedFunctionDeleted>;
9305def note_replace_equals_default_to_delete : Note<
9306  "replace 'default' with 'delete'">;
9307def err_out_of_line_default_deletes : Error<
9308  "defaulting this %sub{select_special_member_kind}0 "
9309  "would delete it after its first declaration">;
9310def note_deleted_type_mismatch : Note<
9311  "function is implicitly deleted because its declared type does not match "
9312  "the type of an implicit %sub{select_special_member_kind}0">;
9313def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
9314  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
9315  "different from the implicit type is incompatible with C++ standards before "
9316  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9317def warn_vbase_moved_multiple_times : Warning<
9318  "defaulted move assignment operator of %0 will move assign virtual base "
9319  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
9320def note_vbase_moved_here : Note<
9321  "%select{%1 is a virtual base class of base class %2 declared here|"
9322  "virtual base class %1 declared here}0">;
9323
9324// C++20 defaulted comparisons
9325// This corresponds to values of Sema::DefaultedComparisonKind.
9326def select_defaulted_comparison_kind : TextSubstitution<
9327  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
9328  "operator">;
9329def ext_defaulted_comparison : ExtWarn<
9330  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
9331def warn_cxx17_compat_defaulted_comparison : Warning<
9332  "defaulted comparison operators are incompatible with C++ standards "
9333  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9334def err_defaulted_comparison_template : Error<
9335  "comparison operator template cannot be defaulted">;
9336def err_defaulted_comparison_num_args : Error<
9337  "%select{non-member|member}0 %sub{select_defaulted_comparison_kind}1"
9338  " comparison operator must have %select{2|1}0 parameters">;
9339def err_defaulted_comparison_param : Error<
9340  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
9341  "; found %1, expected %2%select{| or %4}3">;
9342def err_defaulted_comparison_param_unknown : Error<
9343  "invalid parameter type for non-member defaulted"
9344  " %sub{select_defaulted_comparison_kind}0"
9345  "; found %1, expected class or reference to a constant class">;
9346def err_defaulted_comparison_param_mismatch : Error<
9347  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
9348  "must have the same type%diff{ (found $ vs $)|}1,2">;
9349def err_defaulted_comparison_not_friend : Error<
9350  "%sub{select_defaulted_comparison_kind}0 is not a friend of"
9351  " %select{|incomplete class }1%2">;
9352def err_defaulted_comparison_non_const : Error<
9353  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
9354  "const-qualified">;
9355def err_defaulted_comparison_return_type_not_bool : Error<
9356  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9357  "must be 'bool', not %1">;
9358def err_defaulted_comparison_deduced_return_type_not_auto : Error<
9359  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9360  "must be 'auto', not %1">;
9361def warn_defaulted_comparison_deleted : Warning<
9362  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
9363  "deleted">, InGroup<DefaultedFunctionDeleted>;
9364def err_non_first_default_compare_deletes : Error<
9365  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
9366  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
9367  "would delete it after its first declaration">;
9368def err_non_first_default_compare_in_class : Error<
9369  "defaulting this %sub{select_defaulted_comparison_kind}0 "
9370  "is not allowed because it was already declared outside the class">;
9371def note_defaulted_comparison_union : Note<
9372  "defaulted %0 is implicitly deleted because "
9373  "%2 is a %select{union-like class|union}1 with variant members">;
9374def note_defaulted_comparison_reference_member : Note<
9375  "defaulted %0 is implicitly deleted because "
9376  "class %1 has a reference member">;
9377def note_defaulted_comparison_ambiguous : Note<
9378  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
9379  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
9380def note_defaulted_comparison_inaccessible : Note<
9381  "defaulted %0 is implicitly deleted because it would invoke a "
9382  "%select{private|protected}3 %4%select{ member of %6|"
9383  " member of %6 to compare member %2| to compare base class %2}1">;
9384def note_defaulted_comparison_calls_deleted : Note<
9385  "defaulted %0 is implicitly deleted because it would invoke a deleted "
9386  "comparison function%select{| for member %2| for base class %2}1">;
9387def note_defaulted_comparison_no_viable_function : Note<
9388  "defaulted %0 is implicitly deleted because there is no viable "
9389  "%select{three-way comparison function|'operator=='}1 for "
9390  "%select{|member |base class }2%3">;
9391def note_defaulted_comparison_no_viable_function_synthesized : Note<
9392  "three-way comparison cannot be synthesized because there is no viable "
9393  "function for %select{'=='|'<'}0 comparison">;
9394def note_defaulted_comparison_not_rewritten_callee : Note<
9395  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
9396  "function would be the best match for the comparison">;
9397def note_defaulted_comparison_not_rewritten_conversion : Note<
9398  "defaulted %0 is implicitly deleted because a builtin comparison function "
9399  "using this conversion would be the best match for the comparison">;
9400def note_defaulted_comparison_cannot_deduce : Note<
9401  "return type of defaulted 'operator<=>' cannot be deduced because "
9402  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
9403  "is not a standard comparison category type">;
9404def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
9405  "return type of defaulted 'operator<=>' cannot be deduced because "
9406  "three-way comparison for %select{|member|base class}0 %1 "
9407  "has a deduced return type and is not yet defined">;
9408def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
9409  "%select{|member|base class}0 %1 declared here">;
9410def note_defaulted_comparison_cannot_deduce_callee : Note<
9411  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
9412def err_incorrect_defaulted_comparison_constexpr : Error<
9413  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
9414  "three-way comparison operator}0 "
9415  "cannot be declared %select{constexpr|consteval}2 because "
9416  "%select{it|the corresponding implicit 'operator=='}0 "
9417  "invokes a non-constexpr comparison function">;
9418def note_defaulted_comparison_not_constexpr : Note<
9419  "non-constexpr comparison function would be used to compare "
9420  "%select{|member %1|base class %1}0">;
9421def note_defaulted_comparison_not_constexpr_here : Note<
9422  "non-constexpr comparison function declared here">;
9423def note_in_declaration_of_implicit_equality_comparison : Note<
9424  "while declaring the corresponding implicit 'operator==' "
9425  "for this defaulted 'operator<=>'">;
9426
9427def ext_implicit_exception_spec_mismatch : ExtWarn<
9428  "function previously declared with an %select{explicit|implicit}0 exception "
9429  "specification redeclared with an %select{implicit|explicit}0 exception "
9430  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
9431
9432def warn_ptr_arith_precedes_bounds : Warning<
9433  "the pointer decremented by %0 refers before the beginning of the array">,
9434  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9435def warn_ptr_arith_exceeds_bounds : Warning<
9436  "the pointer incremented by %0 refers past the end of the array (that has type %1)">,
9437  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9438def warn_array_index_precedes_bounds : Warning<
9439  "array index %0 is before the beginning of the array">,
9440  InGroup<ArrayBounds>;
9441def warn_array_index_exceeds_bounds : Warning<
9442  "array index %0 is past the end of the array (that has type %1%select{|, cast to %3}2)">,
9443  InGroup<ArrayBounds>;
9444def warn_ptr_arith_exceeds_max_addressable_bounds : Warning<
9445  "the pointer incremented by %0 refers past the last possible element for an array in %1-bit "
9446  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9447  InGroup<ArrayBounds>;
9448def warn_array_index_exceeds_max_addressable_bounds : Warning<
9449  "array index %0 refers past the last possible element for an array in %1-bit "
9450  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9451  InGroup<ArrayBounds>;
9452def note_array_declared_here : Note<
9453  "array %0 declared here">;
9454
9455def warn_inconsistent_array_form : Warning<
9456  "argument %0 of type %1 with mismatched bound">,
9457  InGroup<ArrayParameter>, DefaultIgnore;
9458def note_previous_declaration_as : Note<
9459  "previously declared as %0 here">;
9460
9461def warn_printf_insufficient_data_args : Warning<
9462  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9463def warn_printf_data_arg_not_used : Warning<
9464  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9465def warn_format_invalid_conversion : Warning<
9466  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9467def warn_printf_incomplete_specifier : Warning<
9468  "incomplete format specifier">, InGroup<Format>;
9469def warn_missing_format_string : Warning<
9470  "format string missing">, InGroup<Format>;
9471def warn_scanf_nonzero_width : Warning<
9472  "zero field width in scanf format string is unused">,
9473  InGroup<Format>;
9474def warn_format_conversion_argument_type_mismatch : Warning<
9475  "format specifies type %0 but the argument has "
9476  "%select{type|underlying type}2 %1">,
9477  InGroup<Format>;
9478def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9479  warn_format_conversion_argument_type_mismatch.Summary>,
9480  InGroup<FormatPedantic>;
9481def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9482  warn_format_conversion_argument_type_mismatch.Summary>,
9483  InGroup<FormatTypeConfusion>, DefaultIgnore;
9484def warn_format_argument_needs_cast : Warning<
9485  "%select{values of type|enum values with underlying type}2 '%0' should not "
9486  "be used as format arguments; add an explicit cast to %1 instead">,
9487  InGroup<Format>;
9488def warn_format_argument_needs_cast_pedantic : Warning<
9489  warn_format_argument_needs_cast.Summary>,
9490  InGroup<FormatPedantic>, DefaultIgnore;
9491def warn_printf_positional_arg_exceeds_data_args : Warning <
9492  "data argument position '%0' exceeds the number of data arguments (%1)">,
9493  InGroup<Format>;
9494def warn_format_zero_positional_specifier : Warning<
9495  "position arguments in format strings start counting at 1 (not 0)">,
9496  InGroup<Format>;
9497def warn_format_invalid_positional_specifier : Warning<
9498  "invalid position specified for %select{field width|field precision}0">,
9499  InGroup<Format>;
9500def warn_format_mix_positional_nonpositional_args : Warning<
9501  "cannot mix positional and non-positional arguments in format string">,
9502  InGroup<Format>;
9503def warn_static_array_too_small : Warning<
9504  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9505  " callee requires at least %1">,
9506  InGroup<ArrayBounds>;
9507def note_callee_static_array : Note<
9508  "callee declares array parameter as static here">;
9509def warn_empty_format_string : Warning<
9510  "format string is empty">, InGroup<FormatZeroLength>;
9511def warn_format_string_is_wide_literal : Warning<
9512  "format string should not be a wide string">, InGroup<Format>;
9513def warn_printf_format_string_contains_null_char : Warning<
9514  "format string contains '\\0' within the string body">, InGroup<Format>;
9515def warn_printf_format_string_not_null_terminated : Warning<
9516  "format string is not null-terminated">, InGroup<Format>;
9517def warn_printf_asterisk_missing_arg : Warning<
9518  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9519  InGroup<Format>;
9520def warn_printf_asterisk_wrong_type : Warning<
9521  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9522  InGroup<Format>;
9523def warn_printf_nonsensical_optional_amount: Warning<
9524  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9525  InGroup<Format>;
9526def warn_printf_nonsensical_flag: Warning<
9527  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9528  InGroup<Format>;
9529def warn_format_nonsensical_length: Warning<
9530  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9531  InGroup<Format>;
9532def warn_format_non_standard_positional_arg: Warning<
9533  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9534def warn_format_non_standard: Warning<
9535  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
9536  InGroup<FormatNonStandard>, DefaultIgnore;
9537def warn_format_non_standard_conversion_spec: Warning<
9538  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
9539  InGroup<FormatNonStandard>, DefaultIgnore;
9540def err_invalid_mask_type_size : Error<
9541  "mask type size must be between 1-byte and 8-bytes">;
9542def warn_format_invalid_annotation : Warning<
9543  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
9544  InGroup<Format>;
9545def warn_format_P_no_precision : Warning<
9546  "using '%%P' format specifier without precision">,
9547  InGroup<Format>;
9548def warn_printf_ignored_flag: Warning<
9549  "flag '%0' is ignored when flag '%1' is present">,
9550  InGroup<Format>;
9551def warn_printf_empty_objc_flag: Warning<
9552  "missing object format flag">,
9553  InGroup<Format>;
9554def warn_printf_ObjCflags_without_ObjCConversion: Warning<
9555  "object format flags cannot be used with '%0' conversion specifier">,
9556  InGroup<Format>;
9557def warn_printf_invalid_objc_flag: Warning<
9558    "'%0' is not a valid object format flag">,
9559    InGroup<Format>;
9560def warn_printf_narg_not_supported : Warning<
9561    "'%%n' specifier not supported on this platform">,
9562    InGroup<Format>;
9563def warn_scanf_scanlist_incomplete : Warning<
9564  "no closing ']' for '%%[' in scanf format string">,
9565  InGroup<Format>;
9566def warn_format_bool_as_character : Warning<
9567  "using '%0' format specifier, but argument has boolean value">,
9568  InGroup<Format>;
9569def note_format_string_defined : Note<"format string is defined here">;
9570def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
9571def note_printf_c_str: Note<"did you mean to call the %0 method?">;
9572def note_format_security_fixit: Note<
9573  "treat the string as an argument to avoid this">;
9574
9575def warn_null_arg : Warning<
9576  "null passed to a callee that requires a non-null argument">,
9577  InGroup<NonNull>;
9578def warn_null_ret : Warning<
9579  "null returned from %select{function|method}0 that requires a non-null return value">,
9580  InGroup<NonNull>;
9581
9582def err_lifetimebound_no_object_param : Error<
9583  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
9584  "function has no implicit object parameter">;
9585def err_lifetimebound_ctor_dtor : Error<
9586  "'lifetimebound' attribute cannot be applied to a "
9587  "%select{constructor|destructor}0">;
9588
9589// CHECK: returning address/reference of stack memory
9590def warn_ret_stack_addr_ref : Warning<
9591  "%select{address of|reference to}0 stack memory associated with "
9592  "%select{local variable|parameter}2 %1 returned">,
9593  InGroup<ReturnStackAddress>;
9594def warn_ret_local_temp_addr_ref : Warning<
9595  "returning %select{address of|reference to}0 local temporary object">,
9596  InGroup<ReturnStackAddress>;
9597def warn_ret_addr_label : Warning<
9598  "returning address of label, which is local">,
9599  InGroup<ReturnStackAddress>;
9600def err_ret_local_block : Error<
9601  "returning block that lives on the local stack">;
9602def note_local_var_initializer : Note<
9603  "%select{via initialization of|binding reference}0 variable "
9604  "%select{%2 |}1here">;
9605def note_lambda_capture_initializer : Note<
9606  "%select{implicitly |}2captured%select{| by reference}3"
9607  "%select{%select{ due to use|}2 here|"
9608  " via initialization of lambda capture %0}1">;
9609def note_init_with_default_member_initalizer : Note<
9610  "initializing field %0 with default member initializer">;
9611
9612// Check for initializing a member variable with the address or a reference to
9613// a constructor parameter.
9614def warn_bind_ref_member_to_parameter : Warning<
9615  "binding reference member %0 to stack allocated "
9616  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9617def warn_init_ptr_member_to_parameter_addr : Warning<
9618  "initializing pointer member %0 with the stack address of "
9619  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9620def note_ref_or_ptr_member_declared_here : Note<
9621  "%select{reference|pointer}0 member declared here">;
9622
9623def err_dangling_member : Error<
9624  "%select{reference|backing array for 'std::initializer_list'}2 "
9625  "%select{|subobject of }1member %0 "
9626  "%select{binds to|is}2 a temporary object "
9627  "whose lifetime would be shorter than the lifetime of "
9628  "the constructed object">;
9629def warn_dangling_member : Warning<
9630  "%select{reference|backing array for 'std::initializer_list'}2 "
9631  "%select{|subobject of }1member %0 "
9632  "%select{binds to|is}2 a temporary object "
9633  "whose lifetime is shorter than the lifetime of the constructed object">,
9634  InGroup<DanglingField>;
9635def warn_dangling_lifetime_pointer_member : Warning<
9636  "initializing pointer member %0 to point to a temporary object "
9637  "whose lifetime is shorter than the lifetime of the constructed object">,
9638  InGroup<DanglingGsl>;
9639def note_lifetime_extending_member_declared_here : Note<
9640  "%select{%select{reference|'std::initializer_list'}0 member|"
9641  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
9642  "declared here">;
9643def warn_dangling_variable : Warning<
9644  "%select{temporary %select{whose address is used as value of|"
9645  "%select{|implicitly }2bound to}4 "
9646  "%select{%select{|reference }4member of local variable|"
9647  "local %select{variable|reference}4}1|"
9648  "array backing "
9649  "%select{initializer list subobject of local variable|"
9650  "local initializer list}1}0 "
9651  "%select{%3 |}2will be destroyed at the end of the full-expression">,
9652  InGroup<Dangling>;
9653def warn_new_dangling_reference : Warning<
9654  "temporary bound to reference member of allocated object "
9655  "will be destroyed at the end of the full-expression">,
9656  InGroup<DanglingField>;
9657def warn_dangling_lifetime_pointer : Warning<
9658  "object backing the pointer "
9659  "will be destroyed at the end of the full-expression">,
9660  InGroup<DanglingGsl>;
9661def warn_new_dangling_initializer_list : Warning<
9662  "array backing "
9663  "%select{initializer list subobject of the allocated object|"
9664  "the allocated initializer list}0 "
9665  "will be destroyed at the end of the full-expression">,
9666  InGroup<DanglingInitializerList>;
9667def warn_unsupported_lifetime_extension : Warning<
9668  "sorry, lifetime extension of "
9669  "%select{temporary|backing array of initializer list}0 created "
9670  "by aggregate initialization using default member initializer "
9671  "is not supported; lifetime of %select{temporary|backing array}0 "
9672  "will end at the end of the full-expression">, InGroup<Dangling>;
9673
9674// For non-floating point, expressions of the form x == x or x != x
9675// should result in a warning, since these always evaluate to a constant.
9676// Array comparisons have similar warnings
9677def warn_comparison_always : Warning<
9678  "%select{self-|array }0comparison always evaluates to "
9679  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
9680  InGroup<TautologicalCompare>;
9681def warn_comparison_bitwise_always : Warning<
9682  "bitwise comparison always evaluates to %select{false|true}0">,
9683  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9684def warn_comparison_bitwise_or : Warning<
9685  "bitwise or with non-zero value always evaluates to true">,
9686  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9687def warn_tautological_overlap_comparison : Warning<
9688  "overlapping comparisons always evaluate to %select{false|true}0">,
9689  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
9690def warn_depr_array_comparison : Warning<
9691  "comparison between two arrays is deprecated; "
9692  "to compare array addresses, use unary '+' to decay operands to pointers">,
9693  InGroup<DeprecatedArrayCompare>;
9694
9695def warn_stringcompare : Warning<
9696  "result of comparison against %select{a string literal|@encode}0 is "
9697  "unspecified (use an explicit string comparison function instead)">,
9698  InGroup<StringCompare>;
9699
9700def warn_identity_field_assign : Warning<
9701  "assigning %select{field|instance variable}0 to itself">,
9702  InGroup<SelfAssignmentField>;
9703
9704// Type safety attributes
9705def err_type_tag_for_datatype_not_ice : Error<
9706  "'type_tag_for_datatype' attribute requires the initializer to be "
9707  "an %select{integer|integral}0 constant expression">;
9708def err_type_tag_for_datatype_too_large : Error<
9709  "'type_tag_for_datatype' attribute requires the initializer to be "
9710  "an %select{integer|integral}0 constant expression "
9711  "that can be represented by a 64 bit integer">;
9712def err_tag_index_out_of_range : Error<
9713  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
9714def warn_type_tag_for_datatype_wrong_kind : Warning<
9715  "this type tag was not designed to be used with this function">,
9716  InGroup<TypeSafety>;
9717def warn_type_safety_type_mismatch : Warning<
9718  "argument type %0 doesn't match specified %1 type tag "
9719  "%select{that requires %3|}2">, InGroup<TypeSafety>;
9720def warn_type_safety_null_pointer_required : Warning<
9721  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
9722
9723// Generic selections.
9724def err_assoc_type_incomplete : Error<
9725  "type %0 in generic association incomplete">;
9726def err_assoc_type_nonobject : Error<
9727  "type %0 in generic association not an object type">;
9728def err_assoc_type_variably_modified : Error<
9729  "type %0 in generic association is a variably modified type">;
9730def err_assoc_compatible_types : Error<
9731  "type %0 in generic association compatible with previously specified type %1">;
9732def note_compat_assoc : Note<
9733  "compatible type %0 specified here">;
9734def err_generic_sel_no_match : Error<
9735  "controlling expression type %0 not compatible with any generic association type">;
9736def err_generic_sel_multi_match : Error<
9737  "controlling expression type %0 compatible with %1 generic association types">;
9738
9739
9740// Blocks
9741def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
9742  " or %select{pick a deployment target that supports them|for OpenCL C 2.0"
9743  " or OpenCL C 3.0 with __opencl_c_device_enqueue feature}0">;
9744def err_block_returning_array_function : Error<
9745  "block cannot return %select{array|function}0 type %1">;
9746
9747// Builtin annotation
9748def err_builtin_annotation_first_arg : Error<
9749  "first argument to __builtin_annotation must be an integer">;
9750def err_builtin_annotation_second_arg : Error<
9751  "second argument to __builtin_annotation must be a non-wide string constant">;
9752def err_msvc_annotation_wide_str : Error<
9753  "arguments to __annotation must be wide string constants">;
9754
9755// CFString checking
9756def err_cfstring_literal_not_string_constant : Error<
9757  "CFString literal is not a string constant">;
9758def warn_cfstring_truncated : Warning<
9759  "input conversion stopped due to an input byte that does not "
9760  "belong to the input codeset UTF-8">,
9761  InGroup<DiagGroup<"CFString-literal">>;
9762
9763// os_log checking
9764// TODO: separate diagnostic for os_trace()
9765def err_os_log_format_not_string_constant : Error<
9766  "os_log() format argument is not a string constant">;
9767def err_os_log_argument_too_big : Error<
9768  "os_log() argument %0 is too big (%1 bytes, max %2)">;
9769def warn_os_log_format_narg : Error<
9770 "os_log() '%%n' format specifier is not allowed">, DefaultError;
9771
9772// Statements.
9773def err_continue_not_in_loop : Error<
9774  "'continue' statement not in loop statement">;
9775def err_break_not_in_loop_or_switch : Error<
9776  "'break' statement not in loop or switch statement">;
9777def warn_loop_ctrl_binds_to_inner : Warning<
9778  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
9779  InGroup<GccCompat>;
9780def warn_break_binds_to_switch : Warning<
9781  "'break' is bound to loop, GCC binds it to switch">,
9782  InGroup<GccCompat>;
9783def err_default_not_in_switch : Error<
9784  "'default' statement not in switch statement">;
9785def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
9786def warn_bool_switch_condition : Warning<
9787  "switch condition has boolean value">, InGroup<SwitchBool>;
9788def warn_case_value_overflow : Warning<
9789  "overflow converting case value to switch condition type (%0 to %1)">,
9790  InGroup<Switch>;
9791def err_duplicate_case : Error<"duplicate case value '%0'">;
9792def err_duplicate_case_differing_expr : Error<
9793  "duplicate case value: '%0' and '%1' both equal '%2'">;
9794def warn_case_empty_range : Warning<"empty case range specified">;
9795def warn_missing_case_for_condition :
9796  Warning<"no case matching constant switch condition '%0'">;
9797
9798def warn_def_missing_case : Warning<"%plural{"
9799  "1:enumeration value %1 not explicitly handled in switch|"
9800  "2:enumeration values %1 and %2 not explicitly handled in switch|"
9801  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
9802  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
9803  InGroup<SwitchEnum>, DefaultIgnore;
9804
9805def warn_missing_case : Warning<"%plural{"
9806  "1:enumeration value %1 not handled in switch|"
9807  "2:enumeration values %1 and %2 not handled in switch|"
9808  "3:enumeration values %1, %2, and %3 not handled in switch|"
9809  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
9810  InGroup<Switch>;
9811
9812def warn_unannotated_fallthrough : Warning<
9813  "unannotated fall-through between switch labels">,
9814  InGroup<ImplicitFallthrough>, DefaultIgnore;
9815def warn_unannotated_fallthrough_per_function : Warning<
9816  "unannotated fall-through between switch labels in partly-annotated "
9817  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
9818def note_insert_fallthrough_fixit : Note<
9819  "insert '%0;' to silence this warning">;
9820def note_insert_break_fixit : Note<
9821  "insert 'break;' to avoid fall-through">;
9822def err_fallthrough_attr_wrong_target : Error<
9823  "%0 attribute is only allowed on empty statements">;
9824def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
9825def err_fallthrough_attr_outside_switch : Error<
9826  "fallthrough annotation is outside switch statement">;
9827def err_fallthrough_attr_invalid_placement : Error<
9828  "fallthrough annotation does not directly precede switch label">;
9829
9830def warn_unreachable_default : Warning<
9831  "default label in switch which covers all enumeration values">,
9832  InGroup<CoveredSwitchDefault>, DefaultIgnore;
9833def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
9834  InGroup<Switch>;
9835def warn_not_in_enum_assignment : Warning<"integer constant not in range "
9836  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
9837def err_typecheck_statement_requires_scalar : Error<
9838  "statement requires expression of scalar type (%0 invalid)">;
9839def err_typecheck_statement_requires_integer : Error<
9840  "statement requires expression of integer type (%0 invalid)">;
9841def err_multiple_default_labels_defined : Error<
9842  "multiple default labels in one switch">;
9843def err_switch_multiple_conversions : Error<
9844  "multiple conversions from switch condition type %0 to an integral or "
9845  "enumeration type">;
9846def note_switch_conversion : Note<
9847  "conversion to %select{integral|enumeration}0 type %1">;
9848def err_switch_explicit_conversion : Error<
9849  "switch condition type %0 requires explicit conversion to %1">;
9850def err_switch_incomplete_class_type : Error<
9851  "switch condition has incomplete class type %0">;
9852
9853def warn_empty_if_body : Warning<
9854  "if statement has empty body">, InGroup<EmptyBody>;
9855def warn_empty_for_body : Warning<
9856  "for loop has empty body">, InGroup<EmptyBody>;
9857def warn_empty_range_based_for_body : Warning<
9858  "range-based for loop has empty body">, InGroup<EmptyBody>;
9859def warn_empty_while_body : Warning<
9860  "while loop has empty body">, InGroup<EmptyBody>;
9861def warn_empty_switch_body : Warning<
9862  "switch statement has empty body">, InGroup<EmptyBody>;
9863def note_empty_body_on_separate_line : Note<
9864  "put the semicolon on a separate line to silence this warning">;
9865
9866def err_va_start_captured_stmt : Error<
9867  "'va_start' cannot be used in a captured statement">;
9868def err_va_start_outside_function : Error<
9869  "'va_start' cannot be used outside a function">;
9870def err_va_start_fixed_function : Error<
9871  "'va_start' used in function with fixed args">;
9872def err_va_start_used_in_wrong_abi_function : Error<
9873  "'va_start' used in %select{System V|Win64}0 ABI function">;
9874def err_ms_va_start_used_in_sysv_function : Error<
9875  "'__builtin_ms_va_start' used in System V ABI function">;
9876def warn_second_arg_of_va_start_not_last_named_param : Warning<
9877  "second argument to 'va_start' is not the last named parameter">,
9878  InGroup<Varargs>;
9879def warn_c17_compat_ellipsis_only_parameter : Warning<
9880  "'...' as the only parameter of a function is incompatible with C standards "
9881  "before C2x">, DefaultIgnore, InGroup<CPre2xCompat>;
9882def warn_va_start_type_is_undefined : Warning<
9883  "passing %select{an object that undergoes default argument promotion|"
9884  "an object of reference type|a parameter declared with the 'register' "
9885  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
9886def err_first_argument_to_va_arg_not_of_type_va_list : Error<
9887  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
9888def err_second_parameter_to_va_arg_incomplete: Error<
9889  "second argument to 'va_arg' is of incomplete type %0">;
9890def err_second_parameter_to_va_arg_abstract: Error<
9891  "second argument to 'va_arg' is of abstract type %0">;
9892def warn_second_parameter_to_va_arg_not_pod : Warning<
9893  "second argument to 'va_arg' is of non-POD type %0">,
9894  InGroup<NonPODVarargs>, DefaultError;
9895def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
9896  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
9897  InGroup<NonPODVarargs>, DefaultError;
9898def warn_second_parameter_to_va_arg_never_compatible : Warning<
9899  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
9900  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
9901
9902def warn_return_missing_expr : Warning<
9903  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9904  InGroup<ReturnType>;
9905def ext_return_missing_expr : ExtWarn<
9906  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9907  InGroup<ReturnType>;
9908def ext_return_has_expr : ExtWarn<
9909  "%select{void function|void method|constructor|destructor}1 %0 "
9910  "should not return a value">,
9911  DefaultError, InGroup<ReturnType>;
9912def ext_return_has_void_expr : Extension<
9913  "void %select{function|method|block}1 %0 should not return void expression">;
9914def err_return_init_list : Error<
9915  "%select{void function|void method|constructor|destructor}1 %0 "
9916  "must not return a value">;
9917def err_ctor_dtor_returns_void : Error<
9918  "%select{constructor|destructor}1 %0 must not return void expression">;
9919def warn_noreturn_function_has_return_expr : Warning<
9920  "function %0 declared 'noreturn' should not return">,
9921  InGroup<InvalidNoreturn>;
9922def warn_falloff_noreturn_function : Warning<
9923  "function declared 'noreturn' should not return">,
9924  InGroup<InvalidNoreturn>;
9925def err_noreturn_block_has_return_expr : Error<
9926  "block declared 'noreturn' should not return">;
9927def err_carries_dependency_missing_on_first_decl : Error<
9928  "%select{function|parameter}0 declared '[[carries_dependency]]' "
9929  "after its first declaration">;
9930def note_carries_dependency_missing_first_decl : Note<
9931  "declaration missing '[[carries_dependency]]' attribute is here">;
9932def err_carries_dependency_param_not_function_decl : Error<
9933  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
9934  "declaration or lambda">;
9935def err_block_on_nonlocal : Error<
9936  "__block attribute not allowed, only allowed on local variables">;
9937def err_block_on_vm : Error<
9938  "__block attribute not allowed on declaration with a variably modified type">;
9939def err_sizeless_nonlocal : Error<
9940  "non-local variable with sizeless type %0">;
9941
9942def err_vec_builtin_non_vector : Error<
9943 "first two arguments to %0 must be vectors">;
9944def err_vec_builtin_incompatible_vector : Error<
9945  "first two arguments to %0 must have the same type">;
9946def err_vsx_builtin_nonconstant_argument : Error<
9947  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
9948
9949def err_shufflevector_nonconstant_argument : Error<
9950  "index for __builtin_shufflevector must be a constant integer">;
9951def err_shufflevector_argument_too_large : Error<
9952  "index for __builtin_shufflevector must be less than the total number "
9953  "of vector elements">;
9954
9955def err_convertvector_non_vector : Error<
9956  "first argument to __builtin_convertvector must be a vector">;
9957def err_convertvector_non_vector_type : Error<
9958  "second argument to __builtin_convertvector must be a vector type">;
9959def err_convertvector_incompatible_vector : Error<
9960  "first two arguments to __builtin_convertvector must have the same number of elements">;
9961
9962def err_first_argument_to_cwsc_not_call : Error<
9963  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
9964def err_first_argument_to_cwsc_block_call : Error<
9965  "first argument to __builtin_call_with_static_chain must not be a block call">;
9966def err_first_argument_to_cwsc_builtin_call : Error<
9967  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
9968def err_first_argument_to_cwsc_pdtor_call : Error<
9969  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
9970def err_second_argument_to_cwsc_not_pointer : Error<
9971  "second argument to __builtin_call_with_static_chain must be of pointer type">;
9972
9973def err_vector_incorrect_num_initializers : Error<
9974  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
9975def err_altivec_empty_initializer : Error<"expected initializer">;
9976
9977def err_invalid_neon_type_code : Error<
9978  "incompatible constant for this __builtin_neon function">;
9979def err_argument_invalid_range : Error<
9980  "argument value %0 is outside the valid range [%1, %2]">;
9981def warn_argument_invalid_range : Warning<
9982  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
9983  InGroup<DiagGroup<"argument-outside-range">>;
9984def warn_argument_undefined_behaviour : Warning<
9985  "argument value %0 will result in undefined behaviour">,
9986  InGroup<DiagGroup<"argument-undefined-behaviour">>;
9987def err_argument_not_multiple : Error<
9988  "argument should be a multiple of %0">;
9989def err_argument_not_power_of_2 : Error<
9990  "argument should be a power of 2">;
9991def err_argument_not_shifted_byte : Error<
9992  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
9993def err_argument_not_shifted_byte_or_xxff : Error<
9994  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9995def err_argument_not_contiguous_bit_field : Error<
9996  "argument %0 value should represent a contiguous bit field">;
9997def err_rotation_argument_to_cadd : Error<
9998  "argument should be the value 90 or 270">;
9999def err_rotation_argument_to_cmla : Error<
10000  "argument should be the value 0, 90, 180 or 270">;
10001def warn_neon_vector_initializer_non_portable : Warning<
10002  "vector initializers are not compatible with NEON intrinsics in big endian "
10003  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
10004def note_neon_vector_initializer_non_portable : Note<
10005  "consider using vld1_%0%1() to initialize a vector from memory, or "
10006  "vcreate_%0%1() to initialize from an integer constant">;
10007def note_neon_vector_initializer_non_portable_q : Note<
10008  "consider using vld1q_%0%1() to initialize a vector from memory, or "
10009  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
10010  "constants">;
10011def err_systemz_invalid_tabort_code : Error<
10012  "invalid transaction abort code">;
10013def err_64_bit_builtin_32_bit_tgt : Error<
10014  "this builtin is only available on 64-bit targets">;
10015def err_32_bit_builtin_64_bit_tgt : Error<
10016  "this builtin is only available on 32-bit targets">;
10017def err_builtin_x64_aarch64_only : Error<
10018  "this builtin is only available on x86-64 and aarch64 targets">;
10019def err_mips_builtin_requires_dsp : Error<
10020  "this builtin requires 'dsp' ASE, please use -mdsp">;
10021def err_mips_builtin_requires_dspr2 : Error<
10022  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
10023def err_mips_builtin_requires_msa : Error<
10024  "this builtin requires 'msa' ASE, please use -mmsa">;
10025def err_ppc_builtin_only_on_arch : Error<
10026  "this builtin is only valid on POWER%0 or later CPUs">;
10027def err_ppc_builtin_requires_vsx : Error<
10028  "this builtin requires VSX to be enabled">;
10029def err_ppc_builtin_requires_htm : Error<
10030  "this builtin requires HTM to be enabled">;
10031def err_ppc_builtin_requires_abi : Error<
10032  "this builtin requires ABI -mabi=%0">;
10033def err_ppc_invalid_use_mma_type : Error<
10034  "invalid use of PPC MMA type">;
10035def err_ppc_invalid_test_data_class_type : Error<
10036  "expected a 'float', 'double' or '__float128' for the first argument">;
10037def err_x86_builtin_invalid_rounding : Error<
10038  "invalid rounding argument">;
10039def err_x86_builtin_invalid_scale : Error<
10040  "scale argument must be 1, 2, 4, or 8">;
10041def err_x86_builtin_tile_arg_duplicate : Error<
10042  "tile arguments must refer to different tiles">;
10043
10044def err_builtin_target_unsupported : Error<
10045  "builtin is not supported on this target">;
10046def err_builtin_longjmp_unsupported : Error<
10047  "__builtin_longjmp is not supported for the current target">;
10048def err_builtin_setjmp_unsupported : Error<
10049  "__builtin_setjmp is not supported for the current target">;
10050
10051def err_builtin_longjmp_invalid_val : Error<
10052  "argument to __builtin_longjmp must be a constant 1">;
10053def err_builtin_requires_language : Error<"'%0' is only available in %1">;
10054
10055def err_constant_integer_arg_type : Error<
10056  "argument to %0 must be a constant integer">;
10057
10058def ext_mixed_decls_code : Extension<
10059  "mixing declarations and code is a C99 extension">,
10060  InGroup<DeclarationAfterStatement>;
10061def warn_mixed_decls_code : Warning<
10062  "mixing declarations and code is incompatible with standards before C99">,
10063  InGroup<DeclarationAfterStatement>, DefaultIgnore;
10064
10065def err_non_local_variable_decl_in_for : Error<
10066  "declaration of non-local variable in 'for' loop">;
10067def err_non_variable_decl_in_for : Error<
10068  "non-variable declaration in 'for' loop">;
10069def err_toomany_element_decls : Error<
10070  "only one element declaration is allowed">;
10071def err_selector_element_not_lvalue : Error<
10072  "selector element is not a valid lvalue">;
10073def err_selector_element_type : Error<
10074  "selector element type %0 is not a valid object">;
10075def err_selector_element_const_type : Error<
10076  "selector element of type %0 cannot be a constant lvalue expression">;
10077def err_collection_expr_type : Error<
10078  "the type %0 is not a pointer to a fast-enumerable object">;
10079def warn_collection_expr_type : Warning<
10080  "collection expression type %0 may not respond to %1">;
10081
10082def err_invalid_conversion_between_ext_vectors : Error<
10083  "invalid conversion between ext-vector type %0 and %1">;
10084
10085def warn_duplicate_attribute_exact : Warning<
10086  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
10087
10088def warn_duplicate_attribute : Warning<
10089  "attribute %0 is already applied with different arguments">,
10090  InGroup<IgnoredAttributes>;
10091def err_disallowed_duplicate_attribute : Error<
10092  "attribute %0 cannot appear more than once on a declaration">;
10093
10094def warn_sync_fetch_and_nand_semantics_change : Warning<
10095  "the semantics of this intrinsic changed with GCC "
10096  "version 4.4 - the newer semantics are provided here">,
10097  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
10098
10099// Type
10100def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
10101  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
10102def warn_receiver_forward_class : Warning<
10103  "receiver %0 is a forward class and corresponding @interface may not exist">,
10104  InGroup<ForwardClassReceiver>;
10105def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
10106def ext_missing_type_specifier : ExtWarn<
10107  "type specifier missing, defaults to 'int'; ISO C99 and later do not support "
10108  "implicit int">, InGroup<ImplicitInt>;
10109def err_missing_type_specifier : Error<
10110  "a type specifier is required for all declarations">;
10111def err_decimal_unsupported : Error<
10112  "GNU decimal type extension not supported">;
10113def err_objc_array_of_interfaces : Error<
10114  "array of interface %0 is invalid (probably should be an array of pointers)">;
10115def ext_c99_array_usage : Extension<
10116  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
10117  "feature">, InGroup<C99>;
10118def err_c99_array_usage_cxx : Error<
10119  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
10120  "feature, not permitted in C++">;
10121def err_type_unsupported : Error<
10122  "%0 is not supported on this target">;
10123def err_nsconsumed_attribute_mismatch : Error<
10124  "overriding method has mismatched ns_consumed attribute on its"
10125  " parameter">;
10126def err_nsreturns_retained_attribute_mismatch : Error<
10127  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
10128  " attributes">;
10129def err_nserrordomain_invalid_decl : Error<
10130  "domain argument %select{|%1 }0does not refer to global constant">;
10131def err_nserrordomain_wrong_type : Error<
10132  "domain argument %0 does not point to an NSString or CFString constant">;
10133
10134def warn_nsconsumed_attribute_mismatch : Warning<
10135  err_nsconsumed_attribute_mismatch.Summary>, InGroup<NSConsumedMismatch>;
10136def warn_nsreturns_retained_attribute_mismatch : Warning<
10137  err_nsreturns_retained_attribute_mismatch.Summary>, InGroup<NSReturnsMismatch>;
10138
10139def note_getter_unavailable : Note<
10140  "or because setter is declared here, but no getter method %0 is found">;
10141def err_invalid_protocol_qualifiers : Error<
10142  "invalid protocol qualifiers on non-ObjC type">;
10143def warn_ivar_use_hidden : Warning<
10144  "local declaration of %0 hides instance variable">,
10145   InGroup<ShadowIvar>;
10146def warn_direct_initialize_call : Warning<
10147  "explicit call to +initialize results in duplicate call to +initialize">,
10148   InGroup<ExplicitInitializeCall>;
10149def warn_direct_super_initialize_call : Warning<
10150  "explicit call to [super initialize] should only be in implementation "
10151  "of +initialize">,
10152   InGroup<ExplicitInitializeCall>;
10153def err_ivar_use_in_class_method : Error<
10154  "instance variable %0 accessed in class method">;
10155def err_private_ivar_access : Error<"instance variable %0 is private">,
10156  AccessControl;
10157def err_protected_ivar_access : Error<"instance variable %0 is protected">,
10158  AccessControl;
10159def warn_maynot_respond : Warning<"%0 may not respond to %1">;
10160def ext_typecheck_base_super : Warning<
10161  "method parameter type "
10162  "%diff{$ does not match super class method parameter type $|"
10163  "does not match super class method parameter type}0,1">,
10164   InGroup<SuperSubClassMismatch>, DefaultIgnore;
10165def warn_missing_method_return_type : Warning<
10166  "method has no return type specified; defaults to 'id'">,
10167  InGroup<MissingMethodReturnType>, DefaultIgnore;
10168def warn_direct_ivar_access : Warning<"instance variable %0 is being "
10169  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
10170
10171// Spell-checking diagnostics
10172def err_unknown_typename : Error<
10173  "unknown type name %0">;
10174def err_unknown_type_or_class_name_suggest : Error<
10175  "unknown %select{type|class}1 name %0; did you mean %2?">;
10176def err_unknown_typename_suggest : Error<
10177  "unknown type name %0; did you mean %1?">;
10178def err_unknown_nested_typename_suggest : Error<
10179  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
10180def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
10181def err_undeclared_use_suggest : Error<
10182  "use of undeclared %0; did you mean %1?">;
10183def err_undeclared_var_use_suggest : Error<
10184  "use of undeclared identifier %0; did you mean %1?">;
10185def err_no_template : Error<"no template named %0">;
10186def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
10187def err_no_member_template : Error<"no template named %0 in %1">;
10188def err_no_member_template_suggest : Error<
10189  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
10190def err_non_template_in_template_id : Error<
10191  "%0 does not name a template but is followed by template arguments">;
10192def err_non_template_in_template_id_suggest : Error<
10193  "%0 does not name a template but is followed by template arguments; "
10194  "did you mean %1?">;
10195def err_non_template_in_member_template_id_suggest : Error<
10196  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
10197def note_non_template_in_template_id_found : Note<
10198  "non-template declaration found by name lookup">;
10199def err_mem_init_not_member_or_class_suggest : Error<
10200  "initializer %0 does not name a non-static data member or base "
10201  "class; did you mean the %select{base class|member}1 %2?">;
10202def err_field_designator_unknown_suggest : Error<
10203  "field designator %0 does not refer to any field in type %1; did you mean "
10204  "%2?">;
10205def err_typecheck_member_reference_ivar_suggest : Error<
10206  "%0 does not have a member named %1; did you mean %2?">;
10207def err_property_not_found_suggest : Error<
10208  "property %0 not found on object of type %1; did you mean %2?">;
10209def err_class_property_found : Error<
10210  "property %0 is a class property; did you mean to access it with class '%1'?">;
10211def err_ivar_access_using_property_syntax_suggest : Error<
10212  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
10213def warn_property_access_suggest : Warning<
10214"property %0 not found on object of type %1; did you mean to access property %2?">,
10215InGroup<PropertyAccessDotSyntax>;
10216def err_property_found_suggest : Error<
10217  "property %0 found on object of type %1; did you mean to access "
10218  "it with the \".\" operator?">;
10219def err_undef_interface_suggest : Error<
10220  "cannot find interface declaration for %0; did you mean %1?">;
10221def warn_undef_interface_suggest : Warning<
10222  "cannot find interface declaration for %0; did you mean %1?">;
10223def err_undef_superclass_suggest : Error<
10224  "cannot find interface declaration for %0, superclass of %1; did you mean "
10225  "%2?">;
10226def err_undeclared_protocol_suggest : Error<
10227  "cannot find protocol declaration for %0; did you mean %1?">;
10228def note_base_class_specified_here : Note<
10229  "base class %0 specified here">;
10230def err_using_directive_suggest : Error<
10231  "no namespace named %0; did you mean %1?">;
10232def err_using_directive_member_suggest : Error<
10233  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
10234def note_namespace_defined_here : Note<"namespace %0 defined here">;
10235def err_sizeof_pack_no_pack_name_suggest : Error<
10236  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
10237def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
10238
10239def err_uncasted_use_of_unknown_any : Error<
10240  "%0 has unknown type; cast it to its declared type to use it">;
10241def err_uncasted_call_of_unknown_any : Error<
10242  "%0 has unknown return type; cast the call to its declared return type">;
10243def err_uncasted_send_to_unknown_any_method : Error<
10244  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
10245  "message send to the method's return type">;
10246def err_unsupported_unknown_any_decl : Error<
10247  "%0 has unknown type, which is not supported for this kind of declaration">;
10248def err_unsupported_unknown_any_expr : Error<
10249  "unsupported expression with unknown type">;
10250def err_unsupported_unknown_any_call : Error<
10251  "call to unsupported expression with unknown type">;
10252def err_unknown_any_addrof : Error<
10253  "the address of a declaration with unknown type "
10254  "can only be cast to a pointer type">;
10255def err_unknown_any_addrof_call : Error<
10256  "address-of operator cannot be applied to a call to a function with "
10257  "unknown return type">;
10258def err_unknown_any_var_function_type : Error<
10259  "variable %0 with unknown type cannot be given a function type">;
10260def err_unknown_any_function : Error<
10261  "function %0 with unknown type must be given a function type">;
10262
10263def err_filter_expression_integral : Error<
10264  "filter expression has non-integral type %0">;
10265
10266def err_non_asm_stmt_in_naked_function : Error<
10267  "non-ASM statement in naked function is not supported">;
10268def err_asm_naked_this_ref : Error<
10269  "'this' pointer references not allowed in naked functions">;
10270def err_asm_naked_parm_ref : Error<
10271  "parameter references not allowed in naked functions">;
10272
10273// OpenCL warnings and errors.
10274def err_invalid_astype_of_different_size : Error<
10275  "invalid reinterpretation: sizes of %0 and %1 must match">;
10276def err_static_kernel : Error<
10277  "kernel functions cannot be declared static">;
10278def err_method_kernel : Error<
10279  "kernel functions cannot be class members">;
10280def err_template_kernel : Error<
10281  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
10282def err_opencl_ptrptr_kernel_param : Error<
10283  "kernel parameter cannot be declared as a pointer to a pointer">;
10284def err_kernel_arg_address_space : Error<
10285  "pointer arguments to kernel functions must reside in '__global', "
10286  "'__constant' or '__local' address space">;
10287def err_opencl_ext_vector_component_invalid_length : Error<
10288  "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
10289def err_opencl_function_variable : Error<
10290  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
10291def err_opencl_addrspace_scope : Error<
10292  "variables in the %0 address space can only be declared in the outermost "
10293  "scope of a kernel function">;
10294def err_static_function_scope : Error<
10295  "variables in function scope cannot be declared static">;
10296def err_opencl_bitfields : Error<
10297  "bit-fields are not supported in OpenCL">;
10298def err_opencl_vla : Error<
10299  "variable length arrays are not supported in OpenCL">;
10300def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
10301    "scalar operand type has greater rank than the type of the vector "
10302    "element. (%0 and %1)">;
10303def err_bad_kernel_param_type : Error<
10304  "%0 cannot be used as the type of a kernel parameter">;
10305def err_record_with_pointers_kernel_param : Error<
10306  "%select{struct|union}0 kernel parameters may not contain pointers">;
10307def note_within_field_of_type : Note<
10308  "within field of type %0 declared here">;
10309def note_illegal_field_declared_here : Note<
10310  "field of illegal %select{type|pointer type}0 %1 declared here">;
10311def err_opencl_type_struct_or_union_field : Error<
10312  "the %0 type cannot be used to declare a structure or union field">;
10313def err_event_t_addr_space_qual : Error<
10314  "the event_t type can only be used with __private address space qualifier">;
10315def err_expected_kernel_void_return_type : Error<
10316  "kernel must have void return type">;
10317def err_sampler_initializer_not_integer : Error<
10318  "sampler_t initialization requires 32-bit integer, not %0">;
10319def warn_sampler_initializer_invalid_bits : Warning<
10320  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
10321def err_sampler_argument_required : Error<
10322  "sampler_t variable required - got %0">;
10323def err_wrong_sampler_addressspace: Error<
10324  "sampler type cannot be used with the __local and __global address space qualifiers">;
10325def err_opencl_nonconst_global_sampler : Error<
10326  "global sampler requires a const or constant address space qualifier">;
10327def err_opencl_cast_non_zero_to_event_t : Error<
10328  "cannot cast non-zero value '%0' to 'event_t'">;
10329def err_opencl_global_invalid_addr_space : Error<
10330  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
10331def err_missing_actual_pipe_type : Error<
10332  "missing actual type specifier for pipe">;
10333def err_reference_pipe_type : Error <
10334  "pipes packet types cannot be of reference type">;
10335def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
10336def err_opencl_kernel_attr :
10337  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
10338def err_return_value_with_address_space : Error<
10339  "return type cannot be qualified with address space">;
10340def err_opencl_constant_no_init : Error<
10341  "variable in constant address space must be initialized">;
10342def err_opencl_atomic_init: Error<
10343  "atomic variable can be %select{assigned|initialized}0 to a variable only "
10344  "in global address space">;
10345def err_opencl_implicit_vector_conversion : Error<
10346  "implicit conversions between vector types (%0 and %1) are not permitted">;
10347def err_opencl_invalid_type_array : Error<
10348  "array of %0 type is invalid in OpenCL">;
10349def err_opencl_ternary_with_block : Error<
10350  "block type cannot be used as expression in ternary expression in OpenCL">;
10351def err_opencl_pointer_to_type : Error<
10352  "pointer to type %0 is invalid in OpenCL">;
10353def err_opencl_type_can_only_be_used_as_function_parameter : Error <
10354  "type %0 can only be used as a function parameter in OpenCL">;
10355def err_opencl_type_not_found : Error<
10356  "%0 type %1 not found; include the base header with -finclude-default-header">;
10357def warn_opencl_attr_deprecated_ignored : Warning <
10358  "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>;
10359def err_opencl_variadic_function : Error<
10360  "invalid prototype, variadic arguments are not allowed in OpenCL">;
10361def err_opencl_requires_extension : Error<
10362  "use of %select{type|declaration}0 %1 requires %2 support">;
10363def ext_opencl_double_without_pragma : Extension<
10364  "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
10365  " supported">;
10366def warn_opencl_generic_address_space_arg : Warning<
10367  "passing non-generic address space pointer to %0"
10368  " may cause dynamic conversion affecting performance">,
10369  InGroup<Conversion>, DefaultIgnore;
10370
10371// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
10372def err_opencl_builtin_pipe_first_arg : Error<
10373  "first argument to %0 must be a pipe type">;
10374def err_opencl_builtin_pipe_arg_num : Error<
10375  "invalid number of arguments to function: %0">;
10376def err_opencl_builtin_pipe_invalid_arg : Error<
10377  "invalid argument type to function %0 (expecting %1 having %2)">;
10378def err_opencl_builtin_pipe_invalid_access_modifier : Error<
10379  "invalid pipe access modifier (expecting %0)">;
10380
10381// OpenCL access qualifier
10382def err_opencl_invalid_access_qualifier : Error<
10383  "access qualifier can only be used for pipe and image type">;
10384def err_opencl_invalid_read_write : Error<
10385  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 "
10386  "and without __opencl_c_read_write_images feature}2">;
10387def err_opencl_multiple_access_qualifiers : Error<
10388  "multiple access qualifiers">;
10389def note_opencl_typedef_access_qualifier : Note<
10390  "previously declared '%0' here">;
10391
10392// OpenCL v2.0 s6.12.5 Blocks restrictions
10393def err_opencl_block_storage_type : Error<
10394  "the __block storage type is not permitted">;
10395def err_opencl_invalid_block_declaration : Error<
10396  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
10397def err_opencl_extern_block_declaration : Error<
10398  "invalid block variable declaration - using 'extern' storage class is disallowed">;
10399def err_opencl_block_ref_block : Error<
10400  "cannot refer to a block inside block">;
10401
10402// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
10403def err_opencl_builtin_to_addr_invalid_arg : Error<
10404  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
10405
10406// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
10407def err_opencl_enqueue_kernel_incorrect_args : Error<
10408  "illegal call to enqueue_kernel, incorrect argument types">;
10409def err_opencl_enqueue_kernel_local_size_args : Error<
10410  "mismatch in number of block parameters and local size arguments passed">;
10411def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
10412  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
10413def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
10414  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
10415def err_opencl_enqueue_kernel_blocks_no_args : Error<
10416  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
10417
10418def err_opencl_builtin_expected_type : Error<
10419  "illegal call to %0, expected %1 argument type">;
10420
10421// OpenCL v3.0 s6.3.7 - Vector Components
10422def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
10423  "vector component name '%0' is a feature from OpenCL version 3.0 onwards">,
10424  InGroup<OpenCLUnsupportedRGBA>;
10425
10426def err_openclcxx_placement_new : Error<
10427  "use of placement new requires explicit declaration">;
10428
10429// MIG routine annotations.
10430def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
10431  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
10432  InGroup<IgnoredAttributes>;
10433
10434def warn_imp_cast_drops_unaligned : Warning<
10435  "implicit cast from type %0 to type %1 drops __unaligned qualifier">,
10436  InGroup<DiagGroup<"unaligned-qualifier-implicit-cast">>;
10437
10438} // end of sema category
10439
10440let CategoryName = "OpenMP Issue" in {
10441// OpenMP support.
10442def err_omp_expected_var_arg : Error<
10443  "%0 is not a global variable, static local variable or static data member">;
10444def err_omp_expected_var_arg_suggest : Error<
10445  "%0 is not a global variable, static local variable or static data member; "
10446  "did you mean %1">;
10447def err_omp_global_var_arg : Error<
10448  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
10449def err_omp_ref_type_arg : Error<
10450  "arguments of '#pragma omp %0' cannot be of reference type %1">;
10451def err_omp_region_not_file_context : Error<
10452  "directive must be at file or namespace scope">;
10453def err_omp_var_scope : Error<
10454  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
10455def err_omp_var_used : Error<
10456  "'#pragma omp %0' must precede all references to variable %q1">;
10457def err_omp_var_thread_local : Error<
10458  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
10459def err_omp_private_incomplete_type : Error<
10460  "a private variable with incomplete type %0">;
10461def err_omp_firstprivate_incomplete_type : Error<
10462  "a firstprivate variable with incomplete type %0">;
10463def err_omp_lastprivate_incomplete_type : Error<
10464  "a lastprivate variable with incomplete type %0">;
10465def err_omp_reduction_incomplete_type : Error<
10466  "a reduction list item with incomplete type %0">;
10467def err_omp_unexpected_clause_value : Error<
10468  "expected %0 in OpenMP clause '%1'">;
10469def err_omp_unexpected_call_to_omp_runtime_api
10470    : Error<"calls to OpenMP runtime API are not allowed within a region that "
10471            "corresponds to a construct with an order clause that specifies "
10472            "concurrent">;
10473def err_omp_expected_var_name_member_expr : Error<
10474  "expected variable name%select{| or data member of current class}0">;
10475def err_omp_expected_var_name_member_expr_with_type : Error<
10476  "expected variable%select{| or static data member|, static data member, "
10477  "or non-static data member of current class}0 of type '%1'">;
10478def err_omp_expected_var_name_member_expr_or_array_item : Error<
10479  "expected variable name%select{|, data member of current class}0, array element or array section">;
10480def err_omp_expected_addressable_lvalue_or_array_item : Error<
10481  "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">;
10482def err_omp_expected_named_var_member_or_array_expression: Error<
10483  "expected expression containing only member accesses and/or array sections based on named variables">;
10484def err_omp_bit_fields_forbidden_in_clause : Error<
10485  "bit fields cannot be used to specify storage in a '%0' clause">;
10486def err_array_section_does_not_specify_contiguous_storage : Error<
10487  "array section does not specify contiguous storage">;
10488def err_array_section_does_not_specify_length : Error<
10489  "array section does not specify length for outermost dimension">;
10490def err_omp_union_type_not_allowed : Error<
10491  "mapping of union members is not allowed">;
10492def err_omp_expected_access_to_data_field : Error<
10493  "expected access to data field">;
10494def err_omp_multiple_array_items_in_map_clause : Error<
10495  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
10496def err_omp_duplicate_map_type_modifier : Error<
10497  "same map type modifier has been specified more than once">;
10498def err_omp_duplicate_motion_modifier : Error<
10499  "same motion modifier has been specified more than once">;
10500def err_omp_pointer_mapped_along_with_derived_section : Error<
10501  "pointer cannot be mapped along with a section derived from itself">;
10502def err_omp_original_storage_is_shared_and_does_not_contain : Error<
10503  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
10504def err_omp_same_pointer_dereferenced : Error<
10505  "same pointer dereferenced in multiple different ways in map clause expressions">;
10506def note_omp_task_predetermined_firstprivate_here : Note<
10507  "predetermined as a firstprivate in a task construct here">;
10508def err_omp_threadprivate_incomplete_type : Error<
10509  "threadprivate variable with incomplete type %0">;
10510def err_omp_no_dsa_for_variable : Error<
10511  "variable %0 must have explicitly specified data sharing attributes">;
10512def err_omp_defaultmap_no_attr_for_variable : Error<
10513  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
10514def note_omp_default_dsa_none : Note<
10515  "explicit data sharing attribute requested here">;
10516def note_omp_defaultmap_attr_none : Note<
10517  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
10518def err_omp_wrong_dsa : Error<
10519  "%0 variable cannot be %1">;
10520def err_omp_variably_modified_type_not_supported : Error<
10521  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
10522def note_omp_explicit_dsa : Note<
10523  "defined as %0">;
10524def note_omp_predetermined_dsa : Note<
10525  "%select{static data member is predetermined as shared|"
10526  "variable with static storage duration is predetermined as shared|"
10527  "loop iteration variable is predetermined as private|"
10528  "loop iteration variable is predetermined as linear|"
10529  "loop iteration variable is predetermined as lastprivate|"
10530  "constant variable is predetermined as shared|"
10531  "global variable is predetermined as shared|"
10532  "non-shared variable in a task construct is predetermined as firstprivate|"
10533  "variable with automatic storage duration is predetermined as private}0"
10534  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
10535def note_omp_implicit_dsa : Note<
10536  "implicitly determined as %0">;
10537def err_omp_loop_var_dsa : Error<
10538  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
10539def err_omp_not_for : Error<
10540  "%select{statement after '#pragma omp %1' must be a for loop|"
10541  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
10542def note_omp_collapse_ordered_expr : Note<
10543  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
10544def err_omp_negative_expression_in_clause : Error<
10545  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
10546def err_omp_not_integral : Error<
10547  "expression must have integral or unscoped enumeration "
10548  "type, not %0">;
10549def err_omp_threadprivate_in_target : Error<
10550  "threadprivate variables cannot be used in target constructs">;
10551def err_omp_incomplete_type : Error<
10552  "expression has incomplete class type %0">;
10553def err_omp_explicit_conversion : Error<
10554  "expression requires explicit conversion from %0 to %1">;
10555def note_omp_conversion_here : Note<
10556  "conversion to %select{integral|enumeration}0 type %1 declared here">;
10557def err_omp_ambiguous_conversion : Error<
10558  "ambiguous conversion from type %0 to an integral or unscoped "
10559  "enumeration type">;
10560def err_omp_iterator_not_integral_or_pointer : Error<
10561  "expected integral or pointer type as the iterator-type, not %0">;
10562def err_omp_iterator_step_not_integral : Error<
10563  "iterator step expression %0 is not the integral expression">;
10564def err_omp_iterator_step_constant_zero : Error<
10565  "iterator step expression %0 evaluates to 0">;
10566def err_omp_required_access : Error<
10567  "%0 variable must be %1">;
10568def err_omp_const_variable : Error<
10569  "const-qualified variable cannot be %0">;
10570def err_omp_const_not_mutable_variable : Error<
10571  "const-qualified variable without mutable fields cannot be %0">;
10572def err_omp_const_list_item : Error<
10573  "const-qualified list item cannot be %0">;
10574def err_omp_linear_incomplete_type : Error<
10575  "a linear variable with incomplete type %0">;
10576def err_omp_linear_expected_int_or_ptr : Error<
10577  "argument of a linear clause should be of integral or pointer "
10578  "type, not %0">;
10579def warn_omp_linear_step_zero : Warning<
10580  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
10581  InGroup<OpenMPClauses>;
10582def warn_omp_alignment_not_power_of_two : Warning<
10583  "aligned clause will be ignored because the requested alignment is not a power of 2">,
10584  InGroup<OpenMPClauses>;
10585def err_omp_invalid_target_decl : Error<
10586  "%0 used in declare target directive is not a variable or a function name">;
10587def err_omp_declare_target_to_and_link : Error<
10588  "%0 must not appear in both clauses 'to' and 'link'">;
10589def warn_omp_not_in_target_context : Warning<
10590  "declaration is not declared in any declare target region">,
10591  InGroup<OpenMPTarget>;
10592def err_omp_function_in_link_clause : Error<
10593  "function name is not allowed in 'link' clause">;
10594def err_omp_aligned_expected_array_or_ptr : Error<
10595  "argument of aligned clause should be array"
10596  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
10597  ", not %0">;
10598def err_omp_used_in_clause_twice : Error<
10599  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
10600def err_omp_local_var_in_threadprivate_init : Error<
10601  "variable with local storage in initial value of threadprivate variable">;
10602def err_omp_loop_not_canonical_init : Error<
10603  "initialization clause of OpenMP for loop is not in canonical form "
10604  "('var = init' or 'T var = init')">;
10605def ext_omp_loop_not_canonical_init : ExtWarn<
10606  "initialization clause of OpenMP for loop is not in canonical form "
10607  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
10608def err_omp_loop_not_canonical_cond : Error<
10609  "condition of OpenMP for loop must be a relational comparison "
10610  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
10611def err_omp_loop_not_canonical_incr : Error<
10612  "increment clause of OpenMP for loop must perform simple addition "
10613  "or subtraction on loop variable %0">;
10614def err_omp_loop_variable_type : Error<
10615  "variable must be of integer or %select{pointer|random access iterator}0 type">;
10616def err_omp_loop_incr_not_compatible : Error<
10617  "increment expression must cause %0 to %select{decrease|increase}1 "
10618  "on each iteration of OpenMP for loop">;
10619def note_omp_loop_cond_requres_compatible_incr : Note<
10620  "loop step is expected to be %select{negative|positive}0 due to this condition">;
10621def err_omp_loop_diff_cxx : Error<
10622  "could not calculate number of iterations calling 'operator-' with "
10623  "upper and lower loop bounds">;
10624def err_omp_loop_cannot_use_stmt : Error<
10625  "'%0' statement cannot be used in OpenMP for loop">;
10626def err_omp_simd_region_cannot_use_stmt : Error<
10627  "'%0' statement cannot be used in OpenMP simd region">;
10628def warn_omp_loop_64_bit_var : Warning<
10629  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
10630  InGroup<OpenMPLoopForm>;
10631def err_omp_unknown_reduction_identifier : Error<
10632  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
10633  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
10634def err_omp_not_resolved_reduction_identifier : Error<
10635  "unable to resolve declare reduction construct for type %0">;
10636def err_omp_reduction_ref_type_arg : Error<
10637  "argument of OpenMP clause '%0' must reference the same object in all threads">;
10638def err_omp_clause_not_arithmetic_type_arg : Error<
10639  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
10640def err_omp_clause_floating_type_arg : Error<
10641  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
10642def err_omp_once_referenced : Error<
10643  "variable can appear only once in OpenMP '%0' clause">;
10644def err_omp_once_referenced_in_target_update : Error<
10645  "variable can appear only once in OpenMP 'target update' construct">;
10646def note_omp_referenced : Note<
10647  "previously referenced here">;
10648def err_omp_reduction_in_task : Error<
10649  "reduction variables may not be accessed in an explicit task">;
10650def err_omp_reduction_id_not_compatible : Error<
10651  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
10652def err_omp_reduction_identifier_mismatch : Error<
10653  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
10654def note_omp_previous_reduction_identifier : Note<
10655  "previously marked as task_reduction with different reduction operation">;
10656def err_omp_prohibited_region : Error<
10657  "region cannot be%select{| closely}0 nested inside '%1' region"
10658  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
10659  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
10660  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
10661  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
10662  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
10663def err_omp_prohibited_region_simd : Error<
10664  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
10665def err_omp_prohibited_region_atomic : Error<
10666  "OpenMP constructs may not be nested inside an atomic region">;
10667def err_omp_prohibited_region_order
10668    : Error<"construct '%0' not allowed in a region associated with a "
10669            "directive with 'order' clause">;
10670def err_omp_prohibited_region_critical_same_name : Error<
10671  "cannot nest 'critical' regions having the same name %0">;
10672def note_omp_previous_critical_region : Note<
10673  "previous 'critical' region starts here">;
10674def err_omp_several_directives_in_region : Error<
10675  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
10676def note_omp_previous_directive : Note<
10677  "previous '%0' directive used here">;
10678def err_omp_sections_not_compound_stmt : Error<
10679  "the statement for '#pragma omp sections' must be a compound statement">;
10680def err_omp_parallel_sections_not_compound_stmt : Error<
10681  "the statement for '#pragma omp parallel sections' must be a compound statement">;
10682def err_omp_orphaned_section_directive : Error<
10683  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
10684  " must be closely nested to a sections region%select{|, not a %1 region}0">;
10685def err_omp_sections_substmt_not_section : Error<
10686  "statement in 'omp sections' directive must be enclosed into a section region">;
10687def err_omp_parallel_sections_substmt_not_section : Error<
10688  "statement in 'omp parallel sections' directive must be enclosed into a section region">;
10689def err_omp_parallel_reduction_in_task_firstprivate : Error<
10690  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
10691def err_omp_atomic_read_not_expression_statement : Error<
10692  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
10693  " where v and x are both lvalue expressions with scalar type">;
10694def note_omp_atomic_read_write: Note<
10695  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
10696def err_omp_atomic_write_not_expression_statement : Error<
10697  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
10698  " where x is a lvalue expression with scalar type">;
10699def err_omp_atomic_update_not_expression_statement : Error<
10700  "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',"
10701  " where x is an lvalue expression with scalar type">;
10702def err_omp_atomic_not_expression_statement : Error<
10703  "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',"
10704  " where x is an lvalue expression with scalar type">;
10705def note_omp_atomic_update: Note<
10706  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
10707  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
10708  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
10709def err_omp_atomic_capture_not_expression_statement : Error<
10710  "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',"
10711  " where x and v are both lvalue expressions with scalar type">;
10712def err_omp_atomic_capture_not_compound_statement : Error<
10713  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
10714  " '{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;}',"
10715  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
10716  " where x is an lvalue expression with scalar type">;
10717def note_omp_atomic_capture: Note<
10718  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
10719def err_omp_atomic_compare : Error<
10720  "the statement for 'atomic compare' must be a compound statement of form '{x = expr ordop x ? expr : x;}', '{x = x ordop expr? expr : x;}',"
10721  " '{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;}',"
10722  " 'if(e == x) {x = d;}' where 'x' is an lvalue expression with scalar type, 'expr', 'e', and 'd' are expressions with scalar type,"
10723  " and 'ordop' is one of '<' or '>'.">;
10724def err_omp_atomic_compare_capture : Error<
10725  "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;}}',"
10726  " '{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;}',"
10727  " '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,"
10728  " and 'ordop' is one of '<' or '>'.">;
10729def note_omp_atomic_compare: Note<
10730  "%select{expected compound statement|expected exactly one expression statement|expected assignment statement|expected conditional operator|expect result value to be at false expression|"
10731  "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'|"
10732  "expect lvalue for result value|expect scalar value|expect integer value|unexpected 'else' statement|expect '==' operator|expect an assignment statement 'v = x'|"
10733  "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">;
10734def err_omp_atomic_several_clauses : Error<
10735  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update', 'capture', or 'compare' clause">;
10736def err_omp_several_mem_order_clauses : Error<
10737  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
10738def err_omp_atomic_incompatible_mem_order_clause : Error<
10739  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
10740def note_omp_previous_mem_order_clause : Note<
10741  "'%0' clause used here">;
10742def err_omp_target_contains_not_only_teams : Error<
10743  "target construct with nested teams region contains statements outside of the teams construct">;
10744def note_omp_nested_teams_construct_here : Note<
10745  "nested teams construct here">;
10746def note_omp_nested_statement_here : Note<
10747  "%select{statement|directive}0 outside teams construct here">;
10748def err_omp_single_copyprivate_with_nowait : Error<
10749  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
10750def err_omp_nowait_clause_without_depend: Error<
10751  "directive '#pragma omp taskwait' cannot use 'nowait' clause without 'depend' clause">;
10752def note_omp_nowait_clause_here : Note<
10753  "'nowait' clause is here">;
10754def err_omp_single_decl_in_declare_simd_variant : Error<
10755  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
10756def err_omp_function_expected : Error<
10757  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
10758def err_omp_wrong_cancel_region : Error<
10759  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
10760def err_omp_parent_cancel_region_nowait : Error<
10761  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
10762def err_omp_parent_cancel_region_ordered : Error<
10763  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
10764def 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">;
10765def 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">;
10766def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
10767def err_omp_mapper_wrong_type : Error<
10768  "mapper type must be of struct, union or class type">;
10769def err_omp_declare_mapper_wrong_var : Error<
10770  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
10771def err_omp_declare_mapper_redefinition : Error<
10772  "redefinition of user-defined mapper for type %0 with name %1">;
10773def err_omp_invalid_mapper: Error<
10774  "cannot find a valid user-defined mapper for type %0 with name %1">;
10775def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
10776def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
10777def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
10778def err_omp_typecheck_section_value : Error<
10779  "subscripted value is not an array or pointer">;
10780def err_omp_typecheck_section_not_integer : Error<
10781  "array section %select{lower bound|length}0 is not an integer">;
10782def err_omp_typecheck_shaping_not_integer : Error<
10783  "array shaping operation dimension is not an integer">;
10784def err_omp_shaping_dimension_not_positive : Error<
10785  "array shaping dimension is evaluated to a non-positive value %0">;
10786def err_omp_section_function_type : Error<
10787  "section of pointer to function type %0">;
10788def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
10789  InGroup<CharSubscript>, DefaultIgnore;
10790def err_omp_section_incomplete_type : Error<
10791  "section of pointer to incomplete type %0">;
10792def err_omp_section_not_subset_of_array : Error<
10793  "array section must be a subset of the original array">;
10794def err_omp_section_length_negative : Error<
10795  "section length is evaluated to a negative value %0">;
10796def err_omp_section_stride_non_positive : Error<
10797  "section stride is evaluated to a non-positive value %0">;
10798def err_omp_section_length_undefined : Error<
10799  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
10800def err_omp_wrong_linear_modifier : Error<
10801  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
10802def err_omp_wrong_linear_modifier_non_reference : Error<
10803  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
10804def err_omp_wrong_simdlen_safelen_values : Error<
10805  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
10806def err_omp_wrong_if_directive_name_modifier : Error<
10807  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
10808def err_omp_no_more_if_clause : Error<
10809  "no more 'if' clause is allowed">;
10810def err_omp_unnamed_if_clause : Error<
10811  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
10812def note_omp_previous_named_if_clause : Note<
10813  "previous clause with directive name modifier specified here">;
10814def err_omp_ordered_directive_with_param : Error<
10815  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
10816def err_omp_ordered_directive_without_param : Error<
10817  "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
10818def note_omp_ordered_param : Note<
10819  "'ordered' clause%select{| with specified parameter}0">;
10820def err_omp_expected_base_var_name : Error<
10821  "expected variable name as a base of the array %select{subscript|section}0">;
10822def err_omp_map_shared_storage : Error<
10823  "variable already marked as mapped in current construct">;
10824def err_omp_invalid_map_type_for_directive : Error<
10825  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
10826def err_omp_invalid_map_type_modifier_for_directive : Error<
10827  "map type modifier '%0' is not allowed for '#pragma omp %1'">;
10828def err_omp_no_clause_for_directive : Error<
10829  "expected at least one %0 clause for '#pragma omp %1'">;
10830def err_omp_threadprivate_in_clause : Error<
10831  "threadprivate variables are not allowed in '%0' clause">;
10832def err_omp_wrong_ordered_loop_count : Error<
10833  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
10834def note_collapse_loop_count : Note<
10835  "parameter of the 'collapse' clause">;
10836def err_omp_clauses_mutually_exclusive : Error<
10837  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
10838def note_omp_previous_clause : Note<
10839  "'%0' clause is specified here">;
10840def err_omp_hint_clause_no_name : Error<
10841  "the name of the construct must be specified in presence of 'hint' clause">;
10842def err_omp_critical_with_hint : Error<
10843  "constructs with the same name must have a 'hint' clause with the same value">;
10844def note_omp_critical_hint_here : Note<
10845  "%select{|previous }0'hint' clause with value '%1'">;
10846def note_omp_critical_no_hint : Note<
10847  "%select{|previous }0directive with no 'hint' clause specified">;
10848def err_omp_depend_clause_thread_simd : Error<
10849  "'depend' clauses cannot be mixed with '%0' clause">;
10850def err_omp_depend_sink_expected_loop_iteration : Error<
10851  "expected%select{| %1}0 loop iteration variable">;
10852def err_omp_depend_sink_unexpected_expr : Error<
10853  "unexpected expression: number of expressions is larger than the number of associated loops">;
10854def err_omp_depend_sink_expected_plus_minus : Error<
10855  "expected '+' or '-' operation">;
10856def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error<
10857  "'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">;
10858def err_omp_depend_sink_source_not_allowed : Error<
10859  "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
10860def err_omp_depend_zero_length_array_section_not_allowed : Error<
10861  "zero-length array section is not allowed in 'depend' clause">;
10862def err_omp_depend_sink_source_with_modifier : Error<
10863  "depend modifier cannot be used with 'sink' or 'source' depend type">;
10864def err_omp_depend_modifier_not_iterator : Error<
10865  "expected iterator specification as depend modifier">;
10866def err_omp_map_modifier_not_iterator : Error<
10867  "expected iterator specification as map modifier">;
10868def err_omp_linear_ordered : Error<
10869  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
10870def err_omp_unexpected_schedule_modifier : Error<
10871  "modifier '%0' cannot be used along with modifier '%1'">;
10872def err_omp_schedule_nonmonotonic_static : Error<
10873  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
10874def err_omp_simple_clause_incompatible_with_ordered : Error<
10875  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
10876def err_omp_ordered_simd : Error<
10877  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
10878def err_omp_variable_in_given_clause_and_dsa : Error<
10879  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
10880def err_omp_param_or_this_in_clause : Error<
10881  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
10882def err_omp_expected_uniform_param : Error<
10883  "expected a reference to a parameter specified in a 'uniform' clause">;
10884def err_omp_expected_int_param : Error<
10885  "expected a reference to an integer-typed parameter">;
10886def err_omp_at_least_one_motion_clause_required : Error<
10887  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
10888def err_omp_cannot_update_with_internal_linkage : Error<
10889  "the host cannot update a declare target variable that is not externally visible.">;
10890def err_omp_usedeviceptr_not_a_pointer : Error<
10891  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
10892def err_omp_argument_type_isdeviceptr : Error <
10893  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
10894def warn_omp_nesting_simd : Warning<
10895  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
10896  InGroup<SourceUsesOpenMP>;
10897def err_omp_orphaned_device_directive : Error<
10898  "orphaned 'omp %0' directives are prohibited"
10899  "; perhaps you forget to enclose the directive into a "
10900  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
10901def err_omp_reduction_non_addressable_expression : Error<
10902  "expected addressable reduction item for the task-based directives">;
10903def err_omp_reduction_with_nogroup : Error<
10904  "'reduction' clause cannot be used with 'nogroup' clause">;
10905def err_omp_reduction_vla_unsupported : Error<
10906  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
10907def err_omp_linear_distribute_var_non_loop_iteration : Error<
10908  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
10909def warn_omp_non_trivial_type_mapped : Warning<
10910  "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
10911  InGroup<OpenMPMapping>;
10912def err_omp_requires_clause_redeclaration : Error <
10913  "Only one %0 clause can appear on a requires directive in a single translation unit">;
10914def note_omp_requires_previous_clause : Note <
10915  "%0 clause previously used here">;
10916def err_omp_directive_before_requires : Error <
10917  "'%0' region encountered before requires directive with '%1' clause">;
10918def note_omp_requires_encountered_directive : Note <
10919  "'%0' previously encountered here">;
10920def err_omp_device_ancestor_without_requires_reverse_offload : Error <
10921  "Device clause with ancestor device-modifier used without specifying 'requires reverse_offload'">;
10922def err_omp_invalid_scope : Error <
10923  "'#pragma omp %0' directive must appear only in file scope">;
10924def note_omp_invalid_length_on_this_ptr_mapping : Note <
10925  "expected length on mapping of 'this' array section expression to be '1'">;
10926def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
10927  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
10928def note_omp_invalid_subscript_on_this_ptr_map : Note <
10929  "expected 'this' subscript expression on map clause to be 'this[0]'">;
10930def err_omp_invalid_map_this_expr : Error <
10931  "invalid 'this' expression on 'map' clause">;
10932def err_omp_implied_type_not_found : Error<
10933  "'%0' type not found; include <omp.h>">;
10934def err_omp_expected_omp_depend_t_lvalue : Error<
10935  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
10936def err_omp_depobj_expected : Error<
10937  "expected depobj expression">;
10938def err_omp_depobj_single_clause_expected : Error<
10939  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
10940def err_omp_scan_single_clause_expected : Error<
10941  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
10942def err_omp_inclusive_exclusive_not_reduction : Error<
10943  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
10944  "of the parent directive">;
10945def err_omp_reduction_not_inclusive_exclusive : Error<
10946  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
10947  " 'exclusive' clause on an inner 'omp scan' directive">;
10948def err_omp_wrong_inscan_reduction : Error<
10949  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
10950  " 'omp parallel for', or 'omp parallel for simd' directive">;
10951def err_omp_inscan_reduction_expected : Error<
10952  "expected 'reduction' clause with the 'inscan' modifier">;
10953def note_omp_previous_inscan_reduction : Note<
10954  "'reduction' clause with 'inscan' modifier is used here">;
10955def err_omp_expected_predefined_allocator : Error<
10956  "expected one of the predefined allocators for the variables with the static "
10957  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
10958  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
10959  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
10960def warn_omp_used_different_allocator : Warning<
10961  "allocate directive specifies %select{default|'%1'}0 allocator while "
10962  "previously used %select{default|'%3'}2">,
10963  InGroup<OpenMPClauses>;
10964def note_omp_previous_allocator : Note<
10965  "previous allocator is specified here">;
10966def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
10967  "inside of the target region; provide an 'allocator' clause or use 'requires'"
10968  " directive with the 'dynamic_allocators' clause">;
10969def err_expected_allocator_expression : Error<"expected an allocator expression "
10970  "inside of the target region; provide an allocator expression or use 'requires'"
10971  " directive with the 'dynamic_allocators' clause">;
10972def warn_omp_allocate_thread_on_task_target_directive : Warning<
10973  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
10974  InGroup<OpenMPClauses>;
10975def err_omp_expected_private_copy_for_allocate : Error<
10976  "the referenced item is not found in any private clause on the same directive">;
10977def err_omp_stmt_depends_on_loop_counter : Error<
10978  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
10979def err_omp_invariant_dependency : Error<
10980  "expected loop invariant expression">;
10981def err_omp_invariant_or_linear_dependency : Error<
10982  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
10983def err_omp_wrong_dependency_iterator_type : Error<
10984  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
10985def err_target_unsupported_type
10986    : Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support,"
10987            " but target '%5' does not support it">;
10988def err_omp_lambda_capture_in_declare_target_not_to : Error<
10989  "variable captured in declare target region must appear in a to clause">;
10990def err_omp_device_type_mismatch : Error<
10991  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
10992def err_omp_wrong_device_function_call : Error<
10993  "function with 'device_type(%0)' is not available on %select{device|host}1">;
10994def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
10995def warn_omp_declare_target_after_first_use : Warning<
10996  "declaration marked as declare target after first use, it may lead to incorrect results">,
10997  InGroup<OpenMPTarget>;
10998def err_omp_declare_variant_incompat_attributes : Error<
10999  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
11000def warn_omp_declare_variant_score_not_constant
11001    : Warning<"score expressions in the OpenMP context selector need to be "
11002              "constant; %0 is not and will be ignored">,
11003      InGroup<SourceUsesOpenMP>;
11004def err_omp_declare_variant_user_condition_not_constant
11005    : Error<"the user condition in the OpenMP context selector needs to be "
11006            "constant; %0 is not">;
11007def warn_omp_declare_variant_after_used : Warning<
11008  "'#pragma omp declare variant' cannot be applied for function after first "
11009  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
11010def warn_omp_declare_variant_after_emitted : Warning<
11011  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
11012  " the original function might be used">, InGroup<SourceUsesOpenMP>;
11013def err_omp_declare_variant_doesnt_support : Error<
11014  "'#pragma omp declare variant' does not "
11015  "support %select{function templates|virtual functions|"
11016  "deduced return types|constructors|destructors|deleted functions|"
11017  "defaulted functions|constexpr functions|consteval function}0">;
11018def err_omp_declare_variant_diff : Error<
11019  "function with '#pragma omp declare variant' has a different %select{calling convention"
11020  "|return type|constexpr specification|inline specification|storage class|"
11021  "linkage}0">;
11022def err_omp_declare_variant_prototype_required : Error<
11023  "function with '#pragma omp declare variant' must have a prototype when "
11024  "'append_args' is used">;
11025def err_omp_interop_type_not_found : Error<
11026  "'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">;
11027def err_omp_declare_variant_incompat_types : Error<
11028  "variant in '#pragma omp declare variant' with type %0 is incompatible with"
11029  " type %1%select{| with appended arguments}2">;
11030def err_omp_declare_variant_same_base_function : Error<
11031  "variant in '#pragma omp declare variant' is the same as the base function">;
11032def warn_omp_declare_variant_marked_as_declare_variant : Warning<
11033  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
11034  >, InGroup<SourceUsesOpenMP>;
11035def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
11036def err_omp_one_defaultmap_each_category: Error<
11037  "at most one defaultmap clause for each variable-category can appear on the directive">;
11038def err_omp_lastprivate_conditional_non_scalar : Error<
11039  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
11040  >;
11041def err_omp_flush_order_clause_and_list : Error<
11042  "'flush' directive with memory order clause '%0' cannot have the list">;
11043def note_omp_flush_order_clause_here : Note<
11044  "memory order clause '%0' is specified here">;
11045def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
11046  "expected addressable lvalue in '%0' clause">;
11047def err_omp_var_expected : Error<
11048  "expected variable of the '%0' type%select{|, not %2}1">;
11049def err_omp_non_pointer_type_array_shaping_base : Error<
11050  "expected expression with a pointer to a complete type as a base of an array "
11051  "shaping operation">;
11052def err_omp_reduction_task_not_parallel_or_worksharing : Error<
11053  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
11054  " worksharing constructs">;
11055def err_omp_expected_array_alloctraits : Error<
11056  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
11057def err_omp_predefined_allocator_with_traits : Error<
11058  "predefined allocator cannot have traits specified">;
11059def note_omp_predefined_allocator : Note<
11060  "predefined trait '%0' used here">;
11061def err_omp_nonpredefined_allocator_without_traits : Error<
11062  "non-predefined allocator must have traits specified">;
11063def err_omp_allocator_used_in_clauses : Error<
11064  "allocators used in 'uses_allocators' clause cannot appear in other "
11065  "data-sharing or data-mapping attribute clauses">;
11066def err_omp_allocator_not_in_uses_allocators : Error<
11067  "allocator must be specified in the 'uses_allocators' clause">;
11068def note_omp_protected_structured_block
11069    : Note<"jump bypasses OpenMP structured block">;
11070def note_omp_exits_structured_block
11071    : Note<"jump exits scope of OpenMP structured block">;
11072def err_omp_lastprivate_loop_var_non_loop_iteration : Error<
11073  "only loop iteration variables are allowed in 'lastprivate' clause in "
11074  "'omp %0' directives">;
11075def err_omp_interop_variable_expected : Error<
11076  "expected%select{| non-const}0 variable of type 'omp_interop_t'">;
11077def err_omp_interop_variable_wrong_type : Error<
11078  "interop variable must be of type 'omp_interop_t'">;
11079def err_omp_interop_prefer_type : Error<
11080  "prefer_list item must be a string literal or constant integral "
11081  "expression">;
11082def err_omp_interop_bad_depend_clause : Error<
11083  "'depend' clause requires the 'targetsync' interop type">;
11084def err_omp_interop_var_multiple_actions : Error<
11085  "interop variable %0 used in multiple action clauses">;
11086def err_omp_dispatch_statement_call
11087    : Error<"statement after '#pragma omp dispatch' must be a direct call"
11088            " to a target function or an assignment to one">;
11089def err_omp_unroll_full_variable_trip_count : Error<
11090  "loop to be fully unrolled must have a constant trip count">;
11091def note_omp_directive_here : Note<"'%0' directive found here">;
11092def err_omp_instantiation_not_supported
11093    : Error<"instantiation of '%0' not supported yet">;
11094def err_omp_adjust_arg_multiple_clauses : Error<
11095  "'adjust_arg' argument %0 used in multiple clauses">;
11096def err_omp_clause_requires_dispatch_construct : Error<
11097  "'%0' clause requires 'dispatch' context selector">;
11098def err_omp_append_args_with_varargs : Error<
11099  "'append_args' is not allowed with varargs functions">;
11100def err_openmp_vla_in_task_untied : Error<
11101  "variable length arrays are not supported in OpenMP tasking regions with 'untied' clause">;
11102def warn_omp_unterminated_declare_target : Warning<
11103  "expected '#pragma omp end declare target' at end of file to match '#pragma omp %0'">,
11104  InGroup<SourceUsesOpenMP>;
11105} // end of OpenMP category
11106
11107let CategoryName = "Related Result Type Issue" in {
11108// Objective-C related result type compatibility
11109def warn_related_result_type_compatibility_class : Warning<
11110  "method is expected to return an instance of its class type "
11111  "%diff{$, but is declared to return $|"
11112  ", but is declared to return different type}0,1">;
11113def warn_related_result_type_compatibility_protocol : Warning<
11114  "protocol method is expected to return an instance of the implementing "
11115  "class, but is declared to return %0">;
11116def note_related_result_type_family : Note<
11117  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
11118  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
11119  "self}1' method family%select{| and is expected to return an instance of its "
11120  "class type}0">;
11121def note_related_result_type_overridden : Note<
11122  "overridden method returns an instance of its class type">;
11123def note_related_result_type_inferred : Note<
11124  "%select{class|instance}0 method %1 is assumed to return an instance of "
11125  "its receiver type (%2)">;
11126def note_related_result_type_explicit : Note<
11127  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
11128  "%select{| and is expected to return an instance of its class type}0">;
11129def err_invalid_type_for_program_scope_var : Error<
11130  "the %0 type cannot be used to declare a program scope variable">;
11131
11132}
11133
11134let CategoryName = "Modules Issue" in {
11135def err_module_decl_in_module_map_module : Error<
11136  "'module' declaration found while building module from module map">;
11137def err_module_decl_in_header_unit : Error<
11138  "'module' declaration found while building header unit">;
11139def err_module_interface_implementation_mismatch : Error<
11140  "missing 'export' specifier in module declaration while "
11141  "building module interface">;
11142def err_current_module_name_mismatch : Error<
11143  "module name '%0' specified on command line does not match name of module">;
11144def err_module_redefinition : Error<
11145  "redefinition of module '%0'">;
11146def note_prev_module_definition : Note<"previously defined here">;
11147def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
11148def err_module_not_defined : Error<
11149  "definition of module '%0' is not available; use -fmodule-file= to specify "
11150  "path to precompiled module interface">;
11151def err_module_redeclaration : Error<
11152  "translation unit contains multiple module declarations">;
11153def note_prev_module_declaration : Note<"previous module declaration is here">;
11154def err_module_declaration_missing : Error<
11155  "missing 'export module' declaration in module interface unit">;
11156def err_module_declaration_missing_after_global_module_introducer : Error<
11157  "missing 'module' declaration at end of global module fragment "
11158  "introduced here">;
11159def err_module_private_specialization : Error<
11160  "%select{template|partial|member}0 specialization cannot be "
11161  "declared __module_private__">;
11162def err_module_private_local : Error<
11163  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
11164  "__module_private__">;
11165def err_module_private_local_class : Error<
11166  "local %select{struct|interface|union|class|enum}0 cannot be declared "
11167  "__module_private__">;
11168def err_module_unimported_use : Error<
11169  "%select{declaration|definition|default argument|"
11170  "explicit specialization|partial specialization}0 of %1 must be imported "
11171  "from module '%2' before it is required">;
11172def err_module_unimported_use_header : Error<
11173  "%select{missing '#include'|missing '#include %3'}2; "
11174  "%select{||default argument of |explicit specialization of |"
11175  "partial specialization of }0%1 must be "
11176  "%select{declared|defined|defined|declared|declared}0 "
11177  "before it is used">;
11178def err_module_unimported_use_multiple : Error<
11179  "%select{declaration|definition|default argument|"
11180  "explicit specialization|partial specialization}0 of %1 must be imported "
11181  "from one of the following modules before it is required:%2">;
11182def note_unreachable_entity : Note<
11183  "%select{declaration|definition|default argument declared|"
11184  "explicit specialization declared|partial specialization declared}0 here "
11185  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
11186def ext_module_import_in_extern_c : ExtWarn<
11187  "import of C++ module '%0' appears within extern \"C\" language linkage "
11188  "specification">, DefaultError,
11189  InGroup<DiagGroup<"module-import-in-extern-c">>;
11190def err_module_import_not_at_top_level_fatal : Error<
11191  "import of module '%0' appears within %1">, DefaultFatal;
11192def ext_module_import_not_at_top_level_noop : ExtWarn<
11193  "redundant #include of module '%0' appears within %1">, DefaultError,
11194  InGroup<DiagGroup<"modules-import-nested-redundant">>;
11195def note_module_import_not_at_top_level : Note<"%0 begins here">;
11196def err_module_self_import : Error<
11197  "import of module '%0' appears within same top-level module '%1'">;
11198def err_module_self_import_cxx20 : Error<
11199  "import of module '%0' appears within its own %select{interface|implementation}1">;
11200def err_module_import_in_implementation : Error<
11201  "@import of module '%0' in implementation of '%1'; use #import">;
11202
11203// C++ Modules
11204def err_module_decl_not_at_start : Error<
11205  "module declaration must occur at the start of the translation unit">;
11206def note_global_module_introducer_missing : Note<
11207  "add 'module;' to the start of the file to introduce a "
11208  "global module fragment">;
11209def err_export_within_anonymous_namespace : Error<
11210  "export declaration appears within anonymous namespace">;
11211def note_anonymous_namespace : Note<"anonymous namespace begins here">;
11212def ext_export_no_name_block : ExtWarn<
11213  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
11214  "to appear in an export block">, InGroup<ExportUnnamed>;
11215def ext_export_no_names : ExtWarn<
11216  "ISO C++20 does not permit a declaration that does not introduce any names "
11217  "to be exported">, InGroup<ExportUnnamed>;
11218def introduces_no_names : Error<
11219  "declaration does not introduce any names to be exported">;
11220def note_export : Note<"export block begins here">;
11221def err_export_no_name : Error<
11222  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
11223def ext_export_using_directive : ExtWarn<
11224  "ISO C++20 does not permit using directive to be exported">,
11225  InGroup<DiagGroup<"export-using-directive">>;
11226def err_export_within_export : Error<
11227  "export declaration appears within another export declaration">;
11228def err_export_internal : Error<
11229  "declaration of %0 with internal linkage cannot be exported">;
11230def err_export_using_internal : Error<
11231  "using declaration referring to %1 with %select{internal|module|unknown}0 "
11232  "linkage cannot be exported">;
11233def err_export_not_in_module_interface : Error<
11234  "export declaration can only be used within a module interface unit"
11235  "%select{ after the module declaration|}0">;
11236def err_export_inline_not_defined : Error<
11237  "inline function not defined%select{| before the private module fragment}0">;
11238def err_export_partition_impl : Error<
11239  "module partition implementations cannot be exported">;
11240def err_export_in_private_module_fragment : Error<
11241  "export declaration cannot be used in a private module fragment">;
11242def note_private_module_fragment : Note<
11243  "private module fragment begins here">;
11244def err_private_module_fragment_not_module : Error<
11245  "private module fragment declaration with no preceding module declaration">;
11246def err_private_module_fragment_redefined : Error<
11247  "private module fragment redefined">;
11248def err_private_module_fragment_not_module_interface : Error<
11249  "private module fragment in module implementation unit">;
11250def note_not_module_interface_add_export : Note<
11251  "add 'export' here if this is intended to be a module interface unit">;
11252def err_invalid_module_name : Error<
11253  "%0 is %select{an invalid|a reserved}1 name for a module">;
11254def err_extern_def_in_header_unit : Error<
11255  "non-inline external definitions are not permitted in C++ header units">;
11256
11257def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
11258  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
11259  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
11260def note_equivalent_internal_linkage_decl : Note<
11261  "declared here%select{ in module '%1'|}0">;
11262
11263def note_redefinition_modules_same_file : Note<
11264  "'%0' included multiple times, additional include site in header from module '%1'">;
11265def note_redefinition_include_same_file : Note<
11266  "'%0' included multiple times, additional include site here">;
11267}
11268
11269let CategoryName = "Coroutines Issue" in {
11270def err_return_in_coroutine : Error<
11271  "return statement not allowed in coroutine; did you mean 'co_return'?">;
11272def note_declared_coroutine_here : Note<
11273  "function is a coroutine due to use of '%0' here">;
11274def err_coroutine_objc_method : Error<
11275  "Objective-C methods as coroutines are not yet supported">;
11276def err_coroutine_unevaluated_context : Error<
11277  "'%0' cannot be used in an unevaluated context">;
11278def err_coroutine_within_handler : Error<
11279  "'%0' cannot be used in the handler of a try block">;
11280def err_coroutine_outside_function : Error<
11281  "'%0' cannot be used outside a function">;
11282def err_coroutine_invalid_func_context : Error<
11283  "'%1' cannot be used in %select{a constructor|a destructor"
11284  "|the 'main' function|a constexpr function"
11285  "|a function with a deduced return type|a varargs function"
11286  "|a consteval function}0">;
11287def err_implied_coroutine_type_not_found : Error<
11288  "%0 type was not found; include <coroutine> before defining "
11289  "a coroutine; include <experimental/coroutine> if your version "
11290  "of libcxx is less than 14.0">;
11291def warn_deprecated_coroutine_namespace : Warning<
11292  "support for 'std::experimental::%0' will be removed in Clang 17; "
11293  "use 'std::%0' instead">,
11294  InGroup<DeprecatedExperimentalCoroutine>;
11295def err_mixed_use_std_and_experimental_namespace_for_coroutine : Error<
11296  "conflicting mixed use of std and std::experimental namespaces for "
11297  "coroutine components">;
11298def err_implicit_coroutine_std_nothrow_type_not_found : Error<
11299  "std::nothrow was not found; include <new> before defining a coroutine which "
11300  "uses get_return_object_on_allocation_failure()">;
11301def err_malformed_std_nothrow : Error<
11302  "std::nothrow must be a valid variable declaration">;
11303def err_malformed_std_coroutine_handle : Error<
11304  "std::coroutine_handle isn't a class template">;
11305def err_coroutine_handle_missing_member : Error<
11306  "std::coroutine_handle must have a member named '%0'">;
11307def err_malformed_std_coroutine_traits : Error<
11308  "std::coroutine_traits isn't a class template">;
11309def err_implied_std_coroutine_traits_promise_type_not_found : Error<
11310  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
11311def err_implied_std_coroutine_traits_promise_type_not_class : Error<
11312  "this function cannot be a coroutine: %0 is not a class">;
11313def err_coroutine_promise_type_incomplete : Error<
11314  "this function cannot be a coroutine: %0 is an incomplete type">;
11315def err_coroutine_type_missing_specialization : Error<
11316  "this function cannot be a coroutine: missing definition of "
11317  "specialization %0">;
11318def err_coroutine_promise_incompatible_return_functions : Error<
11319  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
11320def note_coroutine_promise_implicit_await_transform_required_here : Note<
11321  "call to 'await_transform' implicitly required by 'co_await' here">;
11322def note_coroutine_promise_suspend_implicitly_required : Note<
11323  "call to '%select{initial_suspend|final_suspend}0' implicitly "
11324  "required by the %select{initial suspend point|final suspend point}0">;
11325def err_coroutine_promise_unhandled_exception_required : Error<
11326  "%0 is required to declare the member 'unhandled_exception()'">;
11327def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
11328  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
11329  InGroup<CoroutineMissingUnhandledException>;
11330def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
11331  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
11332def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
11333  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
11334def err_coroutine_promise_new_requires_nothrow : Error<
11335  "%0 is required to have a non-throwing noexcept specification when the promise "
11336   "type declares 'get_return_object_on_allocation_failure()'">;
11337def note_coroutine_promise_call_implicitly_required : Note<
11338  "call to %0 implicitly required by coroutine function here">;
11339def err_await_suspend_invalid_return_type : Error<
11340  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
11341>;
11342def note_await_ready_no_bool_conversion : Note<
11343  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
11344>;
11345def warn_coroutine_handle_address_invalid_return_type : Warning <
11346  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">,
11347  InGroup<Coroutine>;
11348def err_coroutine_promise_final_suspend_requires_nothrow : Error<
11349  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
11350>;
11351def note_coroutine_function_declare_noexcept : Note<
11352  "must be declared with 'noexcept'"
11353>;
11354def warn_always_inline_coroutine : Warning<
11355  "this coroutine may be split into pieces; not every piece is guaranteed to be inlined"
11356  >,
11357  InGroup<AlwaysInlineCoroutine>;
11358def err_coroutine_unusable_new : Error<
11359  "'operator new' provided by %0 is not usable with the function signature of %1"
11360>;
11361def err_coroutine_unfound_nothrow_new : Error <
11362  "unable to find %select{'::operator new(size_t, nothrow_t)'|"
11363  "'::operator new(size_t, align_val_t, nothrow_t)'}1 for %0"
11364>;
11365def warn_non_aligned_allocation_function : Warning <
11366  "under -fcoro-aligned-allocation, the non-aligned allocation function "
11367  "for the promise type %0 has higher precedence than the global aligned "
11368  "allocation function">,
11369  InGroup<CoroNonAlignedAllocationFunction>;
11370def err_conflicting_aligned_options : Error <
11371  "conflicting option '-fcoro-aligned-allocation' and '-fno-aligned-allocation'"
11372>;
11373def err_coro_invalid_addr_of_label : Error<
11374  "the GNU address of label extension is not allowed in coroutines."
11375>;
11376} // end of coroutines issue category
11377
11378let CategoryName = "Documentation Issue" in {
11379def warn_not_a_doxygen_trailing_member_comment : Warning<
11380  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
11381} // end of documentation issue category
11382
11383let CategoryName = "Nullability Issue" in {
11384
11385def warn_mismatched_nullability_attr : Warning<
11386  "nullability specifier %0 conflicts with existing specifier %1">,
11387  InGroup<Nullability>;
11388
11389def warn_nullability_declspec : Warning<
11390  "nullability specifier %0 cannot be applied "
11391  "to non-pointer type %1; did you mean to apply the specifier to the "
11392  "%select{pointer|block pointer|member pointer|function pointer|"
11393  "member function pointer}2?">,
11394  InGroup<NullabilityDeclSpec>,
11395  DefaultError;
11396
11397def note_nullability_here : Note<"%0 specified here">;
11398
11399def err_nullability_nonpointer : Error<
11400  "nullability specifier %0 cannot be applied to non-pointer type %1">;
11401
11402def warn_nullability_lost : Warning<
11403  "implicit conversion from nullable pointer %0 to non-nullable pointer "
11404  "type %1">,
11405  InGroup<NullableToNonNullConversion>, DefaultIgnore;
11406def warn_zero_as_null_pointer_constant : Warning<
11407  "zero as null pointer constant">,
11408  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
11409
11410def err_nullability_cs_multilevel : Error<
11411  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
11412def note_nullability_type_specifier : Note<
11413  "use nullability type specifier %0 to affect the innermost "
11414  "pointer type of %1">;
11415
11416def warn_null_resettable_setter : Warning<
11417  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
11418  InGroup<Nullability>;
11419
11420def warn_nullability_missing : Warning<
11421  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
11422  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
11423  InGroup<NullabilityCompleteness>;
11424def warn_nullability_missing_array : Warning<
11425  "array parameter is missing a nullability type specifier (_Nonnull, "
11426  "_Nullable, or _Null_unspecified)">,
11427  InGroup<NullabilityCompletenessOnArrays>;
11428def note_nullability_fix_it : Note<
11429  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
11430  "%select{pointer|block pointer|member pointer|array parameter}1 "
11431  "%select{should never be null|may be null|should not declare nullability}0">;
11432
11433def warn_nullability_inferred_on_nested_type : Warning<
11434  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
11435  "deprecated">,
11436  InGroup<NullabilityInferredOnNestedType>;
11437
11438def err_objc_type_arg_explicit_nullability : Error<
11439  "type argument %0 cannot explicitly specify nullability">;
11440
11441def err_objc_type_param_bound_explicit_nullability : Error<
11442  "type parameter %0 bound %1 cannot explicitly specify nullability">;
11443
11444}
11445
11446let CategoryName = "Generics Issue" in {
11447
11448def err_objc_type_param_bound_nonobject : Error<
11449  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
11450
11451def err_objc_type_param_bound_missing_pointer : Error<
11452  "missing '*' in type bound %0 for type parameter %1">;
11453def err_objc_type_param_bound_qualified : Error<
11454  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
11455
11456def err_objc_type_param_redecl : Error<
11457  "redeclaration of type parameter %0">;
11458
11459def err_objc_type_param_arity_mismatch : Error<
11460  "%select{forward class declaration|class definition|category|extension}0 has "
11461  "too %select{few|many}1 type parameters (expected %2, have %3)">;
11462
11463def err_objc_type_param_bound_conflict : Error<
11464  "type bound %0 for type parameter %1 conflicts with "
11465  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
11466
11467def err_objc_type_param_variance_conflict : Error<
11468  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
11469  "%select{in|co|contra}2variant type parameter %3">;
11470
11471def note_objc_type_param_here : Note<"type parameter %0 declared here">;
11472
11473def err_objc_type_param_bound_missing : Error<
11474  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
11475
11476def err_objc_parameterized_category_nonclass : Error<
11477  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
11478  "parameters">;
11479
11480def err_objc_parameterized_forward_class : Error<
11481  "forward declaration of non-parameterized class %0 cannot have type "
11482  "parameters">;
11483
11484def err_objc_parameterized_forward_class_first : Error<
11485  "class %0 previously declared with type parameters">;
11486
11487def err_objc_type_arg_missing_star : Error<
11488  "type argument %0 must be a pointer (requires a '*')">;
11489def err_objc_type_arg_qualified : Error<
11490  "type argument %0 cannot be qualified with '%1'">;
11491
11492def err_objc_type_arg_missing : Error<
11493  "no type or protocol named %0">;
11494
11495def err_objc_type_args_and_protocols : Error<
11496  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
11497  "%select{protocol|type}0 (%2)">;
11498
11499def err_objc_type_args_non_class : Error<
11500  "type arguments cannot be applied to non-class type %0">;
11501
11502def err_objc_type_args_non_parameterized_class : Error<
11503  "type arguments cannot be applied to non-parameterized class %0">;
11504
11505def err_objc_type_args_specialized_class : Error<
11506  "type arguments cannot be applied to already-specialized class type %0">;
11507
11508def err_objc_type_args_wrong_arity : Error<
11509  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
11510}
11511
11512def err_objc_type_arg_not_id_compatible : Error<
11513  "type argument %0 is neither an Objective-C object nor a block type">;
11514
11515def err_objc_type_arg_does_not_match_bound : Error<
11516  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
11517
11518def warn_objc_redundant_qualified_class_type : Warning<
11519  "parameterized class %0 already conforms to the protocols listed; did you "
11520  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
11521
11522def warn_block_literal_attributes_on_omitted_return_type : Warning<
11523  "attribute %0 ignored, because it cannot be applied to omitted return type">,
11524  InGroup<IgnoredAttributes>;
11525
11526def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
11527  "'%0' qualifier on omitted return type %1 has no effect">,
11528  InGroup<IgnoredQualifiers>;
11529
11530def warn_shadow_field : Warning<
11531  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
11532  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
11533def note_shadow_field : Note<"declared here">;
11534
11535def err_multiversion_required_in_redecl : Error<
11536  "function declaration is missing %select{'target'|'cpu_specific' or "
11537  "'cpu_dispatch'|'target_version'}0 attribute in a multiversioned function">;
11538def note_multiversioning_caused_here : Note<
11539  "function multiversioning caused by this declaration">;
11540def err_multiversion_after_used : Error<
11541  "function declaration cannot become a multiversioned function after first "
11542  "usage">;
11543def err_bad_multiversion_option : Error<
11544  "function multiversioning doesn't support %select{feature|architecture}0 "
11545  "'%1'">;
11546def err_multiversion_duplicate : Error<
11547  "multiversioned function redeclarations require identical target attributes">;
11548def err_multiversion_noproto : Error<
11549  "multiversioned function must have a prototype">;
11550def err_multiversion_disallowed_other_attr
11551    : Error<"attribute "
11552            "'%select{|target|cpu_specific|cpu_dispatch|target_clones|target_version}0' "
11553            "multiversioning cannot be combined"
11554            " with attribute %1">;
11555def err_multiversion_diff : Error<
11556  "multiversioned function declaration has a different %select{calling convention"
11557  "|return type|constexpr specification|inline specification|linkage|"
11558  "language linkage}0">;
11559def err_multiversion_doesnt_support
11560    : Error<"attribute "
11561            "'%select{|target|cpu_specific|cpu_dispatch|target_clones|target_version}0' "
11562            "multiversioned functions do not "
11563            "yet support %select{function templates|virtual functions|"
11564            "deduced return types|constructors|destructors|deleted functions|"
11565            "defaulted functions|constexpr functions|consteval "
11566            "function|lambdas}1">;
11567def err_multiversion_not_allowed_on_main : Error<
11568  "'main' cannot be a multiversioned function">;
11569def err_multiversion_not_supported : Error<
11570 "function multiversioning is not supported on the current target">;
11571def err_multiversion_types_mixed : Error<
11572  "multiversioning attributes cannot be combined">;
11573def err_cpu_dispatch_mismatch : Error<
11574 "'cpu_dispatch' function redeclared with different CPUs">;
11575def err_cpu_specific_multiple_defs : Error<
11576 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
11577def warn_multiversion_duplicate_entries : Warning<
11578 "CPU list contains duplicate entries; attribute ignored">,
11579  InGroup<FunctionMultiVersioning>;
11580def warn_dispatch_body_ignored : Warning<
11581  "body of cpu_dispatch function will be ignored">,
11582  InGroup<FunctionMultiVersioning>;
11583def err_target_clone_must_have_default
11584    : Error<"'target_clones' multiversioning requires a default target">;
11585def err_target_clone_doesnt_match
11586    : Error<"'target_clones' attribute does not match previous declaration">;
11587def warn_target_clone_mixed_values
11588    : ExtWarn<
11589          "mixing 'target_clones' specifier mechanisms is permitted for GCC "
11590          "compatibility; use a comma separated sequence of string literals, "
11591          "or a string literal containing a comma-separated list of versions">,
11592      InGroup<TargetClonesMixedSpecifiers>;
11593def warn_target_clone_duplicate_options
11594    : Warning<"version list contains duplicate entries">,
11595      InGroup<FunctionMultiVersioning>;
11596def warn_target_clone_no_impact_options
11597    : Warning<"version list contains entries that don't impact code generation">,
11598      InGroup<FunctionMultiVersioning>;
11599
11600// three-way comparison operator diagnostics
11601def err_implied_comparison_category_type_not_found : Error<
11602  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
11603  "because type '%0' was not found; include <compare>">;
11604def err_spaceship_argument_narrowing : Error<
11605  "argument to 'operator<=>' "
11606  "%select{cannot be narrowed from type %1 to %2|"
11607  "evaluates to %1, which cannot be narrowed to type %2}0">;
11608def err_std_compare_type_not_supported : Error<
11609  "standard library implementation of %0 is not supported; "
11610   "%select{member '%2' does not have expected form|"
11611   "member '%2' is missing|"
11612   "the type is not trivially copyable|"
11613   "the type does not have the expected form}1">;
11614def note_rewriting_operator_as_spaceship : Note<
11615  "while rewriting comparison as call to 'operator<=>' declared here">;
11616def err_three_way_vector_comparison : Error<
11617  "three-way comparison between vectors is not supported">;
11618
11619// Memory Tagging Extensions (MTE) diagnostics
11620def err_memtag_arg_null_or_pointer : Error<
11621  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
11622def err_memtag_any2arg_pointer : Error<
11623  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
11624def err_memtag_arg_must_be_pointer : Error<
11625  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
11626def err_memtag_arg_must_be_integer : Error<
11627  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
11628
11629def warn_dereference_of_noderef_type : Warning<
11630  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
11631def warn_dereference_of_noderef_type_no_decl : Warning<
11632  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
11633def warn_noderef_on_non_pointer_or_array : Warning<
11634  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
11635def warn_noderef_to_dereferenceable_pointer : Warning<
11636  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
11637
11638def err_builtin_launder_invalid_arg : Error<
11639  "%select{non-pointer|function pointer|void pointer}0 argument to "
11640  "'__builtin_launder' is not allowed">;
11641
11642def err_builtin_invalid_arg_type: Error <
11643  "%ordinal0 argument must be a "
11644  "%select{vector, integer or floating point type|matrix|"
11645  "pointer to a valid matrix element type|"
11646  "signed integer or floating point type|vector type|"
11647  "floating point type|"
11648  "vector of integers}1 (was %2)">;
11649
11650def err_builtin_matrix_disabled: Error<
11651  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
11652def err_matrix_index_not_integer: Error<
11653  "matrix %select{row|column}0 index is not an integer">;
11654def err_matrix_index_outside_range: Error<
11655  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
11656def err_matrix_incomplete_index: Error<
11657  "single subscript expressions are not allowed for matrix values">;
11658def err_matrix_separate_incomplete_index: Error<
11659  "matrix row and column subscripts cannot be separated by any expression">;
11660def err_matrix_subscript_comma: Error<
11661  "comma expressions are not allowed as indices in matrix subscript expressions">;
11662def err_builtin_matrix_scalar_unsigned_arg: Error<
11663  "%0 argument must be a constant unsigned integer expression">;
11664def err_builtin_matrix_pointer_arg_mismatch: Error<
11665  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
11666def err_builtin_matrix_store_to_const: Error<
11667  "cannot store matrix to read-only pointer">;
11668def err_builtin_matrix_stride_too_small: Error<
11669  "stride must be greater or equal to the number of rows">;
11670def err_builtin_matrix_invalid_dimension: Error<
11671  "%0 dimension is outside the allowed range [1, %1]">;
11672
11673def warn_mismatched_import : Warning<
11674  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
11675  "previous declaration">,
11676  InGroup<IgnoredAttributes>;
11677def warn_import_on_definition : Warning<
11678  "import %select{module|name}0 cannot be applied to a function with a definition">,
11679  InGroup<IgnoredAttributes>;
11680
11681def err_preserve_field_info_not_field : Error<
11682  "__builtin_preserve_field_info argument %0 not a field access">;
11683def err_preserve_field_info_not_const: Error<
11684  "__builtin_preserve_field_info argument %0 not a constant">;
11685def err_btf_type_id_not_const: Error<
11686  "__builtin_btf_type_id argument %0 not a constant">;
11687def err_preserve_type_info_invalid : Error<
11688  "__builtin_preserve_type_info argument %0 invalid">;
11689def err_preserve_type_info_not_const: Error<
11690  "__builtin_preserve_type_info argument %0 not a constant">;
11691def err_preserve_enum_value_invalid : Error<
11692  "__builtin_preserve_enum_value argument %0 invalid">;
11693def err_preserve_enum_value_not_const: Error<
11694  "__builtin_preserve_enum_value argument %0 not a constant">;
11695
11696def err_bit_cast_non_trivially_copyable : Error<
11697  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
11698def err_bit_cast_type_size_mismatch : Error<
11699  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
11700
11701// SYCL-specific diagnostics
11702def warn_sycl_kernel_num_of_template_params : Warning<
11703  "'sycl_kernel' attribute only applies to a function template with at least"
11704  " two template parameters">, InGroup<IgnoredAttributes>;
11705def warn_sycl_kernel_invalid_template_param_type : Warning<
11706  "template parameter of a function template with the 'sycl_kernel' attribute"
11707  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
11708def warn_sycl_kernel_num_of_function_params : Warning<
11709  "function template with 'sycl_kernel' attribute must have a single parameter">,
11710  InGroup<IgnoredAttributes>;
11711def warn_sycl_kernel_return_type : Warning<
11712  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
11713  InGroup<IgnoredAttributes>;
11714def err_sycl_special_type_num_init_method : Error<
11715  "types with 'sycl_special_class' attribute must have one and only one '__init' "
11716  "method defined">;
11717
11718def err_bit_int_bad_size : Error<"%select{signed|unsigned}0 _BitInt must "
11719                                 "have a bit size of at least %select{2|1}0">;
11720def err_bit_int_max_size : Error<"%select{signed|unsigned}0 _BitInt of bit "
11721                                 "sizes greater than %1 not supported">;
11722
11723// errors of expect.with.probability
11724def err_probability_not_constant_float : Error<
11725   "probability argument to __builtin_expect_with_probability must be constant "
11726   "floating-point expression">;
11727def err_probability_out_of_range : Error<
11728   "probability argument to __builtin_expect_with_probability is outside the "
11729   "range [0.0, 1.0]">;
11730
11731// TCB warnings
11732def err_tcb_conflicting_attributes : Error<
11733  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
11734def warn_tcb_enforcement_violation : Warning<
11735  "calling %0 is a violation of trusted computing base '%1'">,
11736  InGroup<DiagGroup<"tcb-enforcement">>;
11737
11738// RISC-V builtin required extension warning
11739def err_riscv_builtin_requires_extension : Error<
11740  "builtin requires%select{| at least one of the following extensions to be enabled}0: %1">;
11741def err_riscv_builtin_invalid_lmul : Error<
11742  "LMUL argument must be in the range [0,3] or [5,7]">;
11743
11744def err_std_source_location_impl_not_found : Error<
11745  "'std::source_location::__impl' was not found; it must be defined before '__builtin_source_location' is called">;
11746def err_std_source_location_impl_malformed : Error<
11747  "'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'">;
11748
11749// HLSL Diagnostics
11750def 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">;
11751def err_hlsl_attr_invalid_type : Error<
11752   "attribute %0 only applies to a field or parameter of type '%1'">;
11753def err_hlsl_attr_invalid_ast_node : Error<
11754   "attribute %0 only applies to %1">;
11755def err_hlsl_numthreads_argument_oor : Error<"argument '%select{X|Y|Z}0' to numthreads attribute cannot exceed %1">;
11756def err_hlsl_numthreads_invalid : Error<"total number of threads cannot exceed %0">;
11757def err_hlsl_missing_numthreads : Error<"missing numthreads attribute for %0 shader entry">;
11758def err_hlsl_attribute_param_mismatch : Error<"%0 attribute parameters do not match the previous declaration">;
11759def err_hlsl_missing_semantic_annotation : Error<
11760  "semantic annotations must be present for all parameters of an entry "
11761  "function or patch constant function">;
11762def err_hlsl_init_priority_unsupported : Error<
11763  "initializer priorities are not supported in HLSL">;
11764
11765def err_hlsl_unsupported_register_type : Error<"invalid resource class specifier '%0' used; expected 'b', 's', 't', or 'u'">;
11766def err_hlsl_unsupported_register_number : Error<"register number should be an integer">;
11767def err_hlsl_expected_space : Error<"invalid space specifier '%0' used; expected 'space' followed by an integer, like space1">;
11768def err_hlsl_pointers_unsupported : Error<
11769  "%select{pointers|references}0 are unsupported in HLSL">;
11770
11771def err_hlsl_operator_unsupported : Error<
11772  "the '%select{&|*|->}0' operator is unsupported in HLSL">;
11773
11774// Layout randomization diagnostics.
11775def err_non_designated_init_used : Error<
11776  "a randomized struct can only be initialized with a designated initializer">;
11777def err_cast_from_randomized_struct : Error<
11778  "casting from randomized structure pointer type %0 to %1">;
11779
11780// LoongArch-specific Diagnostics
11781def err_loongarch_builtin_requires_la64 : Error<
11782  "this builtin requires target: loongarch64">;
11783
11784// Unsafe buffer usage diagnostics.
11785def warn_unsafe_buffer_variable : Warning<
11786  "%0 is an %select{unsafe pointer used for buffer access|unsafe buffer that "
11787  "does not perform bounds checks}1">,
11788  InGroup<UnsafeBufferUsage>, DefaultIgnore;
11789def warn_unsafe_buffer_operation : Warning<
11790  "%select{unsafe pointer operation|unsafe pointer arithmetic|"
11791  "unsafe buffer access}0">,
11792  InGroup<UnsafeBufferUsage>, DefaultIgnore;
11793def note_unsafe_buffer_operation : Note<
11794  "used%select{| in pointer arithmetic| in buffer access}0 here">;
11795def err_loongarch_builtin_requires_la32 : Error<
11796  "this builtin requires target: loongarch32">;
11797} // end of sema component.
11798