xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td (revision 0eae32dcef82f6f06de6419a0d623d7def0cc8f6)
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_double_const_requires_fp64 : Warning<
122  "double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, "
123  "casting to single precision">;
124def err_half_const_requires_fp16 : Error<
125  "half precision constant requires cl_khr_fp16">;
126
127// C99 variable-length arrays
128def ext_vla : Extension<"variable length arrays are a C99 feature">,
129  InGroup<VLAExtension>;
130def warn_vla_used : Warning<"variable length array used">,
131  InGroup<VLA>, DefaultIgnore;
132def err_vla_in_sfinae : Error<
133  "variable length array cannot be formed during template argument deduction">;
134def err_array_star_in_function_definition : Error<
135  "variable length array must be bound in function definition">;
136def err_vla_decl_in_file_scope : Error<
137  "variable length array declaration not allowed at file scope">;
138def err_vla_decl_has_static_storage : Error<
139  "variable length array declaration cannot have 'static' storage duration">;
140def err_vla_decl_has_extern_linkage : Error<
141  "variable length array declaration cannot have 'extern' linkage">;
142def ext_vla_folded_to_constant : ExtWarn<
143  "variable length array folded to constant array as an extension">,
144  InGroup<GNUFoldingConstant>;
145def err_vla_unsupported : Error<
146  "variable length arrays are not supported for the current target">;
147def note_vla_unsupported : Note<
148  "variable length arrays are not supported for the current target">;
149
150// C99 variably modified types
151def err_variably_modified_template_arg : Error<
152  "variably modified type %0 cannot be used as a template argument">;
153def err_variably_modified_nontype_template_param : Error<
154  "non-type template parameter of variably modified type %0">;
155def err_variably_modified_new_type : Error<
156  "'new' cannot allocate object of variably modified type %0">;
157
158// C99 Designated Initializers
159def ext_designated_init : Extension<
160  "designated initializers are a C99 feature">, InGroup<C99Designator>;
161def err_array_designator_negative : Error<
162  "array designator value '%0' is negative">;
163def err_array_designator_empty_range : Error<
164  "array designator range [%0, %1] is empty">;
165def err_array_designator_non_array : Error<
166  "array designator cannot initialize non-array type %0">;
167def err_array_designator_too_large : Error<
168  "array designator index (%0) exceeds array bounds (%1)">;
169def err_field_designator_non_aggr : Error<
170  "field designator cannot initialize a "
171  "%select{non-struct, non-union|non-class}0 type %1">;
172def err_field_designator_unknown : Error<
173  "field designator %0 does not refer to any field in type %1">;
174def err_field_designator_nonfield : Error<
175  "field designator %0 does not refer to a non-static data member">;
176def note_field_designator_found : Note<"field designator refers here">;
177def err_designator_for_scalar_or_sizeless_init : Error<
178  "designator in initializer for %select{scalar|indivisible sizeless}0 "
179  "type %1">;
180def warn_initializer_overrides : Warning<
181  "initializer %select{partially |}0overrides prior initialization of "
182  "this subobject">, InGroup<InitializerOverrides>;
183def ext_initializer_overrides : ExtWarn<warn_initializer_overrides.Text>,
184  InGroup<InitializerOverrides>, SFINAEFailure;
185def err_initializer_overrides_destructed : Error<
186  "initializer would partially override prior initialization of object of "
187  "type %1 with non-trivial destruction">;
188def note_previous_initializer : Note<
189  "previous initialization %select{|with side effects }0is here"
190  "%select{| (side effects will not occur at run time)}0">;
191def err_designator_into_flexible_array_member : Error<
192  "designator into flexible array member subobject">;
193def note_flexible_array_member : Note<
194  "initialized flexible array member %0 is here">;
195def ext_flexible_array_init : Extension<
196  "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
197
198// C++20 designated initializers
199def ext_cxx_designated_init : Extension<
200  "designated initializers are a C++20 extension">, InGroup<CXX20Designator>;
201def warn_cxx17_compat_designated_init : Warning<
202  "designated initializers are incompatible with C++ standards before C++20">,
203  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
204def ext_designated_init_mixed : ExtWarn<
205  "mixture of designated and non-designated initializers in the same "
206  "initializer list is a C99 extension">, InGroup<C99Designator>;
207def note_designated_init_mixed : Note<
208  "first non-designated initializer is here">;
209def ext_designated_init_array : ExtWarn<
210  "array designators are a C99 extension">, InGroup<C99Designator>;
211def ext_designated_init_nested : ExtWarn<
212  "nested designators are a C99 extension">, InGroup<C99Designator>;
213def ext_designated_init_reordered : ExtWarn<
214  "ISO C++ requires field designators to be specified in declaration order; "
215  "field %1 will be initialized after field %0">, InGroup<ReorderInitList>,
216  SFINAEFailure;
217def note_previous_field_init : Note<
218  "previous initialization for field %0 is here">;
219def ext_designated_init_brace_elision : ExtWarn<
220  "brace elision for designated initializer is a C99 extension">,
221  InGroup<C99Designator>, SFINAEFailure;
222
223// Declarations.
224def ext_plain_complex : ExtWarn<
225  "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
226def ext_imaginary_constant : Extension<
227  "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
228def ext_integer_complex : Extension<
229  "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
230
231def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
232  "'_Fract' or '_Accum', not '%0'">;
233def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
234def err_invalid_width_spec : Error<
235  "'%select{|short|long|long long}0 %1' is invalid">;
236def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
237
238def ext_auto_type_specifier : ExtWarn<
239  "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
240def warn_auto_storage_class : Warning<
241  "'auto' storage class specifier is redundant and incompatible with C++11">,
242  InGroup<CXX11Compat>, DefaultIgnore;
243
244def warn_deprecated_register : Warning<
245  "'register' storage class specifier is deprecated "
246  "and incompatible with C++17">, InGroup<DeprecatedRegister>;
247def ext_register_storage_class : ExtWarn<
248  "ISO C++17 does not allow 'register' storage class specifier">,
249  DefaultError, InGroup<Register>;
250
251def err_invalid_decl_spec_combination : Error<
252  "cannot combine with previous '%0' declaration specifier">;
253def err_invalid_vector_decl_spec_combination : Error<
254  "cannot combine with previous '%0' declaration specifier. "
255  "'__vector' must be first">;
256def err_invalid_pixel_decl_spec_combination : Error<
257  "'__pixel' must be preceded by '__vector'.  "
258  "'%0' declaration specifier not allowed here">;
259def err_invalid_vector_bool_decl_spec : Error<
260  "cannot use '%0' with '__vector bool'">;
261def err_invalid_vector_long_decl_spec : Error<
262  "cannot use 'long' with '__vector'">;
263def err_invalid_vector_float_decl_spec : Error<
264  "cannot use 'float' with '__vector'">;
265def err_invalid_vector_double_decl_spec : Error <
266  "use of 'double' with '__vector' requires VSX support to be enabled "
267  "(available on POWER7 or later)">;
268def err_invalid_vector_bool_int128_decl_spec : Error <
269  "use of '__int128' with '__vector bool' requires VSX support enabled (on "
270  "POWER10 or later)">;
271def err_invalid_vector_int128_decl_spec : Error<
272  "use of '__int128' with '__vector' requires extended Altivec support"
273  " (available on POWER8 or later)">;
274def err_invalid_vector_long_long_decl_spec : Error <
275  "use of 'long long' with '__vector' requires VSX support (available on "
276  "POWER7 or later) to be enabled">;
277def err_invalid_vector_long_double_decl_spec : Error<
278  "cannot use 'long double' with '__vector'">;
279def warn_vector_long_decl_spec_combination : Warning<
280  "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
281
282def err_redeclaration_different_type : Error<
283  "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
284def err_bad_variable_name : Error<
285  "%0 cannot be the name of a variable or data member">;
286def err_bad_parameter_name : Error<
287  "%0 cannot be the name of a parameter">;
288def err_bad_parameter_name_template_id : Error<
289  "parameter name cannot have template arguments">;
290def ext_parameter_name_omitted_c2x : ExtWarn<
291  "omitting the parameter name in a function definition is a C2x extension">,
292  InGroup<C2x>;
293def err_anyx86_interrupt_attribute : Error<
294  "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
295  "have %select{a 'void' return type|"
296  "only a pointer parameter optionally followed by an integer parameter|"
297  "a pointer as the first parameter|a %2 type as the second parameter}1">;
298def err_anyx86_interrupt_called : Error<
299  "interrupt service routine cannot be called directly">;
300def warn_anyx86_interrupt_regsave : Warning<
301  "interrupt service routine should only call a function"
302  " with attribute 'no_caller_saved_registers'">,
303  InGroup<DiagGroup<"interrupt-service-routine">>;
304def warn_arm_interrupt_calling_convention : Warning<
305   "call to function without interrupt attribute could clobber interruptee's VFP registers">,
306   InGroup<Extra>;
307def warn_interrupt_attribute_invalid : Warning<
308   "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to "
309   "functions that have %select{no parameters|a 'void' return type}1">,
310   InGroup<IgnoredAttributes>;
311def warn_riscv_repeated_interrupt_attribute : Warning<
312  "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
313def note_riscv_repeated_interrupt_attribute : Note<
314  "repeated RISC-V 'interrupt' attribute is here">;
315def warn_unused_parameter : Warning<"unused parameter %0">,
316  InGroup<UnusedParameter>, DefaultIgnore;
317def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">,
318  InGroup<UnusedButSetParameter>, DefaultIgnore;
319def warn_unused_variable : Warning<"unused variable %0">,
320  InGroup<UnusedVariable>, DefaultIgnore;
321def warn_unused_but_set_variable : Warning<"variable %0 set but not used">,
322  InGroup<UnusedButSetVariable>, DefaultIgnore;
323def warn_unused_local_typedef : Warning<
324  "unused %select{typedef|type alias}0 %1">,
325  InGroup<UnusedLocalTypedef>, DefaultIgnore;
326def warn_unused_property_backing_ivar :
327  Warning<"ivar %0 which backs the property is not "
328  "referenced in this property's accessor">,
329  InGroup<UnusedPropertyIvar>, DefaultIgnore;
330def warn_unused_const_variable : Warning<"unused variable %0">,
331  InGroup<UnusedConstVariable>, DefaultIgnore;
332def warn_unused_exception_param : Warning<"unused exception parameter %0">,
333  InGroup<UnusedExceptionParameter>, DefaultIgnore;
334def warn_decl_in_param_list : Warning<
335  "declaration of %0 will not be visible outside of this function">,
336  InGroup<Visibility>;
337def warn_redefinition_in_param_list : Warning<
338  "redefinition of %0 will not be visible outside of this function">,
339  InGroup<Visibility>;
340def warn_empty_parens_are_function_decl : Warning<
341  "empty parentheses interpreted as a function declaration">,
342  InGroup<VexingParse>;
343def warn_parens_disambiguated_as_function_declaration : Warning<
344  "parentheses were disambiguated as a function declaration">,
345  InGroup<VexingParse>;
346def warn_parens_disambiguated_as_variable_declaration : Warning<
347  "parentheses were disambiguated as redundant parentheses around declaration "
348  "of variable named %0">, InGroup<VexingParse>;
349def warn_redundant_parens_around_declarator : Warning<
350  "redundant parentheses surrounding declarator">,
351  InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
352def note_additional_parens_for_variable_declaration : Note<
353  "add a pair of parentheses to declare a variable">;
354def note_raii_guard_add_name : Note<
355  "add a variable name to declare a %0 initialized with %1">;
356def note_function_style_cast_add_parentheses : Note<
357  "add enclosing parentheses to perform a function-style cast">;
358def note_remove_parens_for_variable_declaration : Note<
359  "remove parentheses to silence this warning">;
360def note_empty_parens_function_call : Note<
361  "change this ',' to a ';' to call %0">;
362def note_empty_parens_default_ctor : Note<
363  "remove parentheses to declare a variable">;
364def note_empty_parens_zero_initialize : Note<
365  "replace parentheses with an initializer to declare a variable">;
366def warn_unused_function : Warning<"unused function %0">,
367  InGroup<UnusedFunction>, DefaultIgnore;
368def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
369  InGroup<UnusedTemplate>, DefaultIgnore;
370def warn_unused_member_function : Warning<"unused member function %0">,
371  InGroup<UnusedMemberFunction>, DefaultIgnore;
372def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
373  InGroup<UsedButMarkedUnused>, DefaultIgnore;
374def warn_unneeded_internal_decl : Warning<
375  "%select{function|variable}0 %1 is not needed and will not be emitted">,
376  InGroup<UnneededInternalDecl>, DefaultIgnore;
377def warn_unneeded_static_internal_decl : Warning<
378  "'static' function %0 declared in header file "
379  "should be declared 'static inline'">,
380  InGroup<UnneededInternalDecl>, DefaultIgnore;
381def warn_unneeded_member_function : Warning<
382  "member function %0 is not needed and will not be emitted">,
383  InGroup<UnneededMemberFunction>, DefaultIgnore;
384def warn_unused_private_field: Warning<"private field %0 is not used">,
385  InGroup<UnusedPrivateField>, DefaultIgnore;
386def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
387  "%select{used|required to be captured for this use}1">,
388  InGroup<UnusedLambdaCapture>, DefaultIgnore;
389
390def warn_reserved_extern_symbol: Warning<
391  "identifier %0 is reserved because %select{"
392  "<ERROR>|" // ReservedIdentifierStatus::NotReserved
393  "it starts with '_' at global scope|"
394  "it starts with '_' and has C language linkage|"
395  "it starts with '__'|"
396  "it starts with '_' followed by a capital letter|"
397  "it contains '__'}1">,
398  InGroup<ReservedIdentifier>, DefaultIgnore;
399
400def warn_parameter_size: Warning<
401  "%0 is a large (%1 bytes) pass-by-value argument; "
402  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
403def warn_return_value_size: Warning<
404  "return value of %0 is a large (%1 bytes) pass-by-value object; "
405  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
406def warn_return_value_udt: Warning<
407  "%0 has C-linkage specified, but returns user-defined type %1 which is "
408  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
409def warn_return_value_udt_incomplete: Warning<
410  "%0 has C-linkage specified, but returns incomplete type %1 which could be "
411  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
412def warn_implicit_function_decl : Warning<
413  "implicit declaration of function %0">,
414  InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
415def ext_implicit_function_decl : ExtWarn<
416  "implicit declaration of function %0 is invalid in C99">,
417  InGroup<ImplicitFunctionDeclare>;
418def note_function_suggestion : Note<"did you mean %0?">;
419
420def err_ellipsis_first_param : Error<
421  "ISO C requires a named parameter before '...'">;
422def err_declarator_need_ident : Error<"declarator requires an identifier">;
423def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
424def err_language_linkage_spec_not_ascii : Error<
425  "string literal in language linkage specifier cannot have an "
426  "encoding-prefix">;
427def ext_use_out_of_scope_declaration : ExtWarn<
428  "use of out-of-scope declaration of %0%select{| whose type is not "
429  "compatible with that of an implicit declaration}1">,
430  InGroup<DiagGroup<"out-of-scope-function">>;
431def err_inline_non_function : Error<
432  "'inline' can only appear on functions%select{| and non-local variables}0">;
433def err_noreturn_non_function : Error<
434  "'_Noreturn' can only appear on functions">;
435def warn_qual_return_type : Warning<
436  "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
437  InGroup<IgnoredQualifiers>, DefaultIgnore;
438def warn_deprecated_redundant_constexpr_static_def : Warning<
439  "out-of-line definition of constexpr static data member is redundant "
440  "in C++17 and is deprecated">,
441  InGroup<Deprecated>, DefaultIgnore;
442
443def warn_decl_shadow :
444  Warning<"declaration shadows a %select{"
445          "local variable|"
446          "variable in %2|"
447          "static data member of %2|"
448          "field of %2|"
449          "typedef in %2|"
450          "type alias in %2|"
451          "structured binding}1">,
452  InGroup<Shadow>, DefaultIgnore;
453def warn_decl_shadow_uncaptured_local :
454  Warning<warn_decl_shadow.Text>,
455  InGroup<ShadowUncapturedLocal>, DefaultIgnore;
456def warn_ctor_parm_shadows_field:
457  Warning<"constructor parameter %0 shadows the field %1 of %2">,
458  InGroup<ShadowFieldInConstructor>, DefaultIgnore;
459def warn_modifying_shadowing_decl :
460  Warning<"modifying constructor parameter %0 that shadows a "
461          "field of %1">,
462  InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
463
464// C++ decomposition declarations
465def err_decomp_decl_context : Error<
466  "decomposition declaration not permitted in this context">;
467def warn_cxx14_compat_decomp_decl : Warning<
468  "decomposition declarations are incompatible with "
469  "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
470def ext_decomp_decl : ExtWarn<
471  "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
472def ext_decomp_decl_cond : ExtWarn<
473  "ISO C++17 does not permit structured binding declaration in a condition">,
474  InGroup<DiagGroup<"binding-in-condition">>;
475def err_decomp_decl_spec : Error<
476  "decomposition declaration cannot be declared "
477  "%plural{1:'%1'|:with '%1' specifiers}0">;
478def ext_decomp_decl_spec : ExtWarn<
479  "decomposition declaration declared "
480  "%plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension">,
481  InGroup<CXX20>;
482def warn_cxx17_compat_decomp_decl_spec : Warning<
483  "decomposition declaration declared "
484  "%plural{1:'%1'|:with '%1' specifiers}0 "
485  "is incompatible with C++ standards before C++20">,
486  InGroup<CXXPre20Compat>, DefaultIgnore;
487def err_decomp_decl_type : Error<
488  "decomposition declaration cannot be declared with type %0; "
489  "declared type must be 'auto' or reference to 'auto'">;
490def err_decomp_decl_parens : Error<
491  "decomposition declaration cannot be declared with parentheses">;
492def err_decomp_decl_template : Error<
493  "decomposition declaration template not supported">;
494def err_decomp_decl_not_alone : Error<
495  "decomposition declaration must be the only declaration in its group">;
496def err_decomp_decl_requires_init : Error<
497  "decomposition declaration %0 requires an initializer">;
498def err_decomp_decl_wrong_number_bindings : Error<
499  "type %0 decomposes into %3 %plural{1:element|:elements}2, but "
500  "%select{%plural{0:no|:only %1}1|%1}4 "
501  "%plural{1:name was|:names were}1 provided">;
502def err_decomp_decl_unbindable_type : Error<
503  "cannot decompose %select{union|non-class, non-array}1 type %2">;
504def err_decomp_decl_multiple_bases_with_members : Error<
505  "cannot decompose class type %1: "
506  "%select{its base classes %2 and|both it and its base class}0 %3 "
507  "have non-static data members">;
508def err_decomp_decl_ambiguous_base : Error<
509  "cannot decompose members of ambiguous base class %1 of %0:%2">;
510def err_decomp_decl_inaccessible_base : Error<
511  "cannot decompose members of inaccessible base class %1 of %0">,
512  AccessControl;
513def err_decomp_decl_inaccessible_field : Error<
514  "cannot decompose %select{private|protected}0 member %1 of %3">,
515  AccessControl;
516def err_decomp_decl_lambda : Error<
517  "cannot decompose lambda closure type">;
518def err_decomp_decl_anon_union_member : Error<
519  "cannot decompose class type %0 because it has an anonymous "
520  "%select{struct|union}1 member">;
521def err_decomp_decl_std_tuple_element_not_specialized : Error<
522  "cannot decompose this type; 'std::tuple_element<%0>::type' "
523  "does not name a type">;
524def err_decomp_decl_std_tuple_size_not_constant : Error<
525  "cannot decompose this type; 'std::tuple_size<%0>::value' "
526  "is not a valid integral constant expression">;
527def note_in_binding_decl_init : Note<
528  "in implicit initialization of binding declaration %0">;
529
530def err_std_type_trait_not_class_template : Error<
531  "unsupported standard library implementation: "
532  "'std::%0' is not a class template">;
533
534// C++ using declarations
535def err_using_requires_qualname : Error<
536  "using declaration requires a qualified name">;
537def err_using_typename_non_type : Error<
538  "'typename' keyword used on a non-type">;
539def err_using_dependent_value_is_type : Error<
540  "dependent using declaration resolved to type without 'typename'">;
541def err_using_decl_nested_name_specifier_is_not_class : Error<
542  "using declaration in class refers into '%0', which is not a class">;
543def warn_cxx17_compat_using_decl_non_member_enumerator : Warning<
544  "member using declaration naming non-class '%0' enumerator is "
545  "incompatible with C++ standards before C++20">, InGroup<CXXPre20Compat>,
546  DefaultIgnore;
547def err_using_decl_nested_name_specifier_is_current_class : Error<
548  "using declaration refers to its own class">;
549def err_using_decl_nested_name_specifier_is_not_base_class : Error<
550  "using declaration refers into '%0', which is not a base class of %1">;
551def err_using_decl_constructor_not_in_direct_base : Error<
552  "%0 is not a direct base of %1, cannot inherit constructors">;
553def err_using_decl_can_not_refer_to_class_member : Error<
554  "using declaration cannot refer to class member">;
555def warn_cxx17_compat_using_decl_class_member_enumerator : Warning<
556  "member using declaration naming a non-member enumerator is incompatible "
557  "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
558def ext_using_decl_class_member_enumerator : ExtWarn<
559  "member using declaration naming a non-member enumerator is "
560  "a C++20 extension">, InGroup<CXX20>;
561def err_using_enum_is_dependent : Error<
562  "using-enum cannot name a dependent type">;
563def err_ambiguous_inherited_constructor : Error<
564  "constructor of %0 inherited from multiple base class subobjects">;
565def note_ambiguous_inherited_constructor_using : Note<
566  "inherited from base class %0 here">;
567def note_using_decl_class_member_workaround : Note<
568  "use %select{an alias declaration|a typedef declaration|a reference|"
569  "a const variable|a constexpr variable}0 instead">;
570def err_using_decl_can_not_refer_to_namespace : Error<
571  "using declaration cannot refer to a namespace">;
572def warn_cxx17_compat_using_decl_scoped_enumerator: Warning<
573  "using declaration naming a scoped enumerator is incompatible with "
574  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
575def ext_using_decl_scoped_enumerator : ExtWarn<
576  "using declaration naming a scoped enumerator is a C++20 extension">,
577  InGroup<CXX20>;
578def err_using_decl_constructor : Error<
579  "using declaration cannot refer to a constructor">;
580def warn_cxx98_compat_using_decl_constructor : Warning<
581  "inheriting constructors are incompatible with C++98">,
582  InGroup<CXX98Compat>, DefaultIgnore;
583def err_using_decl_destructor : Error<
584  "using declaration cannot refer to a destructor">;
585def err_using_decl_template_id : Error<
586  "using declaration cannot refer to a template specialization">;
587def note_using_decl_target : Note<"target of using declaration">;
588def note_using_decl_conflict : Note<"conflicting declaration">;
589def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
590def err_using_decl_conflict : Error<
591  "target of using declaration conflicts with declaration already in scope">;
592def err_using_decl_conflict_reverse : Error<
593  "declaration conflicts with target of using declaration already in scope">;
594def note_using_decl : Note<"%select{|previous }0using declaration">;
595def err_using_decl_redeclaration_expansion : Error<
596  "using declaration pack expansion at block scope produces multiple values">;
597def err_use_of_empty_using_if_exists : Error<
598  "reference to unresolved using declaration">;
599def note_empty_using_if_exists_here : Note<
600  "using declaration annotated with 'using_if_exists' here">;
601def err_using_if_exists_on_ctor : Error<
602  "'using_if_exists' attribute cannot be applied to an inheriting constructor">;
603def err_using_enum_decl_redeclaration : Error<
604  "redeclaration of using-enum declaration">;
605def note_using_enum_decl : Note<"%select{|previous }0using-enum declaration">;
606
607def warn_access_decl_deprecated : Warning<
608  "access declarations are deprecated; use using declarations instead">,
609  InGroup<Deprecated>;
610def err_access_decl : Error<
611  "ISO C++11 does not allow access declarations; "
612  "use using declarations instead">;
613def warn_deprecated_copy : Warning<
614  "definition of implicit copy %select{constructor|assignment operator}1 "
615  "for %0 is deprecated because it has a user-declared copy "
616  "%select{assignment operator|constructor}1">,
617  InGroup<DeprecatedCopy>, DefaultIgnore;
618def warn_deprecated_copy_with_dtor : Warning<
619  "definition of implicit copy %select{constructor|assignment operator}1 "
620  "for %0 is deprecated because it has a user-declared destructor">,
621  InGroup<DeprecatedCopyWithDtor>, DefaultIgnore;
622def warn_deprecated_copy_with_user_provided_copy: Warning<
623  "definition of implicit copy %select{constructor|assignment operator}1 "
624  "for %0 is deprecated because it has a user-provided copy "
625  "%select{assignment operator|constructor}1">,
626  InGroup<DeprecatedCopyWithUserProvidedCopy>, DefaultIgnore;
627def warn_deprecated_copy_with_user_provided_dtor : Warning<
628  "definition of implicit copy %select{constructor|assignment operator}1 "
629  "for %0 is deprecated because it has a user-provided destructor">,
630  InGroup<DeprecatedCopyWithUserProvidedDtor>, DefaultIgnore;
631def warn_cxx17_compat_exception_spec_in_signature : Warning<
632  "mangled name of %0 will change in C++17 due to non-throwing exception "
633  "specification in function signature">, InGroup<CXX17CompatMangling>;
634
635def warn_global_constructor : Warning<
636  "declaration requires a global constructor">,
637  InGroup<GlobalConstructors>, DefaultIgnore;
638def warn_global_destructor : Warning<
639  "declaration requires a global destructor">,
640   InGroup<GlobalConstructors>, DefaultIgnore;
641def warn_exit_time_destructor : Warning<
642  "declaration requires an exit-time destructor">,
643  InGroup<ExitTimeDestructors>, DefaultIgnore;
644
645def err_invalid_thread : Error<
646  "'%0' is only allowed on variable declarations">;
647def err_thread_non_global : Error<
648  "'%0' variables must have global storage">;
649def err_thread_unsupported : Error<
650  "thread-local storage is not supported for the current target">;
651
652// FIXME: Combine fallout warnings to just one warning.
653def warn_maybe_falloff_nonvoid_function : Warning<
654  "non-void function does not return a value in all control paths">,
655  InGroup<ReturnType>;
656def warn_falloff_nonvoid_function : Warning<
657  "non-void function does not return a value">,
658  InGroup<ReturnType>;
659def err_maybe_falloff_nonvoid_block : Error<
660  "non-void block does not return a value in all control paths">;
661def err_falloff_nonvoid_block : Error<
662  "non-void block does not return a value">;
663def warn_maybe_falloff_nonvoid_coroutine : Warning<
664  "non-void coroutine does not return a value in all control paths">,
665  InGroup<ReturnType>;
666def warn_falloff_nonvoid_coroutine : Warning<
667  "non-void coroutine does not return a value">,
668  InGroup<ReturnType>;
669def warn_suggest_noreturn_function : Warning<
670  "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
671  InGroup<MissingNoreturn>, DefaultIgnore;
672def warn_suggest_noreturn_block : Warning<
673  "block could be declared with attribute 'noreturn'">,
674  InGroup<MissingNoreturn>, DefaultIgnore;
675
676// Unreachable code.
677def warn_unreachable : Warning<
678  "code will never be executed">,
679  InGroup<UnreachableCode>, DefaultIgnore;
680def warn_unreachable_break : Warning<
681  "'break' will never be executed">,
682  InGroup<UnreachableCodeBreak>, DefaultIgnore;
683def warn_unreachable_return : Warning<
684  "'return' will never be executed">,
685  InGroup<UnreachableCodeReturn>, DefaultIgnore;
686def warn_unreachable_loop_increment : Warning<
687  "loop will run at most once (loop increment never executed)">,
688  InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
689def warn_unreachable_fallthrough_attr : Warning<
690  "fallthrough annotation in unreachable code">,
691  InGroup<UnreachableCodeFallthrough>, DefaultIgnore;
692def note_unreachable_silence : Note<
693  "silence by adding parentheses to mark code as explicitly dead">;
694
695/// Built-in functions.
696def ext_implicit_lib_function_decl : ExtWarn<
697  "implicitly declaring library function '%0' with type %1">,
698  InGroup<ImplicitFunctionDeclare>;
699def note_include_header_or_declare : Note<
700  "include the header <%0> or explicitly provide a declaration for '%1'">;
701def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
702def warn_implicit_decl_no_jmp_buf
703    : Warning<"declaration of built-in function '%0' requires the declaration"
704    " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.">,
705      InGroup<DiagGroup<"incomplete-setjmp-declaration">>;
706def warn_implicit_decl_requires_sysheader : Warning<
707  "declaration of built-in function '%1' requires inclusion of the header <%0>">,
708  InGroup<BuiltinRequiresHeader>;
709def warn_redecl_library_builtin : Warning<
710  "incompatible redeclaration of library function %0">,
711  InGroup<DiagGroup<"incompatible-library-redeclaration">>;
712def err_builtin_definition : Error<"definition of builtin function %0">;
713def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
714def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
715def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as "
716  "%select{GCP|CDE}1">;
717def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
718def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
719def err_invalid_cpu_specific_dispatch_value : Error<
720"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
721def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
722  InGroup<ImplicitFunctionDeclare>, DefaultError;
723def warn_cstruct_memaccess : Warning<
724  "%select{destination for|source of|first operand of|second operand of}0 this "
725  "%1 call is a pointer to record %2 that is not trivial to "
726  "%select{primitive-default-initialize|primitive-copy}3">,
727  InGroup<NonTrivialMemaccess>;
728def note_nontrivial_field : Note<
729  "field is non-trivial to %select{copy|default-initialize}0">;
730def err_non_trivial_c_union_in_invalid_context : Error<
731  "cannot %select{"
732  "use type %1 for a function/method parameter|"
733  "use type %1 for function/method return|"
734  "default-initialize an object of type %1|"
735  "declare an automatic variable of type %1|"
736  "copy-initialize an object of type %1|"
737  "assign to a variable of type %1|"
738  "construct an automatic compound literal of type %1|"
739  "capture a variable of type %1|"
740  "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion"
741  "}3 "
742  "since it %select{contains|is}2 a union that is non-trivial to "
743  "%select{default-initialize|destruct|copy}0">;
744def note_non_trivial_c_union : Note<
745  "%select{%2 has subobjects that are|%3 has type %2 that is}0 "
746  "non-trivial to %select{default-initialize|destruct|copy}1">;
747def warn_dyn_class_memaccess : Warning<
748  "%select{destination for|source of|first operand of|second operand of}0 this "
749  "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
750  "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
751  InGroup<DynamicClassMemaccess>;
752def note_bad_memaccess_silence : Note<
753  "explicitly cast the pointer to silence this warning">;
754def warn_sizeof_pointer_expr_memaccess : Warning<
755  "'%0' call operates on objects of type %1 while the size is based on a "
756  "different type %2">,
757  InGroup<SizeofPointerMemaccess>;
758def warn_sizeof_pointer_expr_memaccess_note : Note<
759  "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
760  "it by the number of elements)|remove the addressof in the argument to "
761  "'sizeof' (and multiply it by the number of elements)|provide an explicit "
762  "length}0?">;
763def warn_sizeof_pointer_type_memaccess : Warning<
764  "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
765  "%select{destination|source}2; expected %3 or an explicit length">,
766  InGroup<SizeofPointerMemaccess>;
767def warn_strlcpycat_wrong_size : Warning<
768  "size argument in %0 call appears to be size of the source; "
769  "expected the size of the destination">,
770  InGroup<DiagGroup<"strlcpy-strlcat-size">>;
771def note_strlcpycat_wrong_size : Note<
772  "change size argument to be the size of the destination">;
773def warn_memsize_comparison : Warning<
774  "size argument in %0 call is a comparison">,
775  InGroup<DiagGroup<"memsize-comparison">>;
776def note_memsize_comparison_paren : Note<
777  "did you mean to compare the result of %0 instead?">;
778def note_memsize_comparison_cast_silence : Note<
779  "explicitly cast the argument to size_t to silence this warning">;
780def warn_suspicious_sizeof_memset : Warning<
781  "%select{'size' argument to memset is '0'|"
782  "setting buffer to a 'sizeof' expression}0"
783  "; did you mean to transpose the last two arguments?">,
784  InGroup<MemsetTransposedArgs>;
785def note_suspicious_sizeof_memset_silence : Note<
786  "%select{parenthesize the third argument|"
787  "cast the second argument to 'int'}0 to silence">;
788def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
789  InGroup<SuspiciousBzero>;
790def note_suspicious_bzero_size_silence : Note<
791  "parenthesize the second argument to silence">;
792
793def warn_strncat_large_size : Warning<
794  "the value of the size argument in 'strncat' is too large, might lead to a "
795  "buffer overflow">, InGroup<StrncatSize>;
796def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
797  "to be size of the source">, InGroup<StrncatSize>;
798def warn_strncat_wrong_size : Warning<
799  "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
800def note_strncat_wrong_size : Note<
801  "change the argument to be the free space in the destination buffer minus "
802  "the terminating null byte">;
803
804def warn_assume_side_effects : Warning<
805  "the argument to %0 has side effects that will be discarded">,
806  InGroup<DiagGroup<"assume">>;
807def warn_assume_attribute_string_unknown : Warning<
808  "unknown assumption string '%0'; attribute is potentially ignored">,
809  InGroup<UnknownAssumption>;
810def warn_assume_attribute_string_unknown_suggested : Warning<
811  "unknown assumption string '%0' may be misspelled; attribute is potentially "
812  "ignored, did you mean '%1'?">,
813  InGroup<MisspelledAssumption>;
814
815def warn_builtin_chk_overflow : Warning<
816  "'%0' will always overflow; destination buffer has size %1,"
817  " but size argument is %2">,
818  InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
819
820def warn_fortify_source_overflow
821  : Warning<warn_builtin_chk_overflow.Text>, InGroup<FortifySource>;
822def warn_fortify_source_size_mismatch : Warning<
823  "'%0' size argument is too large; destination buffer has size %1,"
824  " but size argument is %2">, InGroup<FortifySource>;
825
826def warn_fortify_strlen_overflow: Warning<
827  "'%0' will always overflow; destination buffer has size %1,"
828  " but the source string has length %2 (including NUL byte)">,
829  InGroup<FortifySource>;
830
831def warn_fortify_source_format_overflow : Warning<
832  "'%0' will always overflow; destination buffer has size %1,"
833  " but format string expands to at least %2">,
834  InGroup<FortifySource>;
835
836def warn_fortify_scanf_overflow : Warning<
837  "'%0' may overflow; destination buffer in argument %1 has size "
838  "%2, but the corresponding specifier may require size %3">,
839  InGroup<FortifySource>;
840
841def err_function_start_invalid_type: Error<
842  "argument must be a function">;
843
844/// main()
845// static main() is not an error in C, just in C++.
846def warn_static_main : Warning<"'main' should not be declared static">,
847    InGroup<Main>;
848def err_static_main : Error<"'main' is not allowed to be declared static">;
849def err_inline_main : Error<"'main' is not allowed to be declared inline">;
850def ext_variadic_main : ExtWarn<
851  "'main' is not allowed to be declared variadic">, InGroup<Main>;
852def ext_noreturn_main : ExtWarn<
853  "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
854def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
855def err_constexpr_main : Error<
856  "'main' is not allowed to be declared %select{constexpr|consteval}0">;
857def err_deleted_main : Error<"'main' is not allowed to be deleted">;
858def err_mainlike_template_decl : Error<"%0 cannot be a template">;
859def err_main_returns_nonint : Error<"'main' must return 'int'">;
860def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
861    InGroup<MainReturnType>;
862def note_main_change_return_type : Note<"change return type to 'int'">;
863def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
864    "must be 0, 2, or 3">;
865def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
866    InGroup<Main>;
867def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
868    "parameter of 'main' (%select{argument count|argument array|environment|"
869    "platform-specific data}0) must be of type %1">;
870def warn_main_returns_bool_literal : Warning<"bool literal returned from "
871    "'main'">, InGroup<Main>;
872def err_main_global_variable :
873    Error<"main cannot be declared as global variable">;
874def warn_main_redefined : Warning<"variable named 'main' with external linkage "
875    "has undefined behavior">, InGroup<Main>;
876def ext_main_used : Extension<
877  "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
878
879/// parser diagnostics
880def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
881  InGroup<MissingDeclarations>;
882def err_no_declarators : Error<"declaration does not declare anything">;
883def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
884  InGroup<MissingDeclarations>;
885def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
886
887def ext_non_c_like_anon_struct_in_typedef : ExtWarn<
888  "anonymous non-C-compatible type given name for linkage purposes "
889  "by %select{typedef|alias}0 declaration; "
890  "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>;
891def err_non_c_like_anon_struct_in_typedef : Error<
892  "anonymous non-C-compatible type given name for linkage purposes "
893  "by %select{typedef|alias}0 declaration after its linkage was computed; "
894  "add a tag name here to establish linkage prior to definition">;
895def err_typedef_changes_linkage : Error<
896  "unsupported: anonymous type given name for linkage purposes "
897  "by %select{typedef|alias}0 declaration after its linkage was computed; "
898  "add a tag name here to establish linkage prior to definition">;
899def note_non_c_like_anon_struct : Note<
900  "type is not C-compatible due to this "
901  "%select{base class|default member initializer|lambda expression|"
902  "friend declaration|member declaration}0">;
903def note_typedef_for_linkage_here : Note<
904  "type is given name %0 for linkage purposes by this "
905  "%select{typedef|alias}1 declaration">;
906
907def err_statically_allocated_object : Error<
908  "interface type cannot be statically allocated">;
909def err_object_cannot_be_passed_returned_by_value : Error<
910  "interface type %1 cannot be %select{returned|passed}0 by value"
911  "; did you forget * in %1?">;
912def err_parameters_retval_cannot_have_fp16_type : Error<
913  "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
914def err_opencl_half_load_store : Error<
915  "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
916  "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
917def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
918def err_opencl_half_declaration : Error<
919  "declaring variable of type %0 is not allowed">;
920def err_opencl_invalid_param : Error<
921  "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">;
922def err_opencl_invalid_return : Error<
923  "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
924def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
925def warn_pragma_options_align_reset_failed : Warning<
926  "#pragma options align=reset failed: %0">,
927  InGroup<IgnoredPragmas>;
928def err_pragma_options_align_mac68k_target_unsupported : Error<
929  "mac68k alignment pragma is not supported on this target">;
930def warn_pragma_align_not_xl_compatible : Warning<
931  "#pragma align(packed) may not be compatible with objects generated with AIX XL C/C++">,
932  InGroup<AIXCompat>;
933def warn_pragma_pack_invalid_alignment : Warning<
934  "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
935  InGroup<IgnoredPragmas>;
936def err_pragma_pack_invalid_alignment : Error<
937  warn_pragma_pack_invalid_alignment.Text>;
938def warn_pragma_pack_non_default_at_include : Warning<
939  "non-default #pragma pack value changes the alignment of struct or union "
940  "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
941  DefaultIgnore;
942def warn_pragma_pack_modified_after_include : Warning<
943  "the current #pragma pack alignment value is modified in the included "
944  "file">, InGroup<PragmaPack>;
945def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
946  "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
947def note_pragma_pack_here : Note<
948  "previous '#pragma pack' directive that modifies alignment is here">;
949def note_pragma_pack_pop_instead_reset : Note<
950  "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
951// Follow the Microsoft implementation.
952def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
953def warn_pragma_pack_pop_identifier_and_alignment : Warning<
954  "specifying both a name and alignment to 'pop' is undefined">;
955def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
956  InGroup<IgnoredPragmas>;
957def err_pragma_fc_pp_scope : Error<
958  "'#pragma float_control push/pop' can only appear at file or namespace scope "
959  "or within a language linkage specification">;
960def err_pragma_fc_noprecise_requires_nofenv : Error<
961  "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
962def err_pragma_fc_except_requires_precise : Error<
963  "'#pragma float_control(except, on)' is illegal when precise is disabled">;
964def err_pragma_fc_noprecise_requires_noexcept : Error<
965  "'#pragma float_control(precise, off)' is illegal when except is enabled">;
966def err_pragma_fenv_requires_precise : Error<
967  "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">;
968def warn_cxx_ms_struct :
969  Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
970          "with base classes or virtual functions">,
971  DefaultError, InGroup<IncompatibleMSStruct>;
972def err_pragma_pack_identifer_not_supported : Error<
973  "specifying an identifier within `#pragma pack` is not supported on this target">;
974def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
975def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
976def err_invalid_super_scope : Error<"invalid use of '__super', "
977  "this keyword can only be used inside class or member function scope">;
978def err_super_in_lambda_unsupported : Error<
979  "use of '__super' inside a lambda is unsupported">;
980
981def warn_pragma_unused_undeclared_var : Warning<
982  "undeclared variable %0 used as an argument for '#pragma unused'">,
983  InGroup<IgnoredPragmas>;
984def warn_atl_uuid_deprecated : Warning<
985  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
986  InGroup<DeprecatedDeclarations>;
987def warn_pragma_unused_expected_var_arg : Warning<
988  "only variables can be arguments to '#pragma unused'">,
989  InGroup<IgnoredPragmas>;
990def err_pragma_push_visibility_mismatch : Error<
991  "#pragma visibility push with no matching #pragma visibility pop">;
992def note_surrounding_namespace_ends_here : Note<
993  "surrounding namespace with visibility attribute ends here">;
994def err_pragma_pop_visibility_mismatch : Error<
995  "#pragma visibility pop with no matching #pragma visibility push">;
996def note_surrounding_namespace_starts_here : Note<
997  "surrounding namespace with visibility attribute starts here">;
998def err_pragma_loop_invalid_argument_type : Error<
999  "invalid argument of type %0; expected an integer type">;
1000def err_pragma_loop_invalid_argument_value : Error<
1001  "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
1002def err_pragma_loop_compatibility : Error<
1003  "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
1004def err_pragma_loop_precedes_nonloop : Error<
1005  "expected a for, while, or do-while loop to follow '%0'">;
1006
1007def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
1008  "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
1009  "those declarations">;
1010def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
1011  "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
1012def err_pragma_attribute_invalid_matchers : Error<
1013  "attribute %0 can't be applied to %1">;
1014def err_pragma_attribute_stack_mismatch : Error<
1015  "'#pragma clang attribute %select{%1.|}0pop' with no matching"
1016  " '#pragma clang attribute %select{%1.|}0push'">;
1017def warn_pragma_attribute_unused : Warning<
1018  "unused attribute %0 in '#pragma clang attribute push' region">,
1019  InGroup<PragmaClangAttribute>;
1020def note_pragma_attribute_region_ends_here : Note<
1021  "'#pragma clang attribute push' regions ends here">;
1022def err_pragma_attribute_no_pop_eof : Error<"unterminated "
1023  "'#pragma clang attribute push' at end of file">;
1024def note_pragma_attribute_applied_decl_here : Note<
1025  "when applied to this declaration">;
1026def err_pragma_attr_attr_no_push : Error<
1027  "'#pragma clang attribute' attribute with no matching "
1028  "'#pragma clang attribute push'">;
1029
1030/// Objective-C parser diagnostics
1031def err_duplicate_class_def : Error<
1032  "duplicate interface definition for class %0">;
1033def err_undef_superclass : Error<
1034  "cannot find interface declaration for %0, superclass of %1">;
1035def err_forward_superclass : Error<
1036  "attempting to use the forward class %0 as superclass of %1">;
1037def err_no_nsconstant_string_class : Error<
1038  "cannot find interface declaration for %0">;
1039def err_recursive_superclass : Error<
1040  "trying to recursively use %0 as superclass of %1">;
1041def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
1042def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
1043def warn_duplicate_protocol_def : Warning<
1044  "duplicate protocol definition of %0 is ignored">,
1045  InGroup<DiagGroup<"duplicate-protocol">>;
1046def err_protocol_has_circular_dependency : Error<
1047  "protocol has circular dependency">;
1048def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
1049def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
1050def err_atprotocol_protocol : Error<
1051  "@protocol is using a forward protocol declaration of %0">;
1052def warn_readonly_property : Warning<
1053  "attribute 'readonly' of property %0 restricts attribute "
1054  "'readwrite' of property inherited from %1">,
1055  InGroup<PropertyAttr>;
1056
1057def warn_property_attribute : Warning<
1058  "'%1' attribute on property %0 does not match the property inherited from %2">,
1059  InGroup<PropertyAttr>;
1060def warn_property_types_are_incompatible : Warning<
1061  "property type %0 is incompatible with type %1 inherited from %2">,
1062  InGroup<DiagGroup<"incompatible-property-type">>;
1063def warn_protocol_property_mismatch : Warning<
1064  "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
1065  "getter %1|with setter %1}0 was selected for synthesis">,
1066  InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
1067def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
1068def err_undef_interface : Error<"cannot find interface declaration for %0">;
1069def err_category_forward_interface : Error<
1070  "cannot define %select{category|class extension}0 for undefined class %1">;
1071def err_class_extension_after_impl : Error<
1072  "cannot declare class extension for %0 after class implementation">;
1073def note_implementation_declared : Note<
1074  "class implementation is declared here">;
1075def note_while_in_implementation : Note<
1076  "detected while default synthesizing properties in class implementation">;
1077def note_class_declared : Note<
1078  "class is declared here">;
1079def note_receiver_class_declared : Note<
1080  "receiver is instance of class declared here">;
1081def note_receiver_expr_here : Note<
1082  "receiver expression is here">;
1083def note_receiver_is_id : Note<
1084  "receiver is treated with 'id' type for purpose of method lookup">;
1085def note_suppressed_class_declare : Note<
1086  "class with specified objc_requires_property_definitions attribute is declared here">;
1087def err_objc_root_class_subclass : Error<
1088  "objc_root_class attribute may only be specified on a root class declaration">;
1089def err_restricted_superclass_mismatch : Error<
1090  "cannot subclass a class that was declared with the "
1091  "'objc_subclassing_restricted' attribute">;
1092def err_class_stub_subclassing_mismatch : Error<
1093  "'objc_class_stub' attribute cannot be specified on a class that does not "
1094  "have the 'objc_subclassing_restricted' attribute">;
1095def err_implementation_of_class_stub : Error<
1096  "cannot declare implementation of a class declared with the "
1097  "'objc_class_stub' attribute">;
1098def warn_objc_root_class_missing : Warning<
1099  "class %0 defined without specifying a base class">,
1100  InGroup<ObjCRootClass>;
1101def err_objc_runtime_visible_category : Error<
1102  "cannot implement a category for class %0 that is only visible via the "
1103  "Objective-C runtime">;
1104def err_objc_runtime_visible_subclass : Error<
1105  "cannot implement subclass %0 of a superclass %1 that is only visible via the "
1106  "Objective-C runtime">;
1107def note_objc_needs_superclass : Note<
1108  "add a super class to fix this problem">;
1109def err_conflicting_super_class : Error<"conflicting super class name %0">;
1110def err_dup_implementation_class : Error<"reimplementation of class %0">;
1111def err_dup_implementation_category : Error<
1112  "reimplementation of category %1 for class %0">;
1113def err_conflicting_ivar_type : Error<
1114  "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
1115def err_duplicate_ivar_declaration : Error<
1116  "instance variable is already declared">;
1117def warn_on_superclass_use : Warning<
1118  "class implementation may not have super class">;
1119def err_conflicting_ivar_bitwidth : Error<
1120  "instance variable %0 has conflicting bit-field width">;
1121def err_conflicting_ivar_name : Error<
1122  "conflicting instance variable names: %0 vs %1">;
1123def err_inconsistent_ivar_count : Error<
1124  "inconsistent number of instance variables specified">;
1125def warn_undef_method_impl : Warning<"method definition for %0 not found">,
1126  InGroup<DiagGroup<"incomplete-implementation">>;
1127def warn_objc_boxing_invalid_utf8_string : Warning<
1128  "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
1129  InGroup<ObjCBoxing>;
1130
1131def err_objc_non_runtime_protocol_in_protocol_expr : Error<
1132  "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">;
1133def err_objc_direct_on_protocol : Error<
1134  "'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
1135  "declared in an Objective-C protocol">;
1136def err_objc_direct_duplicate_decl : Error<
1137  "%select{|direct }0%select{method|property}1 declaration conflicts "
1138  "with previous %select{|direct }2declaration of %select{method|property}1 %3">;
1139def err_objc_direct_impl_decl_mismatch : Error<
1140  "direct method was declared in %select{the primary interface|an extension|a category}0 "
1141  "but is implemented in %select{the primary interface|a category|a different category}1">;
1142def err_objc_direct_missing_on_decl : Error<
1143  "direct method implementation was previously declared not direct">;
1144def err_objc_direct_on_override : Error<
1145  "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">;
1146def err_objc_override_direct_method : Error<
1147  "cannot override a method that is declared direct by a superclass">;
1148def warn_objc_direct_ignored : Warning<
1149  "%0 attribute isn't implemented by this Objective-C runtime">,
1150  InGroup<IgnoredAttributes>;
1151def warn_objc_direct_property_ignored : Warning<
1152  "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
1153  InGroup<IgnoredAttributes>;
1154def err_objc_direct_dynamic_property : Error<
1155  "direct property cannot be @dynamic">;
1156def err_objc_direct_protocol_conformance : Error<
1157  "%select{category %1|class extension}0 cannot conform to protocol %2 because "
1158  "of direct members declared in interface %3">;
1159def note_direct_member_here : Note<"direct member declared here">;
1160
1161def warn_conflicting_overriding_ret_types : Warning<
1162  "conflicting return type in "
1163  "declaration of %0%diff{: $ vs $|}1,2">,
1164  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1165
1166def warn_conflicting_ret_types : Warning<
1167  "conflicting return type in "
1168  "implementation of %0%diff{: $ vs $|}1,2">,
1169  InGroup<MismatchedReturnTypes>;
1170
1171def warn_conflicting_overriding_ret_type_modifiers : Warning<
1172  "conflicting distributed object modifiers on return type "
1173  "in declaration of %0">,
1174  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1175
1176def warn_conflicting_ret_type_modifiers : Warning<
1177  "conflicting distributed object modifiers on return type "
1178  "in implementation of %0">,
1179  InGroup<DistributedObjectModifiers>;
1180
1181def warn_non_covariant_overriding_ret_types : Warning<
1182  "conflicting return type in "
1183  "declaration of %0: %1 vs %2">,
1184  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1185
1186def warn_non_covariant_ret_types : Warning<
1187  "conflicting return type in "
1188  "implementation of %0: %1 vs %2">,
1189  InGroup<MethodSignatures>, DefaultIgnore;
1190
1191def warn_conflicting_overriding_param_types : Warning<
1192  "conflicting parameter types in "
1193  "declaration of %0%diff{: $ vs $|}1,2">,
1194  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1195
1196def warn_conflicting_param_types : Warning<
1197  "conflicting parameter types in "
1198  "implementation of %0%diff{: $ vs $|}1,2">,
1199  InGroup<MismatchedParameterTypes>;
1200
1201def warn_conflicting_param_modifiers : Warning<
1202  "conflicting distributed object modifiers on parameter type "
1203  "in implementation of %0">,
1204  InGroup<DistributedObjectModifiers>;
1205
1206def warn_conflicting_overriding_param_modifiers : Warning<
1207  "conflicting distributed object modifiers on parameter type "
1208  "in declaration of %0">,
1209  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1210
1211def warn_non_contravariant_overriding_param_types : Warning<
1212  "conflicting parameter types in "
1213  "declaration of %0: %1 vs %2">,
1214  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1215
1216def warn_non_contravariant_param_types : Warning<
1217  "conflicting parameter types in "
1218  "implementation of %0: %1 vs %2">,
1219  InGroup<MethodSignatures>, DefaultIgnore;
1220
1221def warn_conflicting_overriding_variadic :Warning<
1222  "conflicting variadic declaration of method and its "
1223  "implementation">,
1224  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1225
1226def warn_conflicting_variadic :Warning<
1227  "conflicting variadic declaration of method and its "
1228  "implementation">;
1229
1230def warn_category_method_impl_match:Warning<
1231  "category is implementing a method which will also be implemented"
1232  " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1233
1234def warn_implements_nscopying : Warning<
1235"default assign attribute on property %0 which implements "
1236"NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1237
1238def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1239  InGroup<ObjCMultipleMethodNames>;
1240def warn_strict_multiple_method_decl : Warning<
1241  "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1242def warn_accessor_property_type_mismatch : Warning<
1243  "type of property %0 does not match type of accessor %1">;
1244def note_conv_function_declared_at : Note<"type conversion function declared here">;
1245def note_method_declared_at : Note<"method %0 declared here">;
1246def note_direct_method_declared_at : Note<"direct method %0 declared here">;
1247def note_property_attribute : Note<"property %0 is declared "
1248  "%select{deprecated|unavailable|partial}1 here">;
1249def err_setter_type_void : Error<"type of setter must be void">;
1250def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1251def warn_duplicate_method_decl :
1252  Warning<"multiple declarations of method %0 found and ignored">,
1253  InGroup<MethodDuplicate>, DefaultIgnore;
1254def warn_objc_cdirective_format_string :
1255  Warning<"using %0 directive in %select{NSString|CFString}1 "
1256          "which is being passed as a formatting argument to the formatting "
1257          "%select{method|CFfunction}2">,
1258  InGroup<ObjCCStringFormat>, DefaultIgnore;
1259def err_objc_var_decl_inclass :
1260    Error<"cannot declare variable inside @interface or @protocol">;
1261def err_missing_method_context : Error<
1262  "missing context for method declaration">;
1263def err_objc_property_attr_mutually_exclusive : Error<
1264  "property attributes '%0' and '%1' are mutually exclusive">;
1265def err_objc_property_requires_object : Error<
1266  "property with '%0' attribute must be of object type">;
1267def warn_objc_property_assign_on_object : Warning<
1268  "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1269  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1270def warn_objc_property_no_assignment_attribute : Warning<
1271  "no 'assign', 'retain', or 'copy' attribute is specified - "
1272  "'assign' is assumed">,
1273  InGroup<ObjCPropertyNoAttribute>;
1274def warn_objc_isa_use : Warning<
1275  "direct access to Objective-C's isa is deprecated in favor of "
1276  "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1277def warn_objc_isa_assign : Warning<
1278  "assignment to Objective-C's isa is deprecated in favor of "
1279  "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1280def warn_objc_pointer_masking : Warning<
1281  "bitmasking for introspection of Objective-C object pointers is strongly "
1282  "discouraged">,
1283  InGroup<ObjCPointerIntrospect>;
1284def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1285  InGroup<ObjCPointerIntrospectPerformSelector>;
1286def warn_objc_property_default_assign_on_object : Warning<
1287  "default property attribute 'assign' not appropriate for object">,
1288  InGroup<ObjCPropertyNoAttribute>;
1289def warn_property_attr_mismatch : Warning<
1290  "property attribute in class extension does not match the primary class">,
1291  InGroup<PropertyAttr>;
1292def warn_property_implicitly_mismatched : Warning <
1293  "primary property declaration is implicitly strong while redeclaration "
1294  "in class extension is weak">,
1295  InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1296def warn_objc_property_copy_missing_on_block : Warning<
1297    "'copy' attribute must be specified for the block property "
1298    "when -fobjc-gc-only is specified">;
1299def warn_objc_property_retain_of_block : Warning<
1300    "retain'ed block property does not copy the block "
1301    "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1302def warn_objc_readonly_property_has_setter : Warning<
1303    "setter cannot be specified for a readonly property">,
1304    InGroup<ObjCReadonlyPropertyHasSetter>;
1305def warn_atomic_property_rule : Warning<
1306  "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1307  "with a user defined %select{getter|setter}2">,
1308  InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1309def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1310  "synthesized, or both be user defined,or the property must be nonatomic">;
1311def err_atomic_property_nontrivial_assign_op : Error<
1312  "atomic property of reference type %0 cannot have non-trivial assignment"
1313  " operator">;
1314def warn_cocoa_naming_owned_rule : Warning<
1315  "property follows Cocoa naming"
1316  " convention for returning 'owned' objects">,
1317  InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1318def err_cocoa_naming_owned_rule : Error<
1319  "property follows Cocoa naming"
1320  " convention for returning 'owned' objects">;
1321def note_cocoa_naming_declare_family : Note<
1322  "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1323  "object">;
1324def warn_auto_synthesizing_protocol_property :Warning<
1325  "auto property synthesis will not synthesize property %0"
1326  " declared in protocol %1">,
1327  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1328def note_add_synthesize_directive : Note<
1329  "add a '@synthesize' directive">;
1330def warn_no_autosynthesis_shared_ivar_property : Warning <
1331  "auto property synthesis will not synthesize property "
1332  "%0 because it cannot share an ivar with another synthesized property">,
1333  InGroup<ObjCNoPropertyAutoSynthesis>;
1334def warn_no_autosynthesis_property : Warning<
1335  "auto property synthesis will not synthesize property "
1336  "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1337  "via another property">,
1338  InGroup<ObjCNoPropertyAutoSynthesis>;
1339def warn_autosynthesis_property_in_superclass : Warning<
1340  "auto property synthesis will not synthesize property "
1341  "%0; it will be implemented by its superclass, use @dynamic to "
1342  "acknowledge intention">,
1343  InGroup<ObjCNoPropertyAutoSynthesis>;
1344def warn_autosynthesis_property_ivar_match :Warning<
1345  "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1346  "%2, not existing instance variable %3">,
1347  InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1348def warn_missing_explicit_synthesis : Warning <
1349  "auto property synthesis is synthesizing property not explicitly synthesized">,
1350  InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1351def warn_property_getter_owning_mismatch : Warning<
1352  "property declared as returning non-retained objects"
1353  "; getter returning retained objects">;
1354def warn_property_redecl_getter_mismatch : Warning<
1355  "getter name mismatch between property redeclaration (%1) and its original "
1356  "declaration (%0)">, InGroup<PropertyAttr>;
1357def err_property_setter_ambiguous_use : Error<
1358  "synthesized properties %0 and %1 both claim setter %2 -"
1359  " use of this setter will cause unexpected behavior">;
1360def warn_default_atomic_custom_getter_setter : Warning<
1361  "atomic by default property %0 has a user defined %select{getter|setter}1 "
1362  "(property should be marked 'atomic' if this is intended)">,
1363  InGroup<CustomAtomic>, DefaultIgnore;
1364def err_use_continuation_class : Error<
1365  "illegal redeclaration of property in class extension %0"
1366  " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1367def err_type_mismatch_continuation_class : Error<
1368  "type of property %0 in class extension does not match "
1369  "property type in primary class">;
1370def err_use_continuation_class_redeclaration_readwrite : Error<
1371  "illegal redeclaration of 'readwrite' property in class extension %0"
1372  " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1373  "'readonly' public property?)">;
1374def err_continuation_class : Error<"class extension has no primary class">;
1375def err_property_type : Error<"property cannot have array or function type %0">;
1376def err_missing_property_context : Error<
1377  "missing context for property implementation declaration">;
1378def err_bad_property_decl : Error<
1379  "property implementation must have its declaration in interface %0 or one of "
1380  "its extensions">;
1381def err_category_property : Error<
1382  "property declared in category %0 cannot be implemented in "
1383  "class implementation">;
1384def note_property_declare : Note<
1385  "property declared here">;
1386def note_protocol_property_declare : Note<
1387  "it could also be property "
1388  "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1389  "%1|with setter %1}0 declared here">;
1390def note_property_synthesize : Note<
1391  "property synthesized here">;
1392def err_synthesize_category_decl : Error<
1393  "@synthesize not allowed in a category's implementation">;
1394def err_synthesize_on_class_property : Error<
1395  "@synthesize not allowed on a class property %0">;
1396def err_missing_property_interface : Error<
1397  "property implementation in a category with no category declaration">;
1398def err_bad_category_property_decl : Error<
1399  "property implementation must have its declaration in the category %0">;
1400def err_bad_property_context : Error<
1401  "property implementation must be in a class or category implementation">;
1402def err_missing_property_ivar_decl : Error<
1403  "synthesized property %0 must either be named the same as a compatible"
1404  " instance variable or must explicitly name an instance variable">;
1405def err_arc_perform_selector_retains : Error<
1406  "performSelector names a selector which retains the object">;
1407def warn_arc_perform_selector_leaks : Warning<
1408  "performSelector may cause a leak because its selector is unknown">,
1409  InGroup<DiagGroup<"arc-performSelector-leaks">>;
1410def warn_dealloc_in_category : Warning<
1411"-dealloc is being overridden in a category">,
1412InGroup<DeallocInCategory>;
1413def err_gc_weak_property_strong_type : Error<
1414  "weak attribute declared on a __strong type property in GC mode">;
1415def warn_arc_repeated_use_of_weak : Warning <
1416  "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1417  "accessed multiple times in this %select{function|method|block|lambda}2 "
1418  "but may be unpredictably set to nil; assign to a strong variable to keep "
1419  "the object alive">,
1420  InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1421def warn_implicitly_retains_self : Warning <
1422  "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1423  "this is intended behavior">,
1424  InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1425def warn_arc_possible_repeated_use_of_weak : Warning <
1426  "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1427  "be accessed multiple times in this %select{function|method|block|lambda}2 "
1428  "and may be unpredictably set to nil; assign to a strong variable to keep "
1429  "the object alive">,
1430  InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1431def note_arc_weak_also_accessed_here : Note<
1432  "also accessed here">;
1433def err_incomplete_synthesized_property : Error<
1434  "cannot synthesize property %0 with incomplete type %1">;
1435
1436def err_property_ivar_type : Error<
1437  "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1438def err_property_accessor_type : Error<
1439  "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1440def err_ivar_in_superclass_use : Error<
1441  "property %0 attempting to use instance variable %1 declared in super class %2">;
1442def err_weak_property : Error<
1443  "existing instance variable %1 for __weak property %0 must be __weak">;
1444def err_strong_property : Error<
1445  "existing instance variable %1 for strong property %0 may not be __weak">;
1446def err_dynamic_property_ivar_decl : Error<
1447  "dynamic property cannot have instance variable specification">;
1448def err_duplicate_ivar_use : Error<
1449  "synthesized properties %0 and %1 both claim instance variable %2">;
1450def err_property_implemented : Error<"property %0 is already implemented">;
1451def warn_objc_missing_super_call : Warning<
1452  "method possibly missing a [super %0] call">,
1453  InGroup<ObjCMissingSuperCalls>;
1454def err_dealloc_bad_result_type : Error<
1455  "dealloc return type must be correctly specified as 'void' under ARC, "
1456  "instead of %0">;
1457def warn_undeclared_selector : Warning<
1458  "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1459def warn_undeclared_selector_with_typo : Warning<
1460  "undeclared selector %0; did you mean %1?">,
1461  InGroup<UndeclaredSelector>, DefaultIgnore;
1462def warn_implicit_atomic_property : Warning<
1463  "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1464def note_auto_readonly_iboutlet_fixup_suggest : Note<
1465  "property should be changed to be readwrite">;
1466def warn_auto_readonly_iboutlet_property : Warning<
1467  "readonly IBOutlet property %0 when auto-synthesized may "
1468  "not work correctly with 'nib' loader">,
1469  InGroup<DiagGroup<"readonly-iboutlet-property">>;
1470def warn_auto_implicit_atomic_property : Warning<
1471  "property is assumed atomic when auto-synthesizing the property">,
1472  InGroup<ImplicitAtomic>, DefaultIgnore;
1473def warn_unimplemented_selector:  Warning<
1474  "no method with selector %0 is implemented in this translation unit">,
1475  InGroup<Selector>, DefaultIgnore;
1476def warn_unimplemented_protocol_method : Warning<
1477  "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1478def warn_multiple_selectors: Warning<
1479  "several methods with selector %0 of mismatched types are found "
1480  "for the @selector expression">,
1481  InGroup<SelectorTypeMismatch>, DefaultIgnore;
1482def err_direct_selector_expression : Error<
1483  "@selector expression formed with direct selector %0">;
1484def warn_potentially_direct_selector_expression : Warning<
1485  "@selector expression formed with potentially direct selector %0">,
1486  InGroup<ObjCPotentiallyDirectSelector>;
1487def warn_strict_potentially_direct_selector_expression : Warning<
1488  warn_potentially_direct_selector_expression.Text>,
1489  InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore;
1490
1491def err_objc_kindof_nonobject : Error<
1492  "'__kindof' specifier cannot be applied to non-object type %0">;
1493def err_objc_kindof_wrong_position : Error<
1494  "'__kindof' type specifier must precede the declarator">;
1495
1496def err_objc_method_unsupported_param_ret_type : Error<
1497  "%0 %select{parameter|return}1 type is unsupported; "
1498  "support for vector types for this target is introduced in %2">;
1499
1500def warn_messaging_unqualified_id : Warning<
1501  "messaging unqualified id">, DefaultIgnore,
1502  InGroup<DiagGroup<"objc-messaging-id">>;
1503def err_messaging_unqualified_id_with_direct_method : Error<
1504  "messaging unqualified id with a method that is possibly direct">;
1505def err_messaging_super_with_direct_method : Error<
1506  "messaging super with a direct method">;
1507def err_messaging_class_with_direct_method : Error<
1508  "messaging a Class with a method that is possibly direct">;
1509
1510// C++ declarations
1511def err_static_assert_expression_is_not_constant : Error<
1512  "static_assert expression is not an integral constant expression">;
1513def err_constexpr_if_condition_expression_is_not_constant : Error<
1514  "constexpr if condition is not a constant expression">;
1515def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1516def err_static_assert_requirement_failed : Error<
1517  "static_assert failed due to requirement '%0'%select{ %2|}1">;
1518
1519def warn_consteval_if_always_true : Warning<
1520  "consteval if is always true in an %select{unevaluated|immediate}0 context">,
1521  InGroup<DiagGroup<"redundant-consteval-if">>;
1522
1523def ext_inline_variable : ExtWarn<
1524  "inline variables are a C++17 extension">, InGroup<CXX17>;
1525def warn_cxx14_compat_inline_variable : Warning<
1526  "inline variables are incompatible with C++ standards before C++17">,
1527  DefaultIgnore, InGroup<CXXPre17Compat>;
1528
1529def warn_inline_namespace_reopened_noninline : Warning<
1530  "inline namespace reopened as a non-inline namespace">,
1531  InGroup<InlineNamespaceReopenedNoninline>;
1532def err_inline_namespace_mismatch : Error<
1533  "non-inline namespace cannot be reopened as inline">;
1534
1535def err_unexpected_friend : Error<
1536  "friends can only be classes or functions">;
1537def ext_enum_friend : ExtWarn<
1538  "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1539def warn_cxx98_compat_enum_friend : Warning<
1540  "befriending enumeration type %0 is incompatible with C++98">,
1541  InGroup<CXX98Compat>, DefaultIgnore;
1542def ext_nonclass_type_friend : ExtWarn<
1543  "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1544def warn_cxx98_compat_nonclass_type_friend : Warning<
1545  "non-class friend type %0 is incompatible with C++98">,
1546  InGroup<CXX98Compat>, DefaultIgnore;
1547def err_friend_is_member : Error<
1548  "friends cannot be members of the declaring class">;
1549def warn_cxx98_compat_friend_is_member : Warning<
1550  "friend declaration naming a member of the declaring class is incompatible "
1551  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1552def ext_unelaborated_friend_type : ExtWarn<
1553  "unelaborated friend declaration is a C++11 extension; specify "
1554  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1555  InGroup<CXX11>;
1556def warn_cxx98_compat_unelaborated_friend_type : Warning<
1557  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1558  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1559def err_qualified_friend_no_match : Error<
1560  "friend declaration of %0 does not match any declaration in %1">;
1561def err_introducing_special_friend : Error<
1562  "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1563  " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1564  "as a friend">;
1565def err_tagless_friend_type_template : Error<
1566  "friend type templates must use an elaborated type">;
1567def err_no_matching_local_friend : Error<
1568  "no matching function found in local scope">;
1569def err_no_matching_local_friend_suggest : Error<
1570  "no matching function %0 found in local scope; did you mean %3?">;
1571def err_partial_specialization_friend : Error<
1572  "partial specialization cannot be declared as a friend">;
1573def err_qualified_friend_def : Error<
1574  "friend function definition cannot be qualified with '%0'">;
1575def err_friend_def_in_local_class : Error<
1576  "friend function cannot be defined in a local class">;
1577def err_friend_not_first_in_declaration : Error<
1578  "'friend' must appear first in a non-function declaration">;
1579def err_using_decl_friend : Error<
1580  "cannot befriend target of using declaration">;
1581def warn_template_qualified_friend_unsupported : Warning<
1582  "dependent nested name specifier '%0' for friend class declaration is "
1583  "not supported; turning off access control for %1">,
1584  InGroup<UnsupportedFriend>;
1585def warn_template_qualified_friend_ignored : Warning<
1586  "dependent nested name specifier '%0' for friend template declaration is "
1587  "not supported; ignoring this friend declaration">,
1588  InGroup<UnsupportedFriend>;
1589def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1590  "unqualified friend declaration referring to type outside of the nearest "
1591  "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1592  InGroup<MicrosoftUnqualifiedFriend>;
1593def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1594
1595def err_invalid_base_in_interface : Error<
1596  "interface type cannot inherit from "
1597  "%select{struct|non-public interface|class}0 %1">;
1598
1599def err_abstract_type_in_decl : Error<
1600  "%select{return|parameter|variable|field|instance variable|"
1601  "synthesized instance variable}0 type %1 is an abstract class">;
1602def err_allocation_of_abstract_type : Error<
1603  "allocating an object of abstract class type %0">;
1604def err_throw_abstract_type : Error<
1605  "cannot throw an object of abstract type %0">;
1606def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1607def err_capture_of_abstract_type : Error<
1608  "by-copy capture of value of abstract type %0">;
1609def err_capture_of_incomplete_or_sizeless_type : Error<
1610  "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">;
1611def err_capture_default_non_local : Error<
1612  "non-local lambda expression cannot have a capture-default">;
1613
1614def err_multiple_final_overriders : Error<
1615  "virtual function %q0 has more than one final overrider in %1">;
1616def note_final_overrider : Note<"final overrider of %q0 in %1">;
1617
1618def err_type_defined_in_type_specifier : Error<
1619  "%0 cannot be defined in a type specifier">;
1620def err_type_defined_in_result_type : Error<
1621  "%0 cannot be defined in the result type of a function">;
1622def err_type_defined_in_param_type : Error<
1623  "%0 cannot be defined in a parameter type">;
1624def err_type_defined_in_alias_template : Error<
1625  "%0 cannot be defined in a type alias template">;
1626def err_type_defined_in_condition : Error<
1627  "%0 cannot be defined in a condition">;
1628def err_type_defined_in_enum : Error<
1629  "%0 cannot be defined in an enumeration">;
1630
1631def note_pure_virtual_function : Note<
1632  "unimplemented pure virtual method %0 in %1">;
1633
1634def note_pure_qualified_call_kext : Note<
1635  "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1636
1637def err_deleted_decl_not_first : Error<
1638  "deleted definition must be first declaration">;
1639
1640def err_deleted_override : Error<
1641  "deleted function %0 cannot override a non-deleted function">;
1642def err_non_deleted_override : Error<
1643  "non-deleted function %0 cannot override a deleted function">;
1644def err_consteval_override : Error<
1645  "consteval function %0 cannot override a non-consteval function">;
1646def err_non_consteval_override : Error<
1647  "non-consteval function %0 cannot override a consteval function">;
1648
1649def warn_weak_vtable : Warning<
1650  "%0 has no out-of-line virtual method definitions; its vtable will be "
1651  "emitted in every translation unit">,
1652  InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1653def warn_weak_template_vtable : Warning<
1654  "this warning is no longer in use and will be removed in the next release">,
1655  InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1656
1657def ext_using_undefined_std : ExtWarn<
1658  "using directive refers to implicitly-defined namespace 'std'">;
1659
1660// C++ exception specifications
1661def err_exception_spec_in_typedef : Error<
1662  "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1663def err_distant_exception_spec : Error<
1664  "exception specifications are not allowed beyond a single level "
1665  "of indirection">;
1666def err_incomplete_in_exception_spec : Error<
1667  "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1668  "in exception specification">;
1669def err_sizeless_in_exception_spec : Error<
1670  "%select{|reference to }0sizeless type %1 is not allowed "
1671  "in exception specification">;
1672def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1673  InGroup<MicrosoftExceptionSpec>;
1674def err_rref_in_exception_spec : Error<
1675  "rvalue reference type %0 is not allowed in exception specification">;
1676def err_mismatched_exception_spec : Error<
1677  "exception specification in declaration does not match previous declaration">;
1678def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1679  InGroup<MicrosoftExceptionSpec>;
1680def err_override_exception_spec : Error<
1681  "exception specification of overriding function is more lax than "
1682  "base version">;
1683def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1684  InGroup<MicrosoftExceptionSpec>;
1685def err_incompatible_exception_specs : Error<
1686  "target exception specification is not superset of source">;
1687def warn_incompatible_exception_specs : Warning<
1688  err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1689def err_deep_exception_specs_differ : Error<
1690  "exception specifications of %select{return|argument}0 types differ">;
1691def warn_deep_exception_specs_differ : Warning<
1692  err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1693def err_missing_exception_specification : Error<
1694  "%0 is missing exception specification '%1'">;
1695def ext_missing_exception_specification : ExtWarn<
1696  err_missing_exception_specification.Text>,
1697  InGroup<DiagGroup<"missing-exception-spec">>;
1698def ext_ms_missing_exception_specification : ExtWarn<
1699  err_missing_exception_specification.Text>,
1700  InGroup<MicrosoftExceptionSpec>;
1701def err_noexcept_needs_constant_expression : Error<
1702  "argument to noexcept specifier must be a constant expression">;
1703def err_exception_spec_not_parsed : Error<
1704  "exception specification is not available until end of class definition">;
1705def err_exception_spec_cycle : Error<
1706  "exception specification of %0 uses itself">;
1707def err_exception_spec_incomplete_type : Error<
1708  "exception specification needed for member of incomplete class %0">;
1709def warn_wasm_dynamic_exception_spec_ignored : ExtWarn<
1710  "dynamic exception specifications with types are currently ignored in wasm">,
1711  InGroup<WebAssemblyExceptionSpec>;
1712
1713// C++ access checking
1714def err_class_redeclared_with_different_access : Error<
1715  "%0 redeclared with '%1' access">;
1716def err_access : Error<
1717  "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1718def ext_ms_using_declaration_inaccessible : ExtWarn<
1719  "using declaration referring to inaccessible member '%0' (which refers "
1720  "to accessible member '%1') is a Microsoft compatibility extension">,
1721    AccessControl, InGroup<MicrosoftUsingDecl>;
1722def err_access_ctor : Error<
1723  "calling a %select{private|protected}0 constructor of class %2">,
1724  AccessControl;
1725def ext_rvalue_to_reference_access_ctor : Extension<
1726  "C++98 requires an accessible copy constructor for class %2 when binding "
1727  "a reference to a temporary; was %select{private|protected}0">,
1728  AccessControl, InGroup<BindToTemporaryCopy>;
1729def err_access_base_ctor : Error<
1730  // The ERRORs represent other special members that aren't constructors, in
1731  // hopes that someone will bother noticing and reporting if they appear
1732  "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1733  "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1734  "|*ERROR*|}2constructor">, AccessControl;
1735def err_access_field_ctor : Error<
1736  // The ERRORs represent other special members that aren't constructors, in
1737  // hopes that someone will bother noticing and reporting if they appear
1738  "field of type %0 has %select{private|protected}2 "
1739  "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1740  AccessControl;
1741def err_access_friend_function : Error<
1742  "friend function %1 is a %select{private|protected}0 member of %3">,
1743  AccessControl;
1744
1745def err_access_dtor : Error<
1746  "calling a %select{private|protected}1 destructor of class %0">,
1747  AccessControl;
1748def err_access_dtor_base :
1749    Error<"base class %0 has %select{private|protected}1 destructor">,
1750    AccessControl;
1751def err_access_dtor_vbase :
1752    Error<"inherited virtual base class %1 has "
1753    "%select{private|protected}2 destructor">,
1754    AccessControl;
1755def err_access_dtor_temp :
1756    Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1757    AccessControl;
1758def err_access_dtor_exception :
1759    Error<"exception object of type %0 has %select{private|protected}1 "
1760          "destructor">, AccessControl;
1761def err_access_dtor_field :
1762    Error<"field of type %1 has %select{private|protected}2 destructor">,
1763    AccessControl;
1764def err_access_dtor_var :
1765    Error<"variable of type %1 has %select{private|protected}2 destructor">,
1766    AccessControl;
1767def err_access_dtor_ivar :
1768    Error<"instance variable of type %0 has %select{private|protected}1 "
1769          "destructor">,
1770    AccessControl;
1771def note_previous_access_declaration : Note<
1772  "previously declared '%1' here">;
1773def note_access_natural : Note<
1774  "%select{|implicitly }1declared %select{private|protected}0 here">;
1775def note_access_constrained_by_path : Note<
1776  "constrained by %select{|implicitly }1%select{private|protected}0"
1777  " inheritance here">;
1778def note_access_protected_restricted_noobject : Note<
1779  "must name member using the type of the current context %0">;
1780def note_access_protected_restricted_ctordtor : Note<
1781  "protected %select{constructor|destructor}0 can only be used to "
1782  "%select{construct|destroy}0 a base class subobject">;
1783def note_access_protected_restricted_object : Note<
1784  "can only access this member on an object of type %0">;
1785def warn_cxx98_compat_sfinae_access_control : Warning<
1786  "substitution failure due to access control is incompatible with C++98">,
1787  InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1788
1789// C++ name lookup
1790def err_incomplete_nested_name_spec : Error<
1791  "incomplete type %0 named in nested name specifier">;
1792def err_incomplete_enum : Error<
1793  "enumeration %0 is incomplete">;
1794def err_dependent_nested_name_spec : Error<
1795  "nested name specifier for a declaration cannot depend on a template "
1796  "parameter">;
1797def err_nested_name_member_ref_lookup_ambiguous : Error<
1798  "lookup of %0 in member access expression is ambiguous">;
1799def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1800  "lookup of %0 in member access expression is ambiguous; using member of %1">,
1801  InGroup<AmbigMemberTemplate>;
1802def note_ambig_member_ref_object_type : Note<
1803  "lookup in the object type %0 refers here">;
1804def note_ambig_member_ref_scope : Note<
1805  "lookup from the current scope refers here">;
1806def err_qualified_member_nonclass : Error<
1807  "qualified member access refers to a member in %0">;
1808def err_incomplete_member_access : Error<
1809  "member access into incomplete type %0">;
1810def err_incomplete_type : Error<
1811  "incomplete type %0 where a complete type is required">;
1812def warn_cxx98_compat_enum_nested_name_spec : Warning<
1813  "enumeration type in nested name specifier is incompatible with C++98">,
1814  InGroup<CXX98Compat>, DefaultIgnore;
1815def err_nested_name_spec_is_not_class : Error<
1816  "%0 cannot appear before '::' because it is not a class"
1817  "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1818def ext_nested_name_spec_is_enum : ExtWarn<
1819  "use of enumeration in a nested name specifier is a C++11 extension">,
1820  InGroup<CXX11>;
1821def err_out_of_line_qualified_id_type_names_constructor : Error<
1822  "qualified reference to %0 is a constructor name rather than a "
1823  "%select{template name|type}1 in this context">;
1824def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1825  "ISO C++ specifies that "
1826  "qualified reference to %0 is a constructor name rather than a "
1827  "%select{template name|type}1 in this context, despite preceding "
1828  "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1829  InGroup<DiagGroup<"injected-class-name">>;
1830
1831// C++ class members
1832def err_storageclass_invalid_for_member : Error<
1833  "storage class specified for a member declaration">;
1834def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1835def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1836def ext_mutable_reference : ExtWarn<
1837  "'mutable' on a reference type is a Microsoft extension">,
1838  InGroup<MicrosoftMutableReference>;
1839def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1840def err_mutable_nonmember : Error<
1841  "'mutable' can only be applied to member variables">;
1842def err_virtual_in_union : Error<
1843  "unions cannot have virtual functions">;
1844def err_virtual_non_function : Error<
1845  "'virtual' can only appear on non-static member functions">;
1846def err_virtual_out_of_class : Error<
1847  "'virtual' can only be specified inside the class definition">;
1848def err_virtual_member_function_template : Error<
1849  "'virtual' cannot be specified on member function templates">;
1850def err_static_overrides_virtual : Error<
1851  "'static' member function %0 overrides a virtual function in a base class">;
1852def err_explicit_non_function : Error<
1853  "'explicit' can only appear on non-static member functions">;
1854def err_explicit_out_of_class : Error<
1855  "'explicit' can only be specified inside the class definition">;
1856def err_explicit_non_ctor_or_conv_function : Error<
1857  "'explicit' can only be applied to a constructor or conversion function">;
1858def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1859def err_static_out_of_line : Error<
1860  "'static' can only be specified inside the class definition">;
1861def ext_static_out_of_line : ExtWarn<
1862  err_static_out_of_line.Text>,
1863  InGroup<MicrosoftTemplate>;
1864def err_storage_class_for_static_member : Error<
1865  "static data member definition cannot specify a storage class">;
1866def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1867def err_not_integral_type_bitfield : Error<
1868  "bit-field %0 has non-integral type %1">;
1869def err_not_integral_type_anon_bitfield : Error<
1870  "anonymous bit-field has non-integral type %0">;
1871def err_anon_bitfield_qualifiers : Error<
1872  "anonymous bit-field cannot have qualifiers">;
1873def err_member_function_initialization : Error<
1874  "initializer on function does not look like a pure-specifier">;
1875def err_non_virtual_pure : Error<
1876  "%0 is not virtual and cannot be declared pure">;
1877def ext_pure_function_definition : ExtWarn<
1878  "function definition with pure-specifier is a Microsoft extension">,
1879  InGroup<MicrosoftPureDefinition>;
1880def err_qualified_member_of_unrelated : Error<
1881  "%q0 is not a member of class %1">;
1882
1883def err_member_function_call_bad_cvr : Error<
1884  "'this' argument to member function %0 has type %1, but function is not marked "
1885  "%select{const|restrict|const or restrict|volatile|const or volatile|"
1886  "volatile or restrict|const, volatile, or restrict}2">;
1887def err_member_function_call_bad_ref : Error<
1888  "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1889  "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1890def err_member_function_call_bad_type : Error<
1891  "cannot initialize object parameter of type %0 with an expression "
1892  "of type %1">;
1893
1894def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1895  "call to pure virtual member function %0 has undefined behavior; "
1896  "overrides of %0 in subclasses are not available in the "
1897  "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
1898
1899def select_special_member_kind : TextSubstitution<
1900  "%select{default constructor|copy constructor|move constructor|"
1901  "copy assignment operator|move assignment operator|destructor}0">;
1902
1903def note_member_declared_at : Note<"member is declared here">;
1904def note_ivar_decl : Note<"instance variable is declared here">;
1905def note_bitfield_decl : Note<"bit-field is declared here">;
1906def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1907def note_member_synthesized_at : Note<
1908  "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 "
1909  "first required here">;
1910def note_comparison_synthesized_at : Note<
1911  "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 "
1912  "first required here">;
1913def err_missing_default_ctor : Error<
1914  "%select{constructor for %1 must explicitly initialize the|"
1915  "implicit default constructor for %1 must explicitly initialize the|"
1916  "cannot use constructor inherited from base class %4;}0 "
1917  "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1918  "does not have a default constructor">;
1919def note_due_to_dllexported_class : Note<
1920  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1921
1922def err_illegal_union_or_anon_struct_member : Error<
1923  "%select{anonymous struct|union}0 member %1 has a non-trivial "
1924  "%sub{select_special_member_kind}2">;
1925
1926def warn_frame_address : Warning<
1927  "calling '%0' with a nonzero argument is unsafe">,
1928  InGroup<FrameAddress>, DefaultIgnore;
1929
1930def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1931  "%select{anonymous struct|union}0 member %1 with a non-trivial "
1932  "%sub{select_special_member_kind}2 is incompatible with C++98">,
1933  InGroup<CXX98Compat>, DefaultIgnore;
1934
1935def note_nontrivial_virtual_dtor : Note<
1936  "destructor for %0 is not trivial because it is virtual">;
1937def note_nontrivial_has_virtual : Note<
1938  "because type %0 has a virtual %select{member function|base class}1">;
1939def note_nontrivial_no_def_ctor : Note<
1940  "because %select{base class of |field of |}0type %1 has no "
1941  "default constructor">;
1942def note_user_declared_ctor : Note<
1943  "implicit default constructor suppressed by user-declared constructor">;
1944def note_nontrivial_no_copy : Note<
1945  "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1946  "assignment operator|<<ERROR>>}2 can be used to "
1947  "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1948  "%select{base class|field|an object}0 of type %3">;
1949def note_nontrivial_user_provided : Note<
1950  "because %select{base class of |field of |}0type %1 has a user-provided "
1951  "%sub{select_special_member_kind}2">;
1952def note_nontrivial_default_member_init : Note<
1953  "because field %0 has an initializer">;
1954def note_nontrivial_param_type : Note<
1955  "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1956def note_nontrivial_default_arg : Note<"because it has a default argument">;
1957def note_nontrivial_variadic : Note<"because it is a variadic function">;
1958def note_nontrivial_subobject : Note<
1959  "because the function selected to %select{construct|copy|move|copy|move|"
1960  "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1961def note_nontrivial_objc_ownership : Note<
1962  "because type %0 has a member with %select{no|no|__strong|__weak|"
1963  "__autoreleasing}1 ownership">;
1964
1965/// Selector for a TagTypeKind value.
1966def select_tag_type_kind : TextSubstitution<
1967  "%select{struct|interface|union|class|enum}0">;
1968
1969def err_static_data_member_not_allowed_in_anon_struct : Error<
1970  "static data member %0 not allowed in anonymous "
1971  "%sub{select_tag_type_kind}1">;
1972def ext_static_data_member_in_union : ExtWarn<
1973  "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1974def warn_cxx98_compat_static_data_member_in_union : Warning<
1975  "static data member %0 in union is incompatible with C++98">,
1976  InGroup<CXX98Compat>, DefaultIgnore;
1977def ext_union_member_of_reference_type : ExtWarn<
1978  "union member %0 has reference type %1, which is a Microsoft extension">,
1979  InGroup<MicrosoftUnionMemberReference>;
1980def err_union_member_of_reference_type : Error<
1981  "union member %0 has reference type %1">;
1982def ext_anonymous_struct_union_qualified : Extension<
1983  "anonymous %select{struct|union}0 cannot be '%1'">;
1984def err_different_return_type_for_overriding_virtual_function : Error<
1985  "virtual function %0 has a different return type "
1986  "%diff{($) than the function it overrides (which has return type $)|"
1987  "than the function it overrides}1,2">;
1988def note_overridden_virtual_function : Note<
1989  "overridden virtual function is here">;
1990def err_conflicting_overriding_cc_attributes : Error<
1991  "virtual function %0 has different calling convention attributes "
1992  "%diff{($) than the function it overrides (which has calling convention $)|"
1993  "than the function it overrides}1,2">;
1994def warn_overriding_method_missing_noescape : Warning<
1995  "parameter of overriding method should be annotated with "
1996  "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1997def note_overridden_marked_noescape : Note<
1998  "parameter of overridden method is annotated with __attribute__((noescape))">;
1999def note_cat_conform_to_noescape_prot : Note<
2000  "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
2001
2002def err_covariant_return_inaccessible_base : Error<
2003  "invalid covariant return for virtual function: %1 is a "
2004  "%select{private|protected}2 base class of %0">, AccessControl;
2005def err_covariant_return_ambiguous_derived_to_base_conv : Error<
2006  "return type of virtual function %3 is not covariant with the return type of "
2007  "the function it overrides (ambiguous conversion from derived class "
2008  "%0 to base class %1:%2)">;
2009def err_covariant_return_not_derived : Error<
2010  "return type of virtual function %0 is not covariant with the return type of "
2011  "the function it overrides (%1 is not derived from %2)">;
2012def err_covariant_return_incomplete : Error<
2013  "return type of virtual function %0 is not covariant with the return type of "
2014  "the function it overrides (%1 is incomplete)">;
2015def err_covariant_return_type_different_qualifications : Error<
2016  "return type of virtual function %0 is not covariant with the return type of "
2017  "the function it overrides (%1 has different qualifiers than %2)">;
2018def err_covariant_return_type_class_type_more_qualified : Error<
2019  "return type of virtual function %0 is not covariant with the return type of "
2020  "the function it overrides (class type %1 is more qualified than class "
2021  "type %2">;
2022
2023// C++ implicit special member functions
2024def note_in_declaration_of_implicit_special_member : Note<
2025  "while declaring the implicit %sub{select_special_member_kind}1"
2026  " for %0">;
2027
2028// C++ constructors
2029def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
2030def err_invalid_qualified_constructor : Error<
2031  "'%0' qualifier is not allowed on a constructor">;
2032def err_ref_qualifier_constructor : Error<
2033  "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
2034
2035def err_constructor_return_type : Error<
2036  "constructor cannot have a return type">;
2037def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
2038def err_constructor_byvalue_arg : Error<
2039  "copy constructor must pass its first argument by reference">;
2040def warn_no_constructor_for_refconst : Warning<
2041  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
2042  "constructor to initialize its non-modifiable members">;
2043def note_refconst_member_not_initialized : Note<
2044  "%select{const|reference}0 member %1 will never be initialized">;
2045def ext_ms_explicit_constructor_call : ExtWarn<
2046  "explicit constructor calls are a Microsoft extension">,
2047  InGroup<MicrosoftExplicitConstructorCall>;
2048
2049// C++ destructors
2050def err_destructor_not_member : Error<
2051  "destructor must be a non-static member function">;
2052def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
2053def err_invalid_qualified_destructor : Error<
2054  "'%0' qualifier is not allowed on a destructor">;
2055def err_ref_qualifier_destructor : Error<
2056  "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
2057def err_destructor_return_type : Error<"destructor cannot have a return type">;
2058def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
2059def err_destructor_with_params : Error<"destructor cannot have any parameters">;
2060def err_destructor_variadic : Error<"destructor cannot be variadic">;
2061def ext_destructor_typedef_name : ExtWarn<
2062  "destructor cannot be declared using a %select{typedef|type alias}1 %0 "
2063  "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>;
2064def err_undeclared_destructor_name : Error<
2065  "undeclared identifier %0 in destructor name">;
2066def err_destructor_name : Error<
2067  "expected the class name after '~' to name the enclosing class">;
2068def err_destructor_name_nontype : Error<
2069  "identifier %0 after '~' in destructor name does not name a type">;
2070def err_destructor_expr_mismatch : Error<
2071  "identifier %0 in object destruction expression does not name the type "
2072  "%1 of the object being destroyed">;
2073def err_destructor_expr_nontype : Error<
2074  "identifier %0 in object destruction expression does not name a type">;
2075def err_destructor_expr_type_mismatch : Error<
2076  "destructor type %0 in object destruction expression does not match the "
2077  "type %1 of the object being destroyed">;
2078def note_destructor_type_here : Note<
2079  "type %0 found by destructor name lookup">;
2080def note_destructor_nontype_here : Note<
2081  "non-type declaration found by destructor name lookup">;
2082def ext_dtor_named_in_wrong_scope : Extension<
2083  "ISO C++ requires the name after '::~' to be found in the same scope as "
2084  "the name before '::~'">, InGroup<DtorName>;
2085def ext_qualified_dtor_named_in_lexical_scope : ExtWarn<
2086  "qualified destructor name only found in lexical scope; omit the qualifier "
2087  "to find this type name by unqualified lookup">, InGroup<DtorName>;
2088def ext_dtor_name_ambiguous : Extension<
2089  "ISO C++ considers this destructor name lookup to be ambiguous">,
2090  InGroup<DtorName>;
2091
2092def err_destroy_attr_on_non_static_var : Error<
2093  "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
2094  " variable with static or thread storage duration">;
2095
2096def err_destructor_template : Error<
2097  "destructor cannot be declared as a template">;
2098
2099// C++ initialization
2100def err_init_conversion_failed : Error<
2101  "cannot initialize %select{a variable|a parameter|template parameter|"
2102  "return object|statement expression result|an "
2103  "exception object|a member subobject|an array element|a new value|a value|a "
2104  "base class|a constructor delegation|a vector element|a block element|a "
2105  "block element|a complex element|a lambda capture|a compound literal "
2106  "initializer|a related result|a parameter of CF audited function}0 "
2107  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2108  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2109  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2110  "|: different number of parameters (%5 vs %6)"
2111  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2112  "|: different return type%diff{ ($ vs $)|}5,6"
2113  "|: different qualifiers (%5 vs %6)"
2114  "|: different exception specifications}4">;
2115def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2116  "declared here; conversion would be valid if it was derived from %1">;
2117
2118def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2119  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2120def err_lvalue_reference_bind_to_initlist : Error<
2121  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2122  "initializer list temporary">;
2123def err_lvalue_reference_bind_to_temporary : Error<
2124  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2125  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2126def err_lvalue_reference_bind_to_unrelated : Error<
2127  "%select{non-const|volatile}0 lvalue reference "
2128  "%diff{to type $ cannot bind to a value of unrelated type $|"
2129  "cannot bind to a value of unrelated type}1,2">;
2130def err_reference_bind_drops_quals : Error<
2131  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2132  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2133  "not permitted due to incompatible qualifiers}2">;
2134def err_reference_bind_failed : Error<
2135  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2136  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2137  "incompatible type}0,3">;
2138def err_reference_bind_temporary_addrspace : Error<
2139  "reference of type %0 cannot bind to a temporary object because of "
2140  "address space mismatch">;
2141def err_reference_bind_init_list : Error<
2142  "reference to type %0 cannot bind to an initializer list">;
2143def err_init_list_bad_dest_type : Error<
2144  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2145  "list">;
2146def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2147  "aggregate initialization of type %0 with user-declared constructors "
2148  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2149
2150def err_reference_bind_to_bitfield : Error<
2151  "%select{non-const|volatile}0 reference cannot bind to "
2152  "bit-field%select{| %1}2">;
2153def err_reference_bind_to_vector_element : Error<
2154  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2155def err_reference_bind_to_matrix_element : Error<
2156  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2157def err_reference_var_requires_init : Error<
2158  "declaration of reference variable %0 requires an initializer">;
2159def err_reference_without_init : Error<
2160  "reference to type %0 requires an initializer">;
2161def note_value_initialization_here : Note<
2162  "in value-initialization of type %0 here">;
2163def err_reference_has_multiple_inits : Error<
2164  "reference cannot be initialized with multiple values">;
2165def err_init_non_aggr_init_list : Error<
2166  "initialization of non-aggregate type %0 with an initializer list">;
2167def err_init_reference_member_uninitialized : Error<
2168  "reference member of type %0 uninitialized">;
2169def note_uninit_reference_member : Note<
2170  "uninitialized reference member is here">;
2171def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2172  InGroup<Uninitialized>;
2173def warn_base_class_is_uninit : Warning<
2174  "base class %0 is uninitialized when used here to access %q1">,
2175  InGroup<Uninitialized>;
2176def warn_reference_field_is_uninit : Warning<
2177  "reference %0 is not yet bound to a value when used here">,
2178  InGroup<Uninitialized>;
2179def note_uninit_in_this_constructor : Note<
2180  "during field initialization in %select{this|the implicit default}0 "
2181  "constructor">;
2182def warn_static_self_reference_in_init : Warning<
2183  "static variable %0 is suspiciously used within its own initialization">,
2184  InGroup<UninitializedStaticSelfInit>;
2185def warn_uninit_self_reference_in_init : Warning<
2186  "variable %0 is uninitialized when used within its own initialization">,
2187  InGroup<Uninitialized>;
2188def warn_uninit_self_reference_in_reference_init : Warning<
2189  "reference %0 is not yet bound to a value when used within its own"
2190  " initialization">,
2191  InGroup<Uninitialized>;
2192def warn_uninit_var : Warning<
2193  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2194  InGroup<Uninitialized>, DefaultIgnore;
2195def warn_sometimes_uninit_var : Warning<
2196  "variable %0 is %select{used|captured}1 uninitialized whenever "
2197  "%select{'%3' condition is %select{true|false}4|"
2198  "'%3' loop %select{is entered|exits because its condition is false}4|"
2199  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2200  "switch %3 is taken|"
2201  "its declaration is reached|"
2202  "%3 is called}2">,
2203  InGroup<UninitializedSometimes>, DefaultIgnore;
2204def warn_maybe_uninit_var : Warning<
2205  "variable %0 may be uninitialized when "
2206  "%select{used here|captured by block}1">,
2207  InGroup<UninitializedMaybe>, DefaultIgnore;
2208def note_var_declared_here : Note<"variable %0 is declared here">;
2209def note_uninit_var_use : Note<
2210  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2211def warn_uninit_byref_blockvar_captured_by_block : Warning<
2212  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2213  "block">, InGroup<Uninitialized>, DefaultIgnore;
2214def note_block_var_fixit_add_initialization : Note<
2215  "did you mean to use __block %0?">;
2216def note_in_omitted_aggregate_initializer : Note<
2217  "in implicit initialization of %select{"
2218  "array element %1 with omitted initializer|"
2219  "field %1 with omitted initializer|"
2220  "trailing array elements in runtime-sized array new}0">;
2221def note_in_reference_temporary_list_initializer : Note<
2222  "in initialization of temporary of type %0 created to "
2223  "list-initialize this reference">;
2224def note_var_fixit_add_initialization : Note<
2225  "initialize the variable %0 to silence this warning">;
2226def note_uninit_fixit_remove_cond : Note<
2227  "remove the %select{'%1' if its condition|condition if it}0 "
2228  "is always %select{false|true}2">;
2229def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2230def err_list_init_in_parens : Error<
2231  "cannot initialize %select{non-class|reference}0 type %1 with a "
2232  "parenthesized initializer list">;
2233
2234def warn_uninit_const_reference : Warning<
2235  "variable %0 is uninitialized when passed as a const reference argument "
2236  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2237
2238def warn_unsequenced_mod_mod : Warning<
2239  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2240def warn_unsequenced_mod_use : Warning<
2241  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2242
2243def select_initialized_entity_kind : TextSubstitution<
2244  "%select{copying variable|copying parameter|initializing template parameter|"
2245  "returning object|initializing statement expression result|"
2246  "throwing object|copying member subobject|copying array element|"
2247  "allocating object|copying temporary|initializing base subobject|"
2248  "initializing vector element|capturing value}0">;
2249
2250def err_temp_copy_no_viable : Error<
2251  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2252def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2253  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2254  "C++98 requires a copy constructor when binding a reference to a temporary">,
2255  InGroup<BindToTemporaryCopy>;
2256def err_temp_copy_ambiguous : Error<
2257  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2258  "of type %1">;
2259def err_temp_copy_deleted : Error<
2260  "%sub{select_initialized_entity_kind}0 of type %1 "
2261  "invokes deleted constructor">;
2262def err_temp_copy_incomplete : Error<
2263  "copying a temporary object of incomplete type %0">;
2264def warn_cxx98_compat_temp_copy : Warning<
2265  "%sub{select_initialized_entity_kind}1 "
2266  "of type %2 when binding a reference to a temporary would %select{invoke "
2267  "an inaccessible constructor|find no viable constructor|find ambiguous "
2268  "constructors|invoke a deleted constructor}0 in C++98">,
2269  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2270def err_selected_explicit_constructor : Error<
2271  "chosen constructor is explicit in copy-initialization">;
2272def note_explicit_ctor_deduction_guide_here : Note<
2273  "explicit %select{constructor|deduction guide}0 declared here">;
2274
2275// C++11 decltype
2276def err_decltype_in_declarator : Error<
2277    "'decltype' cannot be used to name a declaration">;
2278
2279// C++11 auto
2280def warn_cxx98_compat_auto_type_specifier : Warning<
2281  "'auto' type specifier is incompatible with C++98">,
2282  InGroup<CXX98Compat>, DefaultIgnore;
2283def err_auto_variable_cannot_appear_in_own_initializer : Error<
2284  "variable %0 declared with deduced type %1 "
2285  "cannot appear in its own initializer">;
2286def err_binding_cannot_appear_in_own_initializer : Error<
2287  "binding %0 cannot appear in the initializer of its own "
2288  "decomposition declaration">;
2289def err_illegal_decl_array_of_auto : Error<
2290  "'%0' declared as array of %1">;
2291def err_new_array_of_auto : Error<
2292  "cannot allocate array of 'auto'">;
2293def err_auto_not_allowed : Error<
2294  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2295  "use of "
2296  "%select{class template|function template|variable template|alias template|"
2297  "template template parameter|concept|template}2 %3 requires template "
2298  "arguments; argument deduction}0 not allowed "
2299  "%select{in function prototype"
2300  "|in non-static struct member|in struct member"
2301  "|in non-static union member|in union member"
2302  "|in non-static class member|in interface member"
2303  "|in exception declaration|in template parameter until C++17|in block literal"
2304  "|in template argument|in typedef|in type alias|in function return type"
2305  "|in conversion function type|here|in lambda parameter"
2306  "|in type allocated by 'new'|in K&R-style function parameter"
2307  "|in template parameter|in friend declaration|in function prototype that is "
2308  "not a function declaration|in requires expression parameter}1">;
2309def err_dependent_deduced_tst : Error<
2310  "typename specifier refers to "
2311  "%select{class template|function template|variable template|alias template|"
2312  "template template parameter|template}0 member in %1; "
2313  "argument deduction not allowed here">;
2314def err_deduced_tst : Error<
2315  "typename specifier refers to "
2316  "%select{class template|function template|variable template|alias template|"
2317  "template template parameter|template}0; argument deduction not allowed "
2318  "here">;
2319def err_auto_not_allowed_var_inst : Error<
2320  "'auto' variable template instantiation is not allowed">;
2321def err_auto_var_requires_init : Error<
2322  "declaration of variable %0 with deduced type %1 requires an initializer">;
2323def err_auto_new_requires_ctor_arg : Error<
2324  "new expression for type %0 requires a constructor argument">;
2325def ext_auto_new_list_init : Extension<
2326  "ISO C++ standards before C++17 do not allow new expression for "
2327  "type %0 to use list-initialization">, InGroup<CXX17>;
2328def err_auto_var_init_no_expression : Error<
2329  "initializer for variable %0 with type %1 is empty">;
2330def err_auto_var_init_multiple_expressions : Error<
2331  "initializer for variable %0 with type %1 contains multiple expressions">;
2332def err_auto_var_init_paren_braces : Error<
2333  "cannot deduce type for variable %1 with type %2 from "
2334  "%select{parenthesized|nested}0 initializer list">;
2335def err_auto_new_ctor_multiple_expressions : Error<
2336  "new expression for type %0 contains multiple constructor arguments">;
2337def err_auto_missing_trailing_return : Error<
2338  "'auto' return without trailing return type; deduced return types are a "
2339  "C++14 extension">;
2340def err_deduced_return_type : Error<
2341  "deduced return types are a C++14 extension">;
2342def err_trailing_return_without_auto : Error<
2343  "function with trailing return type must specify return type 'auto', not %0">;
2344def err_trailing_return_in_parens : Error<
2345  "trailing return type may not be nested within parentheses">;
2346def err_auto_var_deduction_failure : Error<
2347  "variable %0 with type %1 has incompatible initializer of type %2">;
2348def err_auto_var_deduction_failure_from_init_list : Error<
2349  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2350def err_auto_new_deduction_failure : Error<
2351  "new expression for type %0 has incompatible constructor argument of type %1">;
2352def err_auto_inconsistent_deduction : Error<
2353  "deduced conflicting types %diff{($ vs $) |}0,1"
2354  "for initializer list element type">;
2355def err_auto_different_deductions : Error<
2356  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2357  "deduced as %1 in declaration of %2 and "
2358  "deduced as %3 in declaration of %4">;
2359def err_auto_non_deduced_not_alone : Error<
2360  "%select{function with deduced return type|"
2361  "declaration with trailing return type}0 "
2362  "must be the only declaration in its group">;
2363def err_implied_std_initializer_list_not_found : Error<
2364  "cannot deduce type of initializer list because std::initializer_list was "
2365  "not found; include <initializer_list>">;
2366def err_malformed_std_initializer_list : Error<
2367  "std::initializer_list must be a class template with a single type parameter">;
2368def err_auto_init_list_from_c : Error<
2369  "cannot use __auto_type with initializer list in C">;
2370def err_auto_bitfield : Error<
2371  "cannot pass bit-field as __auto_type initializer in C">;
2372
2373// C++1y decltype(auto) type
2374def err_decltype_auto_invalid : Error<
2375  "'decltype(auto)' not allowed here">;
2376def err_decltype_auto_cannot_be_combined : Error<
2377  "'decltype(auto)' cannot be combined with other type specifiers">;
2378def err_decltype_auto_function_declarator_not_declaration : Error<
2379  "'decltype(auto)' can only be used as a return type "
2380  "in a function declaration">;
2381def err_decltype_auto_compound_type : Error<
2382  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2383def err_decltype_auto_initializer_list : Error<
2384  "cannot deduce 'decltype(auto)' from initializer list">;
2385
2386// C++17 deduced class template specialization types
2387def err_deduced_class_template_compound_type : Error<
2388  "cannot %select{form pointer to|form reference to|form array of|"
2389  "form function returning|use parentheses when declaring variable with}0 "
2390  "deduced class template specialization type">;
2391def err_deduced_non_class_template_specialization_type : Error<
2392  "%select{<error>|function template|variable template|alias template|"
2393  "template template parameter|concept|template}0 %1 requires template "
2394  "arguments; argument deduction only allowed for class templates">;
2395def err_deduced_class_template_ctor_ambiguous : Error<
2396  "ambiguous deduction for template arguments of %0">;
2397def err_deduced_class_template_ctor_no_viable : Error<
2398  "no viable constructor or deduction guide for deduction of "
2399  "template arguments of %0">;
2400def err_deduced_class_template_incomplete : Error<
2401  "template %0 has no definition and no %select{|viable }1deduction guides "
2402  "for deduction of template arguments">;
2403def err_deduced_class_template_deleted : Error<
2404  "class template argument deduction for %0 selected a deleted constructor">;
2405def err_deduced_class_template_explicit : Error<
2406  "class template argument deduction for %0 selected an explicit "
2407  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2408def err_deduction_guide_no_trailing_return_type : Error<
2409  "deduction guide declaration without trailing return type">;
2410def err_deduction_guide_bad_trailing_return_type : Error<
2411  "deduced type %1 of deduction guide is not %select{|written as }2"
2412  "a specialization of template %0">;
2413def err_deduction_guide_with_complex_decl : Error<
2414  "cannot specify any part of a return type in the "
2415  "declaration of a deduction guide">;
2416def err_deduction_guide_invalid_specifier : Error<
2417  "deduction guide cannot be declared '%0'">;
2418def err_deduction_guide_name_not_class_template : Error<
2419  "cannot specify deduction guide for "
2420  "%select{<error>|function template|variable template|alias template|"
2421  "template template parameter|concept|dependent template name}0 %1">;
2422def err_deduction_guide_wrong_scope : Error<
2423  "deduction guide must be declared in the same scope as template %q0">;
2424def err_deduction_guide_defines_function : Error<
2425  "deduction guide cannot have a function definition">;
2426def err_deduction_guide_redeclared : Error<
2427  "redeclaration of deduction guide">;
2428def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2429  "%select{explicitly instantiated|explicitly specialized}0">;
2430def err_deduction_guide_template_not_deducible : Error<
2431  "deduction guide template contains "
2432  "%select{a template parameter|template parameters}0 that cannot be "
2433  "deduced">;
2434def err_deduction_guide_wrong_access : Error<
2435  "deduction guide has different access from the corresponding "
2436  "member template">;
2437def note_deduction_guide_template_access : Note<
2438  "member template declared %0 here">;
2439def note_deduction_guide_access : Note<
2440  "deduction guide declared %0 by intervening access specifier">;
2441def warn_cxx14_compat_class_template_argument_deduction : Warning<
2442  "class template argument deduction is incompatible with C++ standards "
2443  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2444  InGroup<CXXPre17Compat>, DefaultIgnore;
2445def warn_ctad_maybe_unsupported : Warning<
2446  "%0 may not intend to support class template argument deduction">,
2447  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2448def note_suppress_ctad_maybe_unsupported : Note<
2449  "add a deduction guide to suppress this warning">;
2450
2451
2452// C++14 deduced return types
2453def err_auto_fn_deduction_failure : Error<
2454  "cannot deduce return type %0 from returned value of type %1">;
2455def err_auto_fn_different_deductions : Error<
2456  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2457  "deduced as %2 in earlier return statement">;
2458def err_auto_fn_used_before_defined : Error<
2459  "function %0 with deduced return type cannot be used before it is defined">;
2460def err_auto_fn_no_return_but_not_auto : Error<
2461  "cannot deduce return type %0 for function with no return statements">;
2462def err_auto_fn_return_void_but_not_auto : Error<
2463  "cannot deduce return type %0 from omitted return expression">;
2464def err_auto_fn_return_init_list : Error<
2465  "cannot deduce return type from initializer list">;
2466def err_auto_fn_virtual : Error<
2467  "function with deduced return type cannot be virtual">;
2468def warn_cxx11_compat_deduced_return_type : Warning<
2469  "return type deduction is incompatible with C++ standards before C++14">,
2470  InGroup<CXXPre14Compat>, DefaultIgnore;
2471
2472// C++11 override control
2473def override_keyword_only_allowed_on_virtual_member_functions : Error<
2474  "only virtual member functions can be marked '%0'">;
2475def override_keyword_hides_virtual_member_function : Error<
2476  "non-virtual member function marked '%0' hides virtual member "
2477  "%select{function|functions}1">;
2478def err_function_marked_override_not_overriding : Error<
2479  "%0 marked 'override' but does not override any member functions">;
2480def warn_destructor_marked_not_override_overriding : TextSubstitution <
2481  "%0 overrides a destructor but is not marked 'override'">;
2482def warn_function_marked_not_override_overriding : TextSubstitution <
2483  "%0 overrides a member function but is not marked 'override'">;
2484def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2485  "%sub{warn_destructor_marked_not_override_overriding}0">,
2486  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2487def warn_inconsistent_function_marked_not_override_overriding : Warning <
2488  "%sub{warn_function_marked_not_override_overriding}0">,
2489  InGroup<CXX11WarnInconsistentOverrideMethod>;
2490def warn_suggest_destructor_marked_not_override_overriding : Warning <
2491  "%sub{warn_destructor_marked_not_override_overriding}0">,
2492  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2493def warn_suggest_function_marked_not_override_overriding : Warning <
2494  "%sub{warn_function_marked_not_override_overriding}0">,
2495  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2496def err_class_marked_final_used_as_base : Error<
2497  "base %0 is marked '%select{final|sealed}1'">;
2498def warn_abstract_final_class : Warning<
2499  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2500def warn_final_dtor_non_final_class : Warning<
2501  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2502  InGroup<FinalDtorNonFinalClass>;
2503def note_final_dtor_non_final_class_silence : Note<
2504  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2505
2506// C++11 attributes
2507def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2508
2509// C++11 final
2510def err_final_function_overridden : Error<
2511  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2512
2513// C++11 scoped enumerations
2514def err_enum_invalid_underlying : Error<
2515  "non-integral type %0 is an invalid underlying type">;
2516def err_enumerator_too_large : Error<
2517  "enumerator value is not representable in the underlying type %0">;
2518def ext_enumerator_too_large : Extension<
2519  "enumerator value is not representable in the underlying type %0">,
2520  InGroup<MicrosoftEnumValue>;
2521def err_enumerator_wrapped : Error<
2522  "enumerator value %0 is not representable in the underlying type %1">;
2523def err_enum_redeclare_type_mismatch : Error<
2524  "enumeration redeclared with different underlying type %0 (was %1)">;
2525def err_enum_redeclare_fixed_mismatch : Error<
2526  "enumeration previously declared with %select{non|}0fixed underlying type">;
2527def err_enum_redeclare_scoped_mismatch : Error<
2528  "enumeration previously declared as %select{un|}0scoped">;
2529def err_only_enums_have_underlying_types : Error<
2530  "only enumeration types have underlying types">;
2531def err_underlying_type_of_incomplete_enum : Error<
2532  "cannot determine underlying type of incomplete enumeration type %0">;
2533
2534// C++11 delegating constructors
2535def err_delegating_ctor : Error<
2536  "delegating constructors are permitted only in C++11">;
2537def warn_cxx98_compat_delegating_ctor : Warning<
2538  "delegating constructors are incompatible with C++98">,
2539  InGroup<CXX98Compat>, DefaultIgnore;
2540def err_delegating_initializer_alone : Error<
2541  "an initializer for a delegating constructor must appear alone">;
2542def warn_delegating_ctor_cycle : Warning<
2543  "constructor for %0 creates a delegation cycle">, DefaultError,
2544  InGroup<DelegatingCtorCycles>;
2545def note_it_delegates_to : Note<"it delegates to">;
2546def note_which_delegates_to : Note<"which delegates to">;
2547
2548// C++11 range-based for loop
2549def err_for_range_decl_must_be_var : Error<
2550  "for range declaration must declare a variable">;
2551def err_for_range_storage_class : Error<
2552  "loop variable %0 may not be declared %select{'extern'|'static'|"
2553  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2554def err_type_defined_in_for_range : Error<
2555  "types may not be defined in a for range declaration">;
2556def err_for_range_deduction_failure : Error<
2557  "cannot use type %0 as a range">;
2558def err_for_range_incomplete_type : Error<
2559  "cannot use incomplete type %0 as a range">;
2560def err_for_range_iter_deduction_failure : Error<
2561  "cannot use type %0 as an iterator">;
2562def ext_for_range_begin_end_types_differ : ExtWarn<
2563  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2564  InGroup<CXX17>;
2565def warn_for_range_begin_end_types_differ : Warning<
2566  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2567  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2568def note_in_for_range: Note<
2569  "when looking up '%select{begin|end}0' function for range expression "
2570  "of type %1">;
2571def err_for_range_invalid: Error<
2572  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2573  "function available">;
2574def note_for_range_member_begin_end_ignored : Note<
2575  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2576def err_range_on_array_parameter : Error<
2577  "cannot build range expression with array function parameter %0 since "
2578  "parameter with array type %1 is treated as pointer type %2">;
2579def err_for_range_dereference : Error<
2580  "invalid range expression of type %0; did you mean to dereference it "
2581  "with '*'?">;
2582def note_for_range_invalid_iterator : Note <
2583  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2584def note_for_range_begin_end : Note<
2585  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2586def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2587  "loop variable %0 "
2588  "%diff{of type $ binds to a temporary constructed from type $"
2589  "|binds to a temporary constructed from a different type}1,2">,
2590  InGroup<RangeLoopConstruct>, DefaultIgnore;
2591def note_use_type_or_non_reference : Note<
2592  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2593def warn_for_range_ref_binds_ret_temp : Warning<
2594  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2595  InGroup<RangeLoopBindReference>, DefaultIgnore;
2596def note_use_non_reference_type : Note<"use non-reference type %0">;
2597def warn_for_range_copy : Warning<
2598  "loop variable %0 creates a copy from type %1">,
2599  InGroup<RangeLoopConstruct>, DefaultIgnore;
2600def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2601def err_objc_for_range_init_stmt : Error<
2602  "initialization statement is not supported when iterating over Objective-C "
2603  "collection">;
2604
2605// C++11 constexpr
2606def warn_cxx98_compat_constexpr : Warning<
2607  "'constexpr' specifier is incompatible with C++98">,
2608  InGroup<CXX98Compat>, DefaultIgnore;
2609// FIXME: Maybe this should also go in -Wc++14-compat?
2610def warn_cxx14_compat_constexpr_not_const : Warning<
2611  "'constexpr' non-static member function will not be implicitly 'const' "
2612  "in C++14; add 'const' to avoid a change in behavior">,
2613  InGroup<DiagGroup<"constexpr-not-const">>;
2614def err_invalid_consteval_take_address : Error<
2615  "cannot take address of consteval function %0 outside"
2616  " of an immediate invocation">;
2617def err_invalid_consteval_call : Error<
2618  "call to consteval function %q0 is not a constant expression">;
2619def err_invalid_consteval_decl_kind : Error<
2620  "%0 cannot be declared consteval">;
2621def err_invalid_constexpr : Error<
2622  "%select{function parameter|typedef}0 "
2623  "cannot be %sub{select_constexpr_spec_kind}1">;
2624def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2625  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2626def err_constexpr_tag : Error<
2627  "%select{class|struct|interface|union|enum}0 "
2628  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2629def err_constexpr_dtor : Error<
2630  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2631def err_constexpr_dtor_subobject : Error<
2632  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2633  "%select{data member %2|base class %3}1 does not have a "
2634  "constexpr destructor">;
2635def note_constexpr_dtor_subobject : Note<
2636  "%select{data member %1|base class %2}0 declared here">;
2637def err_constexpr_wrong_decl_kind : Error<
2638  "%sub{select_constexpr_spec_kind}0 can only be used "
2639  "in %select{|variable and function|function|variable}0 declarations">;
2640def err_invalid_constexpr_var_decl : Error<
2641  "constexpr variable declaration must be a definition">;
2642def err_constexpr_static_mem_var_requires_init : Error<
2643  "declaration of constexpr static data member %0 requires an initializer">;
2644def err_constexpr_var_non_literal : Error<
2645  "constexpr variable cannot have non-literal type %0">;
2646def err_constexpr_var_requires_const_init : Error<
2647  "constexpr variable %0 must be initialized by a constant expression">;
2648def err_constexpr_var_requires_const_destruction : Error<
2649  "constexpr variable %0 must have constant destruction">;
2650def err_constexpr_redecl_mismatch : Error<
2651  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2652  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2653def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2654def warn_cxx17_compat_constexpr_virtual : Warning<
2655  "virtual constexpr functions are incompatible with "
2656  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2657def err_constexpr_virtual_base : Error<
2658  "constexpr %select{member function|constructor}0 not allowed in "
2659  "%select{struct|interface|class}1 with virtual base "
2660  "%plural{1:class|:classes}2">;
2661def note_non_literal_incomplete : Note<
2662  "incomplete type %0 is not a literal type">;
2663def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2664  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2665def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2666def err_constexpr_non_literal_return : Error<
2667  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2668def err_constexpr_non_literal_param : Error<
2669  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2670  "not a literal type">;
2671def err_constexpr_body_invalid_stmt : Error<
2672  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2673def ext_constexpr_body_invalid_stmt : ExtWarn<
2674  "use of this statement in a constexpr %select{function|constructor}0 "
2675  "is a C++14 extension">, InGroup<CXX14>;
2676def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2677  "use of this statement in a constexpr %select{function|constructor}0 "
2678  "is incompatible with C++ standards before C++14">,
2679  InGroup<CXXPre14Compat>, DefaultIgnore;
2680def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2681  "use of this statement in a constexpr %select{function|constructor}0 "
2682  "is a C++20 extension">, InGroup<CXX20>;
2683def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2684  "use of this statement in a constexpr %select{function|constructor}0 "
2685  "is incompatible with C++ standards before C++20">,
2686  InGroup<CXXPre20Compat>, DefaultIgnore;
2687def ext_constexpr_type_definition : ExtWarn<
2688  "type definition in a constexpr %select{function|constructor}0 "
2689  "is a C++14 extension">, InGroup<CXX14>;
2690def warn_cxx11_compat_constexpr_type_definition : Warning<
2691  "type definition in a constexpr %select{function|constructor}0 "
2692  "is incompatible with C++ standards before C++14">,
2693  InGroup<CXXPre14Compat>, DefaultIgnore;
2694def err_constexpr_vla : Error<
2695  "variably-modified type %0 cannot be used in a constexpr "
2696  "%select{function|constructor}1">;
2697def ext_constexpr_local_var : ExtWarn<
2698  "variable declaration in a constexpr %select{function|constructor}0 "
2699  "is a C++14 extension">, InGroup<CXX14>;
2700def warn_cxx11_compat_constexpr_local_var : Warning<
2701  "variable declaration in a constexpr %select{function|constructor}0 "
2702  "is incompatible with C++ standards before C++14">,
2703  InGroup<CXXPre14Compat>, DefaultIgnore;
2704def err_constexpr_local_var_static : Error<
2705  "%select{static|thread_local}1 variable not permitted in a constexpr "
2706  "%select{function|constructor}0">;
2707def err_constexpr_local_var_non_literal_type : Error<
2708  "variable of non-literal type %1 cannot be defined in a constexpr "
2709  "%select{function|constructor}0">;
2710def ext_constexpr_local_var_no_init : ExtWarn<
2711  "uninitialized variable in a constexpr %select{function|constructor}0 "
2712  "is a C++20 extension">, InGroup<CXX20>;
2713def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2714  "uninitialized variable in a constexpr %select{function|constructor}0 "
2715  "is incompatible with C++ standards before C++20">,
2716  InGroup<CXXPre20Compat>, DefaultIgnore;
2717def ext_constexpr_function_never_constant_expr : ExtWarn<
2718  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2719  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2720def err_attr_cond_never_constant_expr : Error<
2721  "%0 attribute expression never produces a constant expression">;
2722def err_diagnose_if_invalid_diagnostic_type : Error<
2723  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2724  "instead">;
2725def err_constexpr_body_no_return : Error<
2726  "no return statement in %select{constexpr|consteval}0 function">;
2727def err_constexpr_return_missing_expr : Error<
2728  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2729def warn_cxx11_compat_constexpr_body_no_return : Warning<
2730  "constexpr function with no return statements is incompatible with C++ "
2731  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2732def ext_constexpr_body_multiple_return : ExtWarn<
2733  "multiple return statements in constexpr function is a C++14 extension">,
2734  InGroup<CXX14>;
2735def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2736  "multiple return statements in constexpr function "
2737  "is incompatible with C++ standards before C++14">,
2738  InGroup<CXXPre14Compat>, DefaultIgnore;
2739def note_constexpr_body_previous_return : Note<
2740  "previous return statement is here">;
2741
2742// C++20 function try blocks in constexpr
2743def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2744  "function try block in constexpr %select{function|constructor}0 is "
2745  "a C++20 extension">, InGroup<CXX20>;
2746def warn_cxx17_compat_constexpr_function_try_block : Warning<
2747  "function try block in constexpr %select{function|constructor}0 is "
2748  "incompatible with C++ standards before C++20">,
2749  InGroup<CXXPre20Compat>, DefaultIgnore;
2750
2751def ext_constexpr_union_ctor_no_init : ExtWarn<
2752  "constexpr union constructor that does not initialize any member "
2753  "is a C++20 extension">, InGroup<CXX20>;
2754def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2755  "constexpr union constructor that does not initialize any member "
2756  "is incompatible with C++ standards before C++20">,
2757  InGroup<CXXPre20Compat>, DefaultIgnore;
2758def ext_constexpr_ctor_missing_init : ExtWarn<
2759  "constexpr constructor that does not initialize all members "
2760  "is a C++20 extension">, InGroup<CXX20>;
2761def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2762  "constexpr constructor that does not initialize all members "
2763  "is incompatible with C++ standards before C++20">,
2764  InGroup<CXXPre20Compat>, DefaultIgnore;
2765def note_constexpr_ctor_missing_init : Note<
2766  "member not initialized by constructor">;
2767def note_non_literal_no_constexpr_ctors : Note<
2768  "%0 is not literal because it is not an aggregate and has no constexpr "
2769  "constructors other than copy or move constructors">;
2770def note_non_literal_base_class : Note<
2771  "%0 is not literal because it has base class %1 of non-literal type">;
2772def note_non_literal_field : Note<
2773  "%0 is not literal because it has data member %1 of "
2774  "%select{non-literal|volatile}3 type %2">;
2775def note_non_literal_user_provided_dtor : Note<
2776  "%0 is not literal because it has a user-provided destructor">;
2777def note_non_literal_nontrivial_dtor : Note<
2778  "%0 is not literal because it has a non-trivial destructor">;
2779def note_non_literal_non_constexpr_dtor : Note<
2780  "%0 is not literal because its destructor is not constexpr">;
2781def note_non_literal_lambda : Note<
2782  "lambda closure types are non-literal types before C++17">;
2783def warn_private_extern : Warning<
2784  "use of __private_extern__ on a declaration may not produce external symbol "
2785  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2786def note_private_extern : Note<
2787  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2788
2789// C++ Concepts
2790def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2791  "concept declarations may only appear in global or namespace scope">;
2792def err_concept_no_parameters : Error<
2793  "concept template parameter list must have at least one parameter; explicit "
2794  "specialization of concepts is not allowed">;
2795def err_concept_extra_headers : Error<
2796  "extraneous template parameter list in concept definition">;
2797def err_concept_no_associated_constraints : Error<
2798  "concept cannot have associated constraints">;
2799def err_non_constant_constraint_expression : Error<
2800  "substitution into constraint expression resulted in a non-constant "
2801  "expression">;
2802def err_non_bool_atomic_constraint : Error<
2803  "atomic constraint must be of type 'bool' (found %0)">;
2804def err_template_arg_list_constraints_not_satisfied : Error<
2805  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
2806  "template template parameter|template}0 %1%2">;
2807def note_substituted_constraint_expr_is_ill_formed : Note<
2808  "because substituted constraint expression is ill-formed%0">;
2809def note_atomic_constraint_evaluated_to_false : Note<
2810  "%select{and|because}0 '%1' evaluated to false">;
2811def note_concept_specialization_constraint_evaluated_to_false : Note<
2812  "%select{and|because}0 '%1' evaluated to false">;
2813def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
2814  "%select{and|because}0 %1 does not satisfy %2">;
2815def note_atomic_constraint_evaluated_to_false_elaborated : Note<
2816  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
2817def err_constrained_virtual_method : Error<
2818  "virtual function cannot have a requires clause">;
2819def err_trailing_requires_clause_on_deduction_guide : Error<
2820  "deduction guide cannot have a requires clause">;
2821def err_reference_to_function_with_unsatisfied_constraints : Error<
2822  "invalid reference to function %0: constraints not satisfied">;
2823def err_requires_expr_local_parameter_default_argument : Error<
2824  "default arguments not allowed for parameters of a requires expression">;
2825def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
2826  "constraint variable %0 cannot be used in an evaluated context">;
2827def note_expr_requirement_expr_substitution_error : Note<
2828  "%select{and|because}0 '%1' would be invalid: %2">;
2829def note_expr_requirement_expr_unknown_substitution_error : Note<
2830  "%select{and|because}0 '%1' would be invalid">;
2831def note_expr_requirement_noexcept_not_met : Note<
2832  "%select{and|because}0 '%1' may throw an exception">;
2833def note_expr_requirement_type_requirement_substitution_error : Note<
2834  "%select{and|because}0 '%1' would be invalid: %2">;
2835def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
2836  "%select{and|because}0 '%1' would be invalid">;
2837def note_expr_requirement_constraints_not_satisfied : Note<
2838  "%select{and|because}0 type constraint '%1' was not satisfied:">;
2839def note_expr_requirement_constraints_not_satisfied_simple : Note<
2840  "%select{and|because}0 %1 does not satisfy %2:">;
2841def note_type_requirement_substitution_error : Note<
2842  "%select{and|because}0 '%1' would be invalid: %2">;
2843def note_type_requirement_unknown_substitution_error : Note<
2844  "%select{and|because}0 '%1' would be invalid">;
2845def note_nested_requirement_substitution_error : Note<
2846  "%select{and|because}0 '%1' would be invalid: %2">;
2847def note_nested_requirement_unknown_substitution_error : Note<
2848  "%select{and|because}0 '%1' would be invalid">;
2849def note_ambiguous_atomic_constraints : Note<
2850  "similar constraint expressions not considered equivalent; constraint "
2851  "expressions cannot be considered equivalent unless they originate from the "
2852  "same concept">;
2853def note_ambiguous_atomic_constraints_similar_expression : Note<
2854  "similar constraint expression here">;
2855def err_unsupported_placeholder_constraint : Error<
2856  "constrained placeholder types other than simple 'auto' on non-type template "
2857  "parameters not supported yet">;
2858
2859def err_template_different_requires_clause : Error<
2860  "requires clause differs in template redeclaration">;
2861def err_template_different_type_constraint : Error<
2862  "type constraint differs in template redeclaration">;
2863def err_template_template_parameter_not_at_least_as_constrained : Error<
2864  "template template argument %0 is more constrained than template template "
2865  "parameter %1">;
2866
2867def err_type_constraint_non_type_concept : Error<
2868  "concept named in type constraint is not a type concept">;
2869def err_type_constraint_missing_arguments : Error<
2870  "%0 requires more than 1 template argument; provide the remaining arguments "
2871  "explicitly to use it here">;
2872def err_placeholder_constraints_not_satisfied : Error<
2873  "deduced type %0 does not satisfy %1">;
2874
2875// C++11 char16_t/char32_t
2876def warn_cxx98_compat_unicode_type : Warning<
2877  "'%0' type specifier is incompatible with C++98">,
2878  InGroup<CXX98Compat>, DefaultIgnore;
2879def warn_cxx17_compat_unicode_type : Warning<
2880  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2881  InGroup<CXXPre20Compat>, DefaultIgnore;
2882
2883// __make_integer_seq
2884def err_integer_sequence_negative_length : Error<
2885  "integer sequences must have non-negative sequence length">;
2886def err_integer_sequence_integral_element_type : Error<
2887  "integer sequences must have integral element type">;
2888
2889// __type_pack_element
2890def err_type_pack_element_out_of_bounds : Error<
2891  "a parameter pack may not be accessed at an out of bounds index">;
2892
2893// Objective-C++
2894def err_objc_decls_may_only_appear_in_global_scope : Error<
2895  "Objective-C declarations may only appear in global scope">;
2896def warn_auto_var_is_id : Warning<
2897  "'auto' deduced as 'id' in declaration of %0">,
2898  InGroup<DiagGroup<"auto-var-id">>;
2899
2900// Attributes
2901def warn_nomerge_attribute_ignored_in_stmt: Warning<
2902  "%0 attribute is ignored because there exists no call expression inside the "
2903  "statement">,
2904  InGroup<IgnoredAttributes>;
2905
2906def err_musttail_needs_trivial_args : Error<
2907  "tail call requires that the return value, all parameters, and any "
2908  "temporaries created by the expression are trivially destructible">;
2909def err_musttail_needs_call : Error<
2910  "%0 attribute requires that the return value is the result of a function call"
2911  >;
2912def err_musttail_needs_prototype : Error<
2913  "%0 attribute requires that both caller and callee functions have a "
2914  "prototype">;
2915def note_musttail_fix_non_prototype : Note<
2916  "add 'void' to the parameter list to turn an old-style K&R function "
2917  "declaration into a prototype">;
2918def err_musttail_structors_forbidden : Error<"cannot perform a tail call "
2919  "%select{from|to}0 a %select{constructor|destructor}1">;
2920def note_musttail_structors_forbidden : Note<"target "
2921  "%select{constructor|destructor}0 is declared here">;
2922def err_musttail_forbidden_from_this_context : Error<
2923  "%0 attribute cannot be used from "
2924  "%select{a block|an Objective-C function|this context}1">;
2925def err_musttail_member_mismatch : Error<
2926  "%select{non-member|static member|non-static member}0 "
2927  "function cannot perform a tail call to "
2928  "%select{non-member|static member|non-static member|pointer-to-member}1 "
2929  "function%select{| %3}2">;
2930def note_musttail_callee_defined_here : Note<"%0 declared here">;
2931def note_tail_call_required : Note<"tail call required by %0 attribute here">;
2932def err_musttail_mismatch : Error<
2933  "cannot perform a tail call to function%select{| %1}0 because its signature "
2934  "is incompatible with the calling function">;
2935def note_musttail_mismatch : Note<
2936    "target function "
2937    "%select{is a member of different class%diff{ (expected $ but has $)|}1,2"
2938    "|has different number of parameters (expected %1 but has %2)"
2939    "|has type mismatch at %ordinal3 parameter"
2940    "%diff{ (expected $ but has $)|}1,2"
2941    "|has different return type%diff{ ($ expected but has $)|}1,2}0">;
2942def err_musttail_callconv_mismatch : Error<
2943  "cannot perform a tail call to function%select{| %1}0 because it uses an "
2944  "incompatible calling convention">;
2945def note_musttail_callconv_mismatch : Note<
2946  "target function has calling convention %1 (expected %0)">;
2947def err_musttail_scope : Error<
2948  "cannot perform a tail call from this return statement">;
2949def err_musttail_no_variadic : Error<
2950  "%0 attribute may not be used with variadic functions">;
2951
2952def err_nsobject_attribute : Error<
2953  "'NSObject' attribute is for pointer types only">;
2954def err_attributes_are_not_compatible : Error<
2955  "%0 and %1 attributes are not compatible">;
2956def err_attribute_invalid_argument : Error<
2957  "%select{a reference type|an array type|a non-vector or "
2958  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
2959def err_attribute_wrong_number_arguments : Error<
2960  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2961  ":requires exactly %1 arguments}1">;
2962def err_attribute_wrong_number_arguments_for : Error <
2963  "%0 attribute references function %1, which %plural{0:takes no arguments|1:takes one argument|"
2964  ":takes exactly %2 arguments}2">;
2965def err_attribute_bounds_for_function : Error<
2966  "%0 attribute references parameter %1, but the function %2 has only %3 parameters">;
2967def err_attribute_no_member_function : Error<
2968  "%0 attribute cannot be applied to non-static member functions">;
2969def err_attribute_parameter_types : Error<
2970  "%0 attribute parameter types do not match: parameter %1 of function %2 has type %3, "
2971  "but parameter %4 of function %5 has type %6">;
2972
2973def err_attribute_too_many_arguments : Error<
2974  "%0 attribute takes no more than %1 argument%s1">;
2975def err_attribute_too_few_arguments : Error<
2976  "%0 attribute takes at least %1 argument%s1">;
2977def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2978def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
2979def err_attribute_bad_neon_vector_size : Error<
2980  "Neon vector size must be 64 or 128 bits">;
2981def err_attribute_invalid_sve_type : Error<
2982  "%0 attribute applied to non-SVE type %1">;
2983def err_attribute_bad_sve_vector_size : Error<
2984  "invalid SVE vector size '%0', must match value set by "
2985  "'-msve-vector-bits' ('%1')">;
2986def err_attribute_arm_feature_sve_bits_unsupported : Error<
2987  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
2988  "value of 128, 256, 512, 1024 or 2048.">;
2989def err_attribute_requires_positive_integer : Error<
2990  "%0 attribute requires a %select{positive|non-negative}1 "
2991  "integral compile time constant expression">;
2992def err_attribute_requires_opencl_version : Error<
2993  "attribute %0 is supported in the OpenCL version %1%select{| onwards}2">;
2994def err_invalid_branch_protection_spec : Error<
2995  "invalid or misplaced branch protection specification '%0'">;
2996def warn_unsupported_branch_protection_spec : Warning<
2997  "unsupported branch protection specification '%0'">, InGroup<BranchProtection>;
2998
2999def warn_unsupported_target_attribute
3000    : Warning<"%select{unsupported|duplicate|unknown}0%select{| architecture|"
3001              " tune CPU}1 '%2' in the '%select{target|target_clones}3' "
3002              "attribute string; '%select{target|target_clones}3' "
3003              "attribute ignored">,
3004      InGroup<IgnoredAttributes>;
3005def err_attribute_unsupported
3006    : Error<"%0 attribute is not supported on targets missing %1;"
3007            " specify an appropriate -march= or -mcpu=">;
3008// The err_*_attribute_argument_not_int are separate because they're used by
3009// VerifyIntegerConstantExpression.
3010def err_aligned_attribute_argument_not_int : Error<
3011  "'aligned' attribute requires integer constant">;
3012def err_align_value_attribute_argument_not_int : Error<
3013  "'align_value' attribute requires integer constant">;
3014def err_alignas_attribute_wrong_decl_type : Error<
3015  "%0 attribute cannot be applied to a %select{function parameter|"
3016  "variable with 'register' storage class|'catch' variable|bit-field}1">;
3017def err_alignas_missing_on_definition : Error<
3018  "%0 must be specified on definition if it is specified on any declaration">;
3019def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
3020def err_alignas_mismatch : Error<
3021  "redeclaration has different alignment requirement (%1 vs %0)">;
3022def err_alignas_underaligned : Error<
3023  "requested alignment is less than minimum alignment of %1 for type %0">;
3024def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Text>,
3025  InGroup<IgnoredAttributes>;
3026def err_attribute_sizeless_type : Error<
3027  "%0 attribute cannot be applied to sizeless type %1">;
3028def err_attribute_argument_n_type : Error<
3029  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
3030  "constant|a string|an identifier|a constant expression|a builtin function}2">;
3031def err_attribute_argument_type : Error<
3032  "%0 attribute requires %select{int or bool|an integer "
3033  "constant|a string|an identifier}1">;
3034def err_attribute_argument_out_of_range : Error<
3035  "%0 attribute requires integer constant between %1 and %2 inclusive">;
3036def err_init_priority_object_attr : Error<
3037  "can only use 'init_priority' attribute on file-scope definitions "
3038  "of objects of class type">;
3039def err_attribute_argument_out_of_bounds : Error<
3040  "%0 attribute parameter %1 is out of bounds">;
3041def err_attribute_only_once_per_parameter : Error<
3042  "%0 attribute can only be applied once per parameter">;
3043def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
3044def note_previous_uuid : Note<"previous uuid specified here">;
3045def warn_attribute_pointers_only : Warning<
3046  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
3047  InGroup<IgnoredAttributes>;
3048def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
3049def err_attribute_integers_only : Error<
3050  "%0 attribute argument may only refer to a function parameter of integer "
3051  "type">;
3052def warn_attribute_return_pointers_only : Warning<
3053  "%0 attribute only applies to return values that are pointers">,
3054  InGroup<IgnoredAttributes>;
3055def warn_attribute_return_pointers_refs_only : Warning<
3056  "%0 attribute only applies to return values that are pointers or references">,
3057  InGroup<IgnoredAttributes>;
3058def warn_attribute_pointer_or_reference_only : Warning<
3059  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
3060  InGroup<IgnoredAttributes>;
3061def err_attribute_no_member_pointers : Error<
3062  "%0 attribute cannot be used with pointers to members">;
3063def err_attribute_invalid_implicit_this_argument : Error<
3064  "%0 attribute is invalid for the implicit this argument">;
3065def err_ownership_type : Error<
3066  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
3067def err_ownership_returns_index_mismatch : Error<
3068  "'ownership_returns' attribute index does not match; here it is %0">;
3069def note_ownership_returns_index_mismatch : Note<
3070  "declared with index %0 here">;
3071def err_format_strftime_third_parameter : Error<
3072  "strftime format attribute requires 3rd parameter to be 0">;
3073def err_format_attribute_requires_variadic : Error<
3074  "format attribute requires variadic function">;
3075def err_format_attribute_not : Error<"format argument not %0">;
3076def err_format_attribute_result_not : Error<"function does not return %0">;
3077def err_format_attribute_implicit_this_format_string : Error<
3078  "format attribute cannot specify the implicit this argument as the format "
3079  "string">;
3080def err_callback_attribute_no_callee : Error<
3081  "'callback' attribute specifies no callback callee">;
3082def err_callback_attribute_invalid_callee : Error<
3083  "'callback' attribute specifies invalid callback callee">;
3084def err_callback_attribute_multiple : Error<
3085  "multiple 'callback' attributes specified">;
3086def err_callback_attribute_argument_unknown : Error<
3087  "'callback' attribute argument %0 is not a known function parameter">;
3088def err_callback_callee_no_function_type : Error<
3089  "'callback' attribute callee does not have function type">;
3090def err_callback_callee_is_variadic : Error<
3091  "'callback' attribute callee may not be variadic">;
3092def err_callback_implicit_this_not_available : Error<
3093  "'callback' argument at position %0 references unavailable implicit 'this'">;
3094def err_init_method_bad_return_type : Error<
3095  "init methods must return an object pointer type, not %0">;
3096def err_attribute_invalid_size : Error<
3097  "vector size not an integral multiple of component size">;
3098def err_attribute_zero_size : Error<"zero %0 size">;
3099def err_attribute_size_too_large : Error<"%0 size too large">;
3100def err_typecheck_sve_ambiguous : Error<
3101  "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">;
3102def err_typecheck_sve_gnu_ambiguous : Error<
3103  "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">;
3104def err_typecheck_vector_not_convertable_implict_truncation : Error<
3105   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
3106   " %2 as implicit conversion would cause truncation">;
3107def err_typecheck_vector_not_convertable : Error<
3108  "cannot convert between vector values of different size (%0 and %1)">;
3109def err_typecheck_vector_not_convertable_non_scalar : Error<
3110  "cannot convert between vector and non-scalar values (%0 and %1)">;
3111def err_typecheck_vector_lengths_not_equal : Error<
3112  "vector operands do not have the same number of elements (%0 and %1)">;
3113def warn_typecheck_vector_element_sizes_not_equal : Warning<
3114  "vector operands do not have the same elements sizes (%0 and %1)">,
3115  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
3116def err_ext_vector_component_exceeds_length : Error<
3117  "vector component access exceeds type %0">;
3118def err_ext_vector_component_name_illegal : Error<
3119  "illegal vector component name '%0'">;
3120def err_attribute_address_space_negative : Error<
3121  "address space is negative">;
3122def err_attribute_address_space_too_high : Error<
3123  "address space is larger than the maximum supported (%0)">;
3124def err_attribute_address_multiple_qualifiers : Error<
3125  "multiple address spaces specified for type">;
3126def warn_attribute_address_multiple_identical_qualifiers : Warning<
3127  "multiple identical address spaces specified for type">,
3128  InGroup<DuplicateDeclSpecifier>;
3129def err_attribute_not_clinkage : Error<
3130  "function type with %0 attribute must have C linkage">;
3131def err_function_decl_cmse_ns_call : Error<
3132  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
3133def err_attribute_address_function_type : Error<
3134  "function type may not be qualified with an address space">;
3135def err_as_qualified_auto_decl : Error<
3136  "automatic variable qualified with an%select{| invalid}0 address space">;
3137def err_arg_with_address_space : Error<
3138  "parameter may not be qualified with an address space">;
3139def err_field_with_address_space : Error<
3140  "field may not be qualified with an address space">;
3141def err_compound_literal_with_address_space : Error<
3142  "compound literal in function scope may not be qualified with an address space">;
3143def err_address_space_mismatch_templ_inst : Error<
3144  "conflicting address space qualifiers are provided between types %0 and %1">;
3145def err_attr_objc_ownership_redundant : Error<
3146  "the type %0 is already explicitly ownership-qualified">;
3147def err_invalid_nsnumber_type : Error<
3148  "%0 is not a valid literal type for NSNumber">;
3149def err_objc_illegal_boxed_expression_type : Error<
3150  "illegal type %0 used in a boxed expression">;
3151def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3152  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3153def err_objc_incomplete_boxed_expression_type : Error<
3154  "incomplete type %0 used in a boxed expression">;
3155def err_undeclared_objc_literal_class : Error<
3156  "definition of class %0 must be available to use Objective-C "
3157  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3158  "string literals}1">;
3159def err_undeclared_boxing_method : Error<
3160  "declaration of %0 is missing in %1 class">;
3161def err_objc_literal_method_sig : Error<
3162  "literal construction method %0 has incompatible signature">;
3163def note_objc_literal_method_param : Note<
3164  "%select{first|second|third}0 parameter has unexpected type %1 "
3165  "(should be %2)">;
3166def note_objc_literal_method_return : Note<
3167  "method returns unexpected type %0 (should be an object type)">;
3168def err_invalid_collection_element : Error<
3169  "collection element of type %0 is not an Objective-C object">;
3170def err_box_literal_collection : Error<
3171  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3172  "in a collection">;
3173def warn_objc_literal_comparison : Warning<
3174  "direct comparison of %select{an array literal|a dictionary literal|"
3175  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3176  InGroup<ObjCLiteralComparison>;
3177def err_missing_atsign_prefix : Error<
3178  "%select{string|numeric}0 literal must be prefixed by '@'">;
3179def warn_objc_string_literal_comparison : Warning<
3180  "direct comparison of a string literal has undefined behavior">,
3181  InGroup<ObjCStringComparison>;
3182def warn_concatenated_literal_array_init : Warning<
3183  "suspicious concatenation of string literals in an array initialization; "
3184  "did you mean to separate the elements with a comma?">,
3185  InGroup<StringConcatation>, DefaultIgnore;
3186def warn_concatenated_nsarray_literal : Warning<
3187  "concatenated NSString literal for an NSArray expression - "
3188  "possibly missing a comma">,
3189  InGroup<ObjCStringConcatenation>;
3190def note_objc_literal_comparison_isequal : Note<
3191  "use 'isEqual:' instead">;
3192def warn_objc_collection_literal_element : Warning<
3193  "object of type %0 is not compatible with "
3194  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3195  InGroup<ObjCLiteralConversion>;
3196def warn_nsdictionary_duplicate_key : Warning<
3197  "duplicate key in dictionary literal">,
3198  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3199def note_nsdictionary_duplicate_key_here : Note<
3200  "previous equal key is here">;
3201def err_swift_param_attr_not_swiftcall : Error<
3202  "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 "
3203  "calling convention%select{|s}1">;
3204def err_swift_indirect_result_not_first : Error<
3205  "'swift_indirect_result' parameters must be first parameters of function">;
3206def err_swift_error_result_not_after_swift_context : Error<
3207  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3208def err_swift_abi_parameter_wrong_type : Error<
3209  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3210  "type here is %2">;
3211
3212def err_attribute_argument_invalid : Error<
3213  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3214  "min must not be greater than max}1">;
3215def err_attribute_argument_is_zero : Error<
3216  "%0 attribute must be greater than 0">;
3217def warn_attribute_argument_n_negative : Warning<
3218  "%0 attribute parameter %1 is negative and will be ignored">,
3219  InGroup<CudaCompat>;
3220def err_property_function_in_objc_container : Error<
3221  "use of Objective-C property in function nested in Objective-C "
3222  "container not supported, move function outside its container">;
3223
3224let CategoryName = "Cocoa API Issue" in {
3225def warn_objc_redundant_literal_use : Warning<
3226  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3227}
3228
3229def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3230  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3231
3232def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
3233
3234def err_tls_var_aligned_over_maximum : Error<
3235  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3236  "alignment (%2) for a thread-local variable on this target">;
3237
3238def err_only_annotate_after_access_spec : Error<
3239  "access specifier can only have annotation attributes">;
3240
3241def err_attribute_section_invalid_for_target : Error<
3242  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3243def err_pragma_section_invalid_for_target : Error<
3244  "argument to #pragma section is not valid for this target: %0">;
3245def warn_attribute_section_drectve : Warning<
3246  "#pragma %0(\".drectve\") has undefined behavior, "
3247  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3248def warn_mismatched_section : Warning<
3249  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3250def warn_attribute_section_on_redeclaration : Warning<
3251  "section attribute is specified on redeclared variable">, InGroup<Section>;
3252def err_mismatched_code_seg_base : Error<
3253  "derived class must specify the same code segment as its base classes">;
3254def err_mismatched_code_seg_override : Error<
3255  "overriding virtual function must specify the same code segment as its overridden function">;
3256def err_conflicting_codeseg_attribute : Error<
3257  "conflicting code segment specifiers">;
3258def warn_duplicate_codeseg_attribute : Warning<
3259  "duplicate code segment specifiers">, InGroup<Section>;
3260
3261def err_anonymous_property: Error<
3262  "anonymous property is not supported">;
3263def err_property_is_variably_modified : Error<
3264  "property %0 has a variably modified type">;
3265def err_no_accessor_for_property : Error<
3266  "no %select{getter|setter}0 defined for property %1">;
3267def err_cannot_find_suitable_accessor : Error<
3268  "cannot find suitable %select{getter|setter}0 for property %1">;
3269
3270def warn_alloca : Warning<
3271  "use of function %0 is discouraged; there is no way to check for failure but "
3272  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3273  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3274
3275def warn_alloca_align_alignof : Warning<
3276  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3277  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3278
3279def err_alignment_too_small : Error<
3280  "requested alignment must be %0 or greater">;
3281def err_alignment_too_big : Error<
3282  "requested alignment must be %0 or smaller">;
3283def err_alignment_not_power_of_two : Error<
3284  "requested alignment is not a power of 2">;
3285def warn_alignment_not_power_of_two : Warning<
3286  err_alignment_not_power_of_two.Text>,
3287  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3288def err_alignment_dependent_typedef_name : Error<
3289  "requested alignment is dependent but declaration is not dependent">;
3290
3291def warn_alignment_builtin_useless : Warning<
3292  "%select{aligning a value|the result of checking whether a value is aligned}0"
3293  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3294def err_attribute_aligned_too_great : Error<
3295  "requested alignment must be %0 bytes or smaller">;
3296def warn_assume_aligned_too_great
3297    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3298              "alignment assumed">,
3299      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3300def warn_not_xl_compatible
3301    : Warning<"requesting an alignment of 16 bytes or greater for struct"
3302              " members is not binary compatible with IBM XL C/C++ for AIX"
3303              " 16.1.0 and older">,
3304      InGroup<AIXCompat>;
3305def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3306  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3307  InGroup<MicrosoftInconsistentDllImport>;
3308def warn_redeclaration_without_import_attribute : Warning<
3309  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3310  InGroup<MicrosoftInconsistentDllImport>;
3311def warn_dllimport_dropped_from_inline_function : Warning<
3312  "%q0 redeclared inline; %1 attribute ignored">,
3313  InGroup<IgnoredAttributes>;
3314def warn_attribute_ignored : Warning<"%0 attribute ignored">,
3315  InGroup<IgnoredAttributes>;
3316def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3317  " exception specification; attribute ignored">,
3318  InGroup<IgnoredAttributes>;
3319def warn_attribute_ignored_on_non_definition :
3320  Warning<"%0 attribute ignored on a non-definition declaration">,
3321  InGroup<IgnoredAttributes>;
3322def warn_attribute_ignored_on_inline :
3323  Warning<"%0 attribute ignored on inline function">,
3324  InGroup<IgnoredAttributes>;
3325def warn_nocf_check_attribute_ignored :
3326  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3327  InGroup<IgnoredAttributes>;
3328def warn_attribute_after_definition_ignored : Warning<
3329  "attribute %0 after definition is ignored">,
3330   InGroup<IgnoredAttributes>;
3331def warn_attributes_likelihood_ifstmt_conflict
3332    : Warning<"conflicting attributes %0 are ignored">,
3333      InGroup<IgnoredAttributes>;
3334def warn_cxx11_gnu_attribute_on_type : Warning<
3335  "attribute %0 ignored, because it cannot be applied to a type">,
3336  InGroup<IgnoredAttributes>;
3337def warn_unhandled_ms_attribute_ignored : Warning<
3338  "__declspec attribute %0 is not supported">,
3339  InGroup<IgnoredAttributes>;
3340def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3341  "attribute %0 has no effect when annotating an infinite loop">,
3342   InGroup<IgnoredAttributes>;
3343def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3344  "annotating the infinite loop here">;
3345def warn_attribute_has_no_effect_on_compile_time_if : Warning<
3346  "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">,
3347   InGroup<IgnoredAttributes>;
3348def note_attribute_has_no_effect_on_compile_time_if_here : Note<
3349  "annotating the 'if %select{constexpr|consteval}0' statement here">;
3350def err_decl_attribute_invalid_on_stmt : Error<
3351  "%0 attribute cannot be applied to a statement">;
3352def err_stmt_attribute_invalid_on_decl : Error<
3353  "%0 attribute cannot be applied to a declaration">;
3354def warn_declspec_attribute_ignored : Warning<
3355  "attribute %0 is ignored, place it after "
3356  "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
3357  "type declaration">, InGroup<IgnoredAttributes>;
3358def warn_attribute_precede_definition : Warning<
3359  "attribute declaration must precede definition">,
3360  InGroup<IgnoredAttributes>;
3361def warn_attribute_void_function_method : Warning<
3362  "attribute %0 cannot be applied to "
3363  "%select{functions|Objective-C method}1 without return value">,
3364  InGroup<IgnoredAttributes>;
3365def warn_attribute_weak_on_field : Warning<
3366  "__weak attribute cannot be specified on a field declaration">,
3367  InGroup<IgnoredAttributes>;
3368def warn_gc_attribute_weak_on_local : Warning<
3369  "Objective-C GC does not allow weak variables on the stack">,
3370  InGroup<IgnoredAttributes>;
3371def warn_nsobject_attribute : Warning<
3372  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3373  InGroup<NSobjectAttribute>;
3374def warn_independentclass_attribute : Warning<
3375  "'objc_independent_class' attribute may be put on a typedef only; "
3376  "attribute is ignored">,
3377  InGroup<IndependentClassAttribute>;
3378def warn_ptr_independentclass_attribute : Warning<
3379  "'objc_independent_class' attribute may be put on Objective-C object "
3380  "pointer type only; attribute is ignored">,
3381  InGroup<IndependentClassAttribute>;
3382def warn_attribute_weak_on_local : Warning<
3383  "__weak attribute cannot be specified on an automatic variable when ARC "
3384  "is not enabled">,
3385  InGroup<IgnoredAttributes>;
3386def warn_weak_identifier_undeclared : Warning<
3387  "weak identifier %0 never declared">;
3388def warn_attribute_cmse_entry_static : Warning<
3389  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3390  InGroup<IgnoredAttributes>;
3391def warn_cmse_nonsecure_union : Warning<
3392  "passing union across security boundary via %select{parameter %1|return value}0 "
3393  "may leak information">,
3394  InGroup<DiagGroup<"cmse-union-leak">>;
3395def err_attribute_weak_static : Error<
3396  "weak declaration cannot have internal linkage">;
3397def err_attribute_selectany_non_extern_data : Error<
3398  "'selectany' can only be applied to data items with external linkage">;
3399def err_declspec_thread_on_thread_variable : Error<
3400  "'__declspec(thread)' applied to variable that already has a "
3401  "thread-local storage specifier">;
3402def err_attribute_dll_not_extern : Error<
3403  "%q0 must have external linkage when declared %q1">;
3404def err_attribute_dll_thread_local : Error<
3405  "%q0 cannot be thread local when declared %q1">;
3406def err_attribute_dll_lambda : Error<
3407  "lambda cannot be declared %0">;
3408def warn_attribute_invalid_on_definition : Warning<
3409  "'%0' attribute cannot be specified on a definition">,
3410  InGroup<IgnoredAttributes>;
3411def err_attribute_dll_redeclaration : Error<
3412  "redeclaration of %q0 cannot add %q1 attribute">;
3413def warn_attribute_dll_redeclaration : Warning<
3414  "redeclaration of %q0 should not add %q1 attribute">,
3415  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3416def err_attribute_dllimport_function_definition : Error<
3417  "dllimport cannot be applied to non-inline function definition">;
3418def err_attribute_dll_deleted : Error<
3419  "attribute %q0 cannot be applied to a deleted function">;
3420def err_attribute_dllimport_data_definition : Error<
3421  "definition of dllimport data">;
3422def err_attribute_dllimport_static_field_definition : Error<
3423  "definition of dllimport static field not allowed">;
3424def warn_attribute_dllimport_static_field_definition : Warning<
3425  "definition of dllimport static field">,
3426  InGroup<DiagGroup<"dllimport-static-field-def">>;
3427def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3428  "explicit instantiation declaration should not be 'dllexport'">,
3429  InGroup<DllexportExplicitInstantiationDecl>;
3430def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3431  "'dllexport' attribute ignored on explicit instantiation definition">,
3432  InGroup<IgnoredAttributes>;
3433def warn_invalid_initializer_from_system_header : Warning<
3434  "invalid constructor from class in system header, should not be explicit">,
3435  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3436def note_used_in_initialization_here : Note<"used in initialization here">;
3437def err_attribute_dll_member_of_dll_class : Error<
3438  "attribute %q0 cannot be applied to member of %q1 class">;
3439def warn_attribute_dll_instantiated_base_class : Warning<
3440  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3441  "base class template without dll attribute is not supported">,
3442  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3443def err_attribute_dll_ambiguous_default_ctor : Error<
3444  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3445def err_attribute_weakref_not_static : Error<
3446  "weakref declaration must have internal linkage">;
3447def err_attribute_weakref_not_global_context : Error<
3448  "weakref declaration of %0 must be in a global context">;
3449def err_attribute_weakref_without_alias : Error<
3450  "weakref declaration of %0 must also have an alias attribute">;
3451def err_alias_not_supported_on_darwin : Error <
3452  "aliases are not supported on darwin">;
3453def warn_attribute_wrong_decl_type_str : Warning<
3454  "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
3455def err_attribute_wrong_decl_type_str : Error<
3456  warn_attribute_wrong_decl_type_str.Text>;
3457def warn_attribute_wrong_decl_type : Warning<
3458  "%0 attribute only applies to %select{"
3459  "functions"
3460  "|unions"
3461  "|variables and functions"
3462  "|functions and methods"
3463  "|functions, methods and blocks"
3464  "|functions, methods, and parameters"
3465  "|variables"
3466  "|variables and fields"
3467  "|variables, data members and tag types"
3468  "|types and namespaces"
3469  "|variables, functions and classes"
3470  "|kernel functions"
3471  "|non-K&R-style functions}1">,
3472  InGroup<IgnoredAttributes>;
3473def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
3474def warn_type_attribute_wrong_type : Warning<
3475  "'%0' only applies to %select{function|pointer|"
3476  "Objective-C object or block pointer}1 types; type here is %2">,
3477  InGroup<IgnoredAttributes>;
3478def warn_incomplete_encoded_type : Warning<
3479  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3480  InGroup<DiagGroup<"encode-type">>;
3481def warn_gnu_inline_attribute_requires_inline : Warning<
3482  "'gnu_inline' attribute requires function to be marked 'inline',"
3483  " attribute ignored">,
3484  InGroup<IgnoredAttributes>;
3485def warn_gnu_inline_cplusplus_without_extern : Warning<
3486  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3487  " available, this changed in Clang 10">,
3488  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3489def err_attribute_vecreturn_only_vector_member : Error<
3490  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3491def err_attribute_vecreturn_only_pod_record : Error<
3492  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3493def err_cconv_change : Error<
3494  "function declared '%0' here was previously declared "
3495  "%select{'%2'|without calling convention}1">;
3496def warn_cconv_unsupported : Warning<
3497  "%0 calling convention is not supported %select{"
3498  // Use CallingConventionIgnoredReason Enum to specify these.
3499  "for this target"
3500  "|on variadic function"
3501  "|on constructor/destructor"
3502  "|on builtin function"
3503  "}1">,
3504  InGroup<IgnoredAttributes>;
3505def error_cconv_unsupported : Error<warn_cconv_unsupported.Text>;
3506def err_cconv_knr : Error<
3507  "function with no prototype cannot use the %0 calling convention">;
3508def warn_cconv_knr : Warning<
3509  err_cconv_knr.Text>,
3510  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3511def err_cconv_varargs : Error<
3512  "variadic function cannot use %0 calling convention">;
3513def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3514  "attribute was previously declared "
3515  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3516def err_function_attribute_mismatch : Error<
3517  "function declared with %0 attribute "
3518  "was previously declared without the %0 attribute">;
3519def err_objc_precise_lifetime_bad_type : Error<
3520  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3521def warn_objc_precise_lifetime_meaningless : Error<
3522  "objc_precise_lifetime is not meaningful for "
3523  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3524def err_invalid_pcs : Error<"invalid PCS type">;
3525def warn_attribute_not_on_decl : Warning<
3526  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3527def err_base_specifier_attribute : Error<
3528  "%0 attribute cannot be applied to a base specifier">;
3529def err_invalid_attribute_on_virtual_function : Error<
3530  "%0 attribute cannot be applied to virtual functions">;
3531def warn_declspec_allocator_nonpointer : Warning<
3532  "ignoring __declspec(allocator) because the function return type %0 is not "
3533  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3534def err_cconv_incomplete_param_type : Error<
3535  "parameter %0 must have a complete type to use function %1 with the %2 "
3536  "calling convention">;
3537def err_attribute_output_parameter : Error<
3538  "attribute only applies to output parameters">;
3539
3540def ext_cannot_use_trivial_abi : ExtWarn<
3541  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3542def note_cannot_use_trivial_abi_reason : Note<
3543  "'trivial_abi' is disallowed on %0 because %select{"
3544  "its copy constructors and move constructors are all deleted|"
3545  "it is polymorphic|"
3546  "it has a base of a non-trivial class type|it has a virtual base|"
3547  "it has a __weak field|it has a field of a non-trivial class type}1">;
3548
3549// Availability attribute
3550def warn_availability_unknown_platform : Warning<
3551  "unknown platform %0 in availability macro">, InGroup<Availability>;
3552def warn_availability_version_ordering : Warning<
3553  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3554  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3555  "attribute ignored">, InGroup<Availability>;
3556def warn_mismatched_availability: Warning<
3557  "availability does not match previous declaration">, InGroup<Availability>;
3558def warn_mismatched_availability_override : Warning<
3559  "%select{|overriding }4method %select{introduced after|"
3560  "deprecated before|obsoleted before}0 "
3561  "%select{the protocol method it implements|overridden method}4 "
3562  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3563def warn_mismatched_availability_override_unavail : Warning<
3564  "%select{|overriding }1method cannot be unavailable on %0 when "
3565  "%select{the protocol method it implements|its overridden method}1 is "
3566  "available">,
3567  InGroup<Availability>;
3568def warn_availability_on_static_initializer : Warning<
3569  "ignoring availability attribute %select{on '+load' method|"
3570  "with constructor attribute|with destructor attribute}0">,
3571  InGroup<Availability>;
3572def note_overridden_method : Note<
3573  "overridden method is here">;
3574def warn_availability_swift_unavailable_deprecated_only : Warning<
3575  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3576  InGroup<Availability>;
3577def note_protocol_method : Note<
3578  "protocol method is here">;
3579def warn_availability_fuchsia_unavailable_minor : Warning<
3580  "Fuchsia API Level prohibits specifying a minor or sub-minor version">,
3581  InGroup<Availability>;
3582
3583def warn_unguarded_availability :
3584  Warning<"%0 is only available on %1 %2 or newer">,
3585  InGroup<UnguardedAvailability>, DefaultIgnore;
3586def warn_unguarded_availability_new :
3587  Warning<warn_unguarded_availability.Text>,
3588  InGroup<UnguardedAvailabilityNew>;
3589def note_decl_unguarded_availability_silence : Note<
3590  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3591def note_unguarded_available_silence : Note<
3592  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3593  " this warning">;
3594def warn_at_available_unchecked_use : Warning<
3595  "%select{@available|__builtin_available}0 does not guard availability here; "
3596  "use if (%select{@available|__builtin_available}0) instead">,
3597  InGroup<DiagGroup<"unsupported-availability-guard">>;
3598
3599def warn_missing_sdksettings_for_availability_checking : Warning<
3600  "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
3601  InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
3602
3603// Thread Safety Attributes
3604def warn_thread_attribute_ignored : Warning<
3605  "ignoring %0 attribute because its argument is invalid">,
3606  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3607def warn_thread_attribute_not_on_non_static_member : Warning<
3608  "%0 attribute without capability arguments can only be applied to non-static "
3609  "methods of a class">,
3610  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3611def warn_thread_attribute_not_on_capability_member : Warning<
3612  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3613  "annotated with 'capability' or 'scoped_lockable' attribute">,
3614  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3615def warn_thread_attribute_argument_not_lockable : Warning<
3616  "%0 attribute requires arguments whose type is annotated "
3617  "with 'capability' attribute; type here is %1">,
3618  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3619def warn_thread_attribute_decl_not_lockable : Warning<
3620  "%0 attribute can only be applied in a context annotated "
3621  "with 'capability' attribute">,
3622  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3623def warn_thread_attribute_decl_not_pointer : Warning<
3624  "%0 only applies to pointer types; type here is %1">,
3625  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3626def err_attribute_argument_out_of_bounds_extra_info : Error<
3627  "%0 attribute parameter %1 is out of bounds: "
3628  "%plural{0:no parameters to index into|"
3629  "1:can only be 1, since there is one parameter|"
3630  ":must be between 1 and %2}2">;
3631
3632// Thread Safety Analysis
3633def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3634  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3635def warn_unlock_kind_mismatch : Warning<
3636  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3637  "%select{shared|exclusive}3 access">,
3638  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3639def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3640  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3641def warn_no_unlock : Warning<
3642  "%0 '%1' is still held at the end of function">,
3643  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3644def warn_expecting_locked : Warning<
3645  "expecting %0 '%1' to be held at the end of function">,
3646  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3647// FIXME: improve the error message about locks not in scope
3648def warn_lock_some_predecessors : Warning<
3649  "%0 '%1' is not held on every path through here">,
3650  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3651def warn_expecting_lock_held_on_loop : Warning<
3652  "expecting %0 '%1' to be held at start of each loop">,
3653  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3654def note_locked_here : Note<"%0 acquired here">;
3655def note_unlocked_here : Note<"%0 released here">;
3656def warn_lock_exclusive_and_shared : Warning<
3657  "%0 '%1' is acquired exclusively and shared in the same scope">,
3658  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3659def note_lock_exclusive_and_shared : Note<
3660  "the other acquisition of %0 '%1' is here">;
3661def warn_variable_requires_any_lock : Warning<
3662  "%select{reading|writing}1 variable %0 requires holding "
3663  "%select{any mutex|any mutex exclusively}1">,
3664  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3665def warn_var_deref_requires_any_lock : Warning<
3666  "%select{reading|writing}1 the value pointed to by %0 requires holding "
3667  "%select{any mutex|any mutex exclusively}1">,
3668  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3669def warn_fun_excludes_mutex : Warning<
3670  "cannot call function '%1' while %0 '%2' is held">,
3671  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3672def warn_cannot_resolve_lock : Warning<
3673  "cannot resolve lock expression">,
3674  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3675def warn_acquired_before : Warning<
3676  "%0 '%1' must be acquired before '%2'">,
3677  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3678def warn_acquired_before_after_cycle : Warning<
3679  "Cycle in acquired_before/after dependencies, starting with '%0'">,
3680  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3681
3682
3683// Thread safety warnings negative capabilities
3684def warn_acquire_requires_negative_cap : Warning<
3685  "acquiring %0 '%1' requires negative capability '%2'">,
3686  InGroup<ThreadSafetyNegative>, DefaultIgnore;
3687def warn_fun_requires_negative_cap : Warning<
3688  "calling function %0 requires negative capability '%1'">,
3689  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3690
3691// Thread safety warnings on pass by reference
3692def warn_guarded_pass_by_reference : Warning<
3693  "passing variable %1 by reference requires holding %0 "
3694  "%select{'%2'|'%2' exclusively}3">,
3695  InGroup<ThreadSafetyReference>, DefaultIgnore;
3696def warn_pt_guarded_pass_by_reference : Warning<
3697  "passing the value that %1 points to by reference requires holding %0 "
3698  "%select{'%2'|'%2' exclusively}3">,
3699  InGroup<ThreadSafetyReference>, DefaultIgnore;
3700
3701// Imprecise thread safety warnings
3702def warn_variable_requires_lock : Warning<
3703  "%select{reading|writing}3 variable %1 requires holding %0 "
3704  "%select{'%2'|'%2' exclusively}3">,
3705  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3706def warn_var_deref_requires_lock : Warning<
3707  "%select{reading|writing}3 the value pointed to by %1 requires "
3708  "holding %0 %select{'%2'|'%2' exclusively}3">,
3709  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3710def warn_fun_requires_lock : Warning<
3711  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3712  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3713
3714// Precise thread safety warnings
3715def warn_variable_requires_lock_precise :
3716  Warning<warn_variable_requires_lock.Text>,
3717  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3718def warn_var_deref_requires_lock_precise :
3719  Warning<warn_var_deref_requires_lock.Text>,
3720  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3721def warn_fun_requires_lock_precise :
3722  Warning<warn_fun_requires_lock.Text>,
3723  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3724def note_found_mutex_near_match : Note<"found near match '%0'">;
3725
3726// Verbose thread safety warnings
3727def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
3728  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3729def note_thread_warning_in_fun : Note<"thread warning in function %0">;
3730def note_guarded_by_declared_here : Note<"guarded_by declared here">;
3731
3732// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3733def warn_thread_safety_beta : Warning<"thread safety beta warning">,
3734  InGroup<ThreadSafetyBeta>, DefaultIgnore;
3735
3736// Consumed warnings
3737def warn_use_in_invalid_state : Warning<
3738  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3739  "state">, InGroup<Consumed>, DefaultIgnore;
3740def warn_use_of_temp_in_invalid_state : Warning<
3741  "invalid invocation of method '%0' on a temporary object while it is in the "
3742  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3743def warn_attr_on_unconsumable_class : Warning<
3744  "consumed analysis attribute is attached to member of class %0 which isn't "
3745  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3746def warn_return_typestate_for_unconsumable_type : Warning<
3747  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3748  DefaultIgnore;
3749def warn_return_typestate_mismatch : Warning<
3750  "return value not in expected state; expected '%0', observed '%1'">,
3751  InGroup<Consumed>, DefaultIgnore;
3752def warn_loop_state_mismatch : Warning<
3753  "state of variable '%0' must match at the entry and exit of loop">,
3754  InGroup<Consumed>, DefaultIgnore;
3755def warn_param_return_typestate_mismatch : Warning<
3756  "parameter '%0' not in expected state when the function returns: expected "
3757  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3758def warn_param_typestate_mismatch : Warning<
3759  "argument not in expected state; expected '%0', observed '%1'">,
3760  InGroup<Consumed>, DefaultIgnore;
3761
3762// no_sanitize attribute
3763def warn_unknown_sanitizer_ignored : Warning<
3764  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3765
3766def warn_impcast_vector_scalar : Warning<
3767  "implicit conversion turns vector to scalar: %0 to %1">,
3768  InGroup<Conversion>, DefaultIgnore;
3769def warn_impcast_complex_scalar : Warning<
3770  "implicit conversion discards imaginary component: %0 to %1">,
3771  InGroup<Conversion>, DefaultIgnore;
3772def err_impcast_complex_scalar : Error<
3773  "implicit conversion from %0 to %1 is not permitted in C++">;
3774def warn_impcast_float_precision : Warning<
3775  "implicit conversion loses floating-point precision: %0 to %1">,
3776  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3777def warn_impcast_float_result_precision : Warning<
3778  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3779  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3780def warn_impcast_double_promotion : Warning<
3781  "implicit conversion increases floating-point precision: %0 to %1">,
3782  InGroup<DoublePromotion>, DefaultIgnore;
3783def warn_impcast_integer_sign : Warning<
3784  "implicit conversion changes signedness: %0 to %1">,
3785  InGroup<SignConversion>, DefaultIgnore;
3786def warn_impcast_integer_sign_conditional : Warning<
3787  "operand of ? changes signedness: %0 to %1">,
3788  InGroup<SignConversion>, DefaultIgnore;
3789def warn_impcast_integer_precision : Warning<
3790  "implicit conversion loses integer precision: %0 to %1">,
3791  InGroup<ImplicitIntConversion>, DefaultIgnore;
3792def warn_impcast_high_order_zero_bits : Warning<
3793  "higher order bits are zeroes after implicit conversion">,
3794  InGroup<ImplicitIntConversion>, DefaultIgnore;
3795def warn_impcast_nonnegative_result : Warning<
3796  "the resulting value is always non-negative after implicit conversion">,
3797  InGroup<SignConversion>, DefaultIgnore;
3798def warn_impcast_integer_64_32 : Warning<
3799  "implicit conversion loses integer precision: %0 to %1">,
3800  InGroup<Shorten64To32>, DefaultIgnore;
3801def warn_impcast_integer_precision_constant : Warning<
3802  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3803  InGroup<ConstantConversion>;
3804def warn_impcast_bitfield_precision_constant : Warning<
3805  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3806  InGroup<BitFieldConstantConversion>;
3807def warn_impcast_constant_value_to_objc_bool : Warning<
3808  "implicit conversion from constant value %0 to 'BOOL'; "
3809  "the only well defined values for 'BOOL' are YES and NO">,
3810  InGroup<ObjCBoolConstantConversion>;
3811
3812def warn_impcast_fixed_point_range : Warning<
3813  "implicit conversion from %0 cannot fit within the range of values for %1">,
3814  InGroup<ImplicitFixedPointConversion>;
3815
3816def warn_impcast_literal_float_to_integer : Warning<
3817  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3818  InGroup<LiteralConversion>;
3819def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3820  "implicit conversion of out of range value from %0 to %1 is undefined">,
3821  InGroup<LiteralConversion>;
3822def warn_impcast_float_integer : Warning<
3823  "implicit conversion turns floating-point number into integer: %0 to %1">,
3824  InGroup<FloatConversion>, DefaultIgnore;
3825def warn_impcast_float_to_objc_signed_char_bool : Warning<
3826  "implicit conversion from floating-point type %0 to 'BOOL'">,
3827  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
3828def warn_impcast_int_to_objc_signed_char_bool : Warning<
3829  "implicit conversion from integral type %0 to 'BOOL'">,
3830  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
3831
3832// Implicit int -> float conversion precision loss warnings.
3833def warn_impcast_integer_float_precision : Warning<
3834  "implicit conversion from %0 to %1 may lose precision">,
3835  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
3836def warn_impcast_integer_float_precision_constant : Warning<
3837  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3838  InGroup<ImplicitConstIntFloatConversion>;
3839
3840def warn_impcast_float_to_integer : Warning<
3841  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3842  InGroup<FloatOverflowConversion>, DefaultIgnore;
3843def warn_impcast_float_to_integer_out_of_range : Warning<
3844  "implicit conversion of out of range value from %0 to %1 is undefined">,
3845  InGroup<FloatOverflowConversion>, DefaultIgnore;
3846def warn_impcast_float_to_integer_zero : Warning<
3847  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3848  InGroup<FloatZeroConversion>, DefaultIgnore;
3849
3850def warn_impcast_string_literal_to_bool : Warning<
3851  "implicit conversion turns string literal into bool: %0 to %1">,
3852  InGroup<StringConversion>, DefaultIgnore;
3853def warn_impcast_different_enum_types : Warning<
3854  "implicit conversion from enumeration type %0 to different enumeration type "
3855  "%1">, InGroup<EnumConversion>;
3856def warn_impcast_bool_to_null_pointer : Warning<
3857    "initialization of pointer of type %0 to null from a constant boolean "
3858    "expression">, InGroup<BoolConversion>;
3859def warn_non_literal_null_pointer : Warning<
3860    "expression which evaluates to zero treated as a null pointer constant of "
3861    "type %0">, InGroup<NonLiteralNullConversion>;
3862def warn_pointer_compare : Warning<
3863    "comparing a pointer to a null character constant; did you mean "
3864    "to compare to %select{NULL|(void *)0}0?">,
3865    InGroup<DiagGroup<"pointer-compare">>;
3866def warn_impcast_null_pointer_to_integer : Warning<
3867    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3868    InGroup<NullConversion>;
3869def warn_impcast_floating_point_to_bool : Warning<
3870    "implicit conversion turns floating-point number into bool: %0 to %1">,
3871    InGroup<ImplicitConversionFloatingPointToBool>;
3872def ext_ms_impcast_fn_obj : ExtWarn<
3873  "implicit conversion between pointer-to-function and pointer-to-object is a "
3874  "Microsoft extension">, InGroup<MicrosoftCast>;
3875
3876def warn_impcast_pointer_to_bool : Warning<
3877    "address of%select{| function| array}0 '%1' will always evaluate to "
3878    "'true'">,
3879    InGroup<PointerBoolConversion>;
3880def warn_cast_nonnull_to_bool : Warning<
3881    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3882    "'true' on first encounter">,
3883    InGroup<PointerBoolConversion>;
3884def warn_this_bool_conversion : Warning<
3885  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3886  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3887def warn_address_of_reference_bool_conversion : Warning<
3888  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3889  "code; pointer may be assumed to always convert to true">,
3890  InGroup<UndefinedBoolConversion>;
3891
3892def warn_xor_used_as_pow : Warning<
3893  "result of '%0' is %1; did you mean exponentiation?">,
3894  InGroup<XorUsedAsPow>;
3895def warn_xor_used_as_pow_base_extra : Warning<
3896  "result of '%0' is %1; did you mean '%2' (%3)?">,
3897  InGroup<XorUsedAsPow>;
3898def warn_xor_used_as_pow_base : Warning<
3899  "result of '%0' is %1; did you mean '%2'?">,
3900  InGroup<XorUsedAsPow>;
3901def note_xor_used_as_pow_silence : Note<
3902  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
3903
3904def warn_null_pointer_compare : Warning<
3905    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3906    "equal to a null pointer is always %select{true|false}2">,
3907    InGroup<TautologicalPointerCompare>;
3908def warn_nonnull_expr_compare : Warning<
3909    "comparison of nonnull %select{function call|parameter}0 '%1' "
3910    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3911    "encounter">,
3912    InGroup<TautologicalPointerCompare>;
3913def warn_this_null_compare : Warning<
3914  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3915  "assumed to always evaluate to %select{true|false}0">,
3916  InGroup<TautologicalUndefinedCompare>;
3917def warn_address_of_reference_null_compare : Warning<
3918  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3919  "code; comparison may be assumed to always evaluate to "
3920  "%select{true|false}0">,
3921  InGroup<TautologicalUndefinedCompare>;
3922def note_reference_is_return_value : Note<"%0 returns a reference">;
3923
3924def note_pointer_declared_here : Note<
3925  "pointer %0 declared here">;
3926def warn_division_sizeof_ptr : Warning<
3927  "'%0' will return the size of the pointer, not the array itself">,
3928  InGroup<DiagGroup<"sizeof-pointer-div">>;
3929def warn_division_sizeof_array : Warning<
3930  "expression does not compute the number of elements in this array; element "
3931  "type is %0, not %1">,
3932  InGroup<DiagGroup<"sizeof-array-div">>;
3933
3934def note_function_warning_silence : Note<
3935    "prefix with the address-of operator to silence this warning">;
3936def note_function_to_function_call : Note<
3937    "suffix with parentheses to turn this into a function call">;
3938def warn_impcast_objective_c_literal_to_bool : Warning<
3939    "implicit boolean conversion of Objective-C object literal always "
3940    "evaluates to true">,
3941    InGroup<ObjCLiteralConversion>;
3942
3943def warn_cast_align : Warning<
3944  "cast from %0 to %1 increases required alignment from %2 to %3">,
3945  InGroup<CastAlign>, DefaultIgnore;
3946def warn_old_style_cast : Warning<
3947  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3948
3949// Separate between casts to void* and non-void* pointers.
3950// Some APIs use (abuse) void* for something like a user context,
3951// and often that value is an integer even if it isn't a pointer itself.
3952// Having a separate warning flag allows users to control the warning
3953// for their workflow.
3954def warn_int_to_pointer_cast : Warning<
3955  "cast to %1 from smaller integer type %0">,
3956  InGroup<IntToPointerCast>;
3957def warn_int_to_void_pointer_cast : Warning<
3958  "cast to %1 from smaller integer type %0">,
3959  InGroup<IntToVoidPointerCast>;
3960def warn_pointer_to_int_cast : Warning<
3961  "cast to smaller integer type %1 from %0">,
3962  InGroup<PointerToIntCast>;
3963def warn_pointer_to_enum_cast : Warning<
3964  warn_pointer_to_int_cast.Text>,
3965  InGroup<PointerToEnumCast>;
3966def warn_void_pointer_to_int_cast : Warning<
3967  "cast to smaller integer type %1 from %0">,
3968  InGroup<VoidPointerToIntCast>;
3969def warn_void_pointer_to_enum_cast : Warning<
3970  warn_void_pointer_to_int_cast.Text>,
3971  InGroup<VoidPointerToEnumCast>;
3972
3973def warn_attribute_ignored_for_field_of_type : Warning<
3974  "%0 attribute ignored for field of type %1">,
3975  InGroup<IgnoredAttributes>;
3976def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3977  "enums in the Microsoft ABI are signed integers by default; consider giving "
3978  "the enum %0 an unsigned underlying type to make this code portable">,
3979  InGroup<SignedEnumBitfield>, DefaultIgnore;
3980def warn_attribute_packed_for_bitfield : Warning<
3981  "'packed' attribute was ignored on bit-fields with single-byte alignment "
3982  "in older versions of GCC and Clang">,
3983  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3984def warn_transparent_union_attribute_field_size_align : Warning<
3985  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3986  "%select{alignment|size}0 of the first field in transparent union; "
3987  "transparent_union attribute ignored">,
3988  InGroup<IgnoredAttributes>;
3989def note_transparent_union_first_field_size_align : Note<
3990  "%select{alignment|size}0 of first field is %1 bits">;
3991def warn_transparent_union_attribute_not_definition : Warning<
3992  "transparent_union attribute can only be applied to a union definition; "
3993  "attribute ignored">,
3994  InGroup<IgnoredAttributes>;
3995def warn_transparent_union_attribute_floating : Warning<
3996  "first field of a transparent union cannot have %select{floating point|"
3997  "vector}0 type %1; transparent_union attribute ignored">,
3998  InGroup<IgnoredAttributes>;
3999def warn_transparent_union_attribute_zero_fields : Warning<
4000  "transparent union definition must contain at least one field; "
4001  "transparent_union attribute ignored">,
4002  InGroup<IgnoredAttributes>;
4003def warn_attribute_type_not_supported : Warning<
4004  "%0 attribute argument not supported: %1">,
4005  InGroup<IgnoredAttributes>;
4006def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
4007  InGroup<IgnoredAttributes>;
4008def warn_attribute_protected_visibility :
4009  Warning<"target does not support 'protected' visibility; using 'default'">,
4010  InGroup<DiagGroup<"unsupported-visibility">>;
4011def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
4012def note_previous_attribute : Note<"previous attribute is here">;
4013def note_conflicting_attribute : Note<"conflicting attribute is here">;
4014def note_attribute : Note<"attribute is here">;
4015def err_mismatched_ms_inheritance : Error<
4016  "inheritance model does not match %select{definition|previous declaration}0">;
4017def warn_ignored_ms_inheritance : Warning<
4018  "inheritance model ignored on %select{primary template|partial specialization}0">,
4019  InGroup<IgnoredAttributes>;
4020def note_previous_ms_inheritance : Note<
4021  "previous inheritance model specified here">;
4022def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
4023def err_mode_not_primitive : Error<
4024  "mode attribute only supported for integer and floating-point types">;
4025def err_mode_wrong_type : Error<
4026  "type of machine mode does not match type of base type">;
4027def warn_vector_mode_deprecated : Warning<
4028  "specifying vector types with the 'mode' attribute is deprecated; "
4029  "use the 'vector_size' attribute instead">,
4030  InGroup<DeprecatedAttributes>;
4031def err_complex_mode_vector_type : Error<
4032  "type of machine mode does not support base vector types">;
4033def err_enum_mode_vector_type : Error<
4034  "mode %0 is not supported for enumeration types">;
4035def warn_attribute_nonnull_no_pointers : Warning<
4036  "'nonnull' attribute applied to function with no pointer arguments">,
4037  InGroup<IgnoredAttributes>;
4038def warn_attribute_nonnull_parm_no_args : Warning<
4039  "'nonnull' attribute when used on parameters takes no arguments">,
4040  InGroup<IgnoredAttributes>;
4041def note_declared_nonnull : Note<
4042  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
4043def warn_attribute_sentinel_named_arguments : Warning<
4044  "'sentinel' attribute requires named arguments">,
4045  InGroup<IgnoredAttributes>;
4046def warn_attribute_sentinel_not_variadic : Warning<
4047  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
4048  InGroup<IgnoredAttributes>;
4049def warn_deprecated_ignored_on_using : Warning<
4050  "%0 currently has no effect on a using declaration">,
4051  InGroup<IgnoredAttributes>;
4052def err_attribute_sentinel_less_than_zero : Error<
4053  "'sentinel' parameter 1 less than zero">;
4054def err_attribute_sentinel_not_zero_or_one : Error<
4055  "'sentinel' parameter 2 not 0 or 1">;
4056def warn_cleanup_ext : Warning<
4057  "GCC does not allow the 'cleanup' attribute argument to be anything other "
4058  "than a simple identifier">,
4059  InGroup<GccCompat>;
4060def err_attribute_cleanup_arg_not_function : Error<
4061  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
4062def err_attribute_cleanup_func_must_take_one_arg : Error<
4063  "'cleanup' function %0 must take 1 parameter">;
4064def err_attribute_cleanup_func_arg_incompatible_type : Error<
4065  "'cleanup' function %0 parameter has "
4066  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
4067def err_attribute_regparm_wrong_platform : Error<
4068  "'regparm' is not valid on this platform">;
4069def err_attribute_regparm_invalid_number : Error<
4070  "'regparm' parameter must be between 0 and %0 inclusive">;
4071def err_attribute_not_supported_in_lang : Error<
4072  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
4073def err_attribute_not_supported_on_arch
4074    : Error<"%0 attribute is not supported on '%1'">;
4075def warn_gcc_ignores_type_attr : Warning<
4076  "GCC does not allow the %0 attribute to be written on a type">,
4077  InGroup<GccCompat>;
4078
4079// Clang-Specific Attributes
4080def warn_attribute_iboutlet : Warning<
4081  "%0 attribute can only be applied to instance variables or properties">,
4082  InGroup<IgnoredAttributes>;
4083def err_iboutletcollection_type : Error<
4084  "invalid type %0 as argument of iboutletcollection attribute">;
4085def err_iboutletcollection_builtintype : Error<
4086  "type argument of iboutletcollection attribute cannot be a builtin type">;
4087def warn_iboutlet_object_type : Warning<
4088  "%select{instance variable|property}2 with %0 attribute must "
4089  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
4090def warn_iboutletcollection_property_assign : Warning<
4091  "IBOutletCollection properties should be copy/strong and not assign">,
4092  InGroup<ObjCInvalidIBOutletProperty>;
4093
4094def err_attribute_overloadable_mismatch : Error<
4095  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
4096def note_attribute_overloadable_prev_overload : Note<
4097  "previous %select{unmarked |}0overload of function is here">;
4098def err_attribute_overloadable_no_prototype : Error<
4099  "'overloadable' function %0 must have a prototype">;
4100def err_attribute_overloadable_multiple_unmarked_overloads : Error<
4101  "at most one overload for a given name may lack the 'overloadable' "
4102  "attribute">;
4103def warn_attribute_no_builtin_invalid_builtin_name : Warning<
4104  "'%0' is not a valid builtin name for %1">,
4105  InGroup<DiagGroup<"invalid-no-builtin-names">>;
4106def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
4107  "empty %0 cannot be composed with named ones">;
4108def err_attribute_no_builtin_on_non_definition : Error<
4109  "%0 attribute is permitted on definitions only">;
4110def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
4111  "%0 attribute has no effect on defaulted or deleted functions">;
4112def warn_ns_attribute_wrong_return_type : Warning<
4113  "%0 attribute only applies to %select{functions|methods|properties}1 that "
4114  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
4115  InGroup<IgnoredAttributes>;
4116def err_ns_attribute_wrong_parameter_type : Error<
4117  "%0 attribute only applies to "
4118  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
4119def warn_ns_attribute_wrong_parameter_type : Warning<
4120  "%0 attribute only applies to "
4121  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
4122  InGroup<IgnoredAttributes>;
4123def warn_objc_requires_super_protocol : Warning<
4124  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
4125  InGroup<DiagGroup<"requires-super-attribute">>;
4126def note_protocol_decl : Note<
4127  "protocol is declared here">;
4128def note_protocol_decl_undefined : Note<
4129  "protocol %0 has no definition">;
4130def err_attribute_preferred_name_arg_invalid : Error<
4131  "argument %0 to 'preferred_name' attribute is not a typedef for "
4132  "a specialization of %1">;
4133def err_attribute_builtin_alias : Error<
4134  "%0 attribute can only be applied to a ARM or RISC-V builtin">;
4135
4136// called-once attribute diagnostics.
4137def err_called_once_attribute_wrong_type : Error<
4138  "'called_once' attribute only applies to function-like parameters">;
4139
4140def warn_completion_handler_never_called : Warning<
4141  "%select{|captured }1completion handler is never called">,
4142  InGroup<CompletionHandler>, DefaultIgnore;
4143def warn_called_once_never_called : Warning<
4144  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
4145  InGroup<CalledOnceParameter>;
4146
4147def warn_completion_handler_never_called_when : Warning<
4148  "completion handler is never %select{used|called}1 when "
4149  "%select{taking true branch|taking false branch|"
4150  "handling this case|none of the cases applies|"
4151  "entering the loop|skipping the loop|taking one of the branches}2">,
4152  InGroup<CompletionHandler>, DefaultIgnore;
4153def warn_called_once_never_called_when : Warning<
4154  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
4155  "%select{taking true branch|taking false branch|"
4156  "handling this case|none of the cases applies|"
4157  "entering the loop|skipping the loop|taking one of the branches}2">,
4158  InGroup<CalledOnceParameter>;
4159
4160def warn_completion_handler_called_twice : Warning<
4161  "completion handler is called twice">,
4162  InGroup<CompletionHandler>, DefaultIgnore;
4163def warn_called_once_gets_called_twice : Warning<
4164  "%0 parameter marked 'called_once' is called twice">,
4165  InGroup<CalledOnceParameter>;
4166def note_called_once_gets_called_twice : Note<
4167  "previous call is here%select{; set to nil to indicate "
4168  "it cannot be called afterwards|}0">;
4169
4170// objc_designated_initializer attribute diagnostics.
4171def warn_objc_designated_init_missing_super_call : Warning<
4172  "designated initializer missing a 'super' call to a designated initializer of the super class">,
4173  InGroup<ObjCDesignatedInit>;
4174def note_objc_designated_init_marked_here : Note<
4175  "method marked as designated initializer of the class here">;
4176def warn_objc_designated_init_non_super_designated_init_call : Warning<
4177  "designated initializer should only invoke a designated initializer on 'super'">,
4178  InGroup<ObjCDesignatedInit>;
4179def warn_objc_designated_init_non_designated_init_call : Warning<
4180  "designated initializer invoked a non-designated initializer">,
4181  InGroup<ObjCDesignatedInit>;
4182def warn_objc_secondary_init_super_init_call : Warning<
4183  "convenience initializer should not invoke an initializer on 'super'">,
4184  InGroup<ObjCDesignatedInit>;
4185def warn_objc_secondary_init_missing_init_call : Warning<
4186  "convenience initializer missing a 'self' call to another initializer">,
4187  InGroup<ObjCDesignatedInit>;
4188def warn_objc_implementation_missing_designated_init_override : Warning<
4189  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4190  InGroup<ObjCDesignatedInit>;
4191def err_designated_init_attr_non_init : Error<
4192  "'objc_designated_initializer' attribute only applies to init methods "
4193  "of interface or class extension declarations">;
4194
4195// objc_bridge attribute diagnostics.
4196def err_objc_attr_not_id : Error<
4197  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4198def err_objc_attr_typedef_not_id : Error<
4199  "parameter of %0 attribute must be 'id' when used on a typedef">;
4200def err_objc_attr_typedef_not_void_pointer : Error<
4201  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4202def err_objc_cf_bridged_not_interface : Error<
4203  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4204def err_objc_ns_bridged_invalid_cfobject : Error<
4205  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
4206def warn_objc_invalid_bridge : Warning<
4207  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4208def warn_objc_invalid_bridge_to_cf : Warning<
4209  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4210
4211// objc_bridge_related attribute diagnostics.
4212def err_objc_bridged_related_invalid_class : Error<
4213  "could not find Objective-C class %0 to convert %1 to %2">;
4214def err_objc_bridged_related_invalid_class_name : Error<
4215  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4216def err_objc_bridged_related_known_method : Error<
4217 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4218 "method for this conversion">;
4219
4220def err_objc_attr_protocol_requires_definition : Error<
4221  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4222
4223// Swift attributes.
4224def warn_attr_swift_name_function
4225  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4226    InGroup<SwiftNameAttribute>;
4227def warn_attr_swift_name_invalid_identifier
4228  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4229    InGroup<SwiftNameAttribute>;
4230def warn_attr_swift_name_decl_kind
4231  : Warning<"%0 attribute cannot be applied to this declaration">,
4232    InGroup<SwiftNameAttribute>;
4233def warn_attr_swift_name_subscript_invalid_parameter
4234  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4235        "have at least one parameter|"
4236        "have a 'self:' parameter}1">,
4237    InGroup<SwiftNameAttribute>;
4238def warn_attr_swift_name_missing_parameters
4239  : Warning<"%0 attribute is missing parameter label clause">,
4240    InGroup<SwiftNameAttribute>;
4241def warn_attr_swift_name_setter_parameters
4242  : Warning<"%0 attribute for setter must have one parameter for new value">,
4243    InGroup<SwiftNameAttribute>;
4244def warn_attr_swift_name_multiple_selfs
4245  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4246    InGroup<SwiftNameAttribute>;
4247def warn_attr_swift_name_getter_parameters
4248  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4249    InGroup<SwiftNameAttribute>;
4250def warn_attr_swift_name_subscript_setter_no_newValue
4251  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4252    InGroup<SwiftNameAttribute>;
4253def warn_attr_swift_name_subscript_setter_multiple_newValues
4254  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4255    InGroup<SwiftNameAttribute>;
4256def warn_attr_swift_name_subscript_getter_newValue
4257  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4258    InGroup<SwiftNameAttribute>;
4259def warn_attr_swift_name_num_params
4260  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4261            "the %1 attribute (expected %2; got %3)">,
4262    InGroup<SwiftNameAttribute>;
4263def warn_attr_swift_name_decl_missing_params
4264  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4265            "with no parameters">,
4266    InGroup<SwiftNameAttribute>;
4267
4268def err_attr_swift_error_no_error_parameter : Error<
4269  "%0 attribute can only be applied to a %select{function|method}1 with an "
4270  "error parameter">;
4271def err_attr_swift_error_return_type : Error<
4272  "%0 attribute with '%1' convention can only be applied to a "
4273  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4274
4275def err_swift_async_no_access : Error<
4276  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4277  "'not_swift_private'">;
4278def err_swift_async_bad_block_type : Error<
4279  "'swift_async' completion handler parameter must have block type returning"
4280  " 'void', type here is %0">;
4281
4282def err_swift_async_error_without_swift_async : Error<
4283  "%0 attribute must be applied to a %select{function|method}1 annotated "
4284  "with non-'none' attribute 'swift_async'">;
4285def err_swift_async_error_no_error_parameter : Error<
4286  "%0 attribute with 'nonnull_error' convention can only be applied to a "
4287  "%select{function|method}1 with a completion handler with an error "
4288  "parameter">;
4289def err_swift_async_error_non_integral : Error<
4290  "%0 attribute with '%1' convention must have an integral-typed parameter "
4291  "in completion handler at index %2, type here is %3">;
4292
4293def warn_ignored_objc_externally_retained : Warning<
4294  "'objc_externally_retained' can only be applied to local variables "
4295  "%select{of retainable type|with strong ownership}0">,
4296  InGroup<IgnoredAttributes>;
4297
4298// Function Parameter Semantic Analysis.
4299def err_param_with_void_type : Error<"argument may not have 'void' type">;
4300def err_void_only_param : Error<
4301  "'void' must be the first and only parameter if specified">;
4302def err_void_param_qualified : Error<
4303  "'void' as parameter must not have type qualifiers">;
4304def err_ident_list_in_fn_declaration : Error<
4305  "a parameter list without types is only allowed in a function definition">;
4306def ext_param_not_declared : Extension<
4307  "parameter %0 was not declared, defaulting to type 'int'">;
4308def err_param_default_argument : Error<
4309  "C does not support default arguments">;
4310def err_param_default_argument_redefinition : Error<
4311  "redefinition of default argument">;
4312def ext_param_default_argument_redefinition : ExtWarn<
4313  err_param_default_argument_redefinition.Text>,
4314  InGroup<MicrosoftDefaultArgRedefinition>;
4315def err_param_default_argument_missing : Error<
4316  "missing default argument on parameter">;
4317def err_param_default_argument_missing_name : Error<
4318  "missing default argument on parameter %0">;
4319def err_param_default_argument_references_param : Error<
4320  "default argument references parameter %0">;
4321def err_param_default_argument_references_local : Error<
4322  "default argument references local variable %0 of enclosing function">;
4323def err_param_default_argument_references_this : Error<
4324  "default argument references 'this'">;
4325def err_param_default_argument_nonfunc : Error<
4326  "default arguments can only be specified for parameters in a function "
4327  "declaration">;
4328def err_param_default_argument_template_redecl : Error<
4329  "default arguments cannot be added to a function template that has already "
4330  "been declared">;
4331def err_param_default_argument_member_template_redecl : Error<
4332  "default arguments cannot be added to an out-of-line definition of a member "
4333  "of a %select{class template|class template partial specialization|nested "
4334  "class in a template}0">;
4335def err_param_default_argument_on_parameter_pack : Error<
4336  "parameter pack cannot have a default argument">;
4337def err_uninitialized_member_for_assign : Error<
4338  "cannot define the implicit copy assignment operator for %0, because "
4339  "non-static %select{reference|const}1 member %2 cannot use copy "
4340  "assignment operator">;
4341def err_uninitialized_member_in_ctor : Error<
4342  "%select{constructor for %1|"
4343  "implicit default constructor for %1|"
4344  "cannot use constructor inherited from %1:}0 must explicitly "
4345  "initialize the %select{reference|const}2 member %3">;
4346def err_default_arg_makes_ctor_special : Error<
4347  "addition of default argument on redeclaration makes this constructor a "
4348  "%select{default|copy|move}0 constructor">;
4349
4350def err_use_of_default_argument_to_function_declared_later : Error<
4351  "use of default argument to function %0 that is declared later in class %1">;
4352def note_default_argument_declared_here : Note<
4353  "default argument declared here">;
4354def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4355def note_recursive_default_argument_used_here : Note<
4356  "default argument used here">;
4357
4358def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4359  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4360  "parameter type $|promoted type of K&R function parameter is not compatible "
4361  "with parameter type}0,1 declared in a previous prototype">,
4362  InGroup<KNRPromotedParameter>;
4363
4364
4365// C++ Overloading Semantic Analysis.
4366def err_ovl_diff_return_type : Error<
4367  "functions that differ only in their return type cannot be overloaded">;
4368def err_ovl_static_nonstatic_member : Error<
4369  "static and non-static member functions with the same parameter types "
4370  "cannot be overloaded">;
4371
4372let Deferrable = 1 in {
4373
4374def err_ovl_no_viable_function_in_call : Error<
4375  "no matching function for call to %0">;
4376def err_ovl_no_viable_member_function_in_call : Error<
4377  "no matching member function for call to %0">;
4378def err_ovl_ambiguous_call : Error<
4379  "call to %0 is ambiguous">;
4380def err_ovl_deleted_call : Error<"call to deleted function %0">;
4381def err_ovl_ambiguous_member_call : Error<
4382  "call to member function %0 is ambiguous">;
4383def err_ovl_deleted_member_call : Error<
4384  "call to deleted member function %0">;
4385def note_ovl_too_many_candidates : Note<
4386    "remaining %0 candidate%s0 omitted; "
4387    "pass -fshow-overloads=all to show them">;
4388
4389def select_ovl_candidate_kind : TextSubstitution<
4390  "%select{function|function|function (with reversed parameter order)|"
4391    "constructor|"
4392    "constructor (the implicit default constructor)|"
4393    "constructor (the implicit copy constructor)|"
4394    "constructor (the implicit move constructor)|"
4395    "function (the implicit copy assignment operator)|"
4396    "function (the implicit move assignment operator)|"
4397    "function (the implicit 'operator==' for this 'operator<=>)'|"
4398    "inherited constructor}0%select{| template| %2}1">;
4399
4400def note_ovl_candidate : Note<
4401    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4402    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4403    "| has different number of parameters (expected %5 but has %6)"
4404    "| has type mismatch at %ordinal5 parameter"
4405    "%diff{ (expected $ but has $)|}6,7"
4406    "| has different return type%diff{ ($ expected but has $)|}5,6"
4407    "| has different qualifiers (expected %5 but found %6)"
4408    "| has different exception specification}4">;
4409
4410def note_ovl_candidate_explicit : Note<
4411    "explicit %select{constructor|conversion function|deduction guide}0 "
4412    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4413def note_ovl_candidate_inherited_constructor : Note<
4414    "constructor from base class %0 inherited here">;
4415def note_ovl_candidate_inherited_constructor_slice : Note<
4416    "candidate %select{constructor|template}0 ignored: "
4417    "inherited constructor cannot be used to %select{copy|move}1 object">;
4418def note_ovl_candidate_illegal_constructor : Note<
4419    "candidate %select{constructor|template}0 ignored: "
4420    "instantiation %select{takes|would take}0 its own class type by value">;
4421def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4422    "candidate constructor ignored: cannot be used to construct an object "
4423    "in address space %0">;
4424def note_ovl_candidate_bad_deduction : Note<
4425    "candidate template ignored: failed template argument deduction">;
4426def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4427    "couldn't infer template argument %0">;
4428def note_ovl_candidate_incomplete_deduction_pack : Note<
4429    "candidate template ignored: "
4430    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4431    "expanded parameter in deduced argument pack %2">;
4432def note_ovl_candidate_inconsistent_deduction : Note<
4433    "candidate template ignored: deduced %select{conflicting types|"
4434    "conflicting values|conflicting templates|packs of different lengths}0 "
4435    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4436def note_ovl_candidate_inconsistent_deduction_types : Note<
4437    "candidate template ignored: deduced values %diff{"
4438    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4439    "%1 and %3 of conflicting types for parameter %0}2,4">;
4440def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4441    "candidate template ignored: invalid explicitly-specified argument "
4442    "for template parameter %0">;
4443def note_ovl_candidate_unsatisfied_constraints : Note<
4444    "candidate template ignored: constraints not satisfied%0">;
4445def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4446    "candidate template ignored: invalid explicitly-specified argument "
4447    "for %ordinal0 template parameter">;
4448def note_ovl_candidate_instantiation_depth : Note<
4449    "candidate template ignored: substitution exceeded maximum template "
4450    "instantiation depth">;
4451def note_ovl_candidate_underqualified : Note<
4452    "candidate template ignored: cannot deduce a type for %0 that would "
4453    "make %2 equal %1">;
4454def note_ovl_candidate_substitution_failure : Note<
4455    "candidate template ignored: substitution failure%0%1">;
4456def note_ovl_candidate_disabled_by_enable_if : Note<
4457    "candidate template ignored: disabled by %0%1">;
4458def note_ovl_candidate_disabled_by_requirement : Note<
4459    "candidate template ignored: requirement '%0' was not satisfied%1">;
4460def note_ovl_candidate_has_pass_object_size_params: Note<
4461    "candidate address cannot be taken because parameter %0 has "
4462    "pass_object_size attribute">;
4463def err_diagnose_if_succeeded : Error<"%0">;
4464def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4465    ShowInSystemHeader;
4466def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4467    "candidate disabled: %0">;
4468def err_addrof_function_disabled_by_enable_if_attr : Error<
4469    "cannot take address of function %0 because it has one or more "
4470    "non-tautological enable_if conditions">;
4471def err_addrof_function_constraints_not_satisfied : Error<
4472    "cannot take address of function %0 because its constraints are not "
4473    "satisfied">;
4474def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4475    "candidate function made ineligible by enable_if">;
4476def note_ovl_candidate_deduced_mismatch : Note<
4477    "candidate template ignored: deduced type "
4478    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4479    "adjusted type $ of %select{|element of }4argument"
4480    "|of %select{|element of }4%ordinal0 parameter does not match "
4481    "adjusted type of %select{|element of }4argument}1,2%3">;
4482def note_ovl_candidate_non_deduced_mismatch : Note<
4483    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4484// This note is needed because the above note would sometimes print two
4485// different types with the same name.  Remove this note when the above note
4486// can handle that case properly.
4487def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4488    "candidate template ignored: could not match %q0 against %q1">;
4489
4490// Note that we don't treat templates differently for this diagnostic.
4491def note_ovl_candidate_arity : Note<"candidate "
4492    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4493    "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
4494    "%plural{1:was|:were}5 provided">;
4495
4496def note_ovl_candidate_arity_one : Note<"candidate "
4497    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4498    "%select{requires at least|allows at most single|requires single}3 "
4499    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4500
4501def note_ovl_candidate_deleted : Note<
4502    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4503    "%select{explicitly made unavailable|explicitly deleted|"
4504    "implicitly deleted}3">;
4505
4506// Giving the index of the bad argument really clutters this message, and
4507// it's relatively unimportant because 1) it's generally obvious which
4508// argument(s) are of the given object type and 2) the fix is usually
4509// to complete the type, which doesn't involve changes to the call line
4510// anyway.  If people complain, we can change it.
4511def note_ovl_candidate_bad_conv_incomplete : Note<
4512    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4513    "cannot convert argument of incomplete type "
4514    "%diff{$ to $|to parameter type}3,4 for "
4515    "%select{%ordinal6 argument|object argument}5"
4516    "%select{|; dereference the argument with *|"
4517    "; take the address of the argument with &|"
4518    "; remove *|"
4519    "; remove &}7">;
4520def note_ovl_candidate_bad_list_argument : Note<
4521    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4522    "%select{cannot convert initializer list|too few initializers in list"
4523    "|too many initializers in list}7 argument to %4">;
4524def note_ovl_candidate_bad_overload : Note<
4525    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4526    "no overload of %4 matching %3 for %ordinal5 argument">;
4527def note_ovl_candidate_bad_conv : Note<
4528    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4529    "no known conversion "
4530    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4531    "%select{%ordinal6 argument|object argument}5"
4532    "%select{|; dereference the argument with *|"
4533    "; take the address of the argument with &|"
4534    "; remove *|"
4535    "; remove &}7">;
4536def note_ovl_candidate_bad_arc_conv : Note<
4537    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4538    "cannot implicitly convert argument "
4539    "%diff{of type $ to $|type to parameter type}3,4 for "
4540    "%select{%ordinal6 argument|object argument}5 under ARC">;
4541def note_ovl_candidate_bad_value_category : Note<
4542    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4543    "expects an %select{lvalue|rvalue}5 for "
4544    "%select{%ordinal4 argument|object argument}3">;
4545def note_ovl_candidate_bad_addrspace : Note<
4546    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4547    "cannot %select{pass pointer to|bind reference in}5 %3 "
4548    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4549    "argument">;
4550def note_ovl_candidate_bad_addrspace_this : Note<
4551    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4552    "'this' object is in %3, but method expects object in %4">;
4553def note_ovl_candidate_bad_gc : Note<
4554    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4555    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4556    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4557def note_ovl_candidate_bad_ownership : Note<
4558    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4559    "%select{%ordinal7|'this'}6 argument (%3) has "
4560    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4561    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4562    "__autoreleasing}5 ownership">;
4563def note_ovl_candidate_bad_cvr_this : Note<
4564    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4565    "'this' argument has type %3, but method is not marked "
4566    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4567    "volatile or restrict|const, volatile, or restrict}4">;
4568def note_ovl_candidate_bad_cvr : Note<
4569    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4570    "%ordinal5 argument (%3) would lose "
4571    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4572    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4573    "%select{||s||s|s|s}4">;
4574def note_ovl_candidate_bad_unaligned : Note<
4575    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4576    "%ordinal5 argument (%3) would lose __unaligned qualifier">;
4577def note_ovl_candidate_bad_base_to_derived_conv : Note<
4578    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4579    "cannot %select{convert from|convert from|bind}3 "
4580    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4581    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4582    "%ordinal6 argument">;
4583def note_ovl_candidate_bad_target : Note<
4584    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4585    "call to "
4586    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4587    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4588def note_ovl_candidate_constraints_not_satisfied : Note<
4589    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4590    "not satisfied">;
4591def note_implicit_member_target_infer_collision : Note<
4592    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4593    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4594    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4595
4596def note_ambiguous_type_conversion: Note<
4597    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4598def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4599def err_ovl_no_viable_function_in_init : Error<
4600  "no matching constructor for initialization of %0">;
4601def err_ovl_no_conversion_in_cast : Error<
4602  "cannot convert %1 to %2 without a conversion operator">;
4603def err_ovl_no_viable_conversion_in_cast : Error<
4604  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4605  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4606def err_ovl_ambiguous_conversion_in_cast : Error<
4607  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4608  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4609def err_ovl_deleted_conversion_in_cast : Error<
4610  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4611  "functional-style cast|}0 from %1 to %2 uses deleted function">;
4612def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4613def err_ref_init_ambiguous : Error<
4614  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4615def err_ovl_deleted_init : Error<
4616  "call to deleted constructor of %0">;
4617def err_ovl_deleted_special_init : Error<
4618  "call to implicitly-deleted %select{default constructor|copy constructor|"
4619  "move constructor|copy assignment operator|move assignment operator|"
4620  "destructor|function}0 of %1">;
4621def err_ovl_ambiguous_oper_unary : Error<
4622  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4623def err_ovl_ambiguous_oper_binary : Error<
4624  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4625def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4626  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4627  "and %2) to be ambiguous despite there being a unique best viable function"
4628  "%select{ with non-reversed arguments|}3">,
4629  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4630def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4631  "ambiguity is between a regular call to this operator and a call with the "
4632  "argument order reversed">;
4633def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4634  "candidate function with non-reversed arguments">;
4635def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
4636  "ambiguous candidate function with reversed arguments">;
4637def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
4638def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
4639def err_ovl_deleted_oper : Error<
4640  "overload resolution selected deleted operator '%0'">;
4641def err_ovl_deleted_special_oper : Error<
4642  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
4643  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
4644  "implicitly deleted">;
4645def err_ovl_deleted_comparison : Error<
4646  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
4647def err_ovl_rewrite_equalequal_not_bool : Error<
4648  "return type %0 of selected 'operator==' function for rewritten "
4649  "'%1' comparison is not 'bool'">;
4650def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
4651  "ISO C++20 requires return type of selected 'operator==' function for "
4652  "rewritten '%1' comparison to be 'bool', not %0">,
4653  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
4654def err_ovl_no_viable_subscript :
4655    Error<"no viable overloaded operator[] for type %0">;
4656def err_ovl_no_oper :
4657    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
4658def err_ovl_unresolvable : Error<
4659  "reference to %select{overloaded|multiversioned}1 function could not be "
4660  "resolved; did you mean to call it%select{| with no arguments}0?">;
4661def err_bound_member_function : Error<
4662  "reference to non-static member function must be called"
4663  "%select{|; did you mean to call it with no arguments?}0">;
4664def note_possible_target_of_call : Note<"possible target for call">;
4665
4666def err_ovl_no_viable_object_call : Error<
4667  "no matching function for call to object of type %0">;
4668def err_ovl_ambiguous_object_call : Error<
4669  "call to object of type %0 is ambiguous">;
4670def err_ovl_deleted_object_call : Error<
4671  "call to deleted function call operator in type %0">;
4672def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
4673def err_member_call_without_object : Error<
4674  "call to non-static member function without an object argument">;
4675
4676// C++ Address of Overloaded Function
4677def err_addr_ovl_no_viable : Error<
4678  "address of overloaded function %0 does not match required type %1">;
4679def err_addr_ovl_ambiguous : Error<
4680  "address of overloaded function %0 is ambiguous">;
4681def err_addr_ovl_not_func_ptrref : Error<
4682  "address of overloaded function %0 cannot be converted to type %1">;
4683def err_addr_ovl_no_qualifier : Error<
4684  "cannot form member pointer of type %0 without '&' and class name">;
4685
4686} // let Deferrable
4687
4688// C++11 Literal Operators
4689def err_ovl_no_viable_literal_operator : Error<
4690  "no matching literal operator for call to %0"
4691  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
4692  "%select{| or 'const char *'}4"
4693  "%select{|, and no matching literal operator template}5">;
4694
4695// C++ Template Declarations
4696def err_template_param_shadow : Error<
4697  "declaration of %0 shadows template parameter">;
4698def ext_template_param_shadow : ExtWarn<
4699  err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>;
4700def note_template_param_here : Note<"template parameter is declared here">;
4701def warn_template_export_unsupported : Warning<
4702  "exported templates are unsupported">;
4703def err_template_outside_namespace_or_class_scope : Error<
4704  "templates can only be declared in namespace or class scope">;
4705def err_template_inside_local_class : Error<
4706  "templates cannot be declared inside of a local class">;
4707def err_template_linkage : Error<"templates must have C++ linkage">;
4708def err_template_typedef : Error<"a typedef cannot be a template">;
4709def err_template_unnamed_class : Error<
4710  "cannot declare a class template with no name">;
4711def err_template_param_list_different_arity : Error<
4712  "%select{too few|too many}0 template parameters in template "
4713  "%select{|template parameter }1redeclaration">;
4714def note_template_param_list_different_arity : Note<
4715  "%select{too few|too many}0 template parameters in template template "
4716  "argument">;
4717def note_template_prev_declaration : Note<
4718  "previous template %select{declaration|template parameter}0 is here">;
4719def err_template_param_different_kind : Error<
4720  "template parameter has a different kind in template "
4721  "%select{|template parameter }0redeclaration">;
4722def note_template_param_different_kind : Note<
4723  "template parameter has a different kind in template argument">;
4724
4725def err_invalid_decl_specifier_in_nontype_parm : Error<
4726  "invalid declaration specifier in template non-type parameter">;
4727
4728def err_template_nontype_parm_different_type : Error<
4729  "template non-type parameter has a different type %0 in template "
4730  "%select{|template parameter }1redeclaration">;
4731
4732def note_template_nontype_parm_different_type : Note<
4733  "template non-type parameter has a different type %0 in template argument">;
4734def note_template_nontype_parm_prev_declaration : Note<
4735  "previous non-type template parameter with type %0 is here">;
4736def err_template_nontype_parm_bad_type : Error<
4737  "a non-type template parameter cannot have type %0">;
4738def err_template_nontype_parm_bad_structural_type : Error<
4739  "a non-type template parameter cannot have type %0 before C++20">;
4740def err_template_nontype_parm_incomplete : Error<
4741  "non-type template parameter has incomplete type %0">;
4742def err_template_nontype_parm_not_literal : Error<
4743  "non-type template parameter has non-literal type %0">;
4744def err_template_nontype_parm_rvalue_ref : Error<
4745  "non-type template parameter has rvalue reference type %0">;
4746def err_template_nontype_parm_not_structural : Error<
4747  "type %0 of non-type template parameter is not a structural type">;
4748def note_not_structural_non_public : Note<
4749  "%0 is not a structural type because it has a "
4750  "%select{non-static data member|base class}1 that is not public">;
4751def note_not_structural_mutable_field : Note<
4752  "%0 is not a structural type because it has a mutable "
4753  "non-static data member">;
4754def note_not_structural_rvalue_ref_field : Note<
4755  "%0 is not a structural type because it has a non-static data member "
4756  "of rvalue reference type">;
4757def note_not_structural_subobject : Note<
4758  "%0 is not a structural type because it has a "
4759  "%select{non-static data member|base class}1 of non-structural type %2">;
4760def warn_cxx17_compat_template_nontype_parm_type : Warning<
4761  "non-type template parameter of type %0 is incompatible with "
4762  "C++ standards before C++20">,
4763  DefaultIgnore, InGroup<CXXPre20Compat>;
4764def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
4765  "non-type template parameters declared with %0 are incompatible with C++ "
4766  "standards before C++17">,
4767  DefaultIgnore, InGroup<CXXPre17Compat>;
4768def err_template_param_default_arg_redefinition : Error<
4769  "template parameter redefines default argument">;
4770def note_template_param_prev_default_arg : Note<
4771  "previous default template argument defined here">;
4772def err_template_param_default_arg_missing : Error<
4773  "template parameter missing a default argument">;
4774def ext_template_parameter_default_in_function_template : ExtWarn<
4775  "default template arguments for a function template are a C++11 extension">,
4776  InGroup<CXX11>;
4777def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
4778  "default template arguments for a function template are incompatible with C++98">,
4779  InGroup<CXX98Compat>, DefaultIgnore;
4780def err_template_parameter_default_template_member : Error<
4781  "cannot add a default template argument to the definition of a member of a "
4782  "class template">;
4783def err_template_parameter_default_friend_template : Error<
4784  "default template argument not permitted on a friend template">;
4785def err_template_template_parm_no_parms : Error<
4786  "template template parameter must have its own template parameters">;
4787
4788def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4789  InGroup<CXX14>;
4790def warn_cxx11_compat_variable_template : Warning<
4791  "variable templates are incompatible with C++ standards before C++14">,
4792  InGroup<CXXPre14Compat>, DefaultIgnore;
4793def err_template_variable_noparams : Error<
4794  "extraneous 'template<>' in declaration of variable %0">;
4795def err_template_member : Error<"member %0 declared as a template">;
4796def err_template_member_noparams : Error<
4797  "extraneous 'template<>' in declaration of member %0">;
4798def err_template_tag_noparams : Error<
4799  "extraneous 'template<>' in declaration of %0 %1">;
4800
4801def warn_cxx17_compat_adl_only_template_id : Warning<
4802  "use of function template name with no prior function template "
4803  "declaration in function call with explicit template arguments "
4804  "is incompatible with C++ standards before C++20">,
4805  InGroup<CXXPre20Compat>, DefaultIgnore;
4806def ext_adl_only_template_id : ExtWarn<
4807  "use of function template name with no prior declaration in function call "
4808  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
4809
4810// C++ Template Argument Lists
4811def err_template_missing_args : Error<
4812  "use of "
4813  "%select{class template|function template|variable template|alias template|"
4814  "template template parameter|concept|template}0 %1 requires template "
4815  "arguments">;
4816def err_template_arg_list_different_arity : Error<
4817  "%select{too few|too many}0 template arguments for "
4818  "%select{class template|function template|variable template|alias template|"
4819  "template template parameter|concept|template}1 %2">;
4820def note_template_decl_here : Note<"template is declared here">;
4821def err_template_arg_must_be_type : Error<
4822  "template argument for template type parameter must be a type">;
4823def err_template_arg_must_be_type_suggest : Error<
4824  "template argument for template type parameter must be a type; "
4825  "did you forget 'typename'?">;
4826def ext_ms_template_type_arg_missing_typename : ExtWarn<
4827  "template argument for template type parameter must be a type; "
4828  "omitted 'typename' is a Microsoft extension">,
4829  InGroup<MicrosoftTemplate>;
4830def err_template_arg_must_be_expr : Error<
4831  "template argument for non-type template parameter must be an expression">;
4832def err_template_arg_nontype_ambig : Error<
4833  "template argument for non-type template parameter is treated as function type %0">;
4834def err_template_arg_must_be_template : Error<
4835  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4836def ext_template_arg_local_type : ExtWarn<
4837  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4838def ext_template_arg_unnamed_type : ExtWarn<
4839  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4840def warn_cxx98_compat_template_arg_local_type : Warning<
4841  "local type %0 as template argument is incompatible with C++98">,
4842  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4843def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4844  "unnamed type as template argument is incompatible with C++98">,
4845  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4846def note_template_unnamed_type_here : Note<
4847  "unnamed type used in template argument was declared here">;
4848def err_template_arg_overload_type : Error<
4849  "template argument is the type of an unresolved overloaded function">;
4850def err_template_arg_not_valid_template : Error<
4851  "template argument does not refer to a class or alias template, or template "
4852  "template parameter">;
4853def note_template_arg_refers_here_func : Note<
4854  "template argument refers to function template %0, here">;
4855def err_template_arg_template_params_mismatch : Error<
4856  "template template argument has different template parameters than its "
4857  "corresponding template template parameter">;
4858def err_template_arg_not_integral_or_enumeral : Error<
4859  "non-type template argument of type %0 must have an integral or enumeration"
4860  " type">;
4861def err_template_arg_not_ice : Error<
4862  "non-type template argument of type %0 is not an integral constant "
4863  "expression">;
4864def err_template_arg_not_address_constant : Error<
4865  "non-type template argument of type %0 is not a constant expression">;
4866def warn_cxx98_compat_template_arg_null : Warning<
4867  "use of null pointer as non-type template argument is incompatible with "
4868  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4869def err_template_arg_untyped_null_constant : Error<
4870  "null non-type template argument must be cast to template parameter type %0">;
4871def err_template_arg_wrongtype_null_constant : Error<
4872  "null non-type template argument of type %0 does not match template parameter "
4873  "of type %1">;
4874def err_non_type_template_parm_type_deduction_failure : Error<
4875  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4876def err_deduced_non_type_template_arg_type_mismatch : Error<
4877  "deduced non-type template argument does not have the same type as the "
4878  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4879def err_non_type_template_arg_subobject : Error<
4880  "non-type template argument refers to subobject '%0'">;
4881def err_non_type_template_arg_addr_label_diff : Error<
4882  "template argument / label address difference / what did you expect?">;
4883def err_non_type_template_arg_unsupported : Error<
4884  "sorry, non-type template argument of type %0 is not yet supported">;
4885def err_template_arg_not_convertible : Error<
4886  "non-type template argument of type %0 cannot be converted to a value "
4887  "of type %1">;
4888def warn_template_arg_negative : Warning<
4889  "non-type template argument with value '%0' converted to '%1' for unsigned "
4890  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4891def warn_template_arg_too_large : Warning<
4892  "non-type template argument value '%0' truncated to '%1' for "
4893  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4894def err_template_arg_no_ref_bind : Error<
4895  "non-type template parameter of reference type "
4896  "%diff{$ cannot bind to template argument of type $"
4897  "|cannot bind to template of incompatible argument type}0,1">;
4898def err_template_arg_ref_bind_ignores_quals : Error<
4899  "reference binding of non-type template parameter "
4900  "%diff{of type $ to template argument of type $|to template argument}0,1 "
4901  "ignores qualifiers">;
4902def err_template_arg_not_decl_ref : Error<
4903  "non-type template argument does not refer to any declaration">;
4904def err_template_arg_not_address_of : Error<
4905  "non-type template argument for template parameter of pointer type %0 must "
4906  "have its address taken">;
4907def err_template_arg_address_of_non_pointer : Error<
4908  "address taken in non-type template argument for template parameter of "
4909  "reference type %0">;
4910def err_template_arg_reference_var : Error<
4911  "non-type template argument of reference type %0 is not an object">;
4912def err_template_arg_field : Error<
4913  "non-type template argument refers to non-static data member %0">;
4914def err_template_arg_method : Error<
4915  "non-type template argument refers to non-static member function %0">;
4916def err_template_arg_object_no_linkage : Error<
4917  "non-type template argument refers to %select{function|object}0 %1 that "
4918  "does not have linkage">;
4919def warn_cxx98_compat_template_arg_object_internal : Warning<
4920  "non-type template argument referring to %select{function|object}0 %1 with "
4921  "internal linkage is incompatible with C++98">,
4922  InGroup<CXX98Compat>, DefaultIgnore;
4923def ext_template_arg_object_internal : ExtWarn<
4924  "non-type template argument referring to %select{function|object}0 %1 with "
4925  "internal linkage is a C++11 extension">, InGroup<CXX11>;
4926def err_template_arg_thread_local : Error<
4927  "non-type template argument refers to thread-local object">;
4928def note_template_arg_internal_object : Note<
4929  "non-type template argument refers to %select{function|object}0 here">;
4930def note_template_arg_refers_here : Note<
4931  "non-type template argument refers here">;
4932def err_template_arg_not_object_or_func : Error<
4933  "non-type template argument does not refer to an object or function">;
4934def err_template_arg_not_pointer_to_member_form : Error<
4935  "non-type template argument is not a pointer to member constant">;
4936def err_template_arg_member_ptr_base_derived_not_supported : Error<
4937  "sorry, non-type template argument of pointer-to-member type %1 that refers "
4938  "to member %q0 of a different class is not supported yet">;
4939def ext_template_arg_extra_parens : ExtWarn<
4940  "address non-type template argument cannot be surrounded by parentheses">;
4941def warn_cxx98_compat_template_arg_extra_parens : Warning<
4942  "redundant parentheses surrounding address non-type template argument are "
4943  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4944def err_pointer_to_member_type : Error<
4945  "invalid use of pointer to member type after %select{.*|->*}0">;
4946def err_pointer_to_member_call_drops_quals : Error<
4947  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4948def err_pointer_to_member_oper_value_classify: Error<
4949  "pointer-to-member function type %0 can only be called on an "
4950  "%select{rvalue|lvalue}1">;
4951def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4952  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
4953  InGroup<CXX20>, SFINAEFailure;
4954def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4955  "invoking a pointer to a 'const &' member function on an rvalue is "
4956  "incompatible with C++ standards before C++20">,
4957  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
4958def ext_ms_deref_template_argument: ExtWarn<
4959  "non-type template argument containing a dereference operation is a "
4960  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4961def ext_ms_delayed_template_argument: ExtWarn<
4962  "using the undeclared type %0 as a default template argument is a "
4963  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4964def err_template_arg_deduced_incomplete_pack : Error<
4965  "deduced incomplete pack %0 for template parameter %1">;
4966
4967// C++ template specialization
4968def err_template_spec_unknown_kind : Error<
4969  "can only provide an explicit specialization for a class template, function "
4970  "template, variable template, or a member function, static data member, "
4971  "%select{or member class|member class, or member enumeration}0 of a "
4972  "class template">;
4973def note_specialized_entity : Note<
4974  "explicitly specialized declaration is here">;
4975def note_explicit_specialization_declared_here : Note<
4976  "explicit specialization declared here">;
4977def err_template_spec_decl_function_scope : Error<
4978  "explicit specialization of %0 in function scope">;
4979def err_template_spec_decl_friend : Error<
4980  "cannot declare an explicit specialization in a friend">;
4981def err_template_spec_redecl_out_of_scope : Error<
4982  "%select{class template|class template partial|variable template|"
4983  "variable template partial|function template|member "
4984  "function|static data member|member class|member enumeration}0 "
4985  "specialization of %1 not in %select{a namespace enclosing %2|"
4986  "class %2 or an enclosing namespace}3">;
4987def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4988  "%select{class template|class template partial|variable template|"
4989  "variable template partial|function template|member "
4990  "function|static data member|member class|member enumeration}0 "
4991  "specialization of %1 not in %select{a namespace enclosing %2|"
4992  "class %2 or an enclosing namespace}3 "
4993  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4994def err_template_spec_redecl_global_scope : Error<
4995  "%select{class template|class template partial|variable template|"
4996  "variable template partial|function template|member "
4997  "function|static data member|member class|member enumeration}0 "
4998  "specialization of %1 must occur at global scope">;
4999def err_spec_member_not_instantiated : Error<
5000  "specialization of member %q0 does not specialize an instantiated member">;
5001def note_specialized_decl : Note<"attempt to specialize declaration here">;
5002def err_specialization_after_instantiation : Error<
5003  "explicit specialization of %0 after instantiation">;
5004def note_instantiation_required_here : Note<
5005  "%select{implicit|explicit}0 instantiation first required here">;
5006def err_template_spec_friend : Error<
5007  "template specialization declaration cannot be a friend">;
5008def err_template_spec_default_arg : Error<
5009  "default argument not permitted on an explicit "
5010  "%select{instantiation|specialization}0 of function %1">;
5011def err_not_class_template_specialization : Error<
5012  "cannot specialize a %select{dependent template|template template "
5013  "parameter}0">;
5014def ext_explicit_specialization_storage_class : ExtWarn<
5015  "explicit specialization cannot have a storage class">;
5016def err_explicit_specialization_inconsistent_storage_class : Error<
5017  "explicit specialization has extraneous, inconsistent storage class "
5018  "'%select{none|extern|static|__private_extern__|auto|register}0'">;
5019def err_dependent_function_template_spec_no_match : Error<
5020  "no candidate function template was found for dependent"
5021  " friend function template specialization">;
5022def note_dependent_function_template_spec_discard_reason : Note<
5023  "candidate ignored: %select{not a function template"
5024  "|not a member of the enclosing namespace;"
5025  " did you mean to explicitly qualify the specialization?}0">;
5026
5027// C++ class template specializations and out-of-line definitions
5028def err_template_spec_needs_header : Error<
5029  "template specialization requires 'template<>'">;
5030def err_template_spec_needs_template_parameters : Error<
5031  "template specialization or definition requires a template parameter list "
5032  "corresponding to the nested type %0">;
5033def err_template_param_list_matches_nontemplate : Error<
5034  "template parameter list matching the non-templated nested type %0 should "
5035  "be empty ('template<>')">;
5036def err_alias_template_extra_headers : Error<
5037  "extraneous template parameter list in alias template declaration">;
5038def err_template_spec_extra_headers : Error<
5039  "extraneous template parameter list in template specialization or "
5040  "out-of-line template definition">;
5041def warn_template_spec_extra_headers : Warning<
5042  "extraneous template parameter list in template specialization">;
5043def note_explicit_template_spec_does_not_need_header : Note<
5044  "'template<>' header not required for explicitly-specialized class %0 "
5045  "declared here">;
5046def err_template_qualified_declarator_no_match : Error<
5047  "nested name specifier '%0' for declaration does not refer into a class, "
5048  "class template or class template partial specialization">;
5049def err_specialize_member_of_template : Error<
5050  "cannot specialize %select{|(with 'template<>') }0a member of an "
5051  "unspecialized template">;
5052
5053// C++ Class Template Partial Specialization
5054def err_default_arg_in_partial_spec : Error<
5055    "default template argument in a class template partial specialization">;
5056def err_dependent_non_type_arg_in_partial_spec : Error<
5057    "type of specialized non-type template argument depends on a template "
5058    "parameter of the partial specialization">;
5059def note_dependent_non_type_default_arg_in_partial_spec : Note<
5060    "template parameter is used in default argument declared here">;
5061def err_dependent_typed_non_type_arg_in_partial_spec : Error<
5062    "non-type template argument specializes a template parameter with "
5063    "dependent type %0">;
5064def err_partial_spec_args_match_primary_template : Error<
5065    "%select{class|variable}0 template partial specialization does not "
5066    "specialize any template argument; to %select{declare|define}1 the "
5067    "primary template, remove the template argument list">;
5068def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
5069    "%select{class|variable}0 template partial specialization is not "
5070    "more specialized than the primary template">, DefaultError,
5071    InGroup<DiagGroup<"invalid-partial-specialization">>;
5072def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
5073def ext_partial_specs_not_deducible : ExtWarn<
5074    "%select{class|variable}0 template partial specialization contains "
5075    "%select{a template parameter|template parameters}1 that cannot be "
5076    "deduced; this partial specialization will never be used">,
5077    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
5078def note_non_deducible_parameter : Note<
5079    "non-deducible template parameter %0">;
5080def err_partial_spec_ordering_ambiguous : Error<
5081    "ambiguous partial specializations of %0">;
5082def note_partial_spec_match : Note<"partial specialization matches %0">;
5083def err_partial_spec_redeclared : Error<
5084  "class template partial specialization %0 cannot be redeclared">;
5085def note_partial_specialization_declared_here : Note<
5086  "explicit specialization declared here">;
5087def note_prev_partial_spec_here : Note<
5088  "previous declaration of class template partial specialization %0 is here">;
5089def err_partial_spec_fully_specialized : Error<
5090  "partial specialization of %0 does not use any of its template parameters">;
5091
5092// C++ Variable Template Partial Specialization
5093def err_var_partial_spec_redeclared : Error<
5094  "variable template partial specialization %0 cannot be redefined">;
5095def note_var_prev_partial_spec_here : Note<
5096  "previous declaration of variable template partial specialization is here">;
5097def err_var_spec_no_template : Error<
5098  "no variable template matches%select{| partial}0 specialization">;
5099def err_var_spec_no_template_but_method : Error<
5100  "no variable template matches specialization; "
5101  "did you mean to use %0 as function template instead?">;
5102
5103// C++ Function template specializations
5104def err_function_template_spec_no_match : Error<
5105    "no function template matches function template specialization %0">;
5106def err_function_template_spec_ambiguous : Error<
5107    "function template specialization %0 ambiguously refers to more than one "
5108    "function template; explicitly specify%select{| additional}1 template "
5109    "arguments to identify a particular function template">;
5110def note_function_template_spec_matched : Note<
5111    "function template %q0 matches specialization %1">;
5112def err_function_template_partial_spec : Error<
5113    "function template partial specialization is not allowed">;
5114
5115// C++ Template Instantiation
5116def err_template_recursion_depth_exceeded : Error<
5117  "recursive template instantiation exceeded maximum depth of %0">,
5118  DefaultFatal, NoSFINAE;
5119def note_template_recursion_depth : Note<
5120  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
5121
5122def err_template_instantiate_within_definition : Error<
5123  "%select{implicit|explicit}0 instantiation of template %1 within its"
5124  " own definition">;
5125def err_template_instantiate_undefined : Error<
5126  "%select{implicit|explicit}0 instantiation of undefined template %1">;
5127def err_implicit_instantiate_member_undefined : Error<
5128  "implicit instantiation of undefined member %0">;
5129def note_template_class_instantiation_was_here : Note<
5130  "class template %0 was instantiated here">;
5131def note_template_class_explicit_specialization_was_here : Note<
5132  "class template %0 was explicitly specialized here">;
5133def note_template_class_instantiation_here : Note<
5134  "in instantiation of template class %q0 requested here">;
5135def note_template_member_class_here : Note<
5136  "in instantiation of member class %q0 requested here">;
5137def note_template_member_function_here : Note<
5138  "in instantiation of member function %q0 requested here">;
5139def note_function_template_spec_here : Note<
5140  "in instantiation of function template specialization %q0 requested here">;
5141def note_template_static_data_member_def_here : Note<
5142  "in instantiation of static data member %q0 requested here">;
5143def note_template_variable_def_here : Note<
5144  "in instantiation of variable template specialization %q0 requested here">;
5145def note_template_enum_def_here : Note<
5146  "in instantiation of enumeration %q0 requested here">;
5147def note_template_nsdmi_here : Note<
5148  "in instantiation of default member initializer %q0 requested here">;
5149def note_template_type_alias_instantiation_here : Note<
5150  "in instantiation of template type alias %0 requested here">;
5151def note_template_exception_spec_instantiation_here : Note<
5152  "in instantiation of exception specification for %0 requested here">;
5153def note_template_requirement_instantiation_here : Note<
5154  "in instantiation of requirement here">;
5155def warn_var_template_missing : Warning<"instantiation of variable %q0 "
5156  "required here, but no definition is available">,
5157  InGroup<UndefinedVarTemplate>;
5158def warn_func_template_missing : Warning<"instantiation of function %q0 "
5159  "required here, but no definition is available">,
5160  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
5161def note_forward_template_decl : Note<
5162  "forward declaration of template entity is here">;
5163def note_inst_declaration_hint : Note<"add an explicit instantiation "
5164  "declaration to suppress this warning if %q0 is explicitly instantiated in "
5165  "another translation unit">;
5166def note_evaluating_exception_spec_here : Note<
5167  "in evaluation of exception specification for %q0 needed here">;
5168
5169def note_default_arg_instantiation_here : Note<
5170  "in instantiation of default argument for '%0' required here">;
5171def note_default_function_arg_instantiation_here : Note<
5172  "in instantiation of default function argument expression "
5173  "for '%0' required here">;
5174def note_explicit_template_arg_substitution_here : Note<
5175  "while substituting explicitly-specified template arguments into function "
5176  "template %0 %1">;
5177def note_function_template_deduction_instantiation_here : Note<
5178  "while substituting deduced template arguments into function template %0 "
5179  "%1">;
5180def note_deduced_template_arg_substitution_here : Note<
5181  "during template argument deduction for %select{class|variable}0 template "
5182  "%select{partial specialization |}1%2 %3">;
5183def note_prior_template_arg_substitution : Note<
5184  "while substituting prior template arguments into %select{non-type|template}0"
5185  " template parameter%1 %2">;
5186def note_template_default_arg_checking : Note<
5187  "while checking a default template argument used here">;
5188def note_concept_specialization_here : Note<
5189  "while checking the satisfaction of concept '%0' requested here">;
5190def note_nested_requirement_here : Note<
5191  "while checking the satisfaction of nested requirement requested here">;
5192def note_checking_constraints_for_template_id_here : Note<
5193  "while checking constraint satisfaction for template '%0' required here">;
5194def note_checking_constraints_for_var_spec_id_here : Note<
5195  "while checking constraint satisfaction for variable template "
5196  "partial specialization '%0' required here">;
5197def note_checking_constraints_for_class_spec_id_here : Note<
5198  "while checking constraint satisfaction for class template partial "
5199  "specialization '%0' required here">;
5200def note_checking_constraints_for_function_here : Note<
5201  "while checking constraint satisfaction for function '%0' required here">;
5202def note_constraint_substitution_here : Note<
5203  "while substituting template arguments into constraint expression here">;
5204def note_constraint_normalization_here : Note<
5205  "while calculating associated constraint of template '%0' here">;
5206def note_parameter_mapping_substitution_here : Note<
5207  "while substituting into concept arguments here; substitution failures not "
5208  "allowed in concept arguments">;
5209def note_instantiation_contexts_suppressed : Note<
5210  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5211  "see all)">;
5212
5213def err_field_instantiates_to_function : Error<
5214  "data member instantiated with function type %0">;
5215def err_variable_instantiates_to_function : Error<
5216  "%select{variable|static data member}0 instantiated with function type %1">;
5217def err_nested_name_spec_non_tag : Error<
5218  "type %0 cannot be used prior to '::' because it has no members">;
5219
5220def err_using_pack_expansion_empty : Error<
5221  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5222
5223// C++ Explicit Instantiation
5224def err_explicit_instantiation_duplicate : Error<
5225    "duplicate explicit instantiation of %0">;
5226def ext_explicit_instantiation_duplicate : ExtWarn<
5227    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5228    InGroup<MicrosoftTemplate>;
5229def note_previous_explicit_instantiation : Note<
5230    "previous explicit instantiation is here">;
5231def warn_explicit_instantiation_after_specialization : Warning<
5232  "explicit instantiation of %0 that occurs after an explicit "
5233  "specialization has no effect">,
5234  InGroup<DiagGroup<"instantiation-after-specialization">>;
5235def note_previous_template_specialization : Note<
5236    "previous template specialization is here">;
5237def err_explicit_instantiation_nontemplate_type : Error<
5238    "explicit instantiation of non-templated type %0">;
5239def note_nontemplate_decl_here : Note<
5240    "non-templated declaration is here">;
5241def err_explicit_instantiation_in_class : Error<
5242  "explicit instantiation of %0 in class scope">;
5243def err_explicit_instantiation_out_of_scope : Error<
5244  "explicit instantiation of %0 not in a namespace enclosing %1">;
5245def err_explicit_instantiation_must_be_global : Error<
5246  "explicit instantiation of %0 must occur at global scope">;
5247def warn_explicit_instantiation_out_of_scope_0x : Warning<
5248  "explicit instantiation of %0 not in a namespace enclosing %1">,
5249  InGroup<CXX11Compat>, DefaultIgnore;
5250def warn_explicit_instantiation_must_be_global_0x : Warning<
5251  "explicit instantiation of %0 must occur at global scope">,
5252  InGroup<CXX11Compat>, DefaultIgnore;
5253
5254def err_explicit_instantiation_requires_name : Error<
5255  "explicit instantiation declaration requires a name">;
5256def err_explicit_instantiation_of_typedef : Error<
5257  "explicit instantiation of typedef %0">;
5258def err_explicit_instantiation_storage_class : Error<
5259  "explicit instantiation cannot have a storage class">;
5260def err_explicit_instantiation_internal_linkage : Error<
5261  "explicit instantiation declaration of %0 with internal linkage">;
5262def err_explicit_instantiation_not_known : Error<
5263  "explicit instantiation of %0 does not refer to a function template, "
5264  "variable template, member function, member class, or static data member">;
5265def note_explicit_instantiation_here : Note<
5266  "explicit instantiation refers here">;
5267def err_explicit_instantiation_data_member_not_instantiated : Error<
5268  "explicit instantiation refers to static data member %q0 that is not an "
5269  "instantiation">;
5270def err_explicit_instantiation_member_function_not_instantiated : Error<
5271  "explicit instantiation refers to member function %q0 that is not an "
5272  "instantiation">;
5273def err_explicit_instantiation_ambiguous : Error<
5274  "partial ordering for explicit instantiation of %0 is ambiguous">;
5275def note_explicit_instantiation_candidate : Note<
5276  "explicit instantiation candidate function %q0 template here %1">;
5277def err_explicit_instantiation_inline : Error<
5278  "explicit instantiation cannot be 'inline'">;
5279def warn_explicit_instantiation_inline_0x : Warning<
5280  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5281  DefaultIgnore;
5282def err_explicit_instantiation_constexpr : Error<
5283  "explicit instantiation cannot be 'constexpr'">;
5284def ext_explicit_instantiation_without_qualified_id : Extension<
5285  "qualifier in explicit instantiation of %q0 requires a template-id "
5286  "(a typedef is not permitted)">;
5287def err_explicit_instantiation_without_template_id : Error<
5288  "explicit instantiation of %q0 must specify a template argument list">;
5289def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5290  "explicit instantiation of %q0 must occur in namespace %1">;
5291def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5292  "explicit instantiation of %q0 must occur in namespace %1">,
5293  InGroup<CXX11Compat>, DefaultIgnore;
5294def err_explicit_instantiation_undefined_member : Error<
5295  "explicit instantiation of undefined %select{member class|member function|"
5296  "static data member}0 %1 of class template %2">;
5297def err_explicit_instantiation_undefined_func_template : Error<
5298  "explicit instantiation of undefined function template %0">;
5299def err_explicit_instantiation_undefined_var_template : Error<
5300  "explicit instantiation of undefined variable template %q0">;
5301def err_explicit_instantiation_declaration_after_definition : Error<
5302  "explicit instantiation declaration (with 'extern') follows explicit "
5303  "instantiation definition (without 'extern')">;
5304def note_explicit_instantiation_definition_here : Note<
5305  "explicit instantiation definition is here">;
5306def err_invalid_var_template_spec_type : Error<"type %2 "
5307  "of %select{explicit instantiation|explicit specialization|"
5308  "partial specialization|redeclaration}0 of %1 does not match"
5309  " expected type %3">;
5310def err_mismatched_exception_spec_explicit_instantiation : Error<
5311  "exception specification in explicit instantiation does not match "
5312  "instantiated one">;
5313def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5314  err_mismatched_exception_spec_explicit_instantiation.Text>,
5315  InGroup<MicrosoftExceptionSpec>;
5316def err_explicit_instantiation_dependent : Error<
5317  "explicit instantiation has dependent template arguments">;
5318
5319// C++ typename-specifiers
5320def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5321def err_typename_nested_not_found_enable_if : Error<
5322  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5323  "this declaration">;
5324def err_typename_nested_not_found_requirement : Error<
5325  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5326  "declaration">;
5327def err_typename_nested_not_type : Error<
5328    "typename specifier refers to non-type member %0 in %1">;
5329def err_typename_not_type : Error<
5330    "typename specifier refers to non-type %0">;
5331def note_typename_member_refers_here : Note<
5332    "referenced member %0 is declared here">;
5333def note_typename_refers_here : Note<
5334    "referenced %0 is declared here">;
5335def err_typename_missing : Error<
5336  "missing 'typename' prior to dependent type name '%0%1'">;
5337def err_typename_missing_template : Error<
5338  "missing 'typename' prior to dependent type template name '%0%1'">;
5339def ext_typename_missing : ExtWarn<
5340  "missing 'typename' prior to dependent type name '%0%1'">,
5341  InGroup<DiagGroup<"typename-missing">>;
5342def ext_typename_outside_of_template : ExtWarn<
5343  "'typename' occurs outside of a template">, InGroup<CXX11>;
5344def warn_cxx98_compat_typename_outside_of_template : Warning<
5345  "use of 'typename' outside of a template is incompatible with C++98">,
5346  InGroup<CXX98Compat>, DefaultIgnore;
5347def err_typename_refers_to_using_value_decl : Error<
5348  "typename specifier refers to a dependent using declaration for a value "
5349  "%0 in %1">;
5350def note_using_value_decl_missing_typename : Note<
5351  "add 'typename' to treat this using declaration as a type">;
5352
5353def err_template_kw_refers_to_non_template : Error<
5354  "%0%select{| following the 'template' keyword}1 "
5355  "does not refer to a template">;
5356def note_template_kw_refers_to_non_template : Note<
5357  "declared as a non-template here">;
5358def err_template_kw_refers_to_dependent_non_template : Error<
5359  "%0%select{| following the 'template' keyword}1 "
5360  "cannot refer to a dependent template">;
5361def err_template_kw_refers_to_class_template : Error<
5362  "'%0%1' instantiated to a class template, not a function template">;
5363def note_referenced_class_template : Note<
5364  "class template declared here">;
5365def err_template_kw_missing : Error<
5366  "missing 'template' keyword prior to dependent template name '%0%1'">;
5367def ext_template_outside_of_template : ExtWarn<
5368  "'template' keyword outside of a template">, InGroup<CXX11>;
5369def warn_cxx98_compat_template_outside_of_template : Warning<
5370  "use of 'template' keyword outside of a template is incompatible with C++98">,
5371  InGroup<CXX98Compat>, DefaultIgnore;
5372
5373def err_non_type_template_in_nested_name_specifier : Error<
5374  "qualified name refers into a specialization of %select{function|variable}0 "
5375  "template %1">;
5376def err_template_id_not_a_type : Error<
5377  "template name refers to non-type template %0">;
5378def note_template_declared_here : Note<
5379  "%select{function template|class template|variable template"
5380  "|type alias template|template template parameter}0 "
5381  "%1 declared here">;
5382def err_template_expansion_into_fixed_list : Error<
5383  "pack expansion used as argument for non-pack parameter of %select{alias "
5384  "template|concept}0">;
5385def note_parameter_type : Note<
5386  "parameter of type %0 is declared here">;
5387
5388// C++11 Variadic Templates
5389def err_template_param_pack_default_arg : Error<
5390  "template parameter pack cannot have a default argument">;
5391def err_template_param_pack_must_be_last_template_parameter : Error<
5392  "template parameter pack must be the last template parameter">;
5393
5394def err_template_parameter_pack_non_pack : Error<
5395  "%select{template type|non-type template|template template}0 parameter"
5396  "%select{| pack}1 conflicts with previous %select{template type|"
5397  "non-type template|template template}0 parameter%select{ pack|}1">;
5398def note_template_parameter_pack_non_pack : Note<
5399  "%select{template type|non-type template|template template}0 parameter"
5400  "%select{| pack}1 does not match %select{template type|non-type template"
5401  "|template template}0 parameter%select{ pack|}1 in template argument">;
5402def note_template_parameter_pack_here : Note<
5403  "previous %select{template type|non-type template|template template}0 "
5404  "parameter%select{| pack}1 declared here">;
5405
5406def err_unexpanded_parameter_pack : Error<
5407  "%select{expression|base type|declaration type|data member type|bit-field "
5408  "size|static assertion|fixed underlying type|enumerator value|"
5409  "using declaration|friend declaration|qualifier|initializer|default argument|"
5410  "non-type template parameter type|exception type|partial specialization|"
5411  "__if_exists name|__if_not_exists name|lambda|block|type constraint|"
5412  "requirement|requires clause}0 "
5413  "contains%plural{0: an|:}1 unexpanded parameter pack"
5414  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5415
5416def err_pack_expansion_without_parameter_packs : Error<
5417  "pack expansion does not contain any unexpanded parameter packs">;
5418def err_pack_expansion_length_conflict : Error<
5419  "pack expansion contains parameter packs %0 and %1 that have different "
5420  "lengths (%2 vs. %3)">;
5421def err_pack_expansion_length_conflict_multilevel : Error<
5422  "pack expansion contains parameter pack %0 that has a different "
5423  "length (%1 vs. %2) from outer parameter packs">;
5424def err_pack_expansion_length_conflict_partial : Error<
5425  "pack expansion contains parameter pack %0 that has a different "
5426  "length (at least %1 vs. %2) from outer parameter packs">;
5427def err_pack_expansion_member_init : Error<
5428  "pack expansion for initialization of member %0">;
5429
5430def err_function_parameter_pack_without_parameter_packs : Error<
5431  "type %0 of function parameter pack does not contain any unexpanded "
5432  "parameter packs">;
5433def err_ellipsis_in_declarator_not_parameter : Error<
5434  "only function and template parameters can be parameter packs">;
5435
5436def err_sizeof_pack_no_pack_name : Error<
5437  "%0 does not refer to the name of a parameter pack">;
5438
5439def err_fold_expression_packs_both_sides : Error<
5440  "binary fold expression has unexpanded parameter packs in both operands">;
5441def err_fold_expression_empty : Error<
5442  "unary fold expression has empty expansion for operator '%0' "
5443  "with no fallback value">;
5444def err_fold_expression_bad_operand : Error<
5445  "expression not permitted as operand of fold expression">;
5446def err_fold_expression_limit_exceeded: Error<
5447  "instantiating fold expression with %0 arguments exceeded expression nesting "
5448  "limit of %1">, DefaultFatal, NoSFINAE;
5449
5450def err_unexpected_typedef : Error<
5451  "unexpected type name %0: expected expression">;
5452def err_unexpected_namespace : Error<
5453  "unexpected namespace name %0: expected expression">;
5454def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5455def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5456  "use of undeclared identifier %0; "
5457  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5458  InGroup<MicrosoftTemplate>;
5459def err_found_in_dependent_base : Error<
5460  "explicit qualification required to use member %0 from dependent base class">;
5461def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5462  "found via unqualified lookup into dependent bases of class templates is a "
5463  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5464def err_found_later_in_class : Error<"member %0 used before its declaration">;
5465def ext_found_later_in_class : ExtWarn<
5466  "use of member %0 before its declaration is a Microsoft extension">,
5467  InGroup<MicrosoftTemplate>;
5468def note_dependent_member_use : Note<
5469  "must qualify identifier to find this declaration in dependent base class">;
5470def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5471    "visible in the template definition nor found by argument-dependent lookup">;
5472def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5473    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5474def err_undeclared_use : Error<"use of undeclared %0">;
5475def warn_deprecated : Warning<"%0 is deprecated">,
5476    InGroup<DeprecatedDeclarations>;
5477def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5478def warn_property_method_deprecated :
5479    Warning<"property access is using %0 method which is deprecated">,
5480    InGroup<DeprecatedDeclarations>;
5481def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5482    InGroup<DeprecatedDeclarations>;
5483def warn_deprecated_anonymous_namespace : Warning<
5484  "'deprecated' attribute on anonymous namespace ignored">,
5485  InGroup<IgnoredAttributes>;
5486def warn_deprecated_fwdclass_message : Warning<
5487    "%0 may be deprecated because the receiver type is unknown">,
5488    InGroup<DeprecatedDeclarations>;
5489def warn_deprecated_def : Warning<
5490  "implementing deprecated %select{method|class|category}0">,
5491  InGroup<DeprecatedImplementations>, DefaultIgnore;
5492def warn_unavailable_def : Warning<
5493  "implementing unavailable method">,
5494  InGroup<DeprecatedImplementations>, DefaultIgnore;
5495def err_unavailable : Error<"%0 is unavailable">;
5496def err_property_method_unavailable :
5497    Error<"property access is using %0 method which is unavailable">;
5498def err_unavailable_message : Error<"%0 is unavailable: %1">;
5499def warn_unavailable_fwdclass_message : Warning<
5500    "%0 may be unavailable because the receiver type is unknown">,
5501    InGroup<UnavailableDeclarations>;
5502def note_availability_specified_here : Note<
5503  "%0 has been explicitly marked "
5504  "%select{unavailable|deleted|deprecated}1 here">;
5505def note_partial_availability_specified_here : Note<
5506  "%0 has been marked as being introduced in %1 %2 here, "
5507  "but the deployment target is %1 %3">;
5508def note_implicitly_deleted : Note<
5509  "explicitly defaulted function was implicitly deleted here">;
5510def warn_not_enough_argument : Warning<
5511  "not enough variable arguments in %0 declaration to fit a sentinel">,
5512  InGroup<Sentinel>;
5513def warn_missing_sentinel : Warning <
5514  "missing sentinel in %select{function call|method dispatch|block call}0">,
5515  InGroup<Sentinel>;
5516def note_sentinel_here : Note<
5517  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5518def warn_missing_prototype : Warning<
5519  "no previous prototype for function %0">,
5520  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5521def note_declaration_not_a_prototype : Note<
5522  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5523  "to make it %select{a prototype for a zero-parameter function|one}0">;
5524def warn_strict_prototypes : Warning<
5525  "this %select{function declaration is not|block declaration is not|"
5526  "old-style function definition is not preceded by}0 a prototype">,
5527  InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
5528def warn_missing_variable_declarations : Warning<
5529  "no previous extern declaration for non-static variable %0">,
5530  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5531def note_static_for_internal_linkage : Note<
5532  "declare 'static' if the %select{variable|function}0 is not intended to be "
5533  "used outside of this translation unit">;
5534def err_static_data_member_reinitialization :
5535  Error<"static data member %0 already has an initializer">;
5536def err_redefinition : Error<"redefinition of %0">;
5537def err_alias_after_tentative :
5538  Error<"alias definition of %0 after tentative definition">;
5539def err_alias_is_definition :
5540  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5541def err_definition_of_implicitly_declared_member : Error<
5542  "definition of implicitly declared %select{default constructor|copy "
5543  "constructor|move constructor|copy assignment operator|move assignment "
5544  "operator|destructor|function}1">;
5545def err_definition_of_explicitly_defaulted_member : Error<
5546  "definition of explicitly defaulted %select{default constructor|copy "
5547  "constructor|move constructor|copy assignment operator|move assignment "
5548  "operator|destructor|function}0">;
5549def err_redefinition_extern_inline : Error<
5550  "redefinition of a 'extern inline' function %0 is not supported in "
5551  "%select{C99 mode|C++}1">;
5552def warn_attr_abi_tag_namespace : Warning<
5553  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5554  InGroup<IgnoredAttributes>;
5555def err_abi_tag_on_redeclaration : Error<
5556  "cannot add 'abi_tag' attribute in a redeclaration">;
5557def err_new_abi_tag_on_redeclaration : Error<
5558  "'abi_tag' %0 missing in original declaration">;
5559def note_use_ifdef_guards : Note<
5560  "unguarded header; consider using #ifdef guards or #pragma once">;
5561
5562def note_deleted_dtor_no_operator_delete : Note<
5563  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5564def note_deleted_special_member_class_subobject : Note<
5565  "%select{default constructor of|copy constructor of|move constructor of|"
5566  "copy assignment operator of|move assignment operator of|destructor of|"
5567  "constructor inherited by}0 "
5568  "%1 is implicitly deleted because "
5569  "%select{base class %3|%select{||||variant }4field %3}2 "
5570  "%select{has "
5571  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
5572  "%select{%select{default constructor|copy constructor|move constructor|copy "
5573  "assignment operator|move assignment operator|destructor|"
5574  "%select{default|corresponding|default|default|default}4 constructor}0|"
5575  "destructor}5"
5576  "%select{||s||}4"
5577  "|is an ObjC pointer}6">;
5578def note_deleted_default_ctor_uninit_field : Note<
5579  "%select{default constructor of|constructor inherited by}0 "
5580  "%1 is implicitly deleted because field %2 of "
5581  "%select{reference|const-qualified}4 type %3 would not be initialized">;
5582def note_deleted_default_ctor_all_const : Note<
5583  "%select{default constructor of|constructor inherited by}0 "
5584  "%1 is implicitly deleted because all "
5585  "%select{data members|data members of an anonymous union member}2"
5586  " are const-qualified">;
5587def note_deleted_copy_ctor_rvalue_reference : Note<
5588  "copy constructor of %0 is implicitly deleted because field %1 is of "
5589  "rvalue reference type %2">;
5590def note_deleted_copy_user_declared_move : Note<
5591  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
5592  " %1 has a user-declared move %select{constructor|assignment operator}2">;
5593def note_deleted_assign_field : Note<
5594  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
5595  "because field %2 is of %select{reference|const-qualified}4 type %3">;
5596
5597// These should be errors.
5598def warn_undefined_internal : Warning<
5599  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
5600  InGroup<DiagGroup<"undefined-internal">>;
5601def err_undefined_internal_type : Error<
5602  "%select{function|variable}0 %q1 is used but not defined in this "
5603  "translation unit, and cannot be defined in any other translation unit "
5604  "because its type does not have linkage">;
5605def ext_undefined_internal_type : Extension<
5606  "ISO C++ requires a definition in this translation unit for "
5607  "%select{function|variable}0 %q1 because its type does not have linkage">,
5608  InGroup<DiagGroup<"undefined-internal-type">>;
5609def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
5610  InGroup<DiagGroup<"undefined-inline">>;
5611def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
5612def note_used_here : Note<"used here">;
5613
5614def err_attribute_missing_on_first_decl : Error<
5615  "%0 attribute does not appear on the first declaration">;
5616def warn_internal_linkage_local_storage : Warning<
5617  "'internal_linkage' attribute on a non-static local variable is ignored">,
5618  InGroup<IgnoredAttributes>;
5619
5620def ext_internal_in_extern_inline : ExtWarn<
5621  "static %select{function|variable}0 %1 is used in an inline function with "
5622  "external linkage">, InGroup<StaticInInline>;
5623def ext_internal_in_extern_inline_quiet : Extension<
5624  "static %select{function|variable}0 %1 is used in an inline function with "
5625  "external linkage">, InGroup<StaticInInline>;
5626def warn_static_local_in_extern_inline : Warning<
5627  "non-constant static local variable in inline function may be different "
5628  "in different files">, InGroup<StaticLocalInInline>;
5629def note_convert_inline_to_static : Note<
5630  "use 'static' to give inline function %0 internal linkage">;
5631
5632def ext_redefinition_of_typedef : ExtWarn<
5633  "redefinition of typedef %0 is a C11 feature">,
5634  InGroup<DiagGroup<"typedef-redefinition"> >;
5635def err_redefinition_variably_modified_typedef : Error<
5636  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
5637
5638def err_inline_decl_follows_def : Error<
5639  "inline declaration of %0 follows non-inline definition">;
5640def err_inline_declaration_block_scope : Error<
5641  "inline declaration of %0 not allowed in block scope">;
5642def err_static_non_static : Error<
5643  "static declaration of %0 follows non-static declaration">;
5644def err_different_language_linkage : Error<
5645  "declaration of %0 has a different language linkage">;
5646def ext_retained_language_linkage : Extension<
5647  "friend function %0 retaining previous language linkage is an extension">,
5648  InGroup<DiagGroup<"retained-language-linkage">>;
5649def err_extern_c_global_conflict : Error<
5650  "declaration of %1 %select{with C language linkage|in global scope}0 "
5651  "conflicts with declaration %select{in global scope|with C language linkage}0">;
5652def note_extern_c_global_conflict : Note<
5653  "declared %select{in global scope|with C language linkage}0 here">;
5654def note_extern_c_begins_here : Note<
5655  "extern \"C\" language linkage specification begins here">;
5656def warn_weak_import : Warning <
5657  "an already-declared variable is made a weak_import declaration %0">;
5658def ext_static_non_static : Extension<
5659  "redeclaring non-static %0 as static is a Microsoft extension">,
5660  InGroup<MicrosoftRedeclareStatic>;
5661def err_non_static_static : Error<
5662  "non-static declaration of %0 follows static declaration">;
5663def err_extern_non_extern : Error<
5664  "extern declaration of %0 follows non-extern declaration">;
5665def err_non_extern_extern : Error<
5666  "non-extern declaration of %0 follows extern declaration">;
5667def err_non_thread_thread : Error<
5668  "non-thread-local declaration of %0 follows thread-local declaration">;
5669def err_thread_non_thread : Error<
5670  "thread-local declaration of %0 follows non-thread-local declaration">;
5671def err_thread_thread_different_kind : Error<
5672  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
5673  "follows declaration with %select{dynamic|static}1 initialization">;
5674def err_mismatched_owning_module : Error<
5675  "declaration of %0 in %select{the global module|module %2}1 follows "
5676  "declaration in %select{the global module|module %4}3">;
5677def err_redefinition_different_type : Error<
5678  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
5679def err_redefinition_different_kind : Error<
5680  "redefinition of %0 as different kind of symbol">;
5681def err_redefinition_different_namespace_alias : Error<
5682  "redefinition of %0 as an alias for a different namespace">;
5683def note_previous_namespace_alias : Note<
5684  "previously defined as an alias for %0">;
5685def warn_forward_class_redefinition : Warning<
5686  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
5687  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
5688def err_redefinition_different_typedef : Error<
5689  "%select{typedef|type alias|type alias template}0 "
5690  "redefinition with different types%diff{ ($ vs $)|}1,2">;
5691def err_tag_reference_non_tag : Error<
5692  "%select{non-struct type|non-class type|non-union type|non-enum "
5693  "type|typedef|type alias|template|type alias template|template "
5694  "template argument}1 %0 cannot be referenced with a "
5695  "%select{struct|interface|union|class|enum}2 specifier">;
5696def err_tag_reference_conflict : Error<
5697  "implicit declaration introduced by elaborated type conflicts with a "
5698  "%select{non-struct type|non-class type|non-union type|non-enum "
5699  "type|typedef|type alias|template|type alias template|template "
5700  "template argument}0 of the same name">;
5701def err_dependent_tag_decl : Error<
5702  "%select{declaration|definition}0 of "
5703  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
5704def err_tag_definition_of_typedef : Error<
5705  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
5706def err_conflicting_types : Error<"conflicting types for %0">;
5707def err_different_pass_object_size_params : Error<
5708  "conflicting pass_object_size attributes on parameters">;
5709def err_late_asm_label_name : Error<
5710  "cannot apply asm label to %select{variable|function}0 after its first use">;
5711def err_different_asm_label : Error<"conflicting asm label">;
5712def err_nested_redefinition : Error<"nested redefinition of %0">;
5713def err_use_with_wrong_tag : Error<
5714  "use of %0 with tag type that does not match previous declaration">;
5715def warn_struct_class_tag_mismatch : Warning<
5716  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
5717  "declared as a %select{struct|interface|class}3%select{| template}1; "
5718  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5719  InGroup<MismatchedTags>, DefaultIgnore;
5720def warn_struct_class_previous_tag_mismatch : Warning<
5721  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
5722  "here but previously declared as "
5723  "%select{a struct|an interface|a class}3%select{| template}1; "
5724  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5725  InGroup<MismatchedTags>, DefaultIgnore;
5726def note_struct_class_suggestion : Note<
5727  "did you mean %select{struct|interface|class}0 here?">;
5728def ext_forward_ref_enum : Extension<
5729  "ISO C forbids forward references to 'enum' types">;
5730def err_forward_ref_enum : Error<
5731  "ISO C++ forbids forward references to 'enum' types">;
5732def ext_ms_forward_ref_enum : ExtWarn<
5733  "forward references to 'enum' types are a Microsoft extension">,
5734  InGroup<MicrosoftEnumForwardReference>;
5735def ext_forward_ref_enum_def : Extension<
5736  "redeclaration of already-defined enum %0 is a GNU extension">,
5737  InGroup<GNURedeclaredEnum>;
5738
5739def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
5740def err_duplicate_member : Error<"duplicate member %0">;
5741def err_misplaced_ivar : Error<
5742  "instance variables may not be placed in %select{categories|class extension}0">;
5743def warn_ivars_in_interface : Warning<
5744  "declaration of instance variables in the interface is deprecated">,
5745  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
5746def ext_enum_value_not_int : Extension<
5747  "ISO C restricts enumerator values to range of 'int' (%0 is too "
5748  "%select{small|large}1)">;
5749def ext_enum_too_large : ExtWarn<
5750  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
5751def ext_enumerator_increment_too_large : ExtWarn<
5752  "incremented enumerator value %0 is not representable in the "
5753  "largest integer type">, InGroup<EnumTooLarge>;
5754def warn_flag_enum_constant_out_of_range : Warning<
5755  "enumeration value %0 is out of range of flags in enumeration type %1">,
5756  InGroup<FlagEnum>;
5757
5758def err_vm_decl_in_file_scope : Error<
5759  "variably modified type declaration not allowed at file scope">;
5760def err_vm_decl_has_extern_linkage : Error<
5761  "variably modified type declaration cannot have 'extern' linkage">;
5762def err_typecheck_field_variable_size : Error<
5763  "fields must have a constant size: 'variable length array in structure' "
5764  "extension will never be supported">;
5765def err_vm_func_decl : Error<
5766  "function declaration cannot have variably modified type">;
5767def err_array_too_large : Error<
5768  "array is too large (%0 elements)">;
5769
5770def err_typecheck_negative_array_size : Error<"array size is negative">;
5771def warn_typecheck_function_qualifiers_ignored : Warning<
5772  "'%0' qualifier on function type %1 has no effect">,
5773  InGroup<IgnoredQualifiers>;
5774def warn_typecheck_function_qualifiers_unspecified : Warning<
5775  "'%0' qualifier on function type %1 has unspecified behavior">;
5776def warn_typecheck_reference_qualifiers : Warning<
5777  "'%0' qualifier on reference type %1 has no effect">,
5778  InGroup<IgnoredReferenceQualifiers>;
5779def err_typecheck_invalid_restrict_not_pointer : Error<
5780  "restrict requires a pointer or reference (%0 is invalid)">;
5781def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
5782  "restrict requires a pointer or reference">;
5783def err_typecheck_invalid_restrict_invalid_pointee : Error<
5784  "pointer to function type %0 may not be 'restrict' qualified">;
5785def ext_typecheck_zero_array_size : Extension<
5786  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
5787def err_typecheck_zero_array_size : Error<
5788  "zero-length arrays are not permitted in C++">;
5789def err_array_size_non_int : Error<"size of array has non-integer type %0">;
5790def err_init_element_not_constant : Error<
5791  "initializer element is not a compile-time constant">;
5792def ext_aggregate_init_not_constant : Extension<
5793  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
5794def err_local_cant_init : Error<
5795  "'__local' variable cannot have an initializer">;
5796def err_loader_uninitialized_cant_init
5797    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
5798            "initializer">;
5799def err_loader_uninitialized_trivial_ctor
5800    : Error<"variable with 'loader_uninitialized' attribute must have a "
5801            "trivial default constructor">;
5802def err_loader_uninitialized_redeclaration
5803    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
5804def err_loader_uninitialized_extern_decl
5805    : Error<"variable %0 cannot be declared both 'extern' and with the "
5806            "'loader_uninitialized' attribute">;
5807def err_block_extern_cant_init : Error<
5808  "'extern' variable cannot have an initializer">;
5809def warn_extern_init : Warning<"'extern' variable has an initializer">,
5810  InGroup<DiagGroup<"extern-initializer">>;
5811def err_variable_object_no_init : Error<
5812  "variable-sized object may not be initialized">;
5813def err_excess_initializers : Error<
5814  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
5815def ext_excess_initializers : ExtWarn<
5816  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
5817  InGroup<ExcessInitializers>;
5818def err_excess_initializers_for_sizeless_type : Error<
5819  "excess elements in initializer for indivisible sizeless type %0">;
5820def ext_excess_initializers_for_sizeless_type : ExtWarn<
5821  "excess elements in initializer for indivisible sizeless type %0">,
5822  InGroup<ExcessInitializers>;
5823def err_excess_initializers_in_char_array_initializer : Error<
5824  "excess elements in char array initializer">;
5825def ext_excess_initializers_in_char_array_initializer : ExtWarn<
5826  "excess elements in char array initializer">,
5827  InGroup<ExcessInitializers>;
5828def err_initializer_string_for_char_array_too_long : Error<
5829  "initializer-string for char array is too long">;
5830def ext_initializer_string_for_char_array_too_long : ExtWarn<
5831  "initializer-string for char array is too long">,
5832  InGroup<ExcessInitializers>;
5833def warn_missing_field_initializers : Warning<
5834  "missing field %0 initializer">,
5835  InGroup<MissingFieldInitializers>, DefaultIgnore;
5836def warn_braces_around_init : Warning<
5837  "braces around %select{scalar |}0initializer">,
5838  InGroup<DiagGroup<"braced-scalar-init">>;
5839def ext_many_braces_around_init : ExtWarn<
5840  "too many braces around %select{scalar |}0initializer">,
5841  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5842def ext_complex_component_init : Extension<
5843  "complex initialization specifying real and imaginary components "
5844  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5845def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5846def err_empty_sizeless_initializer : Error<
5847  "initializer for sizeless type %0 cannot be empty">;
5848def warn_cxx98_compat_empty_scalar_initializer : Warning<
5849  "scalar initialized from empty initializer list is incompatible with C++98">,
5850  InGroup<CXX98Compat>, DefaultIgnore;
5851def warn_cxx98_compat_empty_sizeless_initializer : Warning<
5852  "initializing %0 from an empty initializer list is incompatible with C++98">,
5853  InGroup<CXX98Compat>, DefaultIgnore;
5854def warn_cxx98_compat_reference_list_init : Warning<
5855  "reference initialized from initializer list is incompatible with C++98">,
5856  InGroup<CXX98Compat>, DefaultIgnore;
5857def warn_cxx98_compat_initializer_list_init : Warning<
5858  "initialization of initializer_list object is incompatible with C++98">,
5859  InGroup<CXX98Compat>, DefaultIgnore;
5860def warn_cxx98_compat_ctor_list_init : Warning<
5861  "constructor call from initializer list is incompatible with C++98">,
5862  InGroup<CXX98Compat>, DefaultIgnore;
5863def err_illegal_initializer : Error<
5864  "illegal initializer (only variables can be initialized)">;
5865def err_illegal_initializer_type : Error<"illegal initializer type %0">;
5866def ext_init_list_type_narrowing : ExtWarn<
5867  "type %0 cannot be narrowed to %1 in initializer list">,
5868  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5869def ext_init_list_variable_narrowing : ExtWarn<
5870  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5871  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5872def ext_init_list_constant_narrowing : ExtWarn<
5873  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
5874  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5875def warn_init_list_type_narrowing : Warning<
5876  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
5877  InGroup<CXX11Narrowing>, DefaultIgnore;
5878def warn_init_list_variable_narrowing : Warning<
5879  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5880  "initializer list in C++11">,
5881  InGroup<CXX11Narrowing>, DefaultIgnore;
5882def warn_init_list_constant_narrowing : Warning<
5883  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
5884  "C++11">,
5885  InGroup<CXX11Narrowing>, DefaultIgnore;
5886def note_init_list_narrowing_silence : Note<
5887  "insert an explicit cast to silence this issue">;
5888def err_init_objc_class : Error<
5889  "cannot initialize Objective-C class type %0">;
5890def err_implicit_empty_initializer : Error<
5891  "initializer for aggregate with no elements requires explicit braces">;
5892def err_bitfield_has_negative_width : Error<
5893  "bit-field %0 has negative width (%1)">;
5894def err_anon_bitfield_has_negative_width : Error<
5895  "anonymous bit-field has negative width (%0)">;
5896def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
5897def err_bitfield_width_exceeds_type_width : Error<
5898  "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the "
5899  "%select{width|size}3 of its type (%4 bit%s4)">;
5900def err_incorrect_number_of_vector_initializers : Error<
5901  "number of elements must be either one or match the size of the vector">;
5902
5903// Used by C++ which allows bit-fields that are wider than the type.
5904def warn_bitfield_width_exceeds_type_width: Warning<
5905  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
5906  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
5907def err_bitfield_too_wide : Error<
5908  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
5909def warn_bitfield_too_small_for_enum : Warning<
5910  "bit-field %0 is not wide enough to store all enumerators of %1">,
5911  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5912def note_widen_bitfield : Note<
5913  "widen this field to %0 bits to store all values of %1">;
5914def warn_unsigned_bitfield_assigned_signed_enum : Warning<
5915  "assigning value of signed enum type %1 to unsigned bit-field %0; "
5916  "negative enumerators of enum %1 will be converted to positive values">,
5917  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5918def warn_signed_bitfield_enum_conversion : Warning<
5919  "signed bit-field %0 needs an extra bit to represent the largest positive "
5920  "enumerators of %1">,
5921  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5922def note_change_bitfield_sign : Note<
5923  "consider making the bitfield type %select{unsigned|signed}0">;
5924
5925def warn_missing_braces : Warning<
5926  "suggest braces around initialization of subobject">,
5927  InGroup<MissingBraces>, DefaultIgnore;
5928
5929def err_redefinition_of_label : Error<"redefinition of label %0">;
5930def err_undeclared_label_use : Error<"use of undeclared label %0">;
5931def err_goto_ms_asm_label : Error<
5932  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5933def note_goto_ms_asm_label : Note<
5934  "inline assembly label %0 declared here">;
5935def warn_unused_label : Warning<"unused label %0">,
5936  InGroup<UnusedLabel>, DefaultIgnore;
5937
5938def err_continue_from_cond_var_init : Error<
5939  "cannot jump from this continue statement to the loop increment; "
5940  "jump bypasses initialization of loop condition variable">;
5941def err_goto_into_protected_scope : Error<
5942  "cannot jump from this goto statement to its label">;
5943def ext_goto_into_protected_scope : ExtWarn<
5944  "jump from this goto statement to its label is a Microsoft extension">,
5945  InGroup<MicrosoftGoto>;
5946def warn_cxx98_compat_goto_into_protected_scope : Warning<
5947  "jump from this goto statement to its label is incompatible with C++98">,
5948  InGroup<CXX98Compat>, DefaultIgnore;
5949def err_switch_into_protected_scope : Error<
5950  "cannot jump from switch statement to this case label">;
5951def warn_cxx98_compat_switch_into_protected_scope : Warning<
5952  "jump from switch statement to this case label is incompatible with C++98">,
5953  InGroup<CXX98Compat>, DefaultIgnore;
5954def err_indirect_goto_without_addrlabel : Error<
5955  "indirect goto in function with no address-of-label expressions">;
5956def err_indirect_goto_in_protected_scope : Error<
5957  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
5958def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5959  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
5960  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5961def note_indirect_goto_target : Note<
5962  "possible target of %select{indirect|asm}0 goto statement">;
5963def note_protected_by_variable_init : Note<
5964  "jump bypasses variable initialization">;
5965def note_protected_by_variable_nontriv_destructor : Note<
5966  "jump bypasses variable with a non-trivial destructor">;
5967def note_protected_by_variable_non_pod : Note<
5968  "jump bypasses initialization of non-POD variable">;
5969def note_protected_by_cleanup : Note<
5970  "jump bypasses initialization of variable with __attribute__((cleanup))">;
5971def note_protected_by_vla_typedef : Note<
5972  "jump bypasses initialization of VLA typedef">;
5973def note_protected_by_vla_type_alias : Note<
5974  "jump bypasses initialization of VLA type alias">;
5975def note_protected_by_constexpr_if : Note<
5976  "jump enters controlled statement of constexpr if">;
5977def note_protected_by_consteval_if : Note<
5978  "jump enters controlled statement of consteval if">;
5979def note_protected_by_if_available : Note<
5980  "jump enters controlled statement of if available">;
5981def note_protected_by_vla : Note<
5982  "jump bypasses initialization of variable length array">;
5983def note_protected_by_objc_fast_enumeration : Note<
5984  "jump enters Objective-C fast enumeration loop">;
5985def note_protected_by_objc_try : Note<
5986  "jump bypasses initialization of @try block">;
5987def note_protected_by_objc_catch : Note<
5988  "jump bypasses initialization of @catch block">;
5989def note_protected_by_objc_finally : Note<
5990  "jump bypasses initialization of @finally block">;
5991def note_protected_by_objc_synchronized : Note<
5992  "jump bypasses initialization of @synchronized block">;
5993def note_protected_by_objc_autoreleasepool : Note<
5994  "jump bypasses auto release push of @autoreleasepool block">;
5995def note_protected_by_cxx_try : Note<
5996  "jump bypasses initialization of try block">;
5997def note_protected_by_cxx_catch : Note<
5998  "jump bypasses initialization of catch block">;
5999def note_protected_by_seh_try : Note<
6000  "jump bypasses initialization of __try block">;
6001def note_protected_by_seh_except : Note<
6002  "jump bypasses initialization of __except block">;
6003def note_protected_by_seh_finally : Note<
6004  "jump bypasses initialization of __finally block">;
6005def note_protected_by___block : Note<
6006  "jump bypasses setup of __block variable">;
6007def note_protected_by_objc_strong_init : Note<
6008  "jump bypasses initialization of __strong variable">;
6009def note_protected_by_objc_weak_init : Note<
6010  "jump bypasses initialization of __weak variable">;
6011def note_protected_by_non_trivial_c_struct_init : Note<
6012  "jump bypasses initialization of variable of non-trivial C struct type">;
6013def note_enters_block_captures_cxx_obj : Note<
6014  "jump enters lifetime of block which captures a destructible C++ object">;
6015def note_enters_block_captures_strong : Note<
6016  "jump enters lifetime of block which strongly captures a variable">;
6017def note_enters_block_captures_weak : Note<
6018  "jump enters lifetime of block which weakly captures a variable">;
6019def note_enters_block_captures_non_trivial_c_struct : Note<
6020  "jump enters lifetime of block which captures a C struct that is non-trivial "
6021  "to destroy">;
6022def note_enters_compound_literal_scope : Note<
6023  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
6024
6025def note_exits_cleanup : Note<
6026  "jump exits scope of variable with __attribute__((cleanup))">;
6027def note_exits_dtor : Note<
6028  "jump exits scope of variable with non-trivial destructor">;
6029def note_exits_temporary_dtor : Note<
6030  "jump exits scope of lifetime-extended temporary with non-trivial "
6031  "destructor">;
6032def note_exits___block : Note<
6033  "jump exits scope of __block variable">;
6034def note_exits_objc_try : Note<
6035  "jump exits @try block">;
6036def note_exits_objc_catch : Note<
6037  "jump exits @catch block">;
6038def note_exits_objc_finally : Note<
6039  "jump exits @finally block">;
6040def note_exits_objc_synchronized : Note<
6041  "jump exits @synchronized block">;
6042def note_exits_cxx_try : Note<
6043  "jump exits try block">;
6044def note_exits_cxx_catch : Note<
6045  "jump exits catch block">;
6046def note_exits_seh_try : Note<
6047  "jump exits __try block">;
6048def note_exits_seh_except : Note<
6049  "jump exits __except block">;
6050def note_exits_seh_finally : Note<
6051  "jump exits __finally block">;
6052def note_exits_objc_autoreleasepool : Note<
6053  "jump exits autoreleasepool block">;
6054def note_exits_objc_strong : Note<
6055  "jump exits scope of __strong variable">;
6056def note_exits_objc_weak : Note<
6057  "jump exits scope of __weak variable">;
6058def note_exits_block_captures_cxx_obj : Note<
6059  "jump exits lifetime of block which captures a destructible C++ object">;
6060def note_exits_block_captures_strong : Note<
6061  "jump exits lifetime of block which strongly captures a variable">;
6062def note_exits_block_captures_weak : Note<
6063  "jump exits lifetime of block which weakly captures a variable">;
6064def note_exits_block_captures_non_trivial_c_struct : Note<
6065  "jump exits lifetime of block which captures a C struct that is non-trivial "
6066  "to destroy">;
6067def note_exits_compound_literal_scope : Note<
6068  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
6069
6070def err_func_returning_qualified_void : ExtWarn<
6071  "function cannot return qualified void type %0">,
6072  InGroup<DiagGroup<"qualified-void-return-type">>;
6073def err_func_returning_array_function : Error<
6074  "function cannot return %select{array|function}0 type %1">;
6075def err_field_declared_as_function : Error<"field %0 declared as a function">;
6076def err_field_incomplete_or_sizeless : Error<
6077  "field has %select{incomplete|sizeless}0 type %1">;
6078def ext_variable_sized_type_in_struct : ExtWarn<
6079  "field %0 with variable sized type %1 not at the end of a struct or class is"
6080  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
6081
6082def ext_c99_flexible_array_member : Extension<
6083  "flexible array members are a C99 feature">, InGroup<C99>;
6084def err_flexible_array_virtual_base : Error<
6085  "flexible array member %0 not allowed in "
6086  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
6087def err_flexible_array_empty_aggregate : Error<
6088  "flexible array member %0 not allowed in otherwise empty "
6089  "%select{struct|interface|union|class|enum}1">;
6090def err_flexible_array_has_nontrivial_dtor : Error<
6091  "flexible array member %0 of type %1 with non-trivial destruction">;
6092def ext_flexible_array_in_struct : Extension<
6093  "%0 may not be nested in a struct due to flexible array member">,
6094  InGroup<FlexibleArrayExtensions>;
6095def ext_flexible_array_in_array : Extension<
6096  "%0 may not be used as an array element due to flexible array member">,
6097  InGroup<FlexibleArrayExtensions>;
6098def err_flexible_array_init : Error<
6099  "initialization of flexible array member is not allowed">;
6100def ext_flexible_array_empty_aggregate_ms : Extension<
6101  "flexible array member %0 in otherwise empty "
6102  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
6103  InGroup<MicrosoftFlexibleArray>;
6104def err_flexible_array_union : Error<
6105  "flexible array member %0 in a union is not allowed">;
6106def ext_flexible_array_union_ms : Extension<
6107  "flexible array member %0 in a union is a Microsoft extension">,
6108  InGroup<MicrosoftFlexibleArray>;
6109def ext_flexible_array_empty_aggregate_gnu : Extension<
6110  "flexible array member %0 in otherwise empty "
6111  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
6112  InGroup<GNUEmptyStruct>;
6113def ext_flexible_array_union_gnu : Extension<
6114  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
6115
6116def err_flexible_array_not_at_end : Error<
6117  "flexible array member %0 with type %1 is not at the end of"
6118  " %select{struct|interface|union|class|enum}2">;
6119def err_objc_variable_sized_type_not_at_end : Error<
6120  "field %0 with variable sized type %1 is not at the end of class">;
6121def note_next_field_declaration : Note<
6122  "next field declaration is here">;
6123def note_next_ivar_declaration : Note<
6124  "next %select{instance variable declaration|synthesized instance variable}0"
6125  " is here">;
6126def err_synthesize_variable_sized_ivar : Error<
6127  "synthesized property with variable size type %0"
6128  " requires an existing instance variable">;
6129def err_flexible_array_arc_retainable : Error<
6130  "ARC forbids flexible array members with retainable object type">;
6131def warn_variable_sized_ivar_visibility : Warning<
6132  "field %0 with variable sized type %1 is not visible to subclasses and"
6133  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
6134def warn_superclass_variable_sized_type_not_at_end : Warning<
6135  "field %0 can overwrite instance variable %1 with variable sized type %2"
6136  " in superclass %3">, InGroup<ObjCFlexibleArray>;
6137
6138let CategoryName = "ARC Semantic Issue" in {
6139
6140// ARC-mode diagnostics.
6141
6142let CategoryName = "ARC Weak References" in {
6143
6144def err_arc_weak_no_runtime : Error<
6145  "cannot create __weak reference because the current deployment target "
6146  "does not support weak references">;
6147def err_arc_weak_disabled : Error<
6148  "cannot create __weak reference in file using manual reference counting">;
6149def err_synthesizing_arc_weak_property_disabled : Error<
6150  "cannot synthesize weak property in file using manual reference counting">;
6151def err_synthesizing_arc_weak_property_no_runtime : Error<
6152  "cannot synthesize weak property because the current deployment target "
6153  "does not support weak references">;
6154def err_arc_unsupported_weak_class : Error<
6155  "class is incompatible with __weak references">;
6156def err_arc_weak_unavailable_assign : Error<
6157  "assignment of a weak-unavailable object to a __weak object">;
6158def err_arc_weak_unavailable_property : Error<
6159  "synthesizing __weak instance variable of type %0, which does not "
6160  "support weak references">;
6161def note_implemented_by_class : Note<
6162  "when implemented by class %0">;
6163def err_arc_convesion_of_weak_unavailable : Error<
6164  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
6165  " a __weak object of type %2">;
6166
6167} // end "ARC Weak References" category
6168
6169let CategoryName = "ARC Restrictions" in {
6170
6171def err_unavailable_in_arc : Error<
6172  "%0 is unavailable in ARC">;
6173def note_arc_forbidden_type : Note<
6174  "declaration uses type that is ill-formed in ARC">;
6175def note_performs_forbidden_arc_conversion : Note<
6176  "inline function performs a conversion which is forbidden in ARC">;
6177def note_arc_init_returns_unrelated : Note<
6178  "init method must return a type related to its receiver type">;
6179def note_arc_weak_disabled : Note<
6180  "declaration uses __weak, but ARC is disabled">;
6181def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
6182  "the current deployment target does not support">;
6183def note_arc_field_with_ownership : Note<
6184  "field has non-trivial ownership qualification">;
6185
6186def err_arc_illegal_explicit_message : Error<
6187  "ARC forbids explicit message send of %0">;
6188def err_arc_unused_init_message : Error<
6189  "the result of a delegate init call must be immediately returned "
6190  "or assigned to 'self'">;
6191def err_arc_mismatched_cast : Error<
6192  "%select{implicit conversion|cast}0 of "
6193  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6194  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6195  " to %3 is disallowed with ARC">;
6196def err_arc_nolifetime_behavior : Error<
6197  "explicit ownership qualifier on cast result has no effect">;
6198def err_arc_objc_property_default_assign_on_object : Error<
6199  "ARC forbids synthesizing a property of an Objective-C object "
6200  "with unspecified ownership or storage attribute">;
6201def err_arc_illegal_selector : Error<
6202  "ARC forbids use of %0 in a @selector">;
6203def err_arc_illegal_method_def : Error<
6204  "ARC forbids %select{implementation|synthesis}0 of %1">;
6205def warn_arc_strong_pointer_objc_pointer : Warning<
6206  "method parameter of type %0 with no explicit ownership">,
6207  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6208
6209} // end "ARC Restrictions" category
6210
6211def err_arc_lost_method_convention : Error<
6212  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6213  "method, but its implementation doesn't match because %select{"
6214  "its result type is not an object pointer|"
6215  "its result type is unrelated to its receiver type}1">;
6216def note_arc_lost_method_convention : Note<"declaration in interface">;
6217def err_arc_gained_method_convention : Error<
6218  "method implementation does not match its declaration">;
6219def note_arc_gained_method_convention : Note<
6220  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6221  "family because %select{its result type is not an object pointer|"
6222  "its result type is unrelated to its receiver type}1">;
6223def err_typecheck_arc_assign_self : Error<
6224  "cannot assign to 'self' outside of a method in the init family">;
6225def err_typecheck_arc_assign_self_class_method : Error<
6226  "cannot assign to 'self' in a class method">;
6227def err_typecheck_arr_assign_enumeration : Error<
6228  "fast enumeration variables cannot be modified in ARC by default; "
6229  "declare the variable __strong to allow this">;
6230def err_typecheck_arc_assign_externally_retained : Error<
6231  "variable declared with 'objc_externally_retained' "
6232  "cannot be modified in ARC">;
6233def warn_arc_retained_assign : Warning<
6234  "assigning retained object to %select{weak|unsafe_unretained}0 "
6235  "%select{property|variable}1"
6236  "; object will be released after assignment">,
6237  InGroup<ARCUnsafeRetainedAssign>;
6238def warn_arc_retained_property_assign : Warning<
6239  "assigning retained object to unsafe property"
6240  "; object will be released after assignment">,
6241  InGroup<ARCUnsafeRetainedAssign>;
6242def warn_arc_literal_assign : Warning<
6243  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6244  " to a weak %select{property|variable}1"
6245  "; object will be released after assignment">,
6246  InGroup<ARCUnsafeRetainedAssign>;
6247def err_arc_new_array_without_ownership : Error<
6248  "'new' cannot allocate an array of %0 with no explicit ownership">;
6249def err_arc_autoreleasing_var : Error<
6250  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6251  "__autoreleasing ownership">;
6252def err_arc_autoreleasing_capture : Error<
6253  "cannot capture __autoreleasing variable in a "
6254  "%select{block|lambda by copy}0">;
6255def err_arc_thread_ownership : Error<
6256  "thread-local variable has non-trivial ownership: type is %0">;
6257def err_arc_indirect_no_ownership : Error<
6258  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6259def err_arc_array_param_no_ownership : Error<
6260  "must explicitly describe intended ownership of an object array parameter">;
6261def err_arc_pseudo_dtor_inconstant_quals : Error<
6262  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6263  "type %1">;
6264def err_arc_init_method_unrelated_result_type : Error<
6265  "init methods must return a type related to the receiver type">;
6266def err_arc_nonlocal_writeback : Error<
6267  "passing address of %select{non-local|non-scalar}0 object to "
6268  "__autoreleasing parameter for write-back">;
6269def err_arc_method_not_found : Error<
6270  "no known %select{instance|class}1 method for selector %0">;
6271def err_arc_receiver_forward_class : Error<
6272  "receiver %0 for class message is a forward declaration">;
6273def err_arc_may_not_respond : Error<
6274  "no visible @interface for %0 declares the selector %1">;
6275def err_arc_receiver_forward_instance : Error<
6276  "receiver type %0 for instance message is a forward declaration">;
6277def warn_receiver_forward_instance : Warning<
6278  "receiver type %0 for instance message is a forward declaration">,
6279  InGroup<ForwardClassReceiver>, DefaultIgnore;
6280def err_arc_collection_forward : Error<
6281  "collection expression type %0 is a forward declaration">;
6282def err_arc_multiple_method_decl : Error<
6283  "multiple methods named %0 found with mismatched result, "
6284  "parameter type or attributes">;
6285def warn_arc_lifetime_result_type : Warning<
6286  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6287  "lifetime qualifier on return type is ignored">,
6288  InGroup<IgnoredQualifiers>;
6289
6290let CategoryName = "ARC Retain Cycle" in {
6291
6292def warn_arc_retain_cycle : Warning<
6293  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6294  InGroup<ARCRetainCycles>;
6295def note_arc_retain_cycle_owner : Note<
6296  "block will be retained by %select{the captured object|an object strongly "
6297  "retained by the captured object}0">;
6298
6299} // end "ARC Retain Cycle" category
6300
6301def warn_arc_object_memaccess : Warning<
6302  "%select{destination for|source of}0 this %1 call is a pointer to "
6303  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6304
6305let CategoryName = "ARC and @properties" in {
6306
6307def err_arc_strong_property_ownership : Error<
6308  "existing instance variable %1 for strong property %0 may not be "
6309  "%select{|__unsafe_unretained||__weak}2">;
6310def err_arc_assign_property_ownership : Error<
6311  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6312  "attribute must be __unsafe_unretained">;
6313def err_arc_inconsistent_property_ownership : Error<
6314  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6315  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6316
6317} // end "ARC and @properties" category
6318
6319def warn_block_capture_autoreleasing : Warning<
6320  "block captures an autoreleasing out-parameter, which may result in "
6321  "use-after-free bugs">,
6322  InGroup<BlockCaptureAutoReleasing>;
6323def note_declare_parameter_strong : Note<
6324  "declare the parameter __strong or capture a __block __strong variable to "
6325  "keep values alive across autorelease pools">;
6326
6327def err_arc_atomic_ownership : Error<
6328  "cannot perform atomic operation on a pointer to type %0: type has "
6329  "non-trivial ownership">;
6330
6331let CategoryName = "ARC Casting Rules" in {
6332
6333def err_arc_bridge_cast_incompatible : Error<
6334  "incompatible types casting %0 to %1 with a %select{__bridge|"
6335  "__bridge_transfer|__bridge_retained}2 cast">;
6336def err_arc_bridge_cast_wrong_kind : Error<
6337  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6338  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6339  "__bridge_transfer|__bridge_retained}4">;
6340def err_arc_cast_requires_bridge : Error<
6341  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6342  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6343  "requires a bridged cast">;
6344def note_arc_bridge : Note<
6345  "use __bridge to convert directly (no change in ownership)">;
6346def note_arc_cstyle_bridge : Note<
6347  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6348def note_arc_bridge_transfer : Note<
6349  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6350  "ownership of a +1 %0 into ARC">;
6351def note_arc_cstyle_bridge_transfer : Note<
6352  "use __bridge_transfer with C-style cast to transfer "
6353  "ownership of a +1 %0 into ARC">;
6354def note_arc_bridge_retained : Note<
6355  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6356  "ARC object available as a +1 %0">;
6357def note_arc_cstyle_bridge_retained : Note<
6358  "use __bridge_retained with C-style cast to make an "
6359  "ARC object available as a +1 %0">;
6360
6361} // ARC Casting category
6362
6363} // ARC category name
6364
6365def err_flexible_array_init_needs_braces : Error<
6366  "flexible array requires brace-enclosed initializer">;
6367def err_illegal_decl_array_of_functions : Error<
6368  "'%0' declared as array of functions of type %1">;
6369def err_array_incomplete_or_sizeless_type : Error<
6370  "array has %select{incomplete|sizeless}0 element type %1">;
6371def err_illegal_message_expr_incomplete_type : Error<
6372  "Objective-C message has incomplete result type %0">;
6373def err_illegal_decl_array_of_references : Error<
6374  "'%0' declared as array of references of type %1">;
6375def err_decl_negative_array_size : Error<
6376  "'%0' declared as an array with a negative size">;
6377def err_array_static_outside_prototype : Error<
6378  "%0 used in array declarator outside of function prototype">;
6379def err_array_static_not_outermost : Error<
6380  "%0 used in non-outermost array type derivation">;
6381def err_array_star_outside_prototype : Error<
6382  "star modifier used outside of function prototype">;
6383def err_illegal_decl_pointer_to_reference : Error<
6384  "'%0' declared as a pointer to a reference of type %1">;
6385def err_illegal_decl_mempointer_to_reference : Error<
6386  "'%0' declared as a member pointer to a reference of type %1">;
6387def err_illegal_decl_mempointer_to_void : Error<
6388  "'%0' declared as a member pointer to void">;
6389def err_illegal_decl_mempointer_in_nonclass : Error<
6390  "'%0' does not point into a class">;
6391def err_mempointer_in_nonclass_type : Error<
6392  "member pointer refers into non-class type %0">;
6393def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6394def err_nonfunction_block_type : Error<
6395  "block pointer to non-function type is invalid">;
6396def err_return_block_has_expr : Error<"void block should not return a value">;
6397def err_block_return_missing_expr : Error<
6398  "non-void block should return a value">;
6399def err_func_def_incomplete_result : Error<
6400  "incomplete result type %0 in function definition">;
6401def err_atomic_specifier_bad_type
6402    : Error<"_Atomic cannot be applied to "
6403            "%select{incomplete |array |function |reference |atomic |qualified "
6404            "|sizeless ||integer }0type "
6405            "%1 %select{|||||||which is not trivially copyable|}0">;
6406
6407// Expressions.
6408def ext_sizeof_alignof_function_type : Extension<
6409  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6410def ext_sizeof_alignof_void_type : Extension<
6411  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6412def err_opencl_sizeof_alignof_type : Error<
6413  "invalid application of '%0' to a void type">;
6414def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6415  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6416def err_sizeof_alignof_function_type : Error<
6417  "invalid application of '%0' to a function type">;
6418def err_openmp_default_simd_align_expr : Error<
6419  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6420def err_sizeof_alignof_typeof_bitfield : Error<
6421  "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
6422def err_alignof_member_of_incomplete_type : Error<
6423  "invalid application of 'alignof' to a field of a class still being defined">;
6424def err_vecstep_non_scalar_vector_type : Error<
6425  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6426def err_offsetof_incomplete_type : Error<
6427  "offsetof of incomplete type %0">;
6428def err_offsetof_record_type : Error<
6429  "offsetof requires struct, union, or class type, %0 invalid">;
6430def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6431def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6432  InGroup<InvalidOffsetof>;
6433def ext_offsetof_non_standardlayout_type : ExtWarn<
6434  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6435def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6436def err_offsetof_field_of_virtual_base : Error<
6437  "invalid application of 'offsetof' to a field of a virtual base">;
6438def warn_sub_ptr_zero_size_types : Warning<
6439  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6440  InGroup<PointerArith>;
6441def warn_pointer_arith_null_ptr : Warning<
6442  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6443  InGroup<NullPointerArithmetic>, DefaultIgnore;
6444def warn_gnu_null_ptr_arith : Warning<
6445  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6446  InGroup<NullPointerArithmetic>, DefaultIgnore;
6447def warn_pointer_sub_null_ptr : Warning<
6448  "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
6449  InGroup<NullPointerSubtraction>, DefaultIgnore;
6450
6451def warn_floatingpoint_eq : Warning<
6452  "comparing floating point with == or != is unsafe">,
6453  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6454
6455def warn_remainder_division_by_zero : Warning<
6456  "%select{remainder|division}0 by zero is undefined">,
6457  InGroup<DivZero>;
6458def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6459  InGroup<DiagGroup<"shift-negative-value">>;
6460def warn_shift_negative : Warning<"shift count is negative">,
6461  InGroup<DiagGroup<"shift-count-negative">>;
6462def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6463  InGroup<DiagGroup<"shift-count-overflow">>;
6464def warn_shift_result_gt_typewidth : Warning<
6465  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6466  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6467def warn_shift_result_sets_sign_bit : Warning<
6468  "signed shift result (%0) sets the sign bit of the shift expression's "
6469  "type (%1) and becomes negative">,
6470  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6471
6472def warn_precedence_bitwise_rel : Warning<
6473  "%0 has lower precedence than %1; %1 will be evaluated first">,
6474  InGroup<Parentheses>;
6475def note_precedence_bitwise_first : Note<
6476  "place parentheses around the %0 expression to evaluate it first">;
6477def note_precedence_silence : Note<
6478  "place parentheses around the '%0' expression to silence this warning">;
6479
6480def warn_precedence_conditional : Warning<
6481  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6482  InGroup<Parentheses>;
6483def warn_precedence_bitwise_conditional : Warning<
6484  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6485  InGroup<BitwiseConditionalParentheses>;
6486def note_precedence_conditional_first : Note<
6487  "place parentheses around the '?:' expression to evaluate it first">;
6488
6489def warn_enum_constant_in_bool_context : Warning<
6490  "converting the enum constant to a boolean">,
6491  InGroup<IntInBoolContext>, DefaultIgnore;
6492def warn_left_shift_in_bool_context : Warning<
6493  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6494  InGroup<IntInBoolContext>, DefaultIgnore;
6495def warn_logical_instead_of_bitwise : Warning<
6496  "use of logical '%0' with constant operand">,
6497  InGroup<DiagGroup<"constant-logical-operand">>;
6498def note_logical_instead_of_bitwise_change_operator : Note<
6499  "use '%0' for a bitwise operation">;
6500def note_logical_instead_of_bitwise_remove_constant : Note<
6501  "remove constant to silence this warning">;
6502
6503def warn_bitwise_op_in_bitwise_op : Warning<
6504  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
6505
6506def warn_logical_and_in_logical_or : Warning<
6507  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
6508
6509def warn_overloaded_shift_in_comparison :Warning<
6510  "overloaded operator %select{>>|<<}0 has higher precedence than "
6511  "comparison operator">,
6512  InGroup<OverloadedShiftOpParentheses>;
6513def note_evaluate_comparison_first :Note<
6514  "place parentheses around comparison expression to evaluate it first">;
6515
6516def note_concatenated_string_literal_silence :Note<
6517  "place parentheses around the string literal to silence warning">;
6518
6519def warn_addition_in_bitshift : Warning<
6520  "operator '%0' has lower precedence than '%1'; "
6521  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
6522
6523def warn_self_assignment_builtin : Warning<
6524  "explicitly assigning value of variable of type %0 to itself">,
6525  InGroup<SelfAssignment>, DefaultIgnore;
6526def warn_self_assignment_overloaded : Warning<
6527  "explicitly assigning value of variable of type %0 to itself">,
6528  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
6529def warn_self_move : Warning<
6530  "explicitly moving variable of type %0 to itself">,
6531  InGroup<SelfMove>, DefaultIgnore;
6532
6533def warn_redundant_move_on_return : Warning<
6534  "redundant move in return statement">,
6535  InGroup<RedundantMove>, DefaultIgnore;
6536def warn_pessimizing_move_on_return : Warning<
6537  "moving a local object in a return statement prevents copy elision">,
6538  InGroup<PessimizingMove>, DefaultIgnore;
6539def warn_pessimizing_move_on_initialization : Warning<
6540  "moving a temporary object prevents copy elision">,
6541  InGroup<PessimizingMove>, DefaultIgnore;
6542def note_remove_move : Note<"remove std::move call here">;
6543
6544def warn_string_plus_int : Warning<
6545  "adding %0 to a string does not append to the string">,
6546  InGroup<StringPlusInt>;
6547def warn_string_plus_char : Warning<
6548  "adding %0 to a string pointer does not append to the string">,
6549  InGroup<StringPlusChar>;
6550def note_string_plus_scalar_silence : Note<
6551  "use array indexing to silence this warning">;
6552
6553def warn_sizeof_array_param : Warning<
6554  "sizeof on array function parameter will return size of %0 instead of %1">,
6555  InGroup<SizeofArrayArgument>;
6556
6557def warn_sizeof_array_decay : Warning<
6558  "sizeof on pointer operation will return size of %0 instead of %1">,
6559  InGroup<SizeofArrayDecay>;
6560
6561def err_sizeof_nonfragile_interface : Error<
6562  "application of '%select{alignof|sizeof}1' to interface %0 is "
6563  "not supported on this architecture and platform">;
6564def err_atdef_nonfragile_interface : Error<
6565  "use of @defs is not supported on this architecture and platform">;
6566def err_subscript_nonfragile_interface : Error<
6567  "subscript requires size of interface %0, which is not constant for "
6568  "this architecture and platform">;
6569
6570def err_arithmetic_nonfragile_interface : Error<
6571  "arithmetic on pointer to interface %0, which is not a constant size for "
6572  "this architecture and platform">;
6573
6574def warn_deprecated_comma_subscript : Warning<
6575  "top-level comma expression in array subscript is deprecated">,
6576  InGroup<DeprecatedCommaSubscript>;
6577
6578def ext_subscript_non_lvalue : Extension<
6579  "ISO C90 does not allow subscripting non-lvalue array">;
6580def err_typecheck_subscript_value : Error<
6581  "subscripted value is not an array, pointer, or vector">;
6582def err_typecheck_subscript_not_integer : Error<
6583  "array subscript is not an integer">;
6584def err_subscript_function_type : Error<
6585  "subscript of pointer to function type %0">;
6586def err_subscript_incomplete_or_sizeless_type : Error<
6587  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
6588def err_dereference_incomplete_type : Error<
6589  "dereference of pointer to incomplete type %0">;
6590def ext_gnu_subscript_void_type : Extension<
6591  "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
6592def err_typecheck_member_reference_struct_union : Error<
6593  "member reference base type %0 is not a structure or union">;
6594def err_typecheck_member_reference_ivar : Error<
6595  "%0 does not have a member named %1">;
6596def err_arc_weak_ivar_access : Error<
6597  "dereferencing a __weak pointer is not allowed due to possible "
6598  "null value caused by race condition, assign it to strong variable first">;
6599def err_typecheck_member_reference_arrow : Error<
6600  "member reference type %0 is not a pointer">;
6601def err_typecheck_member_reference_suggestion : Error<
6602  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
6603def note_typecheck_member_reference_suggestion : Note<
6604  "did you mean to use '.' instead?">;
6605def note_member_reference_arrow_from_operator_arrow : Note<
6606  "'->' applied to return value of the operator->() declared here">;
6607def err_typecheck_member_reference_type : Error<
6608  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
6609def err_typecheck_member_reference_unknown : Error<
6610  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
6611def err_member_reference_needs_call : Error<
6612  "base of member reference is a function; perhaps you meant to call "
6613  "it%select{| with no arguments}0?">;
6614def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
6615  InGroup<CharSubscript>, DefaultIgnore;
6616
6617def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
6618def err_no_member : Error<"no member named %0 in %1">;
6619def err_no_member_overloaded_arrow : Error<
6620  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
6621
6622def err_member_not_yet_instantiated : Error<
6623  "no member %0 in %1; it has not yet been instantiated">;
6624def note_non_instantiated_member_here : Note<
6625  "not-yet-instantiated member is declared here">;
6626
6627def err_enumerator_does_not_exist : Error<
6628  "enumerator %0 does not exist in instantiation of %1">;
6629def note_enum_specialized_here : Note<
6630  "enum %0 was explicitly specialized here">;
6631
6632def err_specialization_not_primary_template : Error<
6633  "cannot reference member of primary template because deduced class "
6634  "template specialization %0 is %select{instantiated from a partial|"
6635  "an explicit}1 specialization">;
6636
6637def err_member_redeclared : Error<"class member cannot be redeclared">;
6638def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
6639  InGroup<RedeclaredClassMember>;
6640def err_member_redeclared_in_instantiation : Error<
6641  "multiple overloads of %0 instantiate to the same signature %1">;
6642def err_member_name_of_class : Error<"member %0 has the same name as its class">;
6643def err_member_def_undefined_record : Error<
6644  "out-of-line definition of %0 from class %1 without definition">;
6645def err_member_decl_does_not_match : Error<
6646  "out-of-line %select{declaration|definition}2 of %0 "
6647  "does not match any declaration in %1">;
6648def err_friend_decl_with_def_arg_must_be_def : Error<
6649  "friend declaration specifying a default argument must be a definition">;
6650def err_friend_decl_with_def_arg_redeclared : Error<
6651  "friend declaration specifying a default argument must be the only declaration">;
6652def err_friend_decl_does_not_match : Error<
6653  "friend declaration of %0 does not match any declaration in %1">;
6654def err_member_decl_does_not_match_suggest : Error<
6655  "out-of-line %select{declaration|definition}2 of %0 "
6656  "does not match any declaration in %1; did you mean %3?">;
6657def err_member_def_does_not_match_ret_type : Error<
6658  "return type of out-of-line definition of %q0 differs from "
6659  "that in the declaration">;
6660def err_nonstatic_member_out_of_line : Error<
6661  "non-static data member defined out-of-line">;
6662def err_qualified_typedef_declarator : Error<
6663  "typedef declarator cannot be qualified">;
6664def err_qualified_param_declarator : Error<
6665  "parameter declarator cannot be qualified">;
6666def ext_out_of_line_declaration : ExtWarn<
6667  "out-of-line declaration of a member must be a definition">,
6668  InGroup<OutOfLineDeclaration>, DefaultError;
6669def err_member_extra_qualification : Error<
6670  "extra qualification on member %0">;
6671def warn_member_extra_qualification : Warning<
6672  err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
6673def warn_namespace_member_extra_qualification : Warning<
6674  "extra qualification on member %0">,
6675  InGroup<DiagGroup<"extra-qualification">>;
6676def err_member_qualification : Error<
6677  "non-friend class member %0 cannot have a qualified name">;
6678def note_member_def_close_match : Note<"member declaration nearly matches">;
6679def note_member_def_close_const_match : Note<
6680  "member declaration does not match because "
6681  "it %select{is|is not}0 const qualified">;
6682def note_member_def_close_param_match : Note<
6683  "type of %ordinal0 parameter of member declaration does not match definition"
6684  "%diff{ ($ vs $)|}1,2">;
6685def note_local_decl_close_match : Note<"local declaration nearly matches">;
6686def note_local_decl_close_param_match : Note<
6687  "type of %ordinal0 parameter of local declaration does not match definition"
6688  "%diff{ ($ vs $)|}1,2">;
6689def err_typecheck_ivar_variable_size : Error<
6690  "instance variables must have a constant size">;
6691def err_ivar_reference_type : Error<
6692  "instance variables cannot be of reference type">;
6693def err_typecheck_illegal_increment_decrement : Error<
6694  "cannot %select{decrement|increment}1 value of type %0">;
6695def err_typecheck_expect_int : Error<
6696  "used type %0 where integer is required">;
6697def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
6698  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
6699def err_typecheck_pointer_arith_function_type : Error<
6700  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
6701  "function type%select{|s}2 %1%select{| and %3}2">;
6702def err_typecheck_pointer_arith_void_type : Error<
6703  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
6704def err_typecheck_decl_incomplete_type : Error<
6705  "variable has incomplete type %0">;
6706def ext_typecheck_decl_incomplete_type : ExtWarn<
6707  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
6708  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
6709def err_tentative_def_incomplete_type : Error<
6710  "tentative definition has type %0 that is never completed">;
6711def warn_tentative_incomplete_array : Warning<
6712  "tentative array definition assumed to have one element">;
6713def err_typecheck_incomplete_array_needs_initializer : Error<
6714  "definition of variable with array type needs an explicit size "
6715  "or an initializer">;
6716def err_array_init_not_init_list : Error<
6717  "array initializer must be an initializer "
6718  "list%select{| or string literal| or wide string literal}0">;
6719def err_array_init_narrow_string_into_wchar : Error<
6720  "initializing wide char array with non-wide string literal">;
6721def err_array_init_wide_string_into_char : Error<
6722  "initializing char array with wide string literal">;
6723def err_array_init_incompat_wide_string_into_wchar : Error<
6724  "initializing wide char array with incompatible wide string literal">;
6725def err_array_init_plain_string_into_char8_t : Error<
6726  "initializing 'char8_t' array with plain string literal">;
6727def note_array_init_plain_string_into_char8_t : Note<
6728  "add 'u8' prefix to form a 'char8_t' string literal">;
6729def err_array_init_utf8_string_into_char : Error<
6730  "%select{|ISO C++20 does not permit }0initialization of char array with "
6731  "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">;
6732def warn_cxx20_compat_utf8_string : Warning<
6733  "type of UTF-8 string literal will change from array of const char to "
6734  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
6735def note_cxx20_compat_utf8_string_remove_u8 : Note<
6736  "remove 'u8' prefix to avoid a change of behavior; "
6737  "Clang encodes unprefixed narrow string literals as UTF-8">;
6738def err_array_init_different_type : Error<
6739  "cannot initialize array %diff{of type $ with array of type $|"
6740  "with different type of array}0,1">;
6741def err_array_init_non_constant_array : Error<
6742  "cannot initialize array %diff{of type $ with non-constant array of type $|"
6743  "with different type of array}0,1">;
6744def ext_array_init_copy : Extension<
6745  "initialization of an array "
6746  "%diff{of type $ from a compound literal of type $|"
6747  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
6748// This is intentionally not disabled by -Wno-gnu.
6749def ext_array_init_parens : ExtWarn<
6750  "parenthesized initialization of a member array is a GNU extension">,
6751  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
6752def warn_deprecated_string_literal_conversion : Warning<
6753  "conversion from string literal to %0 is deprecated">,
6754  InGroup<CXX11CompatDeprecatedWritableStr>;
6755def ext_deprecated_string_literal_conversion : ExtWarn<
6756  "ISO C++11 does not allow conversion from string literal to %0">,
6757  InGroup<WritableStrings>, SFINAEFailure;
6758def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
6759def err_typecheck_sclass_fscope : Error<
6760  "illegal storage class on file-scoped variable">;
6761def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
6762  InGroup<MissingDeclarations>;
6763def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
6764  "of a type">, InGroup<MissingDeclarations>;
6765def err_standalone_class_nested_name_specifier : Error<
6766  "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
6767  "have a nested name specifier">;
6768def err_typecheck_sclass_func : Error<"illegal storage class on function">;
6769def err_static_block_func : Error<
6770  "function declared in block scope cannot have 'static' storage class">;
6771def err_typecheck_address_of : Error<"address of %select{bit-field"
6772  "|vector element|property expression|register variable|matrix element}0 requested">;
6773def ext_typecheck_addrof_void : Extension<
6774  "ISO C forbids taking the address of an expression of type 'void'">;
6775def err_unqualified_pointer_member_function : Error<
6776  "must explicitly qualify name of member function when taking its address">;
6777def err_invalid_form_pointer_member_function : Error<
6778  "cannot create a non-constant pointer to member function">;
6779def err_address_of_function_with_pass_object_size_params: Error<
6780  "cannot take address of function %0 because parameter %1 has "
6781  "pass_object_size attribute">;
6782def err_parens_pointer_member_function : Error<
6783  "cannot parenthesize the name of a method when forming a member pointer">;
6784def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
6785  "extra '&' taking address of overloaded function">;
6786def err_typecheck_invalid_lvalue_addrof : Error<
6787  "cannot take the address of an rvalue of type %0">;
6788def ext_typecheck_addrof_temporary : ExtWarn<
6789  "taking the address of a temporary object of type %0">,
6790  InGroup<AddressOfTemporary>, DefaultError;
6791def err_typecheck_addrof_temporary : Error<
6792  "taking the address of a temporary object of type %0">;
6793def err_typecheck_addrof_dtor : Error<
6794  "taking the address of a destructor">;
6795def err_typecheck_unary_expr : Error<
6796  "invalid argument type %0 to unary expression">;
6797def err_typecheck_indirection_requires_pointer : Error<
6798  "indirection requires pointer operand (%0 invalid)">;
6799def ext_typecheck_indirection_through_void_pointer : ExtWarn<
6800  "ISO C++ does not allow indirection on operand of type %0">,
6801  InGroup<DiagGroup<"void-ptr-dereference">>;
6802def warn_indirection_through_null : Warning<
6803  "indirection of non-volatile null pointer will be deleted, not trap">,
6804  InGroup<NullDereference>;
6805def warn_binding_null_to_reference : Warning<
6806  "binding dereferenced null pointer to reference has undefined behavior">,
6807  InGroup<NullDereference>;
6808def note_indirection_through_null : Note<
6809  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
6810def warn_pointer_indirection_from_incompatible_type : Warning<
6811  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
6812  "behavior">,
6813  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6814def warn_taking_address_of_packed_member : Warning<
6815  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
6816  InGroup<DiagGroup<"address-of-packed-member">>;
6817def warn_param_mismatched_alignment : Warning<
6818  "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">,
6819  InGroup<DiagGroup<"align-mismatch">>;
6820
6821def err_objc_object_assignment : Error<
6822  "cannot assign to class object (%0 invalid)">;
6823def err_typecheck_invalid_operands : Error<
6824  "invalid operands to binary expression (%0 and %1)">, Deferrable;
6825def note_typecheck_invalid_operands_converted : Note<
6826  "%select{first|second}0 operand was implicitly converted to type %1">;
6827def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
6828  "logical expression with vector %select{type %1 and non-vector type %2|types"
6829  " %1 and %2}0 is only supported in C++">;
6830def err_typecheck_sub_ptr_compatible : Error<
6831  "%diff{$ and $ are not pointers to compatible types|"
6832  "pointers to incompatible types}0,1">;
6833def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
6834  "ordered comparison between pointer and integer (%0 and %1)">;
6835def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
6836  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
6837def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
6838  "ordered comparison between pointer and zero (%0 and %1)">;
6839def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
6840  "three-way comparison between pointer and zero">;
6841def ext_typecheck_compare_complete_incomplete_pointers : Extension<
6842  "pointer comparisons before C11 "
6843  "need to be between two complete or two incomplete types; "
6844  "%0 is %select{|in}2complete and "
6845  "%1 is %select{|in}3complete">,
6846  InGroup<C11>;
6847def warn_typecheck_ordered_comparison_of_function_pointers : Warning<
6848  "ordered comparison of function pointers (%0 and %1)">,
6849  InGroup<OrderedCompareFunctionPointers>;
6850def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
6851  "ordered comparison of function pointers (%0 and %1)">,
6852  InGroup<OrderedCompareFunctionPointers>;
6853def err_typecheck_ordered_comparison_of_function_pointers : Error<
6854  "ordered comparison of function pointers (%0 and %1)">;
6855def ext_typecheck_comparison_of_fptr_to_void : Extension<
6856  "equality comparison between function pointer and void pointer (%0 and %1)">;
6857def err_typecheck_comparison_of_fptr_to_void : Error<
6858  "equality comparison between function pointer and void pointer (%0 and %1)">;
6859def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
6860  "comparison between pointer and integer (%0 and %1)">,
6861  InGroup<DiagGroup<"pointer-integer-compare">>;
6862def err_typecheck_comparison_of_pointer_integer : Error<
6863  "comparison between pointer and integer (%0 and %1)">;
6864def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
6865  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
6866  InGroup<CompareDistinctPointerType>;
6867def ext_typecheck_cond_incompatible_operands : ExtWarn<
6868  "incompatible operand types (%0 and %1)">;
6869def err_cond_voidptr_arc : Error <
6870  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
6871  "in ARC mode">;
6872def err_typecheck_comparison_of_distinct_pointers : Error<
6873  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
6874def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
6875  "%select{comparison between %diff{ ($ and $)|}0,1"
6876  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
6877  "|conditional operator with the second and third operands of type "
6878  "%diff{ ($ and $)|}0,1}2"
6879  " which are pointers to non-overlapping address spaces">;
6880
6881def select_arith_conv_kind : TextSubstitution<
6882  "%select{arithmetic between|bitwise operation between|comparison of|"
6883  "conditional expression between|compound assignment of}0">;
6884def warn_arith_conv_enum_float : Warning<
6885  "%sub{select_arith_conv_kind}0 "
6886  "%select{floating-point|enumeration}1 type %2 "
6887  "%plural{2:with|4:from|:and}0 "
6888  "%select{enumeration|floating-point}1 type %3">,
6889  InGroup<EnumFloatConversion>, DefaultIgnore;
6890def warn_arith_conv_enum_float_cxx20 : Warning<
6891  "%sub{select_arith_conv_kind}0 "
6892  "%select{floating-point|enumeration}1 type %2 "
6893  "%plural{2:with|4:from|:and}0 "
6894  "%select{enumeration|floating-point}1 type %3 is deprecated">,
6895  InGroup<DeprecatedEnumFloatConversion>;
6896def warn_arith_conv_mixed_enum_types : Warning<
6897  "%sub{select_arith_conv_kind}0 "
6898  "different enumeration types%diff{ ($ and $)|}1,2">,
6899  InGroup<EnumEnumConversion>, DefaultIgnore;
6900def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
6901  "%sub{select_arith_conv_kind}0 "
6902  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
6903  InGroup<DeprecatedEnumEnumConversion>;
6904def warn_arith_conv_mixed_anon_enum_types : Warning<
6905  warn_arith_conv_mixed_enum_types.Text>,
6906  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
6907def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
6908  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6909  InGroup<DeprecatedAnonEnumEnumConversion>;
6910def warn_conditional_mixed_enum_types : Warning<
6911  warn_arith_conv_mixed_enum_types.Text>,
6912  InGroup<EnumCompareConditional>, DefaultIgnore;
6913def warn_conditional_mixed_enum_types_cxx20 : Warning<
6914  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6915  InGroup<DeprecatedEnumCompareConditional>;
6916def warn_comparison_mixed_enum_types : Warning<
6917  warn_arith_conv_mixed_enum_types.Text>,
6918  InGroup<EnumCompare>;
6919def warn_comparison_mixed_enum_types_cxx20 : Warning<
6920  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6921  InGroup<DeprecatedEnumCompare>;
6922def warn_comparison_of_mixed_enum_types_switch : Warning<
6923  "comparison of different enumeration types in switch statement"
6924  "%diff{ ($ and $)|}0,1">,
6925  InGroup<EnumCompareSwitch>;
6926
6927def err_typecheck_assign_const : Error<
6928  "%select{"
6929  "cannot assign to return value because function %1 returns a const value|"
6930  "cannot assign to variable %1 with const-qualified type %2|"
6931  "cannot assign to %select{non-|}1static data member %2 "
6932  "with const-qualified type %3|"
6933  "cannot assign to non-static data member within const member function %1|"
6934  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
6935  "with %select{|nested }3const-qualified data member %4|"
6936  "read-only variable is not assignable}0">;
6937
6938def note_typecheck_assign_const : Note<
6939  "%select{"
6940  "function %1 which returns const-qualified type %2 declared here|"
6941  "variable %1 declared const here|"
6942  "%select{non-|}1static data member %2 declared const here|"
6943  "member function %q1 is declared const here|"
6944  "%select{|nested }1data member %2 declared const here}0">;
6945
6946def warn_unsigned_always_true_comparison : Warning<
6947  "result of comparison of %select{%3|unsigned expression}0 %2 "
6948  "%select{unsigned expression|%3}0 is always %4">,
6949  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
6950def warn_unsigned_char_always_true_comparison : Warning<
6951  "result of comparison of %select{%3|char expression}0 %2 "
6952  "%select{char expression|%3}0 is always %4, since char is interpreted as "
6953  "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore;
6954def warn_unsigned_enum_always_true_comparison : Warning<
6955  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
6956  "%select{unsigned enum expression|%3}0 is always %4">,
6957  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
6958def warn_tautological_constant_compare : Warning<
6959  "result of comparison %select{%3|%1}0 %2 "
6960  "%select{%1|%3}0 is always %4">,
6961  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
6962def warn_tautological_compare_objc_bool : Warning<
6963  "result of comparison of constant %0 with expression of type 'BOOL'"
6964  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
6965  InGroup<TautologicalObjCBoolCompare>;
6966def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
6967def warn_tautological_compare_value_range : Warning<
6968  "result of comparison of "
6969  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
6970  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
6971  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
6972
6973def warn_mixed_sign_comparison : Warning<
6974  "comparison of integers of different signs: %0 and %1">,
6975  InGroup<SignCompare>, DefaultIgnore;
6976def warn_out_of_range_compare : Warning<
6977  "result of comparison of %select{constant %0|true|false}1 with "
6978  "%select{expression of type %2|boolean expression}3 is always %4">,
6979  InGroup<TautologicalOutOfRangeCompare>;
6980def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
6981  InGroup<TautologicalConstantCompare>;
6982def warn_integer_constants_in_conditional_always_true : Warning<
6983  "converting the result of '?:' with integer constants to a boolean always "
6984  "evaluates to 'true'">,
6985  InGroup<TautologicalConstantCompare>;
6986def warn_left_shift_always : Warning<
6987  "converting the result of '<<' to a boolean always evaluates "
6988  "to %select{false|true}0">,
6989  InGroup<TautologicalConstantCompare>;
6990def warn_null_in_arithmetic_operation : Warning<
6991  "use of NULL in arithmetic operation">,
6992  InGroup<NullArithmetic>;
6993def warn_null_in_comparison_operation : Warning<
6994  "comparison between NULL and non-pointer "
6995  "%select{(%1 and NULL)|(NULL and %1)}0">,
6996  InGroup<NullArithmetic>;
6997def err_shift_rhs_only_vector : Error<
6998  "requested shift is a vector of type %0 but the first operand is not a "
6999  "vector (%1)">;
7000
7001def warn_logical_not_on_lhs_of_check : Warning<
7002  "logical not is only applied to the left hand side of this "
7003  "%select{comparison|bitwise operator}0">,
7004  InGroup<LogicalNotParentheses>;
7005def note_logical_not_fix : Note<
7006  "add parentheses after the '!' to evaluate the "
7007  "%select{comparison|bitwise operator}0 first">;
7008def note_logical_not_silence_with_parens : Note<
7009  "add parentheses around left hand side expression to silence this warning">;
7010
7011def err_invalid_this_use : Error<
7012  "invalid use of 'this' outside of a non-static member function">;
7013def err_this_static_member_func : Error<
7014  "'this' cannot be%select{| implicitly}0 used in a static member function "
7015  "declaration">;
7016def err_invalid_member_use_in_static_method : Error<
7017  "invalid use of member %0 in static member function">;
7018def err_invalid_qualified_function_type : Error<
7019  "%select{non-member function|static member function|deduction guide}0 "
7020  "%select{of type %2 |}1cannot have '%3' qualifier">;
7021def err_compound_qualified_function_type : Error<
7022  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
7023  "cannot have '%3' qualifier">;
7024def err_qualified_function_typeid : Error<
7025  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
7026
7027def err_ref_qualifier_overload : Error<
7028  "cannot overload a member function %select{without a ref-qualifier|with "
7029  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
7030  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
7031
7032def err_invalid_non_static_member_use : Error<
7033  "invalid use of non-static data member %0">;
7034def err_nested_non_static_member_use : Error<
7035  "%select{call to non-static member function|use of non-static data member}0 "
7036  "%2 of %1 from nested type %3">;
7037def warn_cxx98_compat_non_static_member_use : Warning<
7038  "use of non-static data member %0 in an unevaluated context is "
7039  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
7040def err_invalid_incomplete_type_use : Error<
7041  "invalid use of incomplete type %0">;
7042def err_builtin_func_cast_more_than_one_arg : Error<
7043  "function-style cast to a builtin type can only take one argument">;
7044def err_value_init_for_array_type : Error<
7045  "array types cannot be value-initialized">;
7046def err_init_for_function_type : Error<
7047  "cannot create object of function type %0">;
7048def warn_format_nonliteral_noargs : Warning<
7049  "format string is not a string literal (potentially insecure)">,
7050  InGroup<FormatSecurity>;
7051def warn_format_nonliteral : Warning<
7052  "format string is not a string literal">,
7053  InGroup<FormatNonLiteral>, DefaultIgnore;
7054
7055def err_unexpected_interface : Error<
7056  "unexpected interface name %0: expected expression">;
7057def err_ref_non_value : Error<"%0 does not refer to a value">;
7058def err_ref_vm_type : Error<
7059  "cannot refer to declaration with a variably modified type inside block">;
7060def err_ref_flexarray_type : Error<
7061  "cannot refer to declaration of structure variable with flexible array member "
7062  "inside block">;
7063def err_ref_array_type : Error<
7064  "cannot refer to declaration with an array type inside block">;
7065def err_property_not_found : Error<
7066  "property %0 not found on object of type %1">;
7067def err_invalid_property_name : Error<
7068  "%0 is not a valid property name (accessing an object of type %1)">;
7069def err_getter_not_found : Error<
7070  "no getter method for read from property">;
7071def err_objc_subscript_method_not_found : Error<
7072  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
7073  "found on object of type %0">;
7074def err_objc_subscript_index_type : Error<
7075  "method index parameter type %0 is not integral type">;
7076def err_objc_subscript_key_type : Error<
7077  "method key parameter type %0 is not object type">;
7078def err_objc_subscript_dic_object_type : Error<
7079  "method object parameter type %0 is not object type">;
7080def err_objc_subscript_object_type : Error<
7081  "cannot assign to this %select{dictionary|array}1 because assigning method's "
7082  "2nd parameter of type %0 is not an Objective-C pointer type">;
7083def err_objc_subscript_base_type : Error<
7084  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
7085def err_objc_multiple_subscript_type_conversion : Error<
7086  "indexing expression is invalid because subscript type %0 has "
7087  "multiple type conversion functions">;
7088def err_objc_subscript_type_conversion : Error<
7089  "indexing expression is invalid because subscript type %0 is not an integral"
7090  " or Objective-C pointer type">;
7091def err_objc_subscript_pointer : Error<
7092  "indexing expression is invalid because subscript type %0 is not an"
7093  " Objective-C pointer">;
7094def err_objc_indexing_method_result_type : Error<
7095  "method for accessing %select{dictionary|array}1 element must have Objective-C"
7096  " object return type instead of %0">;
7097def err_objc_index_incomplete_class_type : Error<
7098  "Objective-C index expression has incomplete class type %0">;
7099def err_illegal_container_subscripting_op : Error<
7100  "illegal operation on Objective-C container subscripting">;
7101def err_property_not_found_forward_class : Error<
7102  "property %0 cannot be found in forward class object %1">;
7103def err_property_not_as_forward_class : Error<
7104  "property %0 refers to an incomplete Objective-C class %1 "
7105  "(with no @interface available)">;
7106def note_forward_class : Note<
7107  "forward declaration of class here">;
7108def err_duplicate_property : Error<
7109  "property has a previous declaration">;
7110def ext_gnu_void_ptr : Extension<
7111  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
7112  InGroup<PointerArith>;
7113def ext_gnu_ptr_func_arith : Extension<
7114  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
7115  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
7116  InGroup<PointerArith>;
7117def err_readonly_message_assignment : Error<
7118  "assigning to 'readonly' return result of an Objective-C message not allowed">;
7119def ext_integer_increment_complex : Extension<
7120  "ISO C does not support '++'/'--' on complex integer type %0">;
7121def ext_integer_complement_complex : Extension<
7122  "ISO C does not support '~' for complex conjugation of %0">;
7123def err_nosetter_property_assignment : Error<
7124  "%select{assignment to readonly property|"
7125  "no setter method %1 for assignment to property}0">;
7126def err_nosetter_property_incdec : Error<
7127  "%select{%select{increment|decrement}1 of readonly property|"
7128  "no setter method %2 for %select{increment|decrement}1 of property}0">;
7129def err_nogetter_property_compound_assignment : Error<
7130  "a getter method is needed to perform a compound assignment on a property">;
7131def err_nogetter_property_incdec : Error<
7132  "no getter method %1 for %select{increment|decrement}0 of property">;
7133def err_no_subobject_property_setting : Error<
7134  "expression is not assignable">;
7135def err_qualified_objc_access : Error<
7136  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
7137
7138def ext_freestanding_complex : Extension<
7139  "complex numbers are an extension in a freestanding C99 implementation">;
7140
7141// FIXME: Remove when we support imaginary.
7142def err_imaginary_not_supported : Error<"imaginary types are not supported">;
7143
7144// Obj-c expressions
7145def warn_root_inst_method_not_found : Warning<
7146  "instance method %0 is being used on 'Class' which is not in the root class">,
7147  InGroup<MethodAccess>;
7148def warn_class_method_not_found : Warning<
7149  "class method %objcclass0 not found (return type defaults to 'id')">,
7150  InGroup<MethodAccess>;
7151def warn_instance_method_on_class_found : Warning<
7152  "instance method %0 found instead of class method %1">,
7153  InGroup<MethodAccess>;
7154def warn_inst_method_not_found : Warning<
7155  "instance method %objcinstance0 not found (return type defaults to 'id')">,
7156  InGroup<MethodAccess>;
7157def warn_instance_method_not_found_with_typo : Warning<
7158  "instance method %objcinstance0 not found (return type defaults to 'id')"
7159  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
7160def warn_class_method_not_found_with_typo : Warning<
7161  "class method %objcclass0 not found (return type defaults to 'id')"
7162  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
7163def err_method_not_found_with_typo : Error<
7164  "%select{instance|class}1 method %0 not found "
7165  "; did you mean %2?">;
7166def err_no_super_class_message : Error<
7167  "no @interface declaration found in class messaging of %0">;
7168def err_root_class_cannot_use_super : Error<
7169  "%0 cannot use 'super' because it is a root class">;
7170def err_invalid_receiver_to_message_super : Error<
7171  "'super' is only valid in a method body">;
7172def err_invalid_receiver_class_message : Error<
7173  "receiver type %0 is not an Objective-C class">;
7174def err_missing_open_square_message_send : Error<
7175  "missing '[' at start of message send expression">;
7176def warn_bad_receiver_type : Warning<
7177  "receiver type %0 is not 'id' or interface pointer, consider "
7178  "casting it to 'id'">,InGroup<ObjCReceiver>;
7179def err_bad_receiver_type : Error<"bad receiver type %0">;
7180def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
7181def err_unknown_receiver_suggest : Error<
7182  "unknown receiver %0; did you mean %1?">;
7183def err_objc_throw_expects_object : Error<
7184  "@throw requires an Objective-C object type (%0 invalid)">;
7185def err_objc_synchronized_expects_object : Error<
7186  "@synchronized requires an Objective-C object type (%0 invalid)">;
7187def err_rethrow_used_outside_catch : Error<
7188  "@throw (rethrow) used outside of a @catch block">;
7189def err_attribute_multiple_objc_gc : Error<
7190  "multiple garbage collection attributes specified for type">;
7191def err_catch_param_not_objc_type : Error<
7192  "@catch parameter is not a pointer to an interface type">;
7193def err_illegal_qualifiers_on_catch_parm : Error<
7194  "illegal qualifiers on @catch parameter">;
7195def err_storage_spec_on_catch_parm : Error<
7196  "@catch parameter cannot have storage specifier '%0'">;
7197def warn_register_objc_catch_parm : Warning<
7198  "'register' storage specifier on @catch parameter will be ignored">;
7199def err_qualified_objc_catch_parm : Error<
7200  "@catch parameter declarator cannot be qualified">;
7201def warn_objc_pointer_cxx_catch_fragile : Warning<
7202  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7203  "exception model">, InGroup<ObjCNonUnifiedException>;
7204def err_objc_object_catch : Error<
7205  "cannot catch an Objective-C object by value">;
7206def err_incomplete_type_objc_at_encode : Error<
7207  "'@encode' of incomplete type %0">;
7208def warn_objc_circular_container : Warning<
7209  "adding %0 to %1 might cause circular dependency in container">,
7210  InGroup<DiagGroup<"objc-circular-container">>;
7211def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7212def warn_objc_unsafe_perform_selector : Warning<
7213  "%0 is incompatible with selectors that return a "
7214  "%select{struct|union|vector}1 type">,
7215  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7216def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7217  "method %0 that returns %1 declared here">;
7218def err_attribute_arm_builtin_alias : Error<
7219  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7220def err_attribute_arm_mve_polymorphism : Error<
7221  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7222
7223def warn_setter_getter_impl_required : Warning<
7224  "property %0 requires method %1 to be defined - "
7225  "use @synthesize, @dynamic or provide a method implementation "
7226  "in this class implementation">,
7227  InGroup<ObjCPropertyImpl>;
7228def warn_setter_getter_impl_required_in_category : Warning<
7229  "property %0 requires method %1 to be defined - "
7230  "use @dynamic or provide a method implementation in this category">,
7231  InGroup<ObjCPropertyImpl>;
7232def note_parameter_named_here : Note<
7233  "passing argument to parameter %0 here">;
7234def note_parameter_here : Note<
7235  "passing argument to parameter here">;
7236def note_method_return_type_change : Note<
7237  "compiler has implicitly changed method %0 return type">;
7238
7239def warn_impl_required_for_class_property : Warning<
7240  "class property %0 requires method %1 to be defined - "
7241  "use @dynamic or provide a method implementation "
7242  "in this class implementation">,
7243  InGroup<ObjCPropertyImpl>;
7244def warn_impl_required_in_category_for_class_property : Warning<
7245  "class property %0 requires method %1 to be defined - "
7246  "use @dynamic or provide a method implementation in this category">,
7247  InGroup<ObjCPropertyImpl>;
7248
7249// C++ casts
7250// These messages adhere to the TryCast pattern: %0 is an int specifying the
7251// cast type, %1 is the source type, %2 is the destination type.
7252def err_bad_reinterpret_cast_overload : Error<
7253  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7254
7255def warn_reinterpret_different_from_static : Warning<
7256  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7257  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7258  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7259def note_reinterpret_updowncast_use_static: Note<
7260  "use 'static_cast' to adjust the pointer correctly while "
7261  "%select{upcasting|downcasting}0">;
7262
7263def err_bad_static_cast_overload : Error<
7264  "address of overloaded function %0 cannot be static_cast to type %1">;
7265
7266def err_bad_cstyle_cast_overload : Error<
7267  "address of overloaded function %0 cannot be cast to type %1">;
7268
7269
7270def err_bad_cxx_cast_generic : Error<
7271  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7272  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7273def err_bad_cxx_cast_unrelated_class : Error<
7274  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7275  "functional-style cast|}0 from %1 to %2, which are not related by "
7276  "inheritance, is not allowed">;
7277def note_type_incomplete : Note<"%0 is incomplete">;
7278def err_bad_cxx_cast_rvalue : Error<
7279  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7280  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7281def err_bad_cxx_cast_bitfield : Error<
7282  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7283  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7284def err_bad_cxx_cast_qualifiers_away : Error<
7285  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7286  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7287def err_bad_cxx_cast_addr_space_mismatch : Error<
7288  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7289  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7290  " spaces">;
7291def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7292  "ISO C++ does not allow "
7293  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7294  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7295  "even though the source and destination types are unrelated">,
7296  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7297def err_bad_const_cast_dest : Error<
7298  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7299  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7300def ext_cast_fn_obj : Extension<
7301  "cast between pointer-to-function and pointer-to-object is an extension">;
7302def ext_ms_cast_fn_obj : ExtWarn<
7303  "static_cast between pointer-to-function and pointer-to-object is a "
7304  "Microsoft extension">, InGroup<MicrosoftCast>;
7305def warn_cxx98_compat_cast_fn_obj : Warning<
7306  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7307  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7308def err_bad_reinterpret_cast_small_int : Error<
7309  "cast from pointer to smaller type %2 loses information">;
7310def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7311  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7312  "to scalar %2 of different size">;
7313def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7314  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7315  "to vector %2 of different size">;
7316def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7317  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7318  "to vector %2 of different size">;
7319def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7320  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7321  "changes address space of nested pointers">,
7322  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7323def err_bad_lvalue_to_rvalue_cast : Error<
7324  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7325  "not compatible">;
7326def err_bad_rvalue_to_rvalue_cast : Error<
7327  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7328  "not compatible">;
7329def err_bad_static_cast_pointer_nonpointer : Error<
7330  "cannot cast from type %1 to pointer type %2">;
7331def err_bad_static_cast_member_pointer_nonmp : Error<
7332  "cannot cast from type %1 to member pointer type %2">;
7333def err_bad_cxx_cast_member_pointer_size : Error<
7334  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7335  "type %1 to member pointer type %2 of different size">;
7336def err_bad_reinterpret_cast_reference : Error<
7337  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7338def warn_undefined_reinterpret_cast : Warning<
7339  "reinterpret_cast from %0 to %1 has undefined behavior">,
7340  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7341
7342// These messages don't adhere to the pattern.
7343// FIXME: Display the path somehow better.
7344def err_ambiguous_base_to_derived_cast : Error<
7345  "ambiguous cast from base %0 to derived %1:%2">;
7346def err_static_downcast_via_virtual : Error<
7347  "cannot cast %0 to %1 via virtual base %2">;
7348def err_downcast_from_inaccessible_base : Error<
7349  "cannot cast %select{private|protected}2 base class %1 to %0">;
7350def err_upcast_to_inaccessible_base : Error<
7351  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7352def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7353  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7354def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7355def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7356def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7357def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7358
7359// Other C++ expressions
7360def err_need_header_before_typeid : Error<
7361  "you need to include <typeinfo> before using the 'typeid' operator">;
7362def err_need_header_before_ms_uuidof : Error<
7363  "you need to include <guiddef.h> before using the '__uuidof' operator">;
7364def err_need_header_before_placement_new : Error<
7365  "no matching %0 function for non-allocating placement new expression; "
7366  "include <new>">;
7367def err_ms___leave_not_in___try : Error<
7368  "'__leave' statement not in __try block">;
7369def err_uuidof_without_guid : Error<
7370  "cannot call operator __uuidof on a type with no GUID">;
7371def err_uuidof_with_multiple_guids : Error<
7372  "cannot call operator __uuidof on a type with multiple GUIDs">;
7373def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7374def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7375def err_static_illegal_in_new : Error<
7376  "the 'static' modifier for the array size is not legal in new expressions">;
7377def err_array_new_needs_size : Error<
7378  "array size must be specified in new expression with no initializer">;
7379def err_bad_new_type : Error<
7380  "cannot allocate %select{function|reference}1 type %0 with new">;
7381def err_new_incomplete_or_sizeless_type : Error<
7382  "allocation of %select{incomplete|sizeless}0 type %1">;
7383def err_new_array_nonconst : Error<
7384  "only the first dimension of an allocated array may have dynamic size">;
7385def err_new_array_size_unknown_from_init : Error<
7386  "cannot determine allocated array size from initializer">;
7387def err_new_array_init_args : Error<
7388  "array 'new' cannot have initialization arguments">;
7389def ext_new_paren_array_nonconst : ExtWarn<
7390  "when type is in parentheses, array cannot have dynamic size">;
7391def err_placement_new_non_placement_delete : Error<
7392  "'new' expression with placement arguments refers to non-placement "
7393  "'operator delete'">;
7394def err_array_size_not_integral : Error<
7395  "array size expression must have integral or %select{|unscoped }0"
7396  "enumeration type, not %1">;
7397def err_array_size_incomplete_type : Error<
7398  "array size expression has incomplete class type %0">;
7399def err_array_size_explicit_conversion : Error<
7400  "array size expression of type %0 requires explicit conversion to type %1">;
7401def note_array_size_conversion : Note<
7402  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7403def err_array_size_ambiguous_conversion : Error<
7404  "ambiguous conversion of array size expression of type %0 to an integral or "
7405  "enumeration type">;
7406def ext_array_size_conversion : Extension<
7407  "implicit conversion from array size expression of type %0 to "
7408  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7409  InGroup<CXX11>;
7410def warn_cxx98_compat_array_size_conversion : Warning<
7411  "implicit conversion from array size expression of type %0 to "
7412  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7413  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7414def err_address_space_qualified_new : Error<
7415  "'new' cannot allocate objects of type %0 in address space '%1'">;
7416def err_address_space_qualified_delete : Error<
7417  "'delete' cannot delete objects of type %0 in address space '%1'">;
7418
7419def err_default_init_const : Error<
7420  "default initialization of an object of const type %0"
7421  "%select{| without a user-provided default constructor}1">;
7422def ext_default_init_const : ExtWarn<
7423  "default initialization of an object of const type %0"
7424  "%select{| without a user-provided default constructor}1 "
7425  "is a Microsoft extension">,
7426  InGroup<MicrosoftConstInit>;
7427def err_delete_operand : Error<"cannot delete expression of type %0">;
7428def ext_delete_void_ptr_operand : ExtWarn<
7429  "cannot delete expression with pointer-to-'void' type %0">,
7430  InGroup<DeleteIncomplete>;
7431def err_ambiguous_delete_operand : Error<
7432  "ambiguous conversion of delete expression of type %0 to a pointer">;
7433def warn_delete_incomplete : Warning<
7434  "deleting pointer to incomplete type %0 may cause undefined behavior">,
7435  InGroup<DeleteIncomplete>;
7436def err_delete_incomplete_class_type : Error<
7437  "deleting incomplete class type %0; no conversions to pointer type">;
7438def err_delete_explicit_conversion : Error<
7439  "converting delete expression from type %0 to type %1 invokes an explicit "
7440  "conversion function">;
7441def note_delete_conversion : Note<"conversion to pointer type %0">;
7442def warn_delete_array_type : Warning<
7443  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
7444def warn_mismatched_delete_new : Warning<
7445  "'delete%select{|[]}0' applied to a pointer that was allocated with "
7446  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
7447  InGroup<DiagGroup<"mismatched-new-delete">>;
7448def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
7449def err_no_suitable_delete_member_function_found : Error<
7450  "no suitable member %0 in %1">;
7451def err_ambiguous_suitable_delete_member_function_found : Error<
7452  "multiple suitable %0 functions in %1">;
7453def warn_ambiguous_suitable_delete_function_found : Warning<
7454  "multiple suitable %0 functions for %1; no 'operator delete' function "
7455  "will be invoked if initialization throws an exception">,
7456  InGroup<DiagGroup<"ambiguous-delete">>;
7457def note_member_declared_here : Note<
7458  "member %0 declared here">;
7459def note_member_first_declared_here : Note<
7460  "member %0 first declared here">;
7461def warn_bitwise_instead_of_logical : Warning<
7462  "use of bitwise '%0' with boolean operands">,
7463  InGroup<BitwiseInsteadOfLogical>, DefaultIgnore;
7464def warn_bitwise_negation_bool : Warning<
7465  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
7466  "did you mean logical negation?">,
7467  InGroup<BoolOperation>, DefaultIgnore;
7468def err_decrement_bool : Error<"cannot decrement expression of type bool">;
7469def warn_increment_bool : Warning<
7470  "incrementing expression of type bool is deprecated and "
7471  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
7472def ext_increment_bool : ExtWarn<
7473  "ISO C++17 does not allow incrementing expression of type bool">,
7474  DefaultError, InGroup<IncrementBool>;
7475def err_increment_decrement_enum : Error<
7476  "cannot %select{decrement|increment}0 expression of enum type %1">;
7477
7478def warn_deprecated_increment_decrement_volatile : Warning<
7479  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
7480  "is deprecated">, InGroup<DeprecatedVolatile>;
7481def warn_deprecated_simple_assign_volatile : Warning<
7482  "use of result of assignment to object of volatile-qualified type %0 "
7483  "is deprecated">, InGroup<DeprecatedVolatile>;
7484def warn_deprecated_compound_assign_volatile : Warning<
7485  "compound assignment to object of volatile-qualified type %0 is deprecated">,
7486  InGroup<DeprecatedVolatile>;
7487def warn_deprecated_volatile_return : Warning<
7488  "volatile-qualified return type %0 is deprecated">,
7489  InGroup<DeprecatedVolatile>;
7490def warn_deprecated_volatile_param : Warning<
7491  "volatile-qualified parameter type %0 is deprecated">,
7492  InGroup<DeprecatedVolatile>;
7493def warn_deprecated_volatile_structured_binding : Warning<
7494  "volatile qualifier in structured binding declaration is deprecated">,
7495  InGroup<DeprecatedVolatile>;
7496
7497def warn_deprecated_altivec_src_compat : Warning<
7498  "Current handling of vector bool and vector pixel types in this context are "
7499  "deprecated. The default behaviour will soon change to that implied by the "
7500  "'-altivec-compat=xl' option">,
7501  InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7502
7503def err_catch_incomplete_ptr : Error<
7504  "cannot catch pointer to incomplete type %0">;
7505def err_catch_incomplete_ref : Error<
7506  "cannot catch reference to incomplete type %0">;
7507def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
7508def err_catch_sizeless : Error<
7509  "cannot catch %select{|reference to }0sizeless type %1">;
7510def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
7511def err_catch_variably_modified : Error<
7512  "cannot catch variably modified type %0">;
7513def err_qualified_catch_declarator : Error<
7514  "exception declarator cannot be qualified">;
7515def err_early_catch_all : Error<"catch-all handler must come last">;
7516def err_bad_memptr_rhs : Error<
7517  "right hand operand to %0 has non-pointer-to-member type %1">;
7518def err_bad_memptr_lhs : Error<
7519  "left hand operand to %0 must be a %select{|pointer to }1class "
7520  "compatible with the right hand operand, but is %2">;
7521def err_memptr_incomplete : Error<
7522  "member pointer has incomplete base type %0">;
7523def warn_exception_caught_by_earlier_handler : Warning<
7524  "exception of type %0 will be caught by earlier handler">,
7525  InGroup<Exceptions>;
7526def note_previous_exception_handler : Note<"for type %0">;
7527def err_exceptions_disabled : Error<
7528  "cannot use '%0' with exceptions disabled">;
7529def err_objc_exceptions_disabled : Error<
7530  "cannot use '%0' with Objective-C exceptions disabled">;
7531def warn_throw_in_noexcept_func : Warning<
7532  "%0 has a non-throwing exception specification but can still throw">,
7533  InGroup<Exceptions>;
7534def note_throw_in_dtor : Note<
7535  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
7536  "non-throwing}1 exception specification">;
7537def note_throw_in_function : Note<"function declared non-throwing here">;
7538def err_seh_try_outside_functions : Error<
7539  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
7540def err_mixing_cxx_try_seh_try : Error<
7541  "cannot use %select{C++ 'try'|Objective-C '@try'}0 "
7542  "in the same function as SEH '__try'">;
7543def err_seh_try_unsupported : Error<
7544  "SEH '__try' is not supported on this target">;
7545def note_conflicting_try_here : Note<
7546  "conflicting %0 here">;
7547def warn_jump_out_of_seh_finally : Warning<
7548  "jump out of __finally block has undefined behavior">,
7549  InGroup<DiagGroup<"jump-seh-finally">>;
7550def warn_non_virtual_dtor : Warning<
7551  "%0 has virtual functions but non-virtual destructor">,
7552  InGroup<NonVirtualDtor>, DefaultIgnore;
7553def warn_delete_non_virtual_dtor : Warning<
7554  "%select{delete|destructor}0 called on non-final %1 that has "
7555  "virtual functions but non-virtual destructor">,
7556  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
7557def note_delete_non_virtual : Note<
7558  "qualify call to silence this warning">;
7559def warn_delete_abstract_non_virtual_dtor : Warning<
7560  "%select{delete|destructor}0 called on %1 that is abstract but has "
7561  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
7562def warn_overloaded_virtual : Warning<
7563  "%q0 hides overloaded virtual %select{function|functions}1">,
7564  InGroup<OverloadedVirtual>, DefaultIgnore;
7565def note_hidden_overloaded_virtual_declared_here : Note<
7566  "hidden overloaded virtual function %q0 declared here"
7567  "%select{|: different classes%diff{ ($ vs $)|}2,3"
7568  "|: different number of parameters (%2 vs %3)"
7569  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
7570  "|: different return type%diff{ ($ vs $)|}2,3"
7571  "|: different qualifiers (%2 vs %3)"
7572  "|: different exception specifications}1">;
7573def warn_using_directive_in_header : Warning<
7574  "using namespace directive in global context in header">,
7575  InGroup<HeaderHygiene>, DefaultIgnore;
7576def warn_overaligned_type : Warning<
7577  "type %0 requires %1 bytes of alignment and the default allocator only "
7578  "guarantees %2 bytes">,
7579  InGroup<OveralignedType>, DefaultIgnore;
7580def err_aligned_allocation_unavailable : Error<
7581  "aligned %select{allocation|deallocation}0 function of type '%1' is "
7582  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
7583def note_silence_aligned_allocation_unavailable : Note<
7584  "if you supply your own aligned allocation functions, use "
7585  "-faligned-allocation to silence this diagnostic">;
7586
7587def err_conditional_void_nonvoid : Error<
7588  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
7589  "is of type %0">;
7590def err_conditional_ambiguous : Error<
7591  "conditional expression is ambiguous; "
7592  "%diff{$ can be converted to $ and vice versa|"
7593  "types can be convert to each other}0,1">;
7594def err_conditional_ambiguous_ovl : Error<
7595  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
7596  "can be converted to several common types">;
7597def err_conditional_vector_size : Error<
7598  "vector condition type %0 and result type %1 do not have the same number "
7599  "of elements">;
7600def err_conditional_vector_element_size : Error<
7601  "vector condition type %0 and result type %1 do not have elements of the "
7602  "same size">;
7603def err_conditional_vector_has_void : Error<
7604  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
7605def err_conditional_vector_operand_type
7606    : Error<"enumeration type %0 is not allowed in a vector conditional">;
7607def err_conditional_vector_cond_result_mismatch
7608    : Error<"cannot mix vectors and extended vectors in a vector conditional">;
7609def err_conditional_vector_mismatched
7610    : Error<"vector operands to the vector conditional must be the same type "
7611            "%diff{($ and $)|}0,1}">;
7612
7613def err_throw_incomplete : Error<
7614  "cannot throw object of incomplete type %0">;
7615def err_throw_incomplete_ptr : Error<
7616  "cannot throw pointer to object of incomplete type %0">;
7617def err_throw_sizeless : Error<
7618  "cannot throw object of sizeless type %0">;
7619def warn_throw_underaligned_obj : Warning<
7620  "underaligned exception object thrown">,
7621  InGroup<UnderalignedExceptionObject>;
7622def note_throw_underaligned_obj : Note<
7623  "required alignment of type %0 (%1 bytes) is larger than the supported "
7624  "alignment of C++ exception objects on this target (%2 bytes)">;
7625def err_return_in_constructor_handler : Error<
7626  "return in the catch of a function try block of a constructor is illegal">;
7627def warn_cdtor_function_try_handler_mem_expr : Warning<
7628  "cannot refer to a non-static member from the handler of a "
7629  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
7630
7631let CategoryName = "Lambda Issue" in {
7632  def err_capture_more_than_once : Error<
7633    "%0 can appear only once in a capture list">;
7634  def err_reference_capture_with_reference_default : Error<
7635    "'&' cannot precede a capture when the capture default is '&'">;
7636  def err_copy_capture_with_copy_default : Error<
7637    "'&' must precede a capture when the capture default is '='">;
7638  def err_capture_does_not_name_variable : Error<
7639    "%0 in capture list does not name a variable">;
7640  def err_capture_non_automatic_variable : Error<
7641    "%0 cannot be captured because it does not have automatic storage "
7642    "duration">;
7643  def err_this_capture : Error<
7644    "'this' cannot be %select{implicitly |}0captured in this context">;
7645  def note_lambda_this_capture_fixit : Note<
7646    "explicitly capture 'this'">;
7647  def err_lambda_capture_anonymous_var : Error<
7648    "unnamed variable cannot be implicitly captured in a lambda expression">;
7649  def err_lambda_capture_flexarray_type : Error<
7650    "variable %0 with flexible array member cannot be captured in "
7651    "a lambda expression">;
7652  def err_lambda_impcap : Error<
7653    "variable %0 cannot be implicitly captured in a lambda with no "
7654    "capture-default specified">;
7655  def note_lambda_variable_capture_fixit : Note<
7656    "capture %0 by %select{value|reference}1">;
7657  def note_lambda_default_capture_fixit : Note<
7658    "default capture by %select{value|reference}0">;
7659  def note_lambda_decl : Note<"lambda expression begins here">;
7660  def err_lambda_unevaluated_operand : Error<
7661    "lambda expression in an unevaluated operand">;
7662  def err_lambda_in_constant_expression : Error<
7663    "a lambda expression may not appear inside of a constant expression">;
7664  def err_lambda_in_invalid_context : Error<
7665    "a lambda expression cannot appear in this context">;
7666  def err_lambda_return_init_list : Error<
7667    "cannot deduce lambda return type from initializer list">;
7668  def err_lambda_capture_default_arg : Error<
7669    "lambda expression in default argument cannot capture any entity">;
7670  def err_lambda_incomplete_result : Error<
7671    "incomplete result type %0 in lambda expression">;
7672  def err_noreturn_lambda_has_return_expr : Error<
7673    "lambda declared 'noreturn' should not return">;
7674  def warn_maybe_falloff_nonvoid_lambda : Warning<
7675    "non-void lambda does not return a value in all control paths">,
7676    InGroup<ReturnType>;
7677  def warn_falloff_nonvoid_lambda : Warning<
7678    "non-void lambda does not return a value">,
7679    InGroup<ReturnType>;
7680  def err_access_lambda_capture : Error<
7681    // The ERRORs represent other special members that aren't constructors, in
7682    // hopes that someone will bother noticing and reporting if they appear
7683    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
7684    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
7685    AccessControl;
7686  def note_lambda_to_block_conv : Note<
7687    "implicit capture of lambda object due to conversion to block pointer "
7688    "here">;
7689  def note_var_explicitly_captured_here : Note<"variable %0 is"
7690    "%select{| explicitly}1 captured here">;
7691
7692  // C++14 lambda init-captures.
7693  def warn_cxx11_compat_init_capture : Warning<
7694    "initialized lambda captures are incompatible with C++ standards "
7695    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
7696  def ext_init_capture : ExtWarn<
7697    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
7698  def err_init_capture_no_expression : Error<
7699    "initializer missing for lambda capture %0">;
7700  def err_init_capture_multiple_expressions : Error<
7701    "initializer for lambda capture %0 contains multiple expressions">;
7702  def err_init_capture_paren_braces : Error<
7703    "cannot deduce type for lambda capture %1 from "
7704    "%select{parenthesized|nested}0 initializer list">;
7705  def err_init_capture_deduction_failure : Error<
7706    "cannot deduce type for lambda capture %0 from initializer of type %2">;
7707  def err_init_capture_deduction_failure_from_init_list : Error<
7708    "cannot deduce type for lambda capture %0 from initializer list">;
7709  def warn_cxx17_compat_init_capture_pack : Warning<
7710    "initialized lambda capture packs are incompatible with C++ standards "
7711    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7712  def ext_init_capture_pack : ExtWarn<
7713    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
7714
7715  // C++14 generic lambdas.
7716  def warn_cxx11_compat_generic_lambda : Warning<
7717    "generic lambdas are incompatible with C++11">,
7718    InGroup<CXXPre14Compat>, DefaultIgnore;
7719
7720  // C++17 '*this' captures.
7721  def warn_cxx14_compat_star_this_lambda_capture : Warning<
7722    "by value capture of '*this' is incompatible with C++ standards before C++17">,
7723     InGroup<CXXPre17Compat>, DefaultIgnore;
7724  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
7725    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
7726
7727  // C++17 parameter shadows capture
7728  def err_parameter_shadow_capture : Error<
7729    "a lambda parameter cannot shadow an explicitly captured entity">;
7730
7731  // C++20 [=, this] captures.
7732  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
7733    "explicit capture of 'this' with a capture default of '=' is incompatible "
7734    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7735  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
7736    "explicit capture of 'this' with a capture default of '=' "
7737    "is a C++20 extension">, InGroup<CXX20>;
7738  def warn_deprecated_this_capture : Warning<
7739    "implicit capture of 'this' with a capture default of '=' is deprecated">,
7740    InGroup<DeprecatedThisCapture>, DefaultIgnore;
7741  def note_deprecated_this_capture : Note<
7742    "add an explicit capture of 'this' to capture '*this' by reference">;
7743
7744  // C++20 default constructible / assignable lambdas.
7745  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
7746    "%select{default construction|assignment}0 of lambda is incompatible with "
7747    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7748}
7749
7750def err_return_in_captured_stmt : Error<
7751  "cannot return from %0">;
7752def err_capture_block_variable : Error<
7753  "__block variable %0 cannot be captured in a "
7754  "%select{lambda expression|captured statement}1">;
7755
7756def err_operator_arrow_circular : Error<
7757  "circular pointer delegation detected">;
7758def err_operator_arrow_depth_exceeded : Error<
7759  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
7760  "'operator->' calls">;
7761def note_operator_arrow_here : Note<
7762  "'operator->' declared here produces an object of type %0">;
7763def note_operator_arrows_suppressed : Note<
7764  "(skipping %0 'operator->'%s0 in backtrace)">;
7765def note_operator_arrow_depth : Note<
7766  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
7767
7768def err_pseudo_dtor_base_not_scalar : Error<
7769  "object expression of non-scalar type %0 cannot be used in a "
7770  "pseudo-destructor expression">;
7771def ext_pseudo_dtor_on_void : ExtWarn<
7772  "pseudo-destructors on type void are a Microsoft extension">,
7773  InGroup<MicrosoftVoidPseudoDtor>;
7774def err_pseudo_dtor_type_mismatch : Error<
7775  "the type of object expression "
7776  "%diff{($) does not match the type being destroyed ($)|"
7777  "does not match the type being destroyed}0,1 "
7778  "in pseudo-destructor expression">;
7779def err_pseudo_dtor_call_with_args : Error<
7780  "call to pseudo-destructor cannot have any arguments">;
7781def err_dtor_expr_without_call : Error<
7782  "reference to %select{destructor|pseudo-destructor}0 must be called"
7783  "%select{|; did you mean to call it with no arguments?}1">;
7784def err_pseudo_dtor_destructor_non_type : Error<
7785  "%0 does not refer to a type name in pseudo-destructor expression; expected "
7786  "the name of type %1">;
7787def err_invalid_use_of_function_type : Error<
7788  "a function type is not allowed here">;
7789def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
7790def err_typecheck_bool_condition : Error<
7791  "value of type %0 is not contextually convertible to 'bool'">;
7792def err_typecheck_ambiguous_condition : Error<
7793  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
7794def err_typecheck_nonviable_condition : Error<
7795  "no viable conversion%select{%diff{ from $ to $|}1,2|"
7796  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
7797def err_typecheck_nonviable_condition_incomplete : Error<
7798  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
7799def err_typecheck_deleted_function : Error<
7800  "conversion function %diff{from $ to $|between types}0,1 "
7801  "invokes a deleted function">;
7802
7803def err_expected_class_or_namespace : Error<"%0 is not a class"
7804  "%select{ or namespace|, namespace, or enumeration}1">;
7805def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
7806  "because namespace %1 does not enclose namespace %2">;
7807def err_invalid_declarator_global_scope : Error<
7808  "definition or redeclaration of %0 cannot name the global scope">;
7809def err_invalid_declarator_in_function : Error<
7810  "definition or redeclaration of %0 not allowed inside a function">;
7811def err_invalid_declarator_in_block : Error<
7812  "definition or redeclaration of %0 not allowed inside a block">;
7813def err_not_tag_in_scope : Error<
7814  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
7815
7816def err_no_typeid_with_fno_rtti : Error<
7817  "use of typeid requires -frtti">;
7818def err_no_dynamic_cast_with_fno_rtti : Error<
7819  "use of dynamic_cast requires -frtti">;
7820def warn_no_dynamic_cast_with_rtti_disabled: Warning<
7821  "dynamic_cast will not work since RTTI data is disabled by "
7822  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7823def warn_no_typeid_with_rtti_disabled: Warning<
7824  "typeid will not work since RTTI data is disabled by "
7825  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7826
7827def err_cannot_form_pointer_to_member_of_reference_type : Error<
7828  "cannot form a pointer-to-member to member %0 of reference type %1">;
7829def err_incomplete_object_call : Error<
7830  "incomplete type in call to object of type %0">;
7831
7832def warn_condition_is_assignment : Warning<"using the result of an "
7833  "assignment as a condition without parentheses">,
7834  InGroup<Parentheses>;
7835def warn_free_nonheap_object
7836  : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">,
7837    InGroup<FreeNonHeapObject>;
7838
7839// Completely identical except off by default.
7840def warn_condition_is_idiomatic_assignment : Warning<"using the result "
7841  "of an assignment as a condition without parentheses">,
7842  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
7843def note_condition_assign_to_comparison : Note<
7844  "use '==' to turn this assignment into an equality comparison">;
7845def note_condition_or_assign_to_comparison : Note<
7846  "use '!=' to turn this compound assignment into an inequality comparison">;
7847def note_condition_assign_silence : Note<
7848  "place parentheses around the assignment to silence this warning">;
7849
7850def warn_equality_with_extra_parens : Warning<"equality comparison with "
7851  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
7852def note_equality_comparison_to_assign : Note<
7853  "use '=' to turn this equality comparison into an assignment">;
7854def note_equality_comparison_silence : Note<
7855  "remove extraneous parentheses around the comparison to silence this warning">;
7856
7857// assignment related diagnostics (also for argument passing, returning, etc).
7858// In most of these diagnostics the %2 is a value from the
7859// Sema::AssignmentAction enumeration
7860def err_typecheck_convert_incompatible : Error<
7861  "%select{%diff{assigning to $ from incompatible type $|"
7862  "assigning to type from incompatible type}0,1"
7863  "|%diff{passing $ to parameter of incompatible type $|"
7864  "passing type to parameter of incompatible type}0,1"
7865  "|%diff{returning $ from a function with incompatible result type $|"
7866  "returning type from a function with incompatible result type}0,1"
7867  "|%diff{converting $ to incompatible type $|"
7868  "converting type to incompatible type}0,1"
7869  "|%diff{initializing $ with an expression of incompatible type $|"
7870  "initializing type with an expression of incompatible type}0,1"
7871  "|%diff{sending $ to parameter of incompatible type $|"
7872  "sending type to parameter of incompatible type}0,1"
7873  "|%diff{casting $ to incompatible type $|"
7874  "casting type to incompatible type}0,1}2"
7875  "%select{|; dereference with *|"
7876  "; take the address with &|"
7877  "; remove *|"
7878  "; remove &}3"
7879  "%select{|: different classes%diff{ ($ vs $)|}5,6"
7880  "|: different number of parameters (%5 vs %6)"
7881  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
7882  "|: different return type%diff{ ($ vs $)|}5,6"
7883  "|: different qualifiers (%5 vs %6)"
7884  "|: different exception specifications}4">;
7885def err_typecheck_missing_return_type_incompatible : Error<
7886  "%diff{return type $ must match previous return type $|"
7887  "return type must match previous return type}0,1 when %select{block "
7888  "literal|lambda expression}2 has unspecified explicit return type">;
7889
7890def note_incomplete_class_and_qualified_id : Note<
7891  "conformance of forward class %0 to protocol %1 can not be confirmed">;
7892def warn_incompatible_qualified_id : Warning<
7893  "%select{%diff{assigning to $ from incompatible type $|"
7894  "assigning to type from incompatible type}0,1"
7895  "|%diff{passing $ to parameter of incompatible type $|"
7896  "passing type to parameter of incompatible type}0,1"
7897  "|%diff{returning $ from a function with incompatible result type $|"
7898  "returning type from a function with incompatible result type}0,1"
7899  "|%diff{converting $ to incompatible type $|"
7900  "converting type to incompatible type}0,1"
7901  "|%diff{initializing $ with an expression of incompatible type $|"
7902  "initializing type with an expression of incompatible type}0,1"
7903  "|%diff{sending $ to parameter of incompatible type $|"
7904  "sending type to parameter of incompatible type}0,1"
7905  "|%diff{casting $ to incompatible type $|"
7906  "casting type to incompatible type}0,1}2">;
7907def err_incompatible_qualified_id : Error<
7908  "%select{%diff{assigning to $ from incompatible type $|"
7909  "assigning to type from incompatible type}0,1"
7910  "|%diff{passing $ to parameter of incompatible type $|"
7911  "passing type to parameter of incompatible type}0,1"
7912  "|%diff{returning $ from a function with incompatible result type $|"
7913  "returning type from a function with incompatible result type}0,1"
7914  "|%diff{converting $ to incompatible type $|"
7915  "converting type to incompatible type}0,1"
7916  "|%diff{initializing $ with an expression of incompatible type $|"
7917  "initializing type with an expression of incompatible type}0,1"
7918  "|%diff{sending $ to parameter of incompatible type $|"
7919  "sending type to parameter of incompatible type}0,1"
7920  "|%diff{casting $ to incompatible type $|"
7921  "casting type to incompatible type}0,1}2">;
7922def ext_typecheck_convert_pointer_int : ExtWarn<
7923  "incompatible pointer to integer conversion "
7924  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7925  "|%diff{passing $ to parameter of type $|"
7926  "passing to parameter of different type}0,1"
7927  "|%diff{returning $ from a function with result type $|"
7928  "returning from function with different return type}0,1"
7929  "|%diff{converting $ to type $|converting between types}0,1"
7930  "|%diff{initializing $ with an expression of type $|"
7931  "initializing with expression of different type}0,1"
7932  "|%diff{sending $ to parameter of type $|"
7933  "sending to parameter of different type}0,1"
7934  "|%diff{casting $ to type $|casting between types}0,1}2"
7935  "%select{|; dereference with *|"
7936  "; take the address with &|"
7937  "; remove *|"
7938  "; remove &}3">,
7939  InGroup<IntConversion>;
7940def err_typecheck_convert_pointer_int : Error<
7941  "incompatible pointer to integer conversion "
7942  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7943  "|%diff{passing $ to parameter of type $|"
7944  "passing to parameter of different type}0,1"
7945  "|%diff{returning $ from a function with result type $|"
7946  "returning from function with different return type}0,1"
7947  "|%diff{converting $ to type $|converting between types}0,1"
7948  "|%diff{initializing $ with an expression of type $|"
7949  "initializing with expression of different type}0,1"
7950  "|%diff{sending $ to parameter of type $|"
7951  "sending to parameter of different type}0,1"
7952  "|%diff{casting $ to type $|casting between types}0,1}2"
7953  "%select{|; dereference with *|"
7954  "; take the address with &|"
7955  "; remove *|"
7956  "; remove &}3">;
7957def ext_typecheck_convert_int_pointer : ExtWarn<
7958  "incompatible integer to pointer conversion "
7959  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7960  "|%diff{passing $ to parameter of type $|"
7961  "passing to parameter of different type}0,1"
7962  "|%diff{returning $ from a function with result type $|"
7963  "returning from function with different return type}0,1"
7964  "|%diff{converting $ to type $|converting between types}0,1"
7965  "|%diff{initializing $ with an expression of type $|"
7966  "initializing with expression of different type}0,1"
7967  "|%diff{sending $ to parameter of type $|"
7968  "sending to parameter of different type}0,1"
7969  "|%diff{casting $ to type $|casting between types}0,1}2"
7970  "%select{|; dereference with *|"
7971  "; take the address with &|"
7972  "; remove *|"
7973  "; remove &}3">,
7974  InGroup<IntConversion>, SFINAEFailure;
7975def err_typecheck_convert_int_pointer : Error<
7976  "incompatible integer to pointer conversion "
7977  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7978  "|%diff{passing $ to parameter of type $|"
7979  "passing to parameter of different type}0,1"
7980  "|%diff{returning $ from a function with result type $|"
7981  "returning from function with different return type}0,1"
7982  "|%diff{converting $ to type $|converting between types}0,1"
7983  "|%diff{initializing $ with an expression of type $|"
7984  "initializing with expression of different type}0,1"
7985  "|%diff{sending $ to parameter of type $|"
7986  "sending to parameter of different type}0,1"
7987  "|%diff{casting $ to type $|casting between types}0,1}2"
7988  "%select{|; dereference with *|"
7989  "; take the address with &|"
7990  "; remove *|"
7991  "; remove &}3">;
7992def ext_typecheck_convert_pointer_void_func : Extension<
7993  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7994  "|%diff{passing $ to parameter of type $|"
7995  "passing to parameter of different type}0,1"
7996  "|%diff{returning $ from a function with result type $|"
7997  "returning from function with different return type}0,1"
7998  "|%diff{converting $ to type $|converting between types}0,1"
7999  "|%diff{initializing $ with an expression of type $|"
8000  "initializing with expression of different type}0,1"
8001  "|%diff{sending $ to parameter of type $|"
8002  "sending to parameter of different type}0,1"
8003  "|%diff{casting $ to type $|casting between types}0,1}2"
8004  " converts between void pointer and function pointer">;
8005def err_typecheck_convert_pointer_void_func : Error<
8006  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8007  "|%diff{passing $ to parameter of type $|"
8008  "passing to parameter of different type}0,1"
8009  "|%diff{returning $ from a function with result type $|"
8010  "returning from function with different return type}0,1"
8011  "|%diff{converting $ to type $|converting between types}0,1"
8012  "|%diff{initializing $ with an expression of type $|"
8013  "initializing with expression of different type}0,1"
8014  "|%diff{sending $ to parameter of type $|"
8015  "sending to parameter of different type}0,1"
8016  "|%diff{casting $ to type $|casting between types}0,1}2"
8017  " converts between void pointer and function pointer">;
8018def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
8019  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8020  "|%diff{passing $ to parameter of type $|"
8021  "passing to parameter of different type}0,1"
8022  "|%diff{returning $ from a function with result type $|"
8023  "returning from function with different return type}0,1"
8024  "|%diff{converting $ to type $|converting between types}0,1"
8025  "|%diff{initializing $ with an expression of type $|"
8026  "initializing with expression of different type}0,1"
8027  "|%diff{sending $ to parameter of type $|"
8028  "sending to parameter of different type}0,1"
8029  "|%diff{casting $ to type $|casting between types}0,1}2"
8030  " converts between pointers to integer types %select{with different sign|"
8031  "where one is of the unique plain 'char' type and the other is not}3">,
8032  InGroup<DiagGroup<"pointer-sign">>;
8033def err_typecheck_convert_incompatible_pointer_sign :
8034  Error<ext_typecheck_convert_incompatible_pointer_sign.Text>;
8035def ext_typecheck_convert_incompatible_pointer : ExtWarn<
8036  "incompatible pointer types "
8037  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8038  "|%diff{passing $ to parameter of type $|"
8039  "passing to parameter of different type}0,1"
8040  "|%diff{returning $ from a function with result type $|"
8041  "returning from function with different return type}0,1"
8042  "|%diff{converting $ to type $|converting between types}0,1"
8043  "|%diff{initializing $ with an expression of type $|"
8044  "initializing with expression of different type}0,1"
8045  "|%diff{sending $ to parameter of type $|"
8046  "sending to parameter of different type}0,1"
8047  "|%diff{casting $ to type $|casting between types}0,1}2"
8048  "%select{|; dereference with *|"
8049  "; take the address with &|"
8050  "; remove *|"
8051  "; remove &}3">,
8052  InGroup<IncompatiblePointerTypes>;
8053def err_typecheck_convert_incompatible_pointer : Error<
8054  "incompatible pointer types "
8055  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8056  "|%diff{passing $ to parameter of type $|"
8057  "passing to parameter of different type}0,1"
8058  "|%diff{returning $ from a function with result type $|"
8059  "returning from function with different return type}0,1"
8060  "|%diff{converting $ to type $|converting between types}0,1"
8061  "|%diff{initializing $ with an expression of type $|"
8062  "initializing with expression of different type}0,1"
8063  "|%diff{sending $ to parameter of type $|"
8064  "sending to parameter of different type}0,1"
8065  "|%diff{casting $ to type $|casting between types}0,1}2"
8066  "%select{|; dereference with *|"
8067  "; take the address with &|"
8068  "; remove *|"
8069  "; remove &}3">;
8070def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
8071  "incompatible function pointer types "
8072  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8073  "|%diff{passing $ to parameter of type $|"
8074  "passing to parameter of different type}0,1"
8075  "|%diff{returning $ from a function with result type $|"
8076  "returning from function with different return type}0,1"
8077  "|%diff{converting $ to type $|converting between types}0,1"
8078  "|%diff{initializing $ with an expression of type $|"
8079  "initializing with expression of different type}0,1"
8080  "|%diff{sending $ to parameter of type $|"
8081  "sending to parameter of different type}0,1"
8082  "|%diff{casting $ to type $|casting between types}0,1}2"
8083  "%select{|; dereference with *|"
8084  "; take the address with &|"
8085  "; remove *|"
8086  "; remove &}3">,
8087  InGroup<IncompatibleFunctionPointerTypes>;
8088def err_typecheck_convert_incompatible_function_pointer : Error<
8089  "incompatible function pointer types "
8090  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8091  "|%diff{passing $ to parameter of type $|"
8092  "passing to parameter of different type}0,1"
8093  "|%diff{returning $ from a function with result type $|"
8094  "returning from function with different return type}0,1"
8095  "|%diff{converting $ to type $|converting between types}0,1"
8096  "|%diff{initializing $ with an expression of type $|"
8097  "initializing with expression of different type}0,1"
8098  "|%diff{sending $ to parameter of type $|"
8099  "sending to parameter of different type}0,1"
8100  "|%diff{casting $ to type $|casting between types}0,1}2"
8101  "%select{|; dereference with *|"
8102  "; take the address with &|"
8103  "; remove *|"
8104  "; remove &}3">;
8105def ext_typecheck_convert_discards_qualifiers : ExtWarn<
8106  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8107  "|%diff{passing $ to parameter of type $|"
8108  "passing to parameter of different type}0,1"
8109  "|%diff{returning $ from a function with result type $|"
8110  "returning from function with different return type}0,1"
8111  "|%diff{converting $ to type $|converting between types}0,1"
8112  "|%diff{initializing $ with an expression of type $|"
8113  "initializing with expression of different type}0,1"
8114  "|%diff{sending $ to parameter of type $|"
8115  "sending to parameter of different type}0,1"
8116  "|%diff{casting $ to type $|casting between types}0,1}2"
8117  " discards qualifiers">,
8118  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8119def err_typecheck_convert_discards_qualifiers : Error<
8120  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8121  "|%diff{passing $ to parameter of type $|"
8122  "passing to parameter of different type}0,1"
8123  "|%diff{returning $ from a function with result type $|"
8124  "returning from function with different return type}0,1"
8125  "|%diff{converting $ to type $|converting between types}0,1"
8126  "|%diff{initializing $ with an expression of type $|"
8127  "initializing with expression of different type}0,1"
8128  "|%diff{sending $ to parameter of type $|"
8129  "sending to parameter of different type}0,1"
8130  "|%diff{casting $ to type $|casting between types}0,1}2"
8131  " discards qualifiers">;
8132def ext_nested_pointer_qualifier_mismatch : ExtWarn<
8133  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8134  "|%diff{passing $ to parameter of type $|"
8135  "passing to parameter of different type}0,1"
8136  "|%diff{returning $ from a function with result type $|"
8137  "returning from function with different return type}0,1"
8138  "|%diff{converting $ to type $|converting between types}0,1"
8139  "|%diff{initializing $ with an expression of type $|"
8140  "initializing with expression of different type}0,1"
8141  "|%diff{sending $ to parameter of type $|"
8142  "sending to parameter of different type}0,1"
8143  "|%diff{casting $ to type $|casting between types}0,1}2"
8144  " discards qualifiers in nested pointer types">,
8145  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8146def err_nested_pointer_qualifier_mismatch : Error<
8147  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8148  "|%diff{passing $ to parameter of type $|"
8149  "passing to parameter of different type}0,1"
8150  "|%diff{returning $ from a function with result type $|"
8151  "returning from function with different return type}0,1"
8152  "|%diff{converting $ to type $|converting between types}0,1"
8153  "|%diff{initializing $ with an expression of type $|"
8154  "initializing with expression of different type}0,1"
8155  "|%diff{sending $ to parameter of type $|"
8156  "sending to parameter of different type}0,1"
8157  "|%diff{casting $ to type $|casting between types}0,1}2"
8158  " discards qualifiers in nested pointer types">;
8159def warn_incompatible_vectors : Warning<
8160  "incompatible vector types "
8161  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8162  "|%diff{passing $ to parameter of type $|"
8163  "passing to parameter of different type}0,1"
8164  "|%diff{returning $ from a function with result type $|"
8165  "returning from function with different return type}0,1"
8166  "|%diff{converting $ to type $|converting between types}0,1"
8167  "|%diff{initializing $ with an expression of type $|"
8168  "initializing with expression of different type}0,1"
8169  "|%diff{sending $ to parameter of type $|"
8170  "sending to parameter of different type}0,1"
8171  "|%diff{casting $ to type $|casting between types}0,1}2">,
8172  InGroup<VectorConversion>, DefaultIgnore;
8173def err_incompatible_vectors : Error<
8174  "incompatible vector types "
8175  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8176  "|%diff{passing $ to parameter of type $|"
8177  "passing to parameter of different type}0,1"
8178  "|%diff{returning $ from a function with result type $|"
8179  "returning from function with different return type}0,1"
8180  "|%diff{converting $ to type $|converting between types}0,1"
8181  "|%diff{initializing $ with an expression of type $|"
8182  "initializing with expression of different type}0,1"
8183  "|%diff{sending $ to parameter of type $|"
8184  "sending to parameter of different type}0,1"
8185  "|%diff{casting $ to type $|casting between types}0,1}2">;
8186def err_int_to_block_pointer : Error<
8187  "invalid block pointer conversion "
8188  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8189  "|%diff{passing $ to parameter of type $|"
8190  "passing to parameter of different type}0,1"
8191  "|%diff{returning $ from a function with result type $|"
8192  "returning from function with different return type}0,1"
8193  "|%diff{converting $ to type $|converting between types}0,1"
8194  "|%diff{initializing $ with an expression of type $|"
8195  "initializing with expression of different type}0,1"
8196  "|%diff{sending $ to parameter of type $|"
8197  "sending to parameter of different type}0,1"
8198  "|%diff{casting $ to type $|casting between types}0,1}2">;
8199def err_typecheck_convert_incompatible_block_pointer : Error<
8200  "incompatible block pointer types "
8201  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8202  "|%diff{passing $ to parameter of type $|"
8203  "passing to parameter of different type}0,1"
8204  "|%diff{returning $ from a function with result type $|"
8205  "returning from function with different return type}0,1"
8206  "|%diff{converting $ to type $|converting between types}0,1"
8207  "|%diff{initializing $ with an expression of type $|"
8208  "initializing with expression of different type}0,1"
8209  "|%diff{sending $ to parameter of type $|"
8210  "sending to parameter of different type}0,1"
8211  "|%diff{casting $ to type $|casting between types}0,1}2">;
8212def err_typecheck_incompatible_address_space : Error<
8213  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8214  "|%diff{passing $ to parameter of type $|"
8215  "passing to parameter of different type}0,1"
8216  "|%diff{returning $ from a function with result type $|"
8217  "returning from function with different return type}0,1"
8218  "|%diff{converting $ to type $|converting between types}0,1"
8219  "|%diff{initializing $ with an expression of type $|"
8220  "initializing with expression of different type}0,1"
8221  "|%diff{sending $ to parameter of type $|"
8222  "sending to parameter of different type}0,1"
8223  "|%diff{casting $ to type $|casting between types}0,1}2"
8224  " changes address space of pointer">;
8225def err_typecheck_incompatible_nested_address_space : Error<
8226  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8227  "|%diff{passing $ to parameter of type $|"
8228  "passing to parameter of different type}0,1"
8229  "|%diff{returning $ from a function with result type $|"
8230  "returning from function with different return type}0,1"
8231  "|%diff{converting $ to type $|converting between types}0,1"
8232  "|%diff{initializing $ with an expression of type $|"
8233  "initializing with expression of different type}0,1"
8234  "|%diff{sending $ to parameter of type $|"
8235  "sending to parameter of different type}0,1"
8236  "|%diff{casting $ to type $|casting between types}0,1}2"
8237  " changes address space of nested pointer">;
8238def err_typecheck_incompatible_ownership : Error<
8239  "%select{%diff{assigning $ to $|assigning to different types}1,0"
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  " changes retain/release properties of pointer">;
8251def err_typecheck_comparison_of_distinct_blocks : Error<
8252  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8253
8254def err_typecheck_array_not_modifiable_lvalue : Error<
8255  "array type %0 is not assignable">;
8256def err_typecheck_non_object_not_modifiable_lvalue : Error<
8257  "non-object type %0 is not assignable">;
8258def err_typecheck_expression_not_modifiable_lvalue : Error<
8259  "expression is not assignable">;
8260def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8261  "incomplete type %0 is not assignable">;
8262def err_typecheck_lvalue_casts_not_supported : Error<
8263  "assignment to cast is illegal, lvalue casts are not supported">;
8264
8265def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8266  "vector is not assignable (contains duplicate components)">;
8267def err_block_decl_ref_not_modifiable_lvalue : Error<
8268  "variable is not assignable (missing __block type specifier)">;
8269def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8270  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8271def err_typecheck_call_not_function : Error<
8272  "called object type %0 is not a function or function pointer">;
8273def err_call_incomplete_return : Error<
8274  "calling function with incomplete return type %0">;
8275def err_call_function_incomplete_return : Error<
8276  "calling %0 with incomplete return type %1">;
8277def err_call_incomplete_argument : Error<
8278  "argument type %0 is incomplete">;
8279def err_typecheck_call_too_few_args : Error<
8280  "too few %select{|||execution configuration }0arguments to "
8281  "%select{function|block|method|kernel function}0 call, "
8282  "expected %1, have %2">;
8283def err_typecheck_call_too_few_args_one : Error<
8284  "too few %select{|||execution configuration }0arguments to "
8285  "%select{function|block|method|kernel function}0 call, "
8286  "single argument %1 was not specified">;
8287def err_typecheck_call_too_few_args_at_least : Error<
8288  "too few %select{|||execution configuration }0arguments to "
8289  "%select{function|block|method|kernel function}0 call, "
8290  "expected at least %1, have %2">;
8291def err_typecheck_call_too_few_args_at_least_one : Error<
8292  "too few %select{|||execution configuration }0arguments to "
8293  "%select{function|block|method|kernel function}0 call, "
8294  "at least argument %1 must be specified">;
8295def err_typecheck_call_too_few_args_suggest : Error<
8296  "too few %select{|||execution configuration }0arguments to "
8297  "%select{function|block|method|kernel function}0 call, "
8298  "expected %1, have %2; did you mean %3?">;
8299def err_typecheck_call_too_few_args_at_least_suggest : Error<
8300  "too few %select{|||execution configuration }0arguments to "
8301  "%select{function|block|method|kernel function}0 call, "
8302  "expected at least %1, have %2; did you mean %3?">;
8303def err_typecheck_call_too_many_args : Error<
8304  "too many %select{|||execution configuration }0arguments to "
8305  "%select{function|block|method|kernel function}0 call, "
8306  "expected %1, have %2">;
8307def err_typecheck_call_too_many_args_one : Error<
8308  "too many %select{|||execution configuration }0arguments to "
8309  "%select{function|block|method|kernel function}0 call, "
8310  "expected single argument %1, have %2 arguments">;
8311def err_typecheck_call_too_many_args_at_most : Error<
8312  "too many %select{|||execution configuration }0arguments to "
8313  "%select{function|block|method|kernel function}0 call, "
8314  "expected at most %1, have %2">;
8315def err_typecheck_call_too_many_args_at_most_one : Error<
8316  "too many %select{|||execution configuration }0arguments to "
8317  "%select{function|block|method|kernel function}0 call, "
8318  "expected at most single argument %1, have %2 arguments">;
8319def err_typecheck_call_too_many_args_suggest : Error<
8320  "too many %select{|||execution configuration }0arguments to "
8321  "%select{function|block|method|kernel function}0 call, "
8322  "expected %1, have %2; did you mean %3?">;
8323def err_typecheck_call_too_many_args_at_most_suggest : Error<
8324  "too many %select{|||execution configuration }0arguments to "
8325  "%select{function|block|method|kernel function}0 call, "
8326  "expected at most %1, have %2; did you mean %3?">;
8327
8328def err_arc_typecheck_convert_incompatible_pointer : Error<
8329  "incompatible pointer types passing retainable parameter of type %0"
8330  "to a CF function expecting %1 type">;
8331
8332def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8333
8334def warn_call_wrong_number_of_arguments : Warning<
8335  "too %select{few|many}0 arguments in call to %1">;
8336def err_atomic_builtin_must_be_pointer : Error<
8337  "address argument to atomic builtin must be a pointer (%0 invalid)">;
8338def err_atomic_builtin_must_be_pointer_intptr : Error<
8339  "address argument to atomic builtin must be a pointer to integer or pointer"
8340  " (%0 invalid)">;
8341def err_atomic_builtin_cannot_be_const : Error<
8342  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8343def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8344  "address argument to atomic builtin must be a pointer to integer,"
8345  " floating-point or pointer (%0 invalid)">;
8346def err_atomic_builtin_pointer_size : Error<
8347  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8348  "type (%0 invalid)">;
8349def err_atomic_exclusive_builtin_pointer_size : Error<
8350  "address argument to load or store exclusive builtin must be a pointer to"
8351  " 1,2,4 or 8 byte type (%0 invalid)">;
8352def err_atomic_builtin_ext_int_size : Error<
8353  "Atomic memory operand must have a power-of-two size">;
8354def err_atomic_builtin_bit_int_prohibit : Error<
8355  "argument to atomic builtin of type '_BitInt' is not supported">;
8356def err_atomic_op_needs_atomic : Error<
8357  "address argument to atomic operation must be a pointer to _Atomic "
8358  "type (%0 invalid)">;
8359def err_atomic_op_needs_non_const_atomic : Error<
8360  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8361  "type (%1 invalid)">;
8362def err_atomic_op_needs_non_const_pointer : Error<
8363  "address argument to atomic operation must be a pointer to non-const "
8364  "type (%0 invalid)">;
8365def err_atomic_op_needs_trivial_copy : Error<
8366  "address argument to atomic operation must be a pointer to a "
8367  "trivially-copyable type (%0 invalid)">;
8368def err_atomic_op_needs_atomic_int_ptr_or_fp : Error<
8369  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8370  "integer, pointer or supported floating point type (%1 invalid)">;
8371def err_atomic_op_needs_atomic_int_or_ptr : Error<
8372  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8373  "integer or pointer (%1 invalid)">;
8374def err_atomic_op_needs_atomic_int : Error<
8375  "address argument to atomic operation must be a pointer to "
8376  "%select{|atomic }0integer (%1 invalid)">;
8377def warn_atomic_op_has_invalid_memory_order : Warning<
8378  "memory order argument to atomic operation is invalid">,
8379  InGroup<DiagGroup<"atomic-memory-ordering">>;
8380def err_atomic_op_has_invalid_synch_scope : Error<
8381  "synchronization scope argument to atomic operation is invalid">;
8382def warn_atomic_implicit_seq_cst : Warning<
8383  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8384  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8385
8386def err_overflow_builtin_must_be_int : Error<
8387  "operand argument to overflow builtin must be an integer (%0 invalid)">;
8388def err_overflow_builtin_must_be_ptr_int : Error<
8389  "result argument to overflow builtin must be a pointer "
8390  "to a non-const integer (%0 invalid)">;
8391def err_overflow_builtin_bit_int_max_size : Error<
8392  "__builtin_mul_overflow does not support 'signed _BitInt' operands of more "
8393  "than %0 bits">;
8394
8395def err_atomic_load_store_uses_lib : Error<
8396  "atomic %select{load|store}0 requires runtime support that is not "
8397  "available for this target">;
8398
8399def err_nontemporal_builtin_must_be_pointer : Error<
8400  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8401def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8402  "address argument to nontemporal builtin must be a pointer to integer, float, "
8403  "pointer, or a vector of such types (%0 invalid)">;
8404
8405def err_deleted_function_use : Error<"attempt to use a deleted function">;
8406def err_deleted_inherited_ctor_use : Error<
8407  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8408
8409def note_called_by : Note<"called by %0">;
8410def err_kern_type_not_void_return : Error<
8411  "kernel function type %0 must have void return type">;
8412def err_kern_is_nonstatic_method : Error<
8413  "kernel function %0 must be a free function or static member function">;
8414def err_config_scalar_return : Error<
8415  "CUDA special function '%0' must have scalar return type">;
8416def err_kern_call_not_global_function : Error<
8417  "kernel call to non-global function %0">;
8418def err_global_call_not_config : Error<
8419  "call to global function %0 not configured">;
8420def err_ref_bad_target : Error<
8421  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8422  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
8423def note_cuda_const_var_unpromoted : Note<
8424  "const variable cannot be emitted on device side due to dynamic initialization">;
8425def note_cuda_host_var : Note<
8426  "host variable declared here">;
8427def err_ref_bad_target_global_initializer : Error<
8428  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8429  "function %1 in global initializer">;
8430def err_capture_bad_target : Error<
8431  "capture host variable %0 by reference in device or host device lambda function">;
8432def warn_maybe_capture_bad_target_this_ptr : Warning<
8433  "capture host side class data member by this pointer in device or host device lambda function "
8434  "may result in invalid memory access if this pointer is not accessible on device side">,
8435  InGroup<DiagGroup<"gpu-maybe-wrong-side">>;
8436def warn_kern_is_method : Extension<
8437  "kernel function %0 is a member function; this may not be accepted by nvcc">,
8438  InGroup<CudaCompat>;
8439def warn_kern_is_inline : Warning<
8440  "ignored 'inline' attribute on kernel function %0">,
8441  InGroup<CudaCompat>;
8442def err_variadic_device_fn : Error<
8443  "CUDA device code does not support variadic functions">;
8444def err_va_arg_in_device : Error<
8445  "CUDA device code does not support va_arg">;
8446def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
8447def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
8448  "constexpr function %0 without __host__ or __device__ attributes cannot "
8449  "overload __device__ function with same signature.  Add a __host__ "
8450  "attribute, or build with -fno-cuda-host-device-constexpr.">;
8451def note_cuda_conflicting_device_function_declared_here : Note<
8452  "conflicting __device__ function declared here">;
8453def err_cuda_device_exceptions : Error<
8454  "cannot use '%0' in "
8455  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
8456def err_dynamic_var_init : Error<
8457    "dynamic initialization is not supported for "
8458    "__device__, __constant__, __shared__, and __managed__ variables.">;
8459def err_shared_var_init : Error<
8460    "initialization is not supported for __shared__ variables.">;
8461def err_cuda_vla : Error<
8462    "cannot use variable-length arrays in "
8463    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8464def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
8465def err_cuda_host_shared : Error<
8466    "__shared__ local variables not allowed in "
8467    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8468def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
8469    "__managed__ are not allowed on non-static local variables">;
8470def err_cuda_ovl_target : Error<
8471  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
8472  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
8473def note_cuda_ovl_candidate_target_mismatch : Note<
8474    "candidate template ignored: target attributes do not match">;
8475
8476def err_cuda_device_builtin_surftex_cls_template : Error<
8477    "illegal device builtin %select{surface|texture}0 reference "
8478    "class template %1 declared here">;
8479def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
8480    "%0 needs to have exactly %1 template parameters">;
8481def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
8482    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
8483    "%select{a type|an integer or enum value}2">;
8484
8485def err_cuda_device_builtin_surftex_ref_decl : Error<
8486    "illegal device builtin %select{surface|texture}0 reference "
8487    "type %1 declared here">;
8488def note_cuda_device_builtin_surftex_should_be_template_class : Note<
8489    "%0 needs to be instantiated from a class template with proper "
8490    "template arguments">;
8491
8492def err_hip_invalid_args_builtin_mangled_name : Error<
8493    "invalid argument: symbol must be a device-side function or global variable">;
8494
8495def warn_non_pod_vararg_with_format_string : Warning<
8496  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
8497  "%select{function|block|method|constructor}2; expected type from format "
8498  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
8499// The arguments to this diagnostic should match the warning above.
8500def err_cannot_pass_objc_interface_to_vararg_format : Error<
8501  "cannot pass object with interface type %1 by value to variadic "
8502  "%select{function|block|method|constructor}2; expected type from format "
8503  "string was %3">;
8504def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
8505  "cannot pass non-trivial C object of type %0 by value to variadic "
8506  "%select{function|block|method|constructor}1">;
8507
8508
8509def err_cannot_pass_objc_interface_to_vararg : Error<
8510  "cannot pass object with interface type %0 by value through variadic "
8511  "%select{function|block|method|constructor}1">;
8512def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
8513  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
8514  " %select{function|block|method|constructor}2; call will abort at runtime">,
8515  InGroup<NonPODVarargs>, DefaultError;
8516def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
8517  "passing object of trivial but non-POD type %0 through variadic"
8518  " %select{function|block|method|constructor}1 is incompatible with C++98">,
8519  InGroup<CXX98Compat>, DefaultIgnore;
8520def warn_pass_class_arg_to_vararg : Warning<
8521  "passing object of class type %0 through variadic "
8522  "%select{function|block|method|constructor}1"
8523  "%select{|; did you mean to call '%3'?}2">,
8524  InGroup<ClassVarargs>, DefaultIgnore;
8525def err_cannot_pass_to_vararg : Error<
8526  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8527  "%select{function|block|method|constructor}2">;
8528def err_cannot_pass_to_vararg_format : Error<
8529  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8530  "%select{function|block|method|constructor}2; expected type from format "
8531  "string was %3">;
8532
8533def err_typecheck_call_invalid_ordered_compare : Error<
8534  "ordered compare requires two args of floating point type"
8535  "%diff{ ($ and $)|}0,1">;
8536def err_typecheck_call_invalid_unary_fp : Error<
8537  "floating point classification requires argument of floating point type "
8538  "(passed in %0)">;
8539def err_typecheck_cond_expect_int_float : Error<
8540  "used type %0 where integer or floating point type is required">;
8541def err_typecheck_cond_expect_scalar : Error<
8542  "used type %0 where arithmetic or pointer type is required">;
8543def err_typecheck_cond_expect_nonfloat : Error<
8544  "used type %0 where floating point type is not allowed">;
8545def ext_typecheck_cond_one_void : Extension<
8546  "C99 forbids conditional expressions with only one void side">;
8547def err_typecheck_cast_to_incomplete : Error<
8548  "cast to incomplete type %0">;
8549def ext_typecheck_cast_nonscalar : Extension<
8550  "C99 forbids casting nonscalar type %0 to the same type">;
8551def ext_typecheck_cast_to_union : Extension<
8552  "cast to union type is a GNU extension">,
8553  InGroup<GNUUnionCast>;
8554def err_typecheck_cast_to_union_no_type : Error<
8555  "cast to union type from type %0 not present in union">;
8556def err_cast_pointer_from_non_pointer_int : Error<
8557  "operand of type %0 cannot be cast to a pointer type">;
8558def warn_cast_pointer_from_sel : Warning<
8559  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
8560  InGroup<SelTypeCast>;
8561def warn_function_def_in_objc_container : Warning<
8562  "function definition inside an Objective-C container is deprecated">,
8563  InGroup<FunctionDefInObjCContainer>;
8564def err_typecheck_call_requires_real_fp : Error<
8565  "argument type %0 is not a real floating point type">;
8566def err_typecheck_call_different_arg_types : Error<
8567  "arguments are of different types%diff{ ($ vs $)|}0,1">;
8568
8569def warn_cast_calling_conv : Warning<
8570  "cast between incompatible calling conventions '%0' and '%1'; "
8571  "calls through this pointer may abort at runtime">,
8572  InGroup<DiagGroup<"cast-calling-convention">>;
8573def note_change_calling_conv_fixit : Note<
8574  "consider defining %0 with the '%1' calling convention">;
8575def warn_bad_function_cast : Warning<
8576  "cast from function call of type %0 to non-matching type %1">,
8577  InGroup<BadFunctionCast>, DefaultIgnore;
8578def warn_cast_function_type : Warning<
8579  "cast %diff{from $ to $ |}0,1converts to incompatible function type">,
8580  InGroup<CastFunctionType>, DefaultIgnore;
8581def err_cast_pointer_to_non_pointer_int : Error<
8582  "pointer cannot be cast to type %0">;
8583def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">;
8584def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">;
8585def err_typecheck_expect_scalar_operand : Error<
8586  "operand of type %0 where arithmetic or pointer type is required">;
8587def err_typecheck_cond_incompatible_operands : Error<
8588  "incompatible operand types%diff{ ($ and $)|}0,1">;
8589def err_typecheck_expect_flt_or_vector : Error<
8590  "invalid operand of type %0 where floating, complex or "
8591  "a vector of such types is required">;
8592def err_cast_selector_expr : Error<
8593  "cannot type cast @selector expression">;
8594def ext_typecheck_cond_incompatible_pointers : ExtWarn<
8595  "pointer type mismatch%diff{ ($ and $)|}0,1">,
8596  InGroup<DiagGroup<"pointer-type-mismatch">>;
8597def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
8598  "pointer/integer type mismatch in conditional expression"
8599  "%diff{ ($ and $)|}0,1">,
8600  InGroup<DiagGroup<"conditional-type-mismatch">>;
8601def err_typecheck_choose_expr_requires_constant : Error<
8602  "'__builtin_choose_expr' requires a constant expression">;
8603def warn_unused_expr : Warning<"expression result unused">,
8604  InGroup<UnusedValue>;
8605def warn_unused_comma_left_operand : Warning<
8606  "left operand of comma operator has no effect">,
8607  InGroup<UnusedValue>;
8608def warn_unused_voidptr : Warning<
8609  "expression result unused; should this cast be to 'void'?">,
8610  InGroup<UnusedValue>;
8611def warn_unused_property_expr : Warning<
8612 "property access result unused - getters should not be used for side effects">,
8613  InGroup<UnusedGetterReturnValue>;
8614def warn_unused_container_subscript_expr : Warning<
8615 "container access result unused - container access should not be used for side effects">,
8616  InGroup<UnusedValue>;
8617def warn_unused_call : Warning<
8618  "ignoring return value of function declared with %0 attribute">,
8619  InGroup<UnusedValue>;
8620def warn_unused_constructor : Warning<
8621  "ignoring temporary created by a constructor declared with %0 attribute">,
8622  InGroup<UnusedValue>;
8623def warn_unused_constructor_msg : Warning<
8624  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
8625  InGroup<UnusedValue>;
8626def warn_side_effects_unevaluated_context : Warning<
8627  "expression with side effects has no effect in an unevaluated context">,
8628  InGroup<UnevaluatedExpression>;
8629def warn_side_effects_typeid : Warning<
8630  "expression with side effects will be evaluated despite being used as an "
8631  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
8632def warn_unused_result : Warning<
8633  "ignoring return value of function declared with %0 attribute">,
8634  InGroup<UnusedResult>;
8635def warn_unused_result_msg : Warning<
8636  "ignoring return value of function declared with %0 attribute: %1">,
8637  InGroup<UnusedResult>;
8638def warn_unused_volatile : Warning<
8639  "expression result unused; assign into a variable to force a volatile load">,
8640  InGroup<DiagGroup<"unused-volatile-lvalue">>;
8641
8642def ext_cxx14_attr : Extension<
8643  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14Attrs>;
8644def ext_cxx17_attr : Extension<
8645  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17Attrs>;
8646def ext_cxx20_attr : Extension<
8647  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20Attrs>;
8648
8649def warn_unused_comparison : Warning<
8650  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
8651  InGroup<UnusedComparison>;
8652def note_inequality_comparison_to_or_assign : Note<
8653  "use '|=' to turn this inequality comparison into an or-assignment">;
8654
8655def err_incomplete_type_used_in_type_trait_expr : Error<
8656  "incomplete type %0 used in type trait expression">;
8657
8658// C++20 constinit and require_constant_initialization attribute
8659def warn_cxx20_compat_constinit : Warning<
8660  "'constinit' specifier is incompatible with C++ standards before C++20">,
8661  InGroup<CXX20Compat>, DefaultIgnore;
8662def err_constinit_local_variable : Error<
8663  "local variable cannot be declared 'constinit'">;
8664def err_require_constant_init_failed : Error<
8665  "variable does not have a constant initializer">;
8666def note_declared_required_constant_init_here : Note<
8667  "required by %select{'require_constant_initialization' attribute|"
8668  "'constinit' specifier}0 here">;
8669def ext_constinit_missing : ExtWarn<
8670  "'constinit' specifier missing on initializing declaration of %0">,
8671  InGroup<DiagGroup<"missing-constinit">>;
8672def note_constinit_specified_here : Note<"variable declared constinit here">;
8673def err_constinit_added_too_late : Error<
8674  "'constinit' specifier added after initialization of variable">;
8675def warn_require_const_init_added_too_late : Warning<
8676  "'require_constant_initialization' attribute added after initialization "
8677  "of variable">, InGroup<IgnoredAttributes>;
8678def note_constinit_missing_here : Note<
8679  "add the "
8680  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
8681  "to the initializing declaration here">;
8682
8683def err_dimension_expr_not_constant_integer : Error<
8684  "dimension expression does not evaluate to a constant unsigned int">;
8685
8686def err_typecheck_cond_incompatible_operands_null : Error<
8687  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
8688def ext_empty_struct_union : Extension<
8689  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
8690def ext_no_named_members_in_struct_union : Extension<
8691  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
8692def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
8693  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8694  InGroup<CXXCompat>, DefaultIgnore;
8695def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
8696  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8697  InGroup<ExternCCompat>;
8698def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
8699  "volatile qualifiers|const qualifier|volatile qualifier}2">,
8700  InGroup<CastQual>, DefaultIgnore;
8701def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
8702  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
8703def warn_redefine_extname_not_applied : Warning<
8704  "#pragma redefine_extname is applicable to external C declarations only; "
8705  "not applied to %select{function|variable}0 %1">,
8706  InGroup<Pragmas>;
8707} // End of general sema category.
8708
8709// inline asm.
8710let CategoryName = "Inline Assembly Issue" in {
8711  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
8712  def err_asm_invalid_output_constraint : Error<
8713    "invalid output constraint '%0' in asm">;
8714  def err_asm_invalid_lvalue_in_input : Error<
8715    "invalid lvalue in asm input for constraint '%0'">;
8716  def err_asm_invalid_input_constraint : Error<
8717    "invalid input constraint '%0' in asm">;
8718  def err_asm_tying_incompatible_types : Error<
8719    "unsupported inline asm: input with type "
8720    "%diff{$ matching output with type $|}0,1">;
8721  def err_asm_unexpected_constraint_alternatives : Error<
8722    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
8723  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
8724  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
8725  def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">;
8726  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
8727    "global register variables on this target">;
8728  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
8729    "match variable size">;
8730  def err_asm_bad_register_type : Error<"bad type for named register variable">;
8731  def err_asm_invalid_input_size : Error<
8732    "invalid input size for constraint '%0'">;
8733  def err_asm_invalid_output_size : Error<
8734    "invalid output size for constraint '%0'">;
8735  def err_invalid_asm_cast_lvalue : Error<
8736    "invalid use of a cast in a inline asm context requiring an lvalue: "
8737    "remove the cast or build with -fheinous-gnu-extensions">;
8738  def err_invalid_asm_value_for_constraint
8739      : Error <"value '%0' out of range for constraint '%1'">;
8740  def err_asm_non_addr_value_in_memory_constraint : Error <
8741    "reference to a %select{bit-field|vector element|global register variable}0"
8742    " in asm %select{input|output}1 with a memory constraint '%2'">;
8743  def err_asm_input_duplicate_match : Error<
8744    "more than one input constraint matches the same output '%0'">;
8745
8746  def warn_asm_label_on_auto_decl : Warning<
8747    "ignored asm label '%0' on automatic variable">;
8748  def warn_invalid_asm_cast_lvalue : Warning<
8749    "invalid use of a cast in an inline asm context requiring an lvalue: "
8750    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
8751    "for this in the future">;
8752  def warn_asm_mismatched_size_modifier : Warning<
8753    "value size does not match register size specified by the constraint "
8754    "and modifier">,
8755    InGroup<ASMOperandWidths>;
8756
8757  def note_asm_missing_constraint_modifier : Note<
8758    "use constraint modifier \"%0\"">;
8759  def note_asm_input_duplicate_first : Note<
8760    "constraint '%0' is already present here">;
8761 def error_duplicate_asm_operand_name : Error<
8762    "duplicate use of asm operand name \"%0\"">;
8763 def note_duplicate_asm_operand_name : Note<
8764    "asm operand name \"%0\" first referenced here">;
8765}
8766
8767  def error_inoutput_conflict_with_clobber : Error<
8768    "asm-specifier for input or output variable conflicts with asm"
8769    " clobber list">;
8770
8771let CategoryName = "Semantic Issue" in {
8772
8773def err_invalid_conversion_between_matrixes : Error<
8774  "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">;
8775
8776def err_invalid_conversion_between_matrix_and_type : Error<
8777  "conversion between matrix type %0 and incompatible type %1 is not allowed">;
8778
8779def err_invalid_conversion_between_vectors : Error<
8780  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
8781  "size">;
8782def err_invalid_conversion_between_vector_and_integer : Error<
8783  "invalid conversion between vector type %0 and integer type %1 "
8784  "of different size">;
8785
8786def err_opencl_function_pointer : Error<
8787  "%select{pointers|references}0 to functions are not allowed">;
8788
8789def err_opencl_taking_address_capture : Error<
8790  "taking address of a capture is not allowed">;
8791
8792def err_invalid_conversion_between_vector_and_scalar : Error<
8793  "invalid conversion between vector type %0 and scalar type %1">;
8794
8795// C++ member initializers.
8796def err_only_constructors_take_base_inits : Error<
8797  "only constructors take base initializers">;
8798
8799def err_multiple_mem_initialization : Error <
8800  "multiple initializations given for non-static member %0">;
8801def err_multiple_mem_union_initialization : Error <
8802  "initializing multiple members of union">;
8803def err_multiple_base_initialization : Error <
8804  "multiple initializations given for base %0">;
8805
8806def err_mem_init_not_member_or_class : Error<
8807  "member initializer %0 does not name a non-static data member or base "
8808  "class">;
8809
8810def warn_initializer_out_of_order : Warning<
8811  "%select{field|base class}0 %1 will be initialized after "
8812  "%select{field|base}2 %3">,
8813  InGroup<ReorderCtor>, DefaultIgnore;
8814
8815def warn_some_initializers_out_of_order : Warning<
8816  "initializer order does not match the declaration order">,
8817  InGroup<ReorderCtor>, DefaultIgnore;
8818
8819def note_initializer_out_of_order : Note<
8820  "%select{field|base class}0 %1 will be initialized after "
8821  "%select{field|base}2 %3">;
8822
8823def warn_abstract_vbase_init_ignored : Warning<
8824  "initializer for virtual base class %0 of abstract class %1 "
8825  "will never be used">,
8826  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
8827
8828def err_base_init_does_not_name_class : Error<
8829  "constructor initializer %0 does not name a class">;
8830def err_base_init_direct_and_virtual : Error<
8831  "base class initializer %0 names both a direct base class and an "
8832  "inherited virtual base class">;
8833def err_not_direct_base_or_virtual : Error<
8834  "type %0 is not a direct or virtual base of %1">;
8835
8836def err_in_class_initializer_non_const : Error<
8837  "non-const static data member must be initialized out of line">;
8838def err_in_class_initializer_volatile : Error<
8839  "static const volatile data member must be initialized out of line">;
8840def err_in_class_initializer_bad_type : Error<
8841  "static data member of type %0 must be initialized out of line">;
8842def ext_in_class_initializer_float_type : ExtWarn<
8843  "in-class initializer for static data member of type %0 is a GNU extension">,
8844  InGroup<GNUStaticFloatInit>;
8845def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
8846  "in-class initializer for static data member of type %0 requires "
8847  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
8848def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
8849def err_in_class_initializer_literal_type : Error<
8850  "in-class initializer for static data member of type %0 requires "
8851  "'constexpr' specifier">;
8852def err_in_class_initializer_non_constant : Error<
8853  "in-class initializer for static data member is not a constant expression">;
8854def err_default_member_initializer_not_yet_parsed : Error<
8855  "default member initializer for %1 needed within definition of enclosing "
8856  "class %0 outside of member functions">;
8857def note_default_member_initializer_not_yet_parsed : Note<
8858  "default member initializer declared here">;
8859def err_default_member_initializer_cycle
8860    : Error<"default member initializer for %0 uses itself">;
8861
8862def ext_in_class_initializer_non_constant : Extension<
8863  "in-class initializer for static data member is not a constant expression; "
8864  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
8865
8866def err_thread_dynamic_init : Error<
8867  "initializer for thread-local variable must be a constant expression">;
8868def err_thread_nontrivial_dtor : Error<
8869  "type of thread-local variable has non-trivial destruction">;
8870def note_use_thread_local : Note<
8871  "use 'thread_local' to allow this">;
8872
8873// C++ anonymous unions and GNU anonymous structs/unions
8874def ext_anonymous_union : Extension<
8875  "anonymous unions are a C11 extension">, InGroup<C11>;
8876def ext_gnu_anonymous_struct : Extension<
8877  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
8878def ext_c11_anonymous_struct : Extension<
8879  "anonymous structs are a C11 extension">, InGroup<C11>;
8880def err_anonymous_union_not_static : Error<
8881  "anonymous unions at namespace or global scope must be declared 'static'">;
8882def err_anonymous_union_with_storage_spec : Error<
8883  "anonymous union at class scope must not have a storage specifier">;
8884def err_anonymous_struct_not_member : Error<
8885  "anonymous %select{structs|structs and classes}0 must be "
8886  "%select{struct or union|class}0 members">;
8887def err_anonymous_record_member_redecl : Error<
8888  "member of anonymous %select{struct|union}0 redeclares %1">;
8889def err_anonymous_record_with_type : Error<
8890  "types cannot be declared in an anonymous %select{struct|union}0">;
8891def ext_anonymous_record_with_type : Extension<
8892  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
8893  "extension">, InGroup<MicrosoftAnonTag>;
8894def ext_anonymous_record_with_anonymous_type : Extension<
8895  "anonymous types declared in an anonymous %select{struct|union}0 "
8896  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
8897def err_anonymous_record_with_function : Error<
8898  "functions cannot be declared in an anonymous %select{struct|union}0">;
8899def err_anonymous_record_with_static : Error<
8900  "static members cannot be declared in an anonymous %select{struct|union}0">;
8901def err_anonymous_record_bad_member : Error<
8902  "anonymous %select{struct|union}0 can only contain non-static data members">;
8903def err_anonymous_record_nonpublic_member : Error<
8904  "anonymous %select{struct|union}0 cannot contain a "
8905  "%select{private|protected}1 data member">;
8906def ext_ms_anonymous_record : ExtWarn<
8907  "anonymous %select{structs|unions}0 are a Microsoft extension">,
8908  InGroup<MicrosoftAnonTag>;
8909
8910// C++ local classes
8911def err_reference_to_local_in_enclosing_context : Error<
8912  "reference to local %select{variable|binding}1 %0 declared in enclosing "
8913  "%select{%3|block literal|lambda expression|context}2">;
8914
8915def err_static_data_member_not_allowed_in_local_class : Error<
8916  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
8917
8918// C++ derived classes
8919def err_base_clause_on_union : Error<"unions cannot have base classes">;
8920def err_base_must_be_class : Error<"base specifier must name a class">;
8921def err_union_as_base_class : Error<"unions cannot be base classes">;
8922def err_circular_inheritance : Error<
8923  "circular inheritance between %0 and %1">;
8924def err_base_class_has_flexible_array_member : Error<
8925  "base class %0 has a flexible array member">;
8926def err_incomplete_base_class : Error<"base class has incomplete type">;
8927def err_duplicate_base_class : Error<
8928  "base class %0 specified more than once as a direct base class">;
8929def warn_inaccessible_base_class : Warning<
8930  "direct base %0 is inaccessible due to ambiguity:%1">,
8931  InGroup<DiagGroup<"inaccessible-base">>;
8932// FIXME: better way to display derivation?  Pass entire thing into diagclient?
8933def err_ambiguous_derived_to_base_conv : Error<
8934  "ambiguous conversion from derived class %0 to base class %1:%2">;
8935def err_ambiguous_memptr_conv : Error<
8936  "ambiguous conversion from pointer to member of %select{base|derived}0 "
8937  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
8938def ext_ms_ambiguous_direct_base : ExtWarn<
8939  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
8940  InGroup<MicrosoftInaccessibleBase>;
8941
8942def err_memptr_conv_via_virtual : Error<
8943  "conversion from pointer to member of class %0 to pointer to member "
8944  "of class %1 via virtual base %2 is not allowed">;
8945
8946// C++ member name lookup
8947def err_ambiguous_member_multiple_subobjects : Error<
8948  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
8949def err_ambiguous_member_multiple_subobject_types : Error<
8950  "member %0 found in multiple base classes of different types">;
8951def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
8952def note_ambiguous_member_type_found : Note<
8953  "member type %0 found by ambiguous name lookup">;
8954def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
8955def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
8956def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
8957  "declaration in a different namespace">;
8958def note_hidden_tag : Note<"type declaration hidden">;
8959def note_hiding_object : Note<"declaration hides type">;
8960
8961// C++ operator overloading
8962def err_operator_overload_needs_class_or_enum : Error<
8963  "overloaded %0 must have at least one parameter of class "
8964  "or enumeration type">;
8965
8966def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
8967def err_operator_overload_static : Error<
8968  "overloaded %0 cannot be a static member function">;
8969def err_operator_overload_default_arg : Error<
8970  "parameter of overloaded %0 cannot have a default argument">;
8971def err_operator_overload_must_be : Error<
8972  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
8973  "(has %1 parameter%s1)">;
8974
8975def err_operator_overload_must_be_member : Error<
8976  "overloaded %0 must be a non-static member function">;
8977def err_operator_overload_post_incdec_must_be_int : Error<
8978  "parameter of overloaded post-%select{increment|decrement}1 operator must "
8979  "have type 'int' (not %0)">;
8980
8981// C++ allocation and deallocation functions.
8982def err_operator_new_delete_declared_in_namespace : Error<
8983  "%0 cannot be declared inside a namespace">;
8984def err_operator_new_delete_declared_static : Error<
8985  "%0 cannot be declared static in global scope">;
8986def ext_operator_new_delete_declared_inline : ExtWarn<
8987  "replacement function %0 cannot be declared 'inline'">,
8988  InGroup<DiagGroup<"inline-new-delete">>;
8989def err_operator_new_delete_invalid_result_type : Error<
8990  "%0 must return type %1">;
8991def err_operator_new_delete_dependent_result_type : Error<
8992  "%0 cannot have a dependent return type; use %1 instead">;
8993def err_operator_new_delete_too_few_parameters : Error<
8994  "%0 must have at least one parameter">;
8995def err_operator_new_delete_template_too_few_parameters : Error<
8996  "%0 template must have at least two parameters">;
8997def warn_operator_new_returns_null : Warning<
8998  "%0 should not return a null pointer unless it is declared 'throw()'"
8999  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
9000
9001def err_operator_new_dependent_param_type : Error<
9002  "%0 cannot take a dependent type as first parameter; "
9003  "use size_t (%1) instead">;
9004def err_operator_new_param_type : Error<
9005  "%0 takes type size_t (%1) as first parameter">;
9006def err_operator_new_default_arg: Error<
9007  "parameter of %0 cannot have a default argument">;
9008def err_operator_delete_dependent_param_type : Error<
9009  "%0 cannot take a dependent type as first parameter; use %1 instead">;
9010def err_operator_delete_param_type : Error<
9011  "first parameter of %0 must have type %1">;
9012def err_destroying_operator_delete_not_usual : Error<
9013  "destroying operator delete can have only an optional size and optional "
9014  "alignment parameter">;
9015def note_implicit_delete_this_in_destructor_here : Note<
9016  "while checking implicit 'delete this' for virtual destructor">;
9017def err_builtin_operator_new_delete_not_usual : Error<
9018  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
9019  "selects non-usual %select{allocation|deallocation}0 function">;
9020def note_non_usual_function_declared_here : Note<
9021  "non-usual %0 declared here">;
9022
9023// C++ literal operators
9024def err_literal_operator_outside_namespace : Error<
9025  "literal operator %0 must be in a namespace or global scope">;
9026def err_literal_operator_id_outside_namespace : Error<
9027  "non-namespace scope '%0' cannot have a literal operator member">;
9028def err_literal_operator_default_argument : Error<
9029  "literal operator cannot have a default argument">;
9030def err_literal_operator_bad_param_count : Error<
9031  "non-template literal operator must have one or two parameters">;
9032def err_literal_operator_invalid_param : Error<
9033  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
9034def err_literal_operator_param : Error<
9035  "invalid literal operator parameter type %0, did you mean %1?">;
9036def err_literal_operator_template_with_params : Error<
9037  "literal operator template cannot have any parameters">;
9038def err_literal_operator_template : Error<
9039  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
9040def err_literal_operator_extern_c : Error<
9041  "literal operator must have C++ linkage">;
9042def ext_string_literal_operator_template : ExtWarn<
9043  "string literal operator templates are a GNU extension">,
9044  InGroup<GNUStringLiteralOperatorTemplate>;
9045def warn_user_literal_reserved : Warning<
9046  "user-defined literal suffixes not starting with '_' are reserved"
9047  "%select{; no literal will invoke this operator|}0">,
9048  InGroup<UserDefinedLiterals>;
9049
9050// C++ conversion functions
9051def err_conv_function_not_member : Error<
9052  "conversion function must be a non-static member function">;
9053def err_conv_function_return_type : Error<
9054  "conversion function cannot have a return type">;
9055def err_conv_function_with_params : Error<
9056  "conversion function cannot have any parameters">;
9057def err_conv_function_variadic : Error<
9058  "conversion function cannot be variadic">;
9059def err_conv_function_to_array : Error<
9060  "conversion function cannot convert to an array type">;
9061def err_conv_function_to_function : Error<
9062  "conversion function cannot convert to a function type">;
9063def err_conv_function_with_complex_decl : Error<
9064  "cannot specify any part of a return type in the "
9065  "declaration of a conversion function"
9066  "%select{"
9067  "; put the complete type after 'operator'|"
9068  "; use a typedef to declare a conversion to %1|"
9069  "; use an alias template to declare a conversion to %1|"
9070  "}0">;
9071def err_conv_function_redeclared : Error<
9072  "conversion function cannot be redeclared">;
9073def warn_conv_to_self_not_used : Warning<
9074  "conversion function converting %0 to itself will never be used">,
9075  InGroup<ClassConversion>;
9076def warn_conv_to_base_not_used : Warning<
9077  "conversion function converting %0 to its base class %1 will never be used">,
9078  InGroup<ClassConversion>;
9079def warn_conv_to_void_not_used : Warning<
9080  "conversion function converting %0 to %1 will never be used">,
9081  InGroup<ClassConversion>;
9082
9083def warn_not_compound_assign : Warning<
9084  "use of unary operator that may be intended as compound assignment (%0=)">;
9085
9086// C++11 explicit conversion operators
9087def ext_explicit_conversion_functions : ExtWarn<
9088  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
9089def warn_cxx98_compat_explicit_conversion_functions : Warning<
9090  "explicit conversion functions are incompatible with C++98">,
9091  InGroup<CXX98Compat>, DefaultIgnore;
9092
9093// C++11 defaulted functions
9094def err_defaulted_special_member_params : Error<
9095  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9096  "have default arguments">;
9097def err_defaulted_special_member_variadic : Error<
9098  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9099  "be variadic">;
9100def err_defaulted_special_member_return_type : Error<
9101  "explicitly-defaulted %select{copy|move}0 assignment operator must "
9102  "return %1">;
9103def err_defaulted_special_member_quals : Error<
9104  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
9105  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
9106def err_defaulted_special_member_volatile_param : Error<
9107  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
9108  "may not be volatile">;
9109def err_defaulted_special_member_move_const_param : Error<
9110  "the parameter for an explicitly-defaulted move "
9111  "%select{constructor|assignment operator}0 may not be const">;
9112def err_defaulted_special_member_copy_const_param : Error<
9113  "the parameter for this explicitly-defaulted copy "
9114  "%select{constructor|assignment operator}0 is const, but a member or base "
9115  "requires it to be non-const">;
9116def err_defaulted_copy_assign_not_ref : Error<
9117  "the parameter for an explicitly-defaulted copy assignment operator must be an "
9118  "lvalue reference type">;
9119def err_incorrect_defaulted_constexpr : Error<
9120  "defaulted definition of %sub{select_special_member_kind}0 "
9121  "is not constexpr">;
9122def err_incorrect_defaulted_consteval : Error<
9123  "defaulted declaration of %sub{select_special_member_kind}0 "
9124  "cannot be consteval because implicit definition is not constexpr">;
9125def warn_defaulted_method_deleted : Warning<
9126  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
9127  "deleted">, InGroup<DefaultedFunctionDeleted>;
9128def err_out_of_line_default_deletes : Error<
9129  "defaulting this %sub{select_special_member_kind}0 "
9130  "would delete it after its first declaration">;
9131def note_deleted_type_mismatch : Note<
9132  "function is implicitly deleted because its declared type does not match "
9133  "the type of an implicit %sub{select_special_member_kind}0">;
9134def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
9135  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
9136  "different from the implicit type is incompatible with C++ standards before "
9137  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9138def warn_vbase_moved_multiple_times : Warning<
9139  "defaulted move assignment operator of %0 will move assign virtual base "
9140  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
9141def note_vbase_moved_here : Note<
9142  "%select{%1 is a virtual base class of base class %2 declared here|"
9143  "virtual base class %1 declared here}0">;
9144
9145// C++20 defaulted comparisons
9146// This corresponds to values of Sema::DefaultedComparisonKind.
9147def select_defaulted_comparison_kind : TextSubstitution<
9148  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
9149  "operator">;
9150def ext_defaulted_comparison : ExtWarn<
9151  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
9152def warn_cxx17_compat_defaulted_comparison : Warning<
9153  "defaulted comparison operators are incompatible with C++ standards "
9154  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9155def err_defaulted_comparison_template : Error<
9156  "comparison operator template cannot be defaulted">;
9157def err_defaulted_comparison_num_args : Error<
9158  "%select{non-member|member}0 %sub{select_defaulted_comparison_kind}1"
9159  " comparison operator must have %select{2|1}0 parameters">;
9160def err_defaulted_comparison_param : Error<
9161  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
9162  "; found %1, expected %2%select{| or %4}3">;
9163def err_defaulted_comparison_param_unknown : Error<
9164  "invalid parameter type for non-member defaulted"
9165  " %sub{select_defaulted_comparison_kind}0"
9166  "; found %1, expected class or reference to a constant class">;
9167def err_defaulted_comparison_param_mismatch : Error<
9168  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
9169  "must have the same type%diff{ (found $ vs $)|}1,2">;
9170def err_defaulted_comparison_not_friend : Error<
9171  "%sub{select_defaulted_comparison_kind}0 is not a friend of"
9172  " %select{|incomplete class }1%2">;
9173def err_defaulted_comparison_non_const : Error<
9174  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
9175  "const-qualified">;
9176def err_defaulted_comparison_return_type_not_bool : Error<
9177  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9178  "must be 'bool', not %1">;
9179def err_defaulted_comparison_deduced_return_type_not_auto : Error<
9180  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9181  "must be 'auto', not %1">;
9182def warn_defaulted_comparison_deleted : Warning<
9183  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
9184  "deleted">, InGroup<DefaultedFunctionDeleted>;
9185def err_non_first_default_compare_deletes : Error<
9186  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
9187  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
9188  "would delete it after its first declaration">;
9189def note_defaulted_comparison_union : Note<
9190  "defaulted %0 is implicitly deleted because "
9191  "%2 is a %select{union-like class|union}1 with variant members">;
9192def note_defaulted_comparison_reference_member : Note<
9193  "defaulted %0 is implicitly deleted because "
9194  "class %1 has a reference member">;
9195def note_defaulted_comparison_ambiguous : Note<
9196  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
9197  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
9198def note_defaulted_comparison_inaccessible : Note<
9199  "defaulted %0 is implicitly deleted because it would invoke a "
9200  "%select{private|protected}3 %4%select{ member of %6|"
9201  " member of %6 to compare member %2| to compare base class %2}1">;
9202def note_defaulted_comparison_calls_deleted : Note<
9203  "defaulted %0 is implicitly deleted because it would invoke a deleted "
9204  "comparison function%select{| for member %2| for base class %2}1">;
9205def note_defaulted_comparison_no_viable_function : Note<
9206  "defaulted %0 is implicitly deleted because there is no viable "
9207  "%select{three-way comparison function|'operator=='}1 for "
9208  "%select{|member |base class }2%3">;
9209def note_defaulted_comparison_no_viable_function_synthesized : Note<
9210  "three-way comparison cannot be synthesized because there is no viable "
9211  "function for %select{'=='|'<'}0 comparison">;
9212def note_defaulted_comparison_not_rewritten_callee : Note<
9213  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
9214  "function would be the best match for the comparison">;
9215def note_defaulted_comparison_not_rewritten_conversion : Note<
9216  "defaulted %0 is implicitly deleted because a builtin comparison function "
9217  "using this conversion would be the best match for the comparison">;
9218def note_defaulted_comparison_cannot_deduce : Note<
9219  "return type of defaulted 'operator<=>' cannot be deduced because "
9220  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
9221  "is not a standard comparison category type">;
9222def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
9223  "return type of defaulted 'operator<=>' cannot be deduced because "
9224  "three-way comparison for %select{|member|base class}0 %1 "
9225  "has a deduced return type and is not yet defined">;
9226def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
9227  "%select{|member|base class}0 %1 declared here">;
9228def note_defaulted_comparison_cannot_deduce_callee : Note<
9229  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
9230def err_incorrect_defaulted_comparison_constexpr : Error<
9231  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
9232  "three-way comparison operator}0 "
9233  "cannot be declared %select{constexpr|consteval}2 because "
9234  "%select{it|the corresponding implicit 'operator=='}0 "
9235  "invokes a non-constexpr comparison function">;
9236def note_defaulted_comparison_not_constexpr : Note<
9237  "non-constexpr comparison function would be used to compare "
9238  "%select{|member %1|base class %1}0">;
9239def note_defaulted_comparison_not_constexpr_here : Note<
9240  "non-constexpr comparison function declared here">;
9241def note_in_declaration_of_implicit_equality_comparison : Note<
9242  "while declaring the corresponding implicit 'operator==' "
9243  "for this defaulted 'operator<=>'">;
9244
9245def ext_implicit_exception_spec_mismatch : ExtWarn<
9246  "function previously declared with an %select{explicit|implicit}0 exception "
9247  "specification redeclared with an %select{implicit|explicit}0 exception "
9248  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
9249
9250def warn_ptr_arith_precedes_bounds : Warning<
9251  "the pointer decremented by %0 refers before the beginning of the array">,
9252  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9253def warn_ptr_arith_exceeds_bounds : Warning<
9254  "the pointer incremented by %0 refers past the end of the array (that "
9255  "contains %1 element%s2)">,
9256  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9257def warn_array_index_precedes_bounds : Warning<
9258  "array index %0 is before the beginning of the array">,
9259  InGroup<ArrayBounds>;
9260def warn_array_index_exceeds_bounds : Warning<
9261  "array index %0 is past the end of the array (which contains %1 "
9262  "element%s2)">, InGroup<ArrayBounds>;
9263def warn_ptr_arith_exceeds_max_addressable_bounds : Warning<
9264  "the pointer incremented by %0 refers past the last possible element for an array in %1-bit "
9265  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9266  InGroup<ArrayBounds>;
9267def warn_array_index_exceeds_max_addressable_bounds : Warning<
9268  "array index %0 refers past the last possible element for an array in %1-bit "
9269  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9270  InGroup<ArrayBounds>;
9271def note_array_declared_here : Note<
9272  "array %0 declared here">;
9273
9274def warn_printf_insufficient_data_args : Warning<
9275  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9276def warn_printf_data_arg_not_used : Warning<
9277  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9278def warn_format_invalid_conversion : Warning<
9279  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9280def warn_printf_incomplete_specifier : Warning<
9281  "incomplete format specifier">, InGroup<Format>;
9282def warn_missing_format_string : Warning<
9283  "format string missing">, InGroup<Format>;
9284def warn_scanf_nonzero_width : Warning<
9285  "zero field width in scanf format string is unused">,
9286  InGroup<Format>;
9287def warn_format_conversion_argument_type_mismatch : Warning<
9288  "format specifies type %0 but the argument has "
9289  "%select{type|underlying type}2 %1">,
9290  InGroup<Format>;
9291def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9292  warn_format_conversion_argument_type_mismatch.Text>,
9293  InGroup<FormatPedantic>;
9294def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9295  warn_format_conversion_argument_type_mismatch.Text>,
9296  InGroup<FormatTypeConfusion>, DefaultIgnore;
9297def warn_format_argument_needs_cast : Warning<
9298  "%select{values of type|enum values with underlying type}2 '%0' should not "
9299  "be used as format arguments; add an explicit cast to %1 instead">,
9300  InGroup<Format>;
9301def warn_format_argument_needs_cast_pedantic : Warning<
9302  warn_format_argument_needs_cast.Text>,
9303  InGroup<FormatPedantic>, DefaultIgnore;
9304def warn_printf_positional_arg_exceeds_data_args : Warning <
9305  "data argument position '%0' exceeds the number of data arguments (%1)">,
9306  InGroup<Format>;
9307def warn_format_zero_positional_specifier : Warning<
9308  "position arguments in format strings start counting at 1 (not 0)">,
9309  InGroup<Format>;
9310def warn_format_invalid_positional_specifier : Warning<
9311  "invalid position specified for %select{field width|field precision}0">,
9312  InGroup<Format>;
9313def warn_format_mix_positional_nonpositional_args : Warning<
9314  "cannot mix positional and non-positional arguments in format string">,
9315  InGroup<Format>;
9316def warn_static_array_too_small : Warning<
9317  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9318  " callee requires at least %1">,
9319  InGroup<ArrayBounds>;
9320def note_callee_static_array : Note<
9321  "callee declares array parameter as static here">;
9322def warn_empty_format_string : Warning<
9323  "format string is empty">, InGroup<FormatZeroLength>;
9324def warn_format_string_is_wide_literal : Warning<
9325  "format string should not be a wide string">, InGroup<Format>;
9326def warn_printf_format_string_contains_null_char : Warning<
9327  "format string contains '\\0' within the string body">, InGroup<Format>;
9328def warn_printf_format_string_not_null_terminated : Warning<
9329  "format string is not null-terminated">, InGroup<Format>;
9330def warn_printf_asterisk_missing_arg : Warning<
9331  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9332  InGroup<Format>;
9333def warn_printf_asterisk_wrong_type : Warning<
9334  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9335  InGroup<Format>;
9336def warn_printf_nonsensical_optional_amount: Warning<
9337  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9338  InGroup<Format>;
9339def warn_printf_nonsensical_flag: Warning<
9340  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9341  InGroup<Format>;
9342def warn_format_nonsensical_length: Warning<
9343  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9344  InGroup<Format>;
9345def warn_format_non_standard_positional_arg: Warning<
9346  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9347def warn_format_non_standard: Warning<
9348  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
9349  InGroup<FormatNonStandard>, DefaultIgnore;
9350def warn_format_non_standard_conversion_spec: Warning<
9351  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
9352  InGroup<FormatNonStandard>, DefaultIgnore;
9353def err_invalid_mask_type_size : Error<
9354  "mask type size must be between 1-byte and 8-bytes">;
9355def warn_format_invalid_annotation : Warning<
9356  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
9357  InGroup<Format>;
9358def warn_format_P_no_precision : Warning<
9359  "using '%%P' format specifier without precision">,
9360  InGroup<Format>;
9361def warn_printf_ignored_flag: Warning<
9362  "flag '%0' is ignored when flag '%1' is present">,
9363  InGroup<Format>;
9364def warn_printf_empty_objc_flag: Warning<
9365  "missing object format flag">,
9366  InGroup<Format>;
9367def warn_printf_ObjCflags_without_ObjCConversion: Warning<
9368  "object format flags cannot be used with '%0' conversion specifier">,
9369  InGroup<Format>;
9370def warn_printf_invalid_objc_flag: Warning<
9371    "'%0' is not a valid object format flag">,
9372    InGroup<Format>;
9373def warn_scanf_scanlist_incomplete : Warning<
9374  "no closing ']' for '%%[' in scanf format string">,
9375  InGroup<Format>;
9376def warn_format_bool_as_character : Warning<
9377  "using '%0' format specifier, but argument has boolean value">,
9378  InGroup<Format>;
9379def note_format_string_defined : Note<"format string is defined here">;
9380def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
9381def note_printf_c_str: Note<"did you mean to call the %0 method?">;
9382def note_format_security_fixit: Note<
9383  "treat the string as an argument to avoid this">;
9384
9385def warn_null_arg : Warning<
9386  "null passed to a callee that requires a non-null argument">,
9387  InGroup<NonNull>;
9388def warn_null_ret : Warning<
9389  "null returned from %select{function|method}0 that requires a non-null return value">,
9390  InGroup<NonNull>;
9391
9392def err_lifetimebound_no_object_param : Error<
9393  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
9394  "function has no implicit object parameter">;
9395def err_lifetimebound_ctor_dtor : Error<
9396  "'lifetimebound' attribute cannot be applied to a "
9397  "%select{constructor|destructor}0">;
9398
9399// CHECK: returning address/reference of stack memory
9400def warn_ret_stack_addr_ref : Warning<
9401  "%select{address of|reference to}0 stack memory associated with "
9402  "%select{local variable|parameter}2 %1 returned">,
9403  InGroup<ReturnStackAddress>;
9404def warn_ret_local_temp_addr_ref : Warning<
9405  "returning %select{address of|reference to}0 local temporary object">,
9406  InGroup<ReturnStackAddress>;
9407def warn_ret_addr_label : Warning<
9408  "returning address of label, which is local">,
9409  InGroup<ReturnStackAddress>;
9410def err_ret_local_block : Error<
9411  "returning block that lives on the local stack">;
9412def note_local_var_initializer : Note<
9413  "%select{via initialization of|binding reference}0 variable "
9414  "%select{%2 |}1here">;
9415def note_lambda_capture_initializer : Note<
9416  "%select{implicitly |}2captured%select{| by reference}3"
9417  "%select{%select{ due to use|}2 here|"
9418  " via initialization of lambda capture %0}1">;
9419def note_init_with_default_member_initalizer : Note<
9420  "initializing field %0 with default member initializer">;
9421
9422// Check for initializing a member variable with the address or a reference to
9423// a constructor parameter.
9424def warn_bind_ref_member_to_parameter : Warning<
9425  "binding reference member %0 to stack allocated "
9426  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9427def warn_init_ptr_member_to_parameter_addr : Warning<
9428  "initializing pointer member %0 with the stack address of "
9429  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9430def note_ref_or_ptr_member_declared_here : Note<
9431  "%select{reference|pointer}0 member declared here">;
9432
9433def err_dangling_member : Error<
9434  "%select{reference|backing array for 'std::initializer_list'}2 "
9435  "%select{|subobject of }1member %0 "
9436  "%select{binds to|is}2 a temporary object "
9437  "whose lifetime would be shorter than the lifetime of "
9438  "the constructed object">;
9439def warn_dangling_member : Warning<
9440  "%select{reference|backing array for 'std::initializer_list'}2 "
9441  "%select{|subobject of }1member %0 "
9442  "%select{binds to|is}2 a temporary object "
9443  "whose lifetime is shorter than the lifetime of the constructed object">,
9444  InGroup<DanglingField>;
9445def warn_dangling_lifetime_pointer_member : Warning<
9446  "initializing pointer member %0 to point to a temporary object "
9447  "whose lifetime is shorter than the lifetime of the constructed object">,
9448  InGroup<DanglingGsl>;
9449def note_lifetime_extending_member_declared_here : Note<
9450  "%select{%select{reference|'std::initializer_list'}0 member|"
9451  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
9452  "declared here">;
9453def warn_dangling_variable : Warning<
9454  "%select{temporary %select{whose address is used as value of|"
9455  "%select{|implicitly }2bound to}4 "
9456  "%select{%select{|reference }4member of local variable|"
9457  "local %select{variable|reference}4}1|"
9458  "array backing "
9459  "%select{initializer list subobject of local variable|"
9460  "local initializer list}1}0 "
9461  "%select{%3 |}2will be destroyed at the end of the full-expression">,
9462  InGroup<Dangling>;
9463def warn_new_dangling_reference : Warning<
9464  "temporary bound to reference member of allocated object "
9465  "will be destroyed at the end of the full-expression">,
9466  InGroup<DanglingField>;
9467def warn_dangling_lifetime_pointer : Warning<
9468  "object backing the pointer "
9469  "will be destroyed at the end of the full-expression">,
9470  InGroup<DanglingGsl>;
9471def warn_new_dangling_initializer_list : Warning<
9472  "array backing "
9473  "%select{initializer list subobject of the allocated object|"
9474  "the allocated initializer list}0 "
9475  "will be destroyed at the end of the full-expression">,
9476  InGroup<DanglingInitializerList>;
9477def warn_unsupported_lifetime_extension : Warning<
9478  "sorry, lifetime extension of "
9479  "%select{temporary|backing array of initializer list}0 created "
9480  "by aggregate initialization using default member initializer "
9481  "is not supported; lifetime of %select{temporary|backing array}0 "
9482  "will end at the end of the full-expression">, InGroup<Dangling>;
9483
9484// For non-floating point, expressions of the form x == x or x != x
9485// should result in a warning, since these always evaluate to a constant.
9486// Array comparisons have similar warnings
9487def warn_comparison_always : Warning<
9488  "%select{self-|array }0comparison always evaluates to "
9489  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
9490  InGroup<TautologicalCompare>;
9491def warn_comparison_bitwise_always : Warning<
9492  "bitwise comparison always evaluates to %select{false|true}0">,
9493  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9494def warn_comparison_bitwise_or : Warning<
9495  "bitwise or with non-zero value always evaluates to true">,
9496  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9497def warn_tautological_overlap_comparison : Warning<
9498  "overlapping comparisons always evaluate to %select{false|true}0">,
9499  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
9500def warn_depr_array_comparison : Warning<
9501  "comparison between two arrays is deprecated; "
9502  "to compare array addresses, use unary '+' to decay operands to pointers">,
9503  InGroup<DeprecatedArrayCompare>;
9504
9505def warn_stringcompare : Warning<
9506  "result of comparison against %select{a string literal|@encode}0 is "
9507  "unspecified (use an explicit string comparison function instead)">,
9508  InGroup<StringCompare>;
9509
9510def warn_identity_field_assign : Warning<
9511  "assigning %select{field|instance variable}0 to itself">,
9512  InGroup<SelfAssignmentField>;
9513
9514// Type safety attributes
9515def err_type_tag_for_datatype_not_ice : Error<
9516  "'type_tag_for_datatype' attribute requires the initializer to be "
9517  "an %select{integer|integral}0 constant expression">;
9518def err_type_tag_for_datatype_too_large : Error<
9519  "'type_tag_for_datatype' attribute requires the initializer to be "
9520  "an %select{integer|integral}0 constant expression "
9521  "that can be represented by a 64 bit integer">;
9522def err_tag_index_out_of_range : Error<
9523  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
9524def warn_type_tag_for_datatype_wrong_kind : Warning<
9525  "this type tag was not designed to be used with this function">,
9526  InGroup<TypeSafety>;
9527def warn_type_safety_type_mismatch : Warning<
9528  "argument type %0 doesn't match specified %1 type tag "
9529  "%select{that requires %3|}2">, InGroup<TypeSafety>;
9530def warn_type_safety_null_pointer_required : Warning<
9531  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
9532
9533// Generic selections.
9534def err_assoc_type_incomplete : Error<
9535  "type %0 in generic association incomplete">;
9536def err_assoc_type_nonobject : Error<
9537  "type %0 in generic association not an object type">;
9538def err_assoc_type_variably_modified : Error<
9539  "type %0 in generic association is a variably modified type">;
9540def err_assoc_compatible_types : Error<
9541  "type %0 in generic association compatible with previously specified type %1">;
9542def note_compat_assoc : Note<
9543  "compatible type %0 specified here">;
9544def err_generic_sel_no_match : Error<
9545  "controlling expression type %0 not compatible with any generic association type">;
9546def err_generic_sel_multi_match : Error<
9547  "controlling expression type %0 compatible with %1 generic association types">;
9548
9549
9550// Blocks
9551def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
9552  " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">;
9553def err_block_returning_array_function : Error<
9554  "block cannot return %select{array|function}0 type %1">;
9555
9556// Builtin annotation
9557def err_builtin_annotation_first_arg : Error<
9558  "first argument to __builtin_annotation must be an integer">;
9559def err_builtin_annotation_second_arg : Error<
9560  "second argument to __builtin_annotation must be a non-wide string constant">;
9561def err_msvc_annotation_wide_str : Error<
9562  "arguments to __annotation must be wide string constants">;
9563
9564// CFString checking
9565def err_cfstring_literal_not_string_constant : Error<
9566  "CFString literal is not a string constant">;
9567def warn_cfstring_truncated : Warning<
9568  "input conversion stopped due to an input byte that does not "
9569  "belong to the input codeset UTF-8">,
9570  InGroup<DiagGroup<"CFString-literal">>;
9571
9572// os_log checking
9573// TODO: separate diagnostic for os_trace()
9574def err_os_log_format_not_string_constant : Error<
9575  "os_log() format argument is not a string constant">;
9576def err_os_log_argument_too_big : Error<
9577  "os_log() argument %0 is too big (%1 bytes, max %2)">;
9578def warn_os_log_format_narg : Error<
9579 "os_log() '%%n' format specifier is not allowed">, DefaultError;
9580
9581// Statements.
9582def err_continue_not_in_loop : Error<
9583  "'continue' statement not in loop statement">;
9584def err_break_not_in_loop_or_switch : Error<
9585  "'break' statement not in loop or switch statement">;
9586def warn_loop_ctrl_binds_to_inner : Warning<
9587  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
9588  InGroup<GccCompat>;
9589def warn_break_binds_to_switch : Warning<
9590  "'break' is bound to loop, GCC binds it to switch">,
9591  InGroup<GccCompat>;
9592def err_default_not_in_switch : Error<
9593  "'default' statement not in switch statement">;
9594def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
9595def warn_bool_switch_condition : Warning<
9596  "switch condition has boolean value">, InGroup<SwitchBool>;
9597def warn_case_value_overflow : Warning<
9598  "overflow converting case value to switch condition type (%0 to %1)">,
9599  InGroup<Switch>;
9600def err_duplicate_case : Error<"duplicate case value '%0'">;
9601def err_duplicate_case_differing_expr : Error<
9602  "duplicate case value: '%0' and '%1' both equal '%2'">;
9603def warn_case_empty_range : Warning<"empty case range specified">;
9604def warn_missing_case_for_condition :
9605  Warning<"no case matching constant switch condition '%0'">;
9606
9607def warn_def_missing_case : Warning<"%plural{"
9608  "1:enumeration value %1 not explicitly handled in switch|"
9609  "2:enumeration values %1 and %2 not explicitly handled in switch|"
9610  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
9611  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
9612  InGroup<SwitchEnum>, DefaultIgnore;
9613
9614def warn_missing_case : Warning<"%plural{"
9615  "1:enumeration value %1 not handled in switch|"
9616  "2:enumeration values %1 and %2 not handled in switch|"
9617  "3:enumeration values %1, %2, and %3 not handled in switch|"
9618  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
9619  InGroup<Switch>;
9620
9621def warn_unannotated_fallthrough : Warning<
9622  "unannotated fall-through between switch labels">,
9623  InGroup<ImplicitFallthrough>, DefaultIgnore;
9624def warn_unannotated_fallthrough_per_function : Warning<
9625  "unannotated fall-through between switch labels in partly-annotated "
9626  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
9627def note_insert_fallthrough_fixit : Note<
9628  "insert '%0;' to silence this warning">;
9629def note_insert_break_fixit : Note<
9630  "insert 'break;' to avoid fall-through">;
9631def err_fallthrough_attr_wrong_target : Error<
9632  "%0 attribute is only allowed on empty statements">;
9633def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
9634def err_fallthrough_attr_outside_switch : Error<
9635  "fallthrough annotation is outside switch statement">;
9636def err_fallthrough_attr_invalid_placement : Error<
9637  "fallthrough annotation does not directly precede switch label">;
9638
9639def warn_unreachable_default : Warning<
9640  "default label in switch which covers all enumeration values">,
9641  InGroup<CoveredSwitchDefault>, DefaultIgnore;
9642def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
9643  InGroup<Switch>;
9644def warn_not_in_enum_assignment : Warning<"integer constant not in range "
9645  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
9646def err_typecheck_statement_requires_scalar : Error<
9647  "statement requires expression of scalar type (%0 invalid)">;
9648def err_typecheck_statement_requires_integer : Error<
9649  "statement requires expression of integer type (%0 invalid)">;
9650def err_multiple_default_labels_defined : Error<
9651  "multiple default labels in one switch">;
9652def err_switch_multiple_conversions : Error<
9653  "multiple conversions from switch condition type %0 to an integral or "
9654  "enumeration type">;
9655def note_switch_conversion : Note<
9656  "conversion to %select{integral|enumeration}0 type %1">;
9657def err_switch_explicit_conversion : Error<
9658  "switch condition type %0 requires explicit conversion to %1">;
9659def err_switch_incomplete_class_type : Error<
9660  "switch condition has incomplete class type %0">;
9661
9662def warn_empty_if_body : Warning<
9663  "if statement has empty body">, InGroup<EmptyBody>;
9664def warn_empty_for_body : Warning<
9665  "for loop has empty body">, InGroup<EmptyBody>;
9666def warn_empty_range_based_for_body : Warning<
9667  "range-based for loop has empty body">, InGroup<EmptyBody>;
9668def warn_empty_while_body : Warning<
9669  "while loop has empty body">, InGroup<EmptyBody>;
9670def warn_empty_switch_body : Warning<
9671  "switch statement has empty body">, InGroup<EmptyBody>;
9672def note_empty_body_on_separate_line : Note<
9673  "put the semicolon on a separate line to silence this warning">;
9674
9675def err_va_start_captured_stmt : Error<
9676  "'va_start' cannot be used in a captured statement">;
9677def err_va_start_outside_function : Error<
9678  "'va_start' cannot be used outside a function">;
9679def err_va_start_fixed_function : Error<
9680  "'va_start' used in function with fixed args">;
9681def err_va_start_used_in_wrong_abi_function : Error<
9682  "'va_start' used in %select{System V|Win64}0 ABI function">;
9683def err_ms_va_start_used_in_sysv_function : Error<
9684  "'__builtin_ms_va_start' used in System V ABI function">;
9685def warn_second_arg_of_va_start_not_last_named_param : Warning<
9686  "second argument to 'va_start' is not the last named parameter">,
9687  InGroup<Varargs>;
9688def warn_va_start_type_is_undefined : Warning<
9689  "passing %select{an object that undergoes default argument promotion|"
9690  "an object of reference type|a parameter declared with the 'register' "
9691  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
9692def err_first_argument_to_va_arg_not_of_type_va_list : Error<
9693  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
9694def err_second_parameter_to_va_arg_incomplete: Error<
9695  "second argument to 'va_arg' is of incomplete type %0">;
9696def err_second_parameter_to_va_arg_abstract: Error<
9697  "second argument to 'va_arg' is of abstract type %0">;
9698def warn_second_parameter_to_va_arg_not_pod : Warning<
9699  "second argument to 'va_arg' is of non-POD type %0">,
9700  InGroup<NonPODVarargs>, DefaultError;
9701def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
9702  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
9703  InGroup<NonPODVarargs>, DefaultError;
9704def warn_second_parameter_to_va_arg_never_compatible : Warning<
9705  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
9706  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
9707
9708def warn_return_missing_expr : Warning<
9709  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9710  InGroup<ReturnType>;
9711def ext_return_missing_expr : ExtWarn<
9712  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9713  InGroup<ReturnType>;
9714def ext_return_has_expr : ExtWarn<
9715  "%select{void function|void method|constructor|destructor}1 %0 "
9716  "should not return a value">,
9717  DefaultError, InGroup<ReturnType>;
9718def ext_return_has_void_expr : Extension<
9719  "void %select{function|method|block}1 %0 should not return void expression">;
9720def err_return_init_list : Error<
9721  "%select{void function|void method|constructor|destructor}1 %0 "
9722  "must not return a value">;
9723def err_ctor_dtor_returns_void : Error<
9724  "%select{constructor|destructor}1 %0 must not return void expression">;
9725def warn_noreturn_function_has_return_expr : Warning<
9726  "function %0 declared 'noreturn' should not return">,
9727  InGroup<InvalidNoreturn>;
9728def warn_falloff_noreturn_function : Warning<
9729  "function declared 'noreturn' should not return">,
9730  InGroup<InvalidNoreturn>;
9731def err_noreturn_block_has_return_expr : Error<
9732  "block declared 'noreturn' should not return">;
9733def err_carries_dependency_missing_on_first_decl : Error<
9734  "%select{function|parameter}0 declared '[[carries_dependency]]' "
9735  "after its first declaration">;
9736def note_carries_dependency_missing_first_decl : Note<
9737  "declaration missing '[[carries_dependency]]' attribute is here">;
9738def err_carries_dependency_param_not_function_decl : Error<
9739  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
9740  "declaration or lambda">;
9741def err_block_on_nonlocal : Error<
9742  "__block attribute not allowed, only allowed on local variables">;
9743def err_block_on_vm : Error<
9744  "__block attribute not allowed on declaration with a variably modified type">;
9745def err_sizeless_nonlocal : Error<
9746  "non-local variable with sizeless type %0">;
9747
9748def err_vec_builtin_non_vector : Error<
9749 "first two arguments to %0 must be vectors">;
9750def err_vec_builtin_incompatible_vector : Error<
9751  "first two arguments to %0 must have the same type">;
9752def err_vsx_builtin_nonconstant_argument : Error<
9753  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
9754
9755def err_shufflevector_nonconstant_argument : Error<
9756  "index for __builtin_shufflevector must be a constant integer">;
9757def err_shufflevector_argument_too_large : Error<
9758  "index for __builtin_shufflevector must be less than the total number "
9759  "of vector elements">;
9760
9761def err_convertvector_non_vector : Error<
9762  "first argument to __builtin_convertvector must be a vector">;
9763def err_convertvector_non_vector_type : Error<
9764  "second argument to __builtin_convertvector must be a vector type">;
9765def err_convertvector_incompatible_vector : Error<
9766  "first two arguments to __builtin_convertvector must have the same number of elements">;
9767
9768def err_first_argument_to_cwsc_not_call : Error<
9769  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
9770def err_first_argument_to_cwsc_block_call : Error<
9771  "first argument to __builtin_call_with_static_chain must not be a block call">;
9772def err_first_argument_to_cwsc_builtin_call : Error<
9773  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
9774def err_first_argument_to_cwsc_pdtor_call : Error<
9775  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
9776def err_second_argument_to_cwsc_not_pointer : Error<
9777  "second argument to __builtin_call_with_static_chain must be of pointer type">;
9778
9779def err_vector_incorrect_num_initializers : Error<
9780  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
9781def err_altivec_empty_initializer : Error<"expected initializer">;
9782
9783def err_invalid_neon_type_code : Error<
9784  "incompatible constant for this __builtin_neon function">;
9785def err_argument_invalid_range : Error<
9786  "argument value %0 is outside the valid range [%1, %2]">;
9787def warn_argument_invalid_range : Warning<
9788  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
9789  InGroup<DiagGroup<"argument-outside-range">>;
9790def warn_argument_undefined_behaviour : Warning<
9791  "argument value %0 will result in undefined behaviour">,
9792  InGroup<DiagGroup<"argument-undefined-behaviour">>;
9793def err_argument_not_multiple : Error<
9794  "argument should be a multiple of %0">;
9795def err_argument_not_power_of_2 : Error<
9796  "argument should be a power of 2">;
9797def err_argument_not_shifted_byte : Error<
9798  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
9799def err_argument_not_shifted_byte_or_xxff : Error<
9800  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9801def err_argument_not_contiguous_bit_field : Error<
9802  "argument %0 value should represent a contiguous bit field">;
9803def err_rotation_argument_to_cadd
9804    : Error<"argument should be the value 90 or 270">;
9805def err_rotation_argument_to_cmla
9806    : Error<"argument should be the value 0, 90, 180 or 270">;
9807def warn_neon_vector_initializer_non_portable : Warning<
9808  "vector initializers are not compatible with NEON intrinsics in big endian "
9809  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
9810def note_neon_vector_initializer_non_portable : Note<
9811  "consider using vld1_%0%1() to initialize a vector from memory, or "
9812  "vcreate_%0%1() to initialize from an integer constant">;
9813def note_neon_vector_initializer_non_portable_q : Note<
9814  "consider using vld1q_%0%1() to initialize a vector from memory, or "
9815  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
9816  "constants">;
9817def err_systemz_invalid_tabort_code : Error<
9818  "invalid transaction abort code">;
9819def err_64_bit_builtin_32_bit_tgt : Error<
9820  "this builtin is only available on 64-bit targets">;
9821def err_32_bit_builtin_64_bit_tgt : Error<
9822  "this builtin is only available on 32-bit targets">;
9823def err_builtin_x64_aarch64_only : Error<
9824  "this builtin is only available on x86-64 and aarch64 targets">;
9825def err_mips_builtin_requires_dsp : Error<
9826  "this builtin requires 'dsp' ASE, please use -mdsp">;
9827def err_mips_builtin_requires_dspr2 : Error<
9828  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
9829def err_mips_builtin_requires_msa : Error<
9830  "this builtin requires 'msa' ASE, please use -mmsa">;
9831def err_ppc_builtin_only_on_arch : Error<
9832  "this builtin is only valid on POWER%0 or later CPUs">;
9833def err_ppc_builtin_requires_vsx : Error<
9834  "this builtin requires VSX to be enabled">;
9835def err_ppc_builtin_requires_htm : Error<
9836  "this builtin requires HTM to be enabled">;
9837def err_ppc_builtin_requires_abi : Error<
9838  "this builtin requires ABI -mabi=%0">;
9839def err_ppc_invalid_use_mma_type : Error<
9840  "invalid use of PPC MMA type">;
9841def err_ppc_invalid_test_data_class_type : Error<
9842  "expected a 'float' or 'double' for the first argument">;
9843def err_x86_builtin_invalid_rounding : Error<
9844  "invalid rounding argument">;
9845def err_x86_builtin_invalid_scale : Error<
9846  "scale argument must be 1, 2, 4, or 8">;
9847def err_x86_builtin_tile_arg_duplicate : Error<
9848  "tile arguments must refer to different tiles">;
9849
9850def err_builtin_target_unsupported : Error<
9851  "builtin is not supported on this target">;
9852def err_builtin_longjmp_unsupported : Error<
9853  "__builtin_longjmp is not supported for the current target">;
9854def err_builtin_setjmp_unsupported : Error<
9855  "__builtin_setjmp is not supported for the current target">;
9856
9857def err_builtin_longjmp_invalid_val : Error<
9858  "argument to __builtin_longjmp must be a constant 1">;
9859def err_builtin_requires_language : Error<"'%0' is only available in %1">;
9860
9861def err_constant_integer_arg_type : Error<
9862  "argument to %0 must be a constant integer">;
9863
9864def ext_mixed_decls_code : Extension<
9865  "ISO C90 forbids mixing declarations and code">,
9866  InGroup<DiagGroup<"declaration-after-statement">>;
9867
9868def err_non_local_variable_decl_in_for : Error<
9869  "declaration of non-local variable in 'for' loop">;
9870def err_non_variable_decl_in_for : Error<
9871  "non-variable declaration in 'for' loop">;
9872def err_toomany_element_decls : Error<
9873  "only one element declaration is allowed">;
9874def err_selector_element_not_lvalue : Error<
9875  "selector element is not a valid lvalue">;
9876def err_selector_element_type : Error<
9877  "selector element type %0 is not a valid object">;
9878def err_selector_element_const_type : Error<
9879  "selector element of type %0 cannot be a constant lvalue expression">;
9880def err_collection_expr_type : Error<
9881  "the type %0 is not a pointer to a fast-enumerable object">;
9882def warn_collection_expr_type : Warning<
9883  "collection expression type %0 may not respond to %1">;
9884
9885def err_invalid_conversion_between_ext_vectors : Error<
9886  "invalid conversion between ext-vector type %0 and %1">;
9887
9888def warn_duplicate_attribute_exact : Warning<
9889  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
9890
9891def warn_duplicate_attribute : Warning<
9892  "attribute %0 is already applied with different arguments">,
9893  InGroup<IgnoredAttributes>;
9894def err_disallowed_duplicate_attribute : Error<
9895  "attribute %0 cannot appear more than once on a declaration">;
9896
9897def warn_sync_fetch_and_nand_semantics_change : Warning<
9898  "the semantics of this intrinsic changed with GCC "
9899  "version 4.4 - the newer semantics are provided here">,
9900  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
9901
9902// Type
9903def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
9904  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
9905def warn_receiver_forward_class : Warning<
9906  "receiver %0 is a forward class and corresponding @interface may not exist">,
9907  InGroup<ForwardClassReceiver>;
9908def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
9909def ext_missing_declspec : ExtWarn<
9910  "declaration specifier missing, defaulting to 'int'">;
9911def ext_missing_type_specifier : ExtWarn<
9912  "type specifier missing, defaults to 'int'">,
9913  InGroup<ImplicitInt>;
9914def err_decimal_unsupported : Error<
9915  "GNU decimal type extension not supported">;
9916def err_missing_type_specifier : Error<
9917  "C++ requires a type specifier for all declarations">;
9918def err_objc_array_of_interfaces : Error<
9919  "array of interface %0 is invalid (probably should be an array of pointers)">;
9920def ext_c99_array_usage : Extension<
9921  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9922  "feature">, InGroup<C99>;
9923def err_c99_array_usage_cxx : Error<
9924  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9925  "feature, not permitted in C++">;
9926def err_type_unsupported : Error<
9927  "%0 is not supported on this target">;
9928def err_nsconsumed_attribute_mismatch : Error<
9929  "overriding method has mismatched ns_consumed attribute on its"
9930  " parameter">;
9931def err_nsreturns_retained_attribute_mismatch : Error<
9932  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
9933  " attributes">;
9934def err_nserrordomain_invalid_decl : Error<
9935  "domain argument %select{|%1 }0does not refer to global constant">;
9936def err_nserrordomain_wrong_type : Error<
9937  "domain argument %0 does not point to an NSString or CFString constant">;
9938
9939def warn_nsconsumed_attribute_mismatch : Warning<
9940  err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
9941def warn_nsreturns_retained_attribute_mismatch : Warning<
9942  err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
9943
9944def note_getter_unavailable : Note<
9945  "or because setter is declared here, but no getter method %0 is found">;
9946def err_invalid_protocol_qualifiers : Error<
9947  "invalid protocol qualifiers on non-ObjC type">;
9948def warn_ivar_use_hidden : Warning<
9949  "local declaration of %0 hides instance variable">,
9950   InGroup<ShadowIvar>;
9951def warn_direct_initialize_call : Warning<
9952  "explicit call to +initialize results in duplicate call to +initialize">,
9953   InGroup<ExplicitInitializeCall>;
9954def warn_direct_super_initialize_call : Warning<
9955  "explicit call to [super initialize] should only be in implementation "
9956  "of +initialize">,
9957   InGroup<ExplicitInitializeCall>;
9958def err_ivar_use_in_class_method : Error<
9959  "instance variable %0 accessed in class method">;
9960def err_private_ivar_access : Error<"instance variable %0 is private">,
9961  AccessControl;
9962def err_protected_ivar_access : Error<"instance variable %0 is protected">,
9963  AccessControl;
9964def warn_maynot_respond : Warning<"%0 may not respond to %1">;
9965def ext_typecheck_base_super : Warning<
9966  "method parameter type "
9967  "%diff{$ does not match super class method parameter type $|"
9968  "does not match super class method parameter type}0,1">,
9969   InGroup<SuperSubClassMismatch>, DefaultIgnore;
9970def warn_missing_method_return_type : Warning<
9971  "method has no return type specified; defaults to 'id'">,
9972  InGroup<MissingMethodReturnType>, DefaultIgnore;
9973def warn_direct_ivar_access : Warning<"instance variable %0 is being "
9974  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
9975
9976// Spell-checking diagnostics
9977def err_unknown_typename : Error<
9978  "unknown type name %0">;
9979def err_unknown_type_or_class_name_suggest : Error<
9980  "unknown %select{type|class}1 name %0; did you mean %2?">;
9981def err_unknown_typename_suggest : Error<
9982  "unknown type name %0; did you mean %1?">;
9983def err_unknown_nested_typename_suggest : Error<
9984  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
9985def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
9986def err_undeclared_use_suggest : Error<
9987  "use of undeclared %0; did you mean %1?">;
9988def err_undeclared_var_use_suggest : Error<
9989  "use of undeclared identifier %0; did you mean %1?">;
9990def err_no_template : Error<"no template named %0">;
9991def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
9992def err_no_member_template : Error<"no template named %0 in %1">;
9993def err_no_member_template_suggest : Error<
9994  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
9995def err_non_template_in_template_id : Error<
9996  "%0 does not name a template but is followed by template arguments">;
9997def err_non_template_in_template_id_suggest : Error<
9998  "%0 does not name a template but is followed by template arguments; "
9999  "did you mean %1?">;
10000def err_non_template_in_member_template_id_suggest : Error<
10001  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
10002def note_non_template_in_template_id_found : Note<
10003  "non-template declaration found by name lookup">;
10004def err_mem_init_not_member_or_class_suggest : Error<
10005  "initializer %0 does not name a non-static data member or base "
10006  "class; did you mean the %select{base class|member}1 %2?">;
10007def err_field_designator_unknown_suggest : Error<
10008  "field designator %0 does not refer to any field in type %1; did you mean "
10009  "%2?">;
10010def err_typecheck_member_reference_ivar_suggest : Error<
10011  "%0 does not have a member named %1; did you mean %2?">;
10012def err_property_not_found_suggest : Error<
10013  "property %0 not found on object of type %1; did you mean %2?">;
10014def err_class_property_found : Error<
10015  "property %0 is a class property; did you mean to access it with class '%1'?">;
10016def err_ivar_access_using_property_syntax_suggest : Error<
10017  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
10018def warn_property_access_suggest : Warning<
10019"property %0 not found on object of type %1; did you mean to access property %2?">,
10020InGroup<PropertyAccessDotSyntax>;
10021def err_property_found_suggest : Error<
10022  "property %0 found on object of type %1; did you mean to access "
10023  "it with the \".\" operator?">;
10024def err_undef_interface_suggest : Error<
10025  "cannot find interface declaration for %0; did you mean %1?">;
10026def warn_undef_interface_suggest : Warning<
10027  "cannot find interface declaration for %0; did you mean %1?">;
10028def err_undef_superclass_suggest : Error<
10029  "cannot find interface declaration for %0, superclass of %1; did you mean "
10030  "%2?">;
10031def err_undeclared_protocol_suggest : Error<
10032  "cannot find protocol declaration for %0; did you mean %1?">;
10033def note_base_class_specified_here : Note<
10034  "base class %0 specified here">;
10035def err_using_directive_suggest : Error<
10036  "no namespace named %0; did you mean %1?">;
10037def err_using_directive_member_suggest : Error<
10038  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
10039def note_namespace_defined_here : Note<"namespace %0 defined here">;
10040def err_sizeof_pack_no_pack_name_suggest : Error<
10041  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
10042def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
10043
10044def err_uncasted_use_of_unknown_any : Error<
10045  "%0 has unknown type; cast it to its declared type to use it">;
10046def err_uncasted_call_of_unknown_any : Error<
10047  "%0 has unknown return type; cast the call to its declared return type">;
10048def err_uncasted_send_to_unknown_any_method : Error<
10049  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
10050  "message send to the method's return type">;
10051def err_unsupported_unknown_any_decl : Error<
10052  "%0 has unknown type, which is not supported for this kind of declaration">;
10053def err_unsupported_unknown_any_expr : Error<
10054  "unsupported expression with unknown type">;
10055def err_unsupported_unknown_any_call : Error<
10056  "call to unsupported expression with unknown type">;
10057def err_unknown_any_addrof : Error<
10058  "the address of a declaration with unknown type "
10059  "can only be cast to a pointer type">;
10060def err_unknown_any_addrof_call : Error<
10061  "address-of operator cannot be applied to a call to a function with "
10062  "unknown return type">;
10063def err_unknown_any_var_function_type : Error<
10064  "variable %0 with unknown type cannot be given a function type">;
10065def err_unknown_any_function : Error<
10066  "function %0 with unknown type must be given a function type">;
10067
10068def err_filter_expression_integral : Error<
10069  "filter expression has non-integral type %0">;
10070
10071def err_non_asm_stmt_in_naked_function : Error<
10072  "non-ASM statement in naked function is not supported">;
10073def err_asm_naked_this_ref : Error<
10074  "'this' pointer references not allowed in naked functions">;
10075def err_asm_naked_parm_ref : Error<
10076  "parameter references not allowed in naked functions">;
10077
10078// OpenCL warnings and errors.
10079def err_invalid_astype_of_different_size : Error<
10080  "invalid reinterpretation: sizes of %0 and %1 must match">;
10081def err_static_kernel : Error<
10082  "kernel functions cannot be declared static">;
10083def err_method_kernel : Error<
10084  "kernel functions cannot be class members">;
10085def err_template_kernel : Error<
10086  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
10087def err_opencl_ptrptr_kernel_param : Error<
10088  "kernel parameter cannot be declared as a pointer to a pointer">;
10089def err_kernel_arg_address_space : Error<
10090  "pointer arguments to kernel functions must reside in '__global', "
10091  "'__constant' or '__local' address space">;
10092def err_opencl_ext_vector_component_invalid_length : Error<
10093  "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
10094def err_opencl_function_variable : Error<
10095  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
10096def err_opencl_addrspace_scope : Error<
10097  "variables in the %0 address space can only be declared in the outermost "
10098  "scope of a kernel function">;
10099def err_static_function_scope : Error<
10100  "variables in function scope cannot be declared static">;
10101def err_opencl_bitfields : Error<
10102  "bit-fields are not supported in OpenCL">;
10103def err_opencl_vla : Error<
10104  "variable length arrays are not supported in OpenCL">;
10105def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
10106    "scalar operand type has greater rank than the type of the vector "
10107    "element. (%0 and %1)">;
10108def err_bad_kernel_param_type : Error<
10109  "%0 cannot be used as the type of a kernel parameter">;
10110def err_opencl_implicit_function_decl : Error<
10111  "implicit declaration of function %0 is invalid in OpenCL">;
10112def err_record_with_pointers_kernel_param : Error<
10113  "%select{struct|union}0 kernel parameters may not contain pointers">;
10114def note_within_field_of_type : Note<
10115  "within field of type %0 declared here">;
10116def note_illegal_field_declared_here : Note<
10117  "field of illegal %select{type|pointer type}0 %1 declared here">;
10118def err_opencl_type_struct_or_union_field : Error<
10119  "the %0 type cannot be used to declare a structure or union field">;
10120def err_event_t_addr_space_qual : Error<
10121  "the event_t type can only be used with __private address space qualifier">;
10122def err_expected_kernel_void_return_type : Error<
10123  "kernel must have void return type">;
10124def err_sampler_initializer_not_integer : Error<
10125  "sampler_t initialization requires 32-bit integer, not %0">;
10126def warn_sampler_initializer_invalid_bits : Warning<
10127  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
10128def err_sampler_argument_required : Error<
10129  "sampler_t variable required - got %0">;
10130def err_wrong_sampler_addressspace: Error<
10131  "sampler type cannot be used with the __local and __global address space qualifiers">;
10132def err_opencl_nonconst_global_sampler : Error<
10133  "global sampler requires a const or constant address space qualifier">;
10134def err_opencl_cast_non_zero_to_event_t : Error<
10135  "cannot cast non-zero value '%0' to 'event_t'">;
10136def err_opencl_global_invalid_addr_space : Error<
10137  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
10138def err_missing_actual_pipe_type : Error<
10139  "missing actual type specifier for pipe">;
10140def err_reference_pipe_type : Error <
10141  "pipes packet types cannot be of reference type">;
10142def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
10143def err_opencl_kernel_attr :
10144  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
10145def err_opencl_return_value_with_address_space : Error<
10146  "return value cannot be qualified with address space">;
10147def err_opencl_constant_no_init : Error<
10148  "variable in constant address space must be initialized">;
10149def err_opencl_atomic_init: Error<
10150  "atomic variable can be %select{assigned|initialized}0 to a variable only "
10151  "in global address space">;
10152def err_opencl_implicit_vector_conversion : Error<
10153  "implicit conversions between vector types (%0 and %1) are not permitted">;
10154def err_opencl_invalid_type_array : Error<
10155  "array of %0 type is invalid in OpenCL">;
10156def err_opencl_ternary_with_block : Error<
10157  "block type cannot be used as expression in ternary expression in OpenCL">;
10158def err_opencl_pointer_to_type : Error<
10159  "pointer to type %0 is invalid in OpenCL">;
10160def err_opencl_type_can_only_be_used_as_function_parameter : Error <
10161  "type %0 can only be used as a function parameter in OpenCL">;
10162def err_opencl_type_not_found : Error<
10163  "%0 type %1 not found; include the base header with -finclude-default-header">;
10164def warn_opencl_attr_deprecated_ignored : Warning <
10165  "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>;
10166def err_opencl_variadic_function : Error<
10167  "invalid prototype, variadic arguments are not allowed in OpenCL">;
10168def err_opencl_requires_extension : Error<
10169  "use of %select{type|declaration}0 %1 requires %2 support">;
10170def ext_opencl_double_without_pragma : Extension<
10171  "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
10172  " supported">;
10173def warn_opencl_generic_address_space_arg : Warning<
10174  "passing non-generic address space pointer to %0"
10175  " may cause dynamic conversion affecting performance">,
10176  InGroup<Conversion>, DefaultIgnore;
10177
10178// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
10179def err_opencl_builtin_pipe_first_arg : Error<
10180  "first argument to %0 must be a pipe type">;
10181def err_opencl_builtin_pipe_arg_num : Error<
10182  "invalid number of arguments to function: %0">;
10183def err_opencl_builtin_pipe_invalid_arg : Error<
10184  "invalid argument type to function %0 (expecting %1 having %2)">;
10185def err_opencl_builtin_pipe_invalid_access_modifier : Error<
10186  "invalid pipe access modifier (expecting %0)">;
10187
10188// OpenCL access qualifier
10189def err_opencl_invalid_access_qualifier : Error<
10190  "access qualifier can only be used for pipe and image type">;
10191def err_opencl_invalid_read_write : Error<
10192  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 "
10193  "and without __opencl_c_read_write_images feature}2">;
10194def err_opencl_multiple_access_qualifiers : Error<
10195  "multiple access qualifiers">;
10196def note_opencl_typedef_access_qualifier : Note<
10197  "previously declared '%0' here">;
10198
10199// OpenCL v2.0 s6.12.5 Blocks restrictions
10200def err_opencl_block_storage_type : Error<
10201  "the __block storage type is not permitted">;
10202def err_opencl_invalid_block_declaration : Error<
10203  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
10204def err_opencl_extern_block_declaration : Error<
10205  "invalid block variable declaration - using 'extern' storage class is disallowed">;
10206def err_opencl_block_ref_block : Error<
10207  "cannot refer to a block inside block">;
10208
10209// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
10210def err_opencl_builtin_to_addr_invalid_arg : Error<
10211  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
10212
10213// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
10214def err_opencl_enqueue_kernel_incorrect_args : Error<
10215  "illegal call to enqueue_kernel, incorrect argument types">;
10216def err_opencl_enqueue_kernel_local_size_args : Error<
10217  "mismatch in number of block parameters and local size arguments passed">;
10218def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
10219  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
10220def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
10221  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
10222def err_opencl_enqueue_kernel_blocks_no_args : Error<
10223  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
10224
10225def err_opencl_builtin_expected_type : Error<
10226  "illegal call to %0, expected %1 argument type">;
10227
10228// OpenCL v3.0 s6.3.7 - Vector Components
10229def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
10230  "vector component name '%0' is a feature from OpenCL version 3.0 onwards">,
10231  InGroup<OpenCLUnsupportedRGBA>;
10232
10233def err_openclcxx_placement_new : Error<
10234  "use of placement new requires explicit declaration">;
10235
10236// MIG routine annotations.
10237def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
10238  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
10239  InGroup<IgnoredAttributes>;
10240} // end of sema category
10241
10242let CategoryName = "OpenMP Issue" in {
10243// OpenMP support.
10244def err_omp_expected_var_arg : Error<
10245  "%0 is not a global variable, static local variable or static data member">;
10246def err_omp_expected_var_arg_suggest : Error<
10247  "%0 is not a global variable, static local variable or static data member; "
10248  "did you mean %1">;
10249def err_omp_global_var_arg : Error<
10250  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
10251def err_omp_ref_type_arg : Error<
10252  "arguments of '#pragma omp %0' cannot be of reference type %1">;
10253def err_omp_region_not_file_context : Error<
10254  "directive must be at file or namespace scope">;
10255def err_omp_var_scope : Error<
10256  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
10257def err_omp_var_used : Error<
10258  "'#pragma omp %0' must precede all references to variable %q1">;
10259def err_omp_var_thread_local : Error<
10260  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
10261def err_omp_private_incomplete_type : Error<
10262  "a private variable with incomplete type %0">;
10263def err_omp_firstprivate_incomplete_type : Error<
10264  "a firstprivate variable with incomplete type %0">;
10265def err_omp_lastprivate_incomplete_type : Error<
10266  "a lastprivate variable with incomplete type %0">;
10267def err_omp_reduction_incomplete_type : Error<
10268  "a reduction list item with incomplete type %0">;
10269def err_omp_unexpected_clause_value : Error<
10270  "expected %0 in OpenMP clause '%1'">;
10271def err_omp_expected_var_name_member_expr : Error<
10272  "expected variable name%select{| or data member of current class}0">;
10273def err_omp_expected_var_name_member_expr_or_array_item : Error<
10274  "expected variable name%select{|, data member of current class}0, array element or array section">;
10275def err_omp_expected_addressable_lvalue_or_array_item : Error<
10276  "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">;
10277def err_omp_expected_named_var_member_or_array_expression: Error<
10278  "expected expression containing only member accesses and/or array sections based on named variables">;
10279def err_omp_bit_fields_forbidden_in_clause : Error<
10280  "bit fields cannot be used to specify storage in a '%0' clause">;
10281def err_array_section_does_not_specify_contiguous_storage : Error<
10282  "array section does not specify contiguous storage">;
10283def err_array_section_does_not_specify_length : Error<
10284  "array section does not specify length for outermost dimension">;
10285def err_omp_union_type_not_allowed : Error<
10286  "mapping of union members is not allowed">;
10287def err_omp_expected_access_to_data_field : Error<
10288  "expected access to data field">;
10289def err_omp_multiple_array_items_in_map_clause : Error<
10290  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
10291def err_omp_duplicate_map_type_modifier : Error<
10292  "same map type modifier has been specified more than once">;
10293def err_omp_duplicate_motion_modifier : Error<
10294  "same motion modifier has been specified more than once">;
10295def err_omp_pointer_mapped_along_with_derived_section : Error<
10296  "pointer cannot be mapped along with a section derived from itself">;
10297def err_omp_original_storage_is_shared_and_does_not_contain : Error<
10298  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
10299def err_omp_same_pointer_dereferenced : Error<
10300  "same pointer dereferenced in multiple different ways in map clause expressions">;
10301def note_omp_task_predetermined_firstprivate_here : Note<
10302  "predetermined as a firstprivate in a task construct here">;
10303def err_omp_threadprivate_incomplete_type : Error<
10304  "threadprivate variable with incomplete type %0">;
10305def err_omp_no_dsa_for_variable : Error<
10306  "variable %0 must have explicitly specified data sharing attributes">;
10307def err_omp_defaultmap_no_attr_for_variable : Error<
10308  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
10309def note_omp_default_dsa_none : Note<
10310  "explicit data sharing attribute requested here">;
10311def note_omp_defaultmap_attr_none : Note<
10312  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
10313def err_omp_wrong_dsa : Error<
10314  "%0 variable cannot be %1">;
10315def err_omp_variably_modified_type_not_supported : Error<
10316  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
10317def note_omp_explicit_dsa : Note<
10318  "defined as %0">;
10319def note_omp_predetermined_dsa : Note<
10320  "%select{static data member is predetermined as shared|"
10321  "variable with static storage duration is predetermined as shared|"
10322  "loop iteration variable is predetermined as private|"
10323  "loop iteration variable is predetermined as linear|"
10324  "loop iteration variable is predetermined as lastprivate|"
10325  "constant variable is predetermined as shared|"
10326  "global variable is predetermined as shared|"
10327  "non-shared variable in a task construct is predetermined as firstprivate|"
10328  "variable with automatic storage duration is predetermined as private}0"
10329  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
10330def note_omp_implicit_dsa : Note<
10331  "implicitly determined as %0">;
10332def err_omp_loop_var_dsa : Error<
10333  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
10334def err_omp_not_for : Error<
10335  "%select{statement after '#pragma omp %1' must be a for loop|"
10336  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
10337def note_omp_collapse_ordered_expr : Note<
10338  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
10339def err_omp_negative_expression_in_clause : Error<
10340  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
10341def err_omp_not_integral : Error<
10342  "expression must have integral or unscoped enumeration "
10343  "type, not %0">;
10344def err_omp_threadprivate_in_target : Error<
10345  "threadprivate variables cannot be used in target constructs">;
10346def err_omp_incomplete_type : Error<
10347  "expression has incomplete class type %0">;
10348def err_omp_explicit_conversion : Error<
10349  "expression requires explicit conversion from %0 to %1">;
10350def note_omp_conversion_here : Note<
10351  "conversion to %select{integral|enumeration}0 type %1 declared here">;
10352def err_omp_ambiguous_conversion : Error<
10353  "ambiguous conversion from type %0 to an integral or unscoped "
10354  "enumeration type">;
10355def err_omp_iterator_not_integral_or_pointer : Error<
10356  "expected integral or pointer type as the iterator-type, not %0">;
10357def err_omp_iterator_step_not_integral : Error<
10358  "iterator step expression %0 is not the integral expression">;
10359def err_omp_iterator_step_constant_zero : Error<
10360  "iterator step expression %0 evaluates to 0">;
10361def err_omp_required_access : Error<
10362  "%0 variable must be %1">;
10363def err_omp_const_variable : Error<
10364  "const-qualified variable cannot be %0">;
10365def err_omp_const_not_mutable_variable : Error<
10366  "const-qualified variable without mutable fields cannot be %0">;
10367def err_omp_const_list_item : Error<
10368  "const-qualified list item cannot be %0">;
10369def err_omp_linear_incomplete_type : Error<
10370  "a linear variable with incomplete type %0">;
10371def err_omp_linear_expected_int_or_ptr : Error<
10372  "argument of a linear clause should be of integral or pointer "
10373  "type, not %0">;
10374def warn_omp_linear_step_zero : Warning<
10375  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
10376  InGroup<OpenMPClauses>;
10377def warn_omp_alignment_not_power_of_two : Warning<
10378  "aligned clause will be ignored because the requested alignment is not a power of 2">,
10379  InGroup<OpenMPClauses>;
10380def err_omp_invalid_target_decl : Error<
10381  "%0 used in declare target directive is not a variable or a function name">;
10382def err_omp_declare_target_to_and_link : Error<
10383  "%0 must not appear in both clauses 'to' and 'link'">;
10384def warn_omp_not_in_target_context : Warning<
10385  "declaration is not declared in any declare target region">,
10386  InGroup<OpenMPTarget>;
10387def err_omp_function_in_link_clause : Error<
10388  "function name is not allowed in 'link' clause">;
10389def err_omp_aligned_expected_array_or_ptr : Error<
10390  "argument of aligned clause should be array"
10391  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
10392  ", not %0">;
10393def err_omp_used_in_clause_twice : Error<
10394  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
10395def err_omp_local_var_in_threadprivate_init : Error<
10396  "variable with local storage in initial value of threadprivate variable">;
10397def err_omp_loop_not_canonical_init : Error<
10398  "initialization clause of OpenMP for loop is not in canonical form "
10399  "('var = init' or 'T var = init')">;
10400def ext_omp_loop_not_canonical_init : ExtWarn<
10401  "initialization clause of OpenMP for loop is not in canonical form "
10402  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
10403def err_omp_loop_not_canonical_cond : Error<
10404  "condition of OpenMP for loop must be a relational comparison "
10405  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
10406def err_omp_loop_not_canonical_incr : Error<
10407  "increment clause of OpenMP for loop must perform simple addition "
10408  "or subtraction on loop variable %0">;
10409def err_omp_loop_variable_type : Error<
10410  "variable must be of integer or %select{pointer|random access iterator}0 type">;
10411def err_omp_loop_incr_not_compatible : Error<
10412  "increment expression must cause %0 to %select{decrease|increase}1 "
10413  "on each iteration of OpenMP for loop">;
10414def note_omp_loop_cond_requres_compatible_incr : Note<
10415  "loop step is expected to be %select{negative|positive}0 due to this condition">;
10416def err_omp_loop_diff_cxx : Error<
10417  "could not calculate number of iterations calling 'operator-' with "
10418  "upper and lower loop bounds">;
10419def err_omp_loop_cannot_use_stmt : Error<
10420  "'%0' statement cannot be used in OpenMP for loop">;
10421def err_omp_simd_region_cannot_use_stmt : Error<
10422  "'%0' statement cannot be used in OpenMP simd region">;
10423def warn_omp_loop_64_bit_var : Warning<
10424  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
10425  InGroup<OpenMPLoopForm>;
10426def err_omp_unknown_reduction_identifier : Error<
10427  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
10428  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
10429def err_omp_not_resolved_reduction_identifier : Error<
10430  "unable to resolve declare reduction construct for type %0">;
10431def err_omp_reduction_ref_type_arg : Error<
10432  "argument of OpenMP clause '%0' must reference the same object in all threads">;
10433def err_omp_clause_not_arithmetic_type_arg : Error<
10434  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
10435def err_omp_clause_floating_type_arg : Error<
10436  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
10437def err_omp_once_referenced : Error<
10438  "variable can appear only once in OpenMP '%0' clause">;
10439def err_omp_once_referenced_in_target_update : Error<
10440  "variable can appear only once in OpenMP 'target update' construct">;
10441def note_omp_referenced : Note<
10442  "previously referenced here">;
10443def err_omp_reduction_in_task : Error<
10444  "reduction variables may not be accessed in an explicit task">;
10445def err_omp_reduction_id_not_compatible : Error<
10446  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
10447def err_omp_reduction_identifier_mismatch : Error<
10448  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
10449def note_omp_previous_reduction_identifier : Note<
10450  "previously marked as task_reduction with different reduction operation">;
10451def err_omp_prohibited_region : Error<
10452  "region cannot be%select{| closely}0 nested inside '%1' region"
10453  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
10454  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
10455  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
10456  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
10457  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
10458def err_omp_prohibited_region_simd : Error<
10459  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
10460def err_omp_prohibited_region_atomic : Error<
10461  "OpenMP constructs may not be nested inside an atomic region">;
10462def err_omp_prohibited_region_critical_same_name : Error<
10463  "cannot nest 'critical' regions having the same name %0">;
10464def note_omp_previous_critical_region : Note<
10465  "previous 'critical' region starts here">;
10466def err_omp_several_directives_in_region : Error<
10467  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
10468def note_omp_previous_directive : Note<
10469  "previous '%0' directive used here">;
10470def err_omp_sections_not_compound_stmt : Error<
10471  "the statement for '#pragma omp sections' must be a compound statement">;
10472def err_omp_parallel_sections_not_compound_stmt : Error<
10473  "the statement for '#pragma omp parallel sections' must be a compound statement">;
10474def err_omp_orphaned_section_directive : Error<
10475  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
10476  " must be closely nested to a sections region%select{|, not a %1 region}0">;
10477def err_omp_sections_substmt_not_section : Error<
10478  "statement in 'omp sections' directive must be enclosed into a section region">;
10479def err_omp_parallel_sections_substmt_not_section : Error<
10480  "statement in 'omp parallel sections' directive must be enclosed into a section region">;
10481def err_omp_parallel_reduction_in_task_firstprivate : Error<
10482  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
10483def err_omp_atomic_read_not_expression_statement : Error<
10484  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
10485  " where v and x are both lvalue expressions with scalar type">;
10486def note_omp_atomic_read_write: Note<
10487  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
10488def err_omp_atomic_write_not_expression_statement : Error<
10489  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
10490  " where x is a lvalue expression with scalar type">;
10491def err_omp_atomic_update_not_expression_statement : Error<
10492  "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',"
10493  " where x is an lvalue expression with scalar type">;
10494def err_omp_atomic_not_expression_statement : Error<
10495  "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',"
10496  " where x is an lvalue expression with scalar type">;
10497def note_omp_atomic_update: Note<
10498  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
10499  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
10500  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
10501def err_omp_atomic_capture_not_expression_statement : Error<
10502  "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',"
10503  " where x and v are both lvalue expressions with scalar type">;
10504def err_omp_atomic_capture_not_compound_statement : Error<
10505  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
10506  " '{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;}',"
10507  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
10508  " where x is an lvalue expression with scalar type">;
10509def note_omp_atomic_capture: Note<
10510  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
10511def err_omp_atomic_several_clauses : Error<
10512  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update', 'capture', or 'compare' clause">;
10513def err_omp_several_mem_order_clauses : Error<
10514  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
10515def err_omp_atomic_incompatible_mem_order_clause : Error<
10516  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
10517def note_omp_previous_mem_order_clause : Note<
10518  "'%0' clause used here">;
10519def err_omp_target_contains_not_only_teams : Error<
10520  "target construct with nested teams region contains statements outside of the teams construct">;
10521def note_omp_nested_teams_construct_here : Note<
10522  "nested teams construct here">;
10523def note_omp_nested_statement_here : Note<
10524  "%select{statement|directive}0 outside teams construct here">;
10525def err_omp_single_copyprivate_with_nowait : Error<
10526  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
10527def note_omp_nowait_clause_here : Note<
10528  "'nowait' clause is here">;
10529def err_omp_single_decl_in_declare_simd_variant : Error<
10530  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
10531def err_omp_function_expected : Error<
10532  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
10533def err_omp_wrong_cancel_region : Error<
10534  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
10535def err_omp_parent_cancel_region_nowait : Error<
10536  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
10537def err_omp_parent_cancel_region_ordered : Error<
10538  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
10539def 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">;
10540def 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">;
10541def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
10542def err_omp_mapper_wrong_type : Error<
10543  "mapper type must be of struct, union or class type">;
10544def err_omp_declare_mapper_wrong_var : Error<
10545  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
10546def err_omp_declare_mapper_redefinition : Error<
10547  "redefinition of user-defined mapper for type %0 with name %1">;
10548def err_omp_invalid_mapper: Error<
10549  "cannot find a valid user-defined mapper for type %0 with name %1">;
10550def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
10551def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
10552def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
10553def err_omp_typecheck_section_value : Error<
10554  "subscripted value is not an array or pointer">;
10555def err_omp_typecheck_section_not_integer : Error<
10556  "array section %select{lower bound|length}0 is not an integer">;
10557def err_omp_typecheck_shaping_not_integer : Error<
10558  "array shaping operation dimension is not an integer">;
10559def err_omp_shaping_dimension_not_positive : Error<
10560  "array shaping dimension is evaluated to a non-positive value %0">;
10561def err_omp_section_function_type : Error<
10562  "section of pointer to function type %0">;
10563def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
10564  InGroup<CharSubscript>, DefaultIgnore;
10565def err_omp_section_incomplete_type : Error<
10566  "section of pointer to incomplete type %0">;
10567def err_omp_section_not_subset_of_array : Error<
10568  "array section must be a subset of the original array">;
10569def err_omp_section_length_negative : Error<
10570  "section length is evaluated to a negative value %0">;
10571def err_omp_section_stride_non_positive : Error<
10572  "section stride is evaluated to a non-positive value %0">;
10573def err_omp_section_length_undefined : Error<
10574  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
10575def err_omp_wrong_linear_modifier : Error<
10576  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
10577def err_omp_wrong_linear_modifier_non_reference : Error<
10578  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
10579def err_omp_wrong_simdlen_safelen_values : Error<
10580  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
10581def err_omp_wrong_if_directive_name_modifier : Error<
10582  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
10583def err_omp_no_more_if_clause : Error<
10584  "no more 'if' clause is allowed">;
10585def err_omp_unnamed_if_clause : Error<
10586  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
10587def note_omp_previous_named_if_clause : Note<
10588  "previous clause with directive name modifier specified here">;
10589def err_omp_ordered_directive_with_param : Error<
10590  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
10591def err_omp_ordered_directive_without_param : Error<
10592  "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
10593def note_omp_ordered_param : Note<
10594  "'ordered' clause%select{| with specified parameter}0">;
10595def err_omp_expected_base_var_name : Error<
10596  "expected variable name as a base of the array %select{subscript|section}0">;
10597def err_omp_map_shared_storage : Error<
10598  "variable already marked as mapped in current construct">;
10599def err_omp_invalid_map_type_for_directive : Error<
10600  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
10601def err_omp_invalid_map_type_modifier_for_directive : Error<
10602  "map type modifier '%0' is not allowed for '#pragma omp %1'">;
10603def err_omp_no_clause_for_directive : Error<
10604  "expected at least one %0 clause for '#pragma omp %1'">;
10605def err_omp_threadprivate_in_clause : Error<
10606  "threadprivate variables are not allowed in '%0' clause">;
10607def err_omp_wrong_ordered_loop_count : Error<
10608  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
10609def note_collapse_loop_count : Note<
10610  "parameter of the 'collapse' clause">;
10611def err_omp_clauses_mutually_exclusive : Error<
10612  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
10613def note_omp_previous_clause : Note<
10614  "'%0' clause is specified here">;
10615def err_omp_hint_clause_no_name : Error<
10616  "the name of the construct must be specified in presence of 'hint' clause">;
10617def err_omp_critical_with_hint : Error<
10618  "constructs with the same name must have a 'hint' clause with the same value">;
10619def note_omp_critical_hint_here : Note<
10620  "%select{|previous }0'hint' clause with value '%1'">;
10621def note_omp_critical_no_hint : Note<
10622  "%select{|previous }0directive with no 'hint' clause specified">;
10623def err_omp_depend_clause_thread_simd : Error<
10624  "'depend' clauses cannot be mixed with '%0' clause">;
10625def err_omp_depend_sink_expected_loop_iteration : Error<
10626  "expected%select{| %1}0 loop iteration variable">;
10627def err_omp_depend_sink_unexpected_expr : Error<
10628  "unexpected expression: number of expressions is larger than the number of associated loops">;
10629def err_omp_depend_sink_expected_plus_minus : Error<
10630  "expected '+' or '-' operation">;
10631def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error<
10632  "'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">;
10633def err_omp_depend_sink_source_not_allowed : Error<
10634  "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
10635def err_omp_depend_zero_length_array_section_not_allowed : Error<
10636  "zero-length array section is not allowed in 'depend' clause">;
10637def err_omp_depend_sink_source_with_modifier : Error<
10638  "depend modifier cannot be used with 'sink' or 'source' depend type">;
10639def err_omp_depend_modifier_not_iterator : Error<
10640  "expected iterator specification as depend modifier">;
10641def err_omp_linear_ordered : Error<
10642  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
10643def err_omp_unexpected_schedule_modifier : Error<
10644  "modifier '%0' cannot be used along with modifier '%1'">;
10645def err_omp_schedule_nonmonotonic_static : Error<
10646  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
10647def err_omp_simple_clause_incompatible_with_ordered : Error<
10648  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
10649def err_omp_ordered_simd : Error<
10650  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
10651def err_omp_variable_in_given_clause_and_dsa : Error<
10652  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
10653def err_omp_param_or_this_in_clause : Error<
10654  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
10655def err_omp_expected_uniform_param : Error<
10656  "expected a reference to a parameter specified in a 'uniform' clause">;
10657def err_omp_expected_int_param : Error<
10658  "expected a reference to an integer-typed parameter">;
10659def err_omp_at_least_one_motion_clause_required : Error<
10660  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
10661def err_omp_usedeviceptr_not_a_pointer : Error<
10662  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
10663def err_omp_argument_type_isdeviceptr : Error <
10664  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
10665def warn_omp_nesting_simd : Warning<
10666  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
10667  InGroup<SourceUsesOpenMP>;
10668def err_omp_orphaned_device_directive : Error<
10669  "orphaned 'omp %0' directives are prohibited"
10670  "; perhaps you forget to enclose the directive into a "
10671  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
10672def err_omp_reduction_non_addressable_expression : Error<
10673  "expected addressable reduction item for the task-based directives">;
10674def err_omp_reduction_with_nogroup : Error<
10675  "'reduction' clause cannot be used with 'nogroup' clause">;
10676def err_omp_reduction_vla_unsupported : Error<
10677  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
10678def err_omp_linear_distribute_var_non_loop_iteration : Error<
10679  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
10680def warn_omp_non_trivial_type_mapped : Warning<
10681  "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
10682  InGroup<OpenMPMapping>;
10683def err_omp_requires_clause_redeclaration : Error <
10684  "Only one %0 clause can appear on a requires directive in a single translation unit">;
10685def note_omp_requires_previous_clause : Note <
10686  "%0 clause previously used here">;
10687def err_omp_directive_before_requires : Error <
10688  "'%0' region encountered before requires directive with '%1' clause">;
10689def note_omp_requires_encountered_directive : Note <
10690  "'%0' previously encountered here">;
10691def err_omp_invalid_scope : Error <
10692  "'#pragma omp %0' directive must appear only in file scope">;
10693def note_omp_invalid_length_on_this_ptr_mapping : Note <
10694  "expected length on mapping of 'this' array section expression to be '1'">;
10695def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
10696  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
10697def note_omp_invalid_subscript_on_this_ptr_map : Note <
10698  "expected 'this' subscript expression on map clause to be 'this[0]'">;
10699def err_omp_invalid_map_this_expr : Error <
10700  "invalid 'this' expression on 'map' clause">;
10701def err_omp_implied_type_not_found : Error<
10702  "'%0' type not found; include <omp.h>">;
10703def err_omp_expected_omp_depend_t_lvalue : Error<
10704  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
10705def err_omp_depobj_expected : Error<
10706  "expected depobj expression">;
10707def err_omp_depobj_single_clause_expected : Error<
10708  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
10709def err_omp_scan_single_clause_expected : Error<
10710  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
10711def err_omp_inclusive_exclusive_not_reduction : Error<
10712  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
10713  "of the parent directive">;
10714def err_omp_reduction_not_inclusive_exclusive : Error<
10715  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
10716  " 'exclusive' clause on an inner 'omp scan' directive">;
10717def err_omp_wrong_inscan_reduction : Error<
10718  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
10719  " 'omp parallel for', or 'omp parallel for simd' directive">;
10720def err_omp_inscan_reduction_expected : Error<
10721  "expected 'reduction' clause with the 'inscan' modifier">;
10722def note_omp_previous_inscan_reduction : Note<
10723  "'reduction' clause with 'inscan' modifier is used here">;
10724def err_omp_expected_predefined_allocator : Error<
10725  "expected one of the predefined allocators for the variables with the static "
10726  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
10727  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
10728  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
10729def warn_omp_used_different_allocator : Warning<
10730  "allocate directive specifies %select{default|'%1'}0 allocator while "
10731  "previously used %select{default|'%3'}2">,
10732  InGroup<OpenMPClauses>;
10733def note_omp_previous_allocator : Note<
10734  "previous allocator is specified here">;
10735def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
10736  "inside of the target region; provide an 'allocator' clause or use 'requires'"
10737  " directive with the 'dynamic_allocators' clause">;
10738def err_expected_allocator_expression : Error<"expected an allocator expression "
10739  "inside of the target region; provide an allocator expression or use 'requires'"
10740  " directive with the 'dynamic_allocators' clause">;
10741def warn_omp_allocate_thread_on_task_target_directive : Warning<
10742  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
10743  InGroup<OpenMPClauses>;
10744def err_omp_expected_private_copy_for_allocate : Error<
10745  "the referenced item is not found in any private clause on the same directive">;
10746def err_omp_stmt_depends_on_loop_counter : Error<
10747  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
10748def err_omp_invariant_dependency : Error<
10749  "expected loop invariant expression">;
10750def err_omp_invariant_or_linear_dependency : Error<
10751  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
10752def err_omp_wrong_dependency_iterator_type : Error<
10753  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
10754def err_target_unsupported_type
10755    : Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support,"
10756            " but target '%5' does not support it">;
10757def err_omp_lambda_capture_in_declare_target_not_to : Error<
10758  "variable captured in declare target region must appear in a to clause">;
10759def err_omp_device_type_mismatch : Error<
10760  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
10761def err_omp_wrong_device_function_call : Error<
10762  "function with 'device_type(%0)' is not available on %select{device|host}1">;
10763def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
10764def warn_omp_declare_target_after_first_use : Warning<
10765  "declaration marked as declare target after first use, it may lead to incorrect results">,
10766  InGroup<OpenMPTarget>;
10767def err_omp_declare_variant_incompat_attributes : Error<
10768  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
10769def warn_omp_declare_variant_score_not_constant
10770    : Warning<"score expressions in the OpenMP context selector need to be "
10771              "constant; %0 is not and will be ignored">,
10772      InGroup<SourceUsesOpenMP>;
10773def err_omp_declare_variant_user_condition_not_constant
10774    : Error<"the user condition in the OpenMP context selector needs to be "
10775            "constant; %0 is not">;
10776def warn_omp_declare_variant_after_used : Warning<
10777  "'#pragma omp declare variant' cannot be applied for function after first "
10778  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
10779def warn_omp_declare_variant_after_emitted : Warning<
10780  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
10781  " the original function might be used">, InGroup<SourceUsesOpenMP>;
10782def err_omp_declare_variant_doesnt_support : Error<
10783  "'#pragma omp declare variant' does not "
10784  "support %select{function templates|virtual functions|"
10785  "deduced return types|constructors|destructors|deleted functions|"
10786  "defaulted functions|constexpr functions|consteval function}0">;
10787def err_omp_declare_variant_diff : Error<
10788  "function with '#pragma omp declare variant' has a different %select{calling convention"
10789  "|return type|constexpr specification|inline specification|storage class|"
10790  "linkage}0">;
10791def err_omp_declare_variant_prototype_required : Error<
10792  "function with '#pragma omp declare variant' must have a prototype when "
10793  "'append_args' is used">;
10794def err_omp_interop_type_not_found : Error<
10795  "'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">;
10796def err_omp_declare_variant_incompat_types : Error<
10797  "variant in '#pragma omp declare variant' with type %0 is incompatible with"
10798  " type %1%select{| with appended arguments}2">;
10799def warn_omp_declare_variant_marked_as_declare_variant : Warning<
10800  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
10801  >, InGroup<SourceUsesOpenMP>;
10802def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
10803def err_omp_one_defaultmap_each_category: Error<
10804  "at most one defaultmap clause for each variable-category can appear on the directive">;
10805def err_omp_lastprivate_conditional_non_scalar : Error<
10806  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
10807  >;
10808def err_omp_flush_order_clause_and_list : Error<
10809  "'flush' directive with memory order clause '%0' cannot have the list">;
10810def note_omp_flush_order_clause_here : Note<
10811  "memory order clause '%0' is specified here">;
10812def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
10813  "expected addressable lvalue in '%0' clause">;
10814def err_omp_var_expected : Error<
10815  "expected variable of the '%0' type%select{|, not %2}1">;
10816def warn_unknown_declare_variant_isa_trait
10817    : Warning<"isa trait '%0' is not known to the current target; verify the "
10818              "spelling or consider restricting the context selector with the "
10819              "'arch' selector further">,
10820      InGroup<SourceUsesOpenMP>;
10821def err_omp_non_pointer_type_array_shaping_base : Error<
10822  "expected expression with a pointer to a complete type as a base of an array "
10823  "shaping operation">;
10824def err_omp_reduction_task_not_parallel_or_worksharing : Error<
10825  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
10826  " worksharing constructs">;
10827def err_omp_expected_array_alloctraits : Error<
10828  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
10829def err_omp_predefined_allocator_with_traits : Error<
10830  "predefined allocator cannot have traits specified">;
10831def note_omp_predefined_allocator : Note<
10832  "predefined trait '%0' used here">;
10833def err_omp_nonpredefined_allocator_without_traits : Error<
10834  "non-predefined allocator must have traits specified">;
10835def err_omp_allocator_used_in_clauses : Error<
10836  "allocators used in 'uses_allocators' clause cannot appear in other "
10837  "data-sharing or data-mapping attribute clauses">;
10838def err_omp_allocator_not_in_uses_allocators : Error<
10839  "allocator must be specified in the 'uses_allocators' clause">;
10840def note_omp_protected_structured_block
10841    : Note<"jump bypasses OpenMP structured block">;
10842def note_omp_exits_structured_block
10843    : Note<"jump exits scope of OpenMP structured block">;
10844def err_omp_lastprivate_loop_var_non_loop_iteration : Error<
10845  "only loop iteration variables are allowed in 'lastprivate' clause in "
10846  "'omp loop' directives">;
10847def err_omp_interop_variable_expected : Error<
10848  "expected%select{| non-const}0 variable of type 'omp_interop_t'">;
10849def err_omp_interop_variable_wrong_type : Error<
10850  "interop variable must be of type 'omp_interop_t'">;
10851def err_omp_interop_prefer_type : Error<
10852  "prefer_list item must be a string literal or constant integral "
10853  "expression">;
10854def err_omp_interop_bad_depend_clause : Error<
10855  "'depend' clause requires the 'targetsync' interop type">;
10856def err_omp_interop_var_multiple_actions : Error<
10857  "interop variable %0 used in multiple action clauses">;
10858def err_omp_dispatch_statement_call
10859    : Error<"statement after '#pragma omp dispatch' must be a direct call"
10860            " to a target function or an assignment to one">;
10861def err_omp_unroll_full_variable_trip_count : Error<
10862  "loop to be fully unrolled must have a constant trip count">;
10863def note_omp_directive_here : Note<"'%0' directive found here">;
10864def err_omp_instantiation_not_supported
10865    : Error<"instantiation of '%0' not supported yet">;
10866def err_omp_adjust_arg_multiple_clauses : Error<
10867  "'adjust_arg' argument %0 used in multiple clauses">;
10868def err_omp_clause_requires_dispatch_construct : Error<
10869  "'%0' clause requires 'dispatch' context selector">;
10870def err_omp_append_args_with_varargs : Error<
10871  "'append_args' is not allowed with varargs functions">;
10872} // end of OpenMP category
10873
10874let CategoryName = "Related Result Type Issue" in {
10875// Objective-C related result type compatibility
10876def warn_related_result_type_compatibility_class : Warning<
10877  "method is expected to return an instance of its class type "
10878  "%diff{$, but is declared to return $|"
10879  ", but is declared to return different type}0,1">;
10880def warn_related_result_type_compatibility_protocol : Warning<
10881  "protocol method is expected to return an instance of the implementing "
10882  "class, but is declared to return %0">;
10883def note_related_result_type_family : Note<
10884  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
10885  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
10886  "self}1' method family%select{| and is expected to return an instance of its "
10887  "class type}0">;
10888def note_related_result_type_overridden : Note<
10889  "overridden method returns an instance of its class type">;
10890def note_related_result_type_inferred : Note<
10891  "%select{class|instance}0 method %1 is assumed to return an instance of "
10892  "its receiver type (%2)">;
10893def note_related_result_type_explicit : Note<
10894  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
10895  "%select{| and is expected to return an instance of its class type}0">;
10896def err_invalid_type_for_program_scope_var : Error<
10897  "the %0 type cannot be used to declare a program scope variable">;
10898
10899}
10900
10901let CategoryName = "Modules Issue" in {
10902def err_module_decl_in_module_map_module : Error<
10903  "'module' declaration found while building module from module map">;
10904def err_module_decl_in_header_module : Error<
10905  "'module' declaration found while building header unit">;
10906def err_module_interface_implementation_mismatch : Error<
10907  "missing 'export' specifier in module declaration while "
10908  "building module interface">;
10909def err_current_module_name_mismatch : Error<
10910  "module name '%0' specified on command line does not match name of module">;
10911def err_module_redefinition : Error<
10912  "redefinition of module '%0'">;
10913def note_prev_module_definition : Note<"previously defined here">;
10914def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
10915def err_module_not_defined : Error<
10916  "definition of module '%0' is not available; use -fmodule-file= to specify "
10917  "path to precompiled module interface">;
10918def err_module_redeclaration : Error<
10919  "translation unit contains multiple module declarations">;
10920def note_prev_module_declaration : Note<"previous module declaration is here">;
10921def err_module_declaration_missing : Error<
10922  "missing 'export module' declaration in module interface unit">;
10923def err_module_declaration_missing_after_global_module_introducer : Error<
10924  "missing 'module' declaration at end of global module fragment "
10925  "introduced here">;
10926def err_module_private_specialization : Error<
10927  "%select{template|partial|member}0 specialization cannot be "
10928  "declared __module_private__">;
10929def err_module_private_local : Error<
10930  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
10931  "__module_private__">;
10932def err_module_private_local_class : Error<
10933  "local %select{struct|interface|union|class|enum}0 cannot be declared "
10934  "__module_private__">;
10935def err_module_unimported_use : Error<
10936  "%select{declaration|definition|default argument|"
10937  "explicit specialization|partial specialization}0 of %1 must be imported "
10938  "from module '%2' before it is required">;
10939def err_module_unimported_use_header : Error<
10940  "%select{missing '#include'|missing '#include %3'}2; "
10941  "%select{||default argument of |explicit specialization of |"
10942  "partial specialization of }0%1 must be "
10943  "%select{declared|defined|defined|declared|declared}0 "
10944  "before it is used">;
10945def err_module_unimported_use_multiple : Error<
10946  "%select{declaration|definition|default argument|"
10947  "explicit specialization|partial specialization}0 of %1 must be imported "
10948  "from one of the following modules before it is required:%2">;
10949def note_unreachable_entity : Note<
10950  "%select{declaration|definition|default argument declared|"
10951  "explicit specialization declared|partial specialization declared}0 here "
10952  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
10953def ext_module_import_in_extern_c : ExtWarn<
10954  "import of C++ module '%0' appears within extern \"C\" language linkage "
10955  "specification">, DefaultError,
10956  InGroup<DiagGroup<"module-import-in-extern-c">>;
10957def err_module_import_not_at_top_level_fatal : Error<
10958  "import of module '%0' appears within %1">, DefaultFatal;
10959def ext_module_import_not_at_top_level_noop : ExtWarn<
10960  "redundant #include of module '%0' appears within %1">, DefaultError,
10961  InGroup<DiagGroup<"modules-import-nested-redundant">>;
10962def note_module_import_not_at_top_level : Note<"%0 begins here">;
10963def err_module_self_import : Error<
10964  "import of module '%0' appears within same top-level module '%1'">;
10965def err_module_import_in_implementation : Error<
10966  "@import of module '%0' in implementation of '%1'; use #import">;
10967
10968// C++ Modules
10969def err_module_decl_not_at_start : Error<
10970  "module declaration must occur at the start of the translation unit">;
10971def note_global_module_introducer_missing : Note<
10972  "add 'module;' to the start of the file to introduce a "
10973  "global module fragment">;
10974def err_export_within_anonymous_namespace : Error<
10975  "export declaration appears within anonymous namespace">;
10976def note_anonymous_namespace : Note<"anonymous namespace begins here">;
10977def ext_export_no_name_block : ExtWarn<
10978  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
10979  "to appear in an export block">, InGroup<ExportUnnamed>;
10980def ext_export_no_names : ExtWarn<
10981  "ISO C++20 does not permit a declaration that does not introduce any names "
10982  "to be exported">, InGroup<ExportUnnamed>;
10983def note_export : Note<"export block begins here">;
10984def err_export_no_name : Error<
10985  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
10986def ext_export_using_directive : ExtWarn<
10987  "ISO C++20 does not permit using directive to be exported">,
10988  InGroup<DiagGroup<"export-using-directive">>;
10989def err_export_within_export : Error<
10990  "export declaration appears within another export declaration">;
10991def err_export_internal : Error<
10992  "declaration of %0 with internal linkage cannot be exported">;
10993def err_export_using_internal : Error<
10994  "using declaration referring to %0 with internal linkage cannot be exported">;
10995def err_export_not_in_module_interface : Error<
10996  "export declaration can only be used within a module interface unit"
10997  "%select{ after the module declaration|}0">;
10998def err_export_in_private_module_fragment : Error<
10999  "export declaration cannot be used in a private module fragment">;
11000def note_private_module_fragment : Note<
11001  "private module fragment begins here">;
11002def err_private_module_fragment_not_module : Error<
11003  "private module fragment declaration with no preceding module declaration">;
11004def err_private_module_fragment_redefined : Error<
11005  "private module fragment redefined">;
11006def err_private_module_fragment_not_module_interface : Error<
11007  "private module fragment in module implementation unit">;
11008def note_not_module_interface_add_export : Note<
11009  "add 'export' here if this is intended to be a module interface unit">;
11010
11011def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
11012  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
11013  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
11014def note_equivalent_internal_linkage_decl : Note<
11015  "declared here%select{ in module '%1'|}0">;
11016
11017def note_redefinition_modules_same_file : Note<
11018  "'%0' included multiple times, additional include site in header from module '%1'">;
11019def note_redefinition_include_same_file : Note<
11020  "'%0' included multiple times, additional include site here">;
11021}
11022
11023let CategoryName = "Coroutines Issue" in {
11024def err_return_in_coroutine : Error<
11025  "return statement not allowed in coroutine; did you mean 'co_return'?">;
11026def note_declared_coroutine_here : Note<
11027  "function is a coroutine due to use of '%0' here">;
11028def err_coroutine_objc_method : Error<
11029  "Objective-C methods as coroutines are not yet supported">;
11030def err_coroutine_unevaluated_context : Error<
11031  "'%0' cannot be used in an unevaluated context">;
11032def err_coroutine_within_handler : Error<
11033  "'%0' cannot be used in the handler of a try block">;
11034def err_coroutine_outside_function : Error<
11035  "'%0' cannot be used outside a function">;
11036def err_coroutine_invalid_func_context : Error<
11037  "'%1' cannot be used in %select{a constructor|a destructor"
11038  "|the 'main' function|a constexpr function"
11039  "|a function with a deduced return type|a varargs function"
11040  "|a consteval function}0">;
11041def err_implied_coroutine_type_not_found : Error<
11042  "%0 type was not found; include <coroutine> before defining "
11043  "a coroutine; include <experimental/coroutine> if your version "
11044  "of libcxx is less than 14.0">;
11045def warn_deprecated_coroutine_namespace : Warning<
11046  "support for std::experimental::%0 will be removed in LLVM 15; "
11047  "use std::%0 instead">,
11048  InGroup<DeprecatedExperimentalCoroutine>;
11049def err_mixed_use_std_and_experimental_namespace_for_coroutine : Error<
11050  "mixed use of std and std::experimental namespaces for "
11051  "coroutine components">;
11052def err_implicit_coroutine_std_nothrow_type_not_found : Error<
11053  "std::nothrow was not found; include <new> before defining a coroutine which "
11054  "uses get_return_object_on_allocation_failure()">;
11055def err_malformed_std_nothrow : Error<
11056  "std::nothrow must be a valid variable declaration">;
11057def err_malformed_std_coroutine_handle : Error<
11058  "std::coroutine_handle isn't a class template">;
11059def err_coroutine_handle_missing_member : Error<
11060  "std::coroutine_handle must have a member named '%0'">;
11061def err_malformed_std_coroutine_traits : Error<
11062  "std::coroutine_traits isn't a class template">;
11063def err_implied_std_coroutine_traits_promise_type_not_found : Error<
11064  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
11065def err_implied_std_coroutine_traits_promise_type_not_class : Error<
11066  "this function cannot be a coroutine: %0 is not a class">;
11067def err_coroutine_promise_type_incomplete : Error<
11068  "this function cannot be a coroutine: %0 is an incomplete type">;
11069def err_coroutine_type_missing_specialization : Error<
11070  "this function cannot be a coroutine: missing definition of "
11071  "specialization %0">;
11072def err_coroutine_promise_incompatible_return_functions : Error<
11073  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
11074def note_coroutine_promise_implicit_await_transform_required_here : Note<
11075  "call to 'await_transform' implicitly required by 'co_await' here">;
11076def note_coroutine_promise_suspend_implicitly_required : Note<
11077  "call to '%select{initial_suspend|final_suspend}0' implicitly "
11078  "required by the %select{initial suspend point|final suspend point}0">;
11079def err_coroutine_promise_unhandled_exception_required : Error<
11080  "%0 is required to declare the member 'unhandled_exception()'">;
11081def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
11082  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
11083  InGroup<CoroutineMissingUnhandledException>;
11084def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
11085  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
11086def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
11087  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
11088def err_coroutine_promise_new_requires_nothrow : Error<
11089  "%0 is required to have a non-throwing noexcept specification when the promise "
11090   "type declares 'get_return_object_on_allocation_failure()'">;
11091def note_coroutine_promise_call_implicitly_required : Note<
11092  "call to %0 implicitly required by coroutine function here">;
11093def err_await_suspend_invalid_return_type : Error<
11094  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
11095>;
11096def note_await_ready_no_bool_conversion : Note<
11097  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
11098>;
11099def warn_coroutine_handle_address_invalid_return_type : Warning <
11100  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">,
11101  InGroup<Coroutine>;
11102def err_coroutine_promise_final_suspend_requires_nothrow : Error<
11103  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
11104>;
11105def note_coroutine_function_declare_noexcept : Note<
11106  "must be declared with 'noexcept'"
11107>;
11108} // end of coroutines issue category
11109
11110let CategoryName = "Documentation Issue" in {
11111def warn_not_a_doxygen_trailing_member_comment : Warning<
11112  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
11113} // end of documentation issue category
11114
11115let CategoryName = "Nullability Issue" in {
11116
11117def warn_mismatched_nullability_attr : Warning<
11118  "nullability specifier %0 conflicts with existing specifier %1">,
11119  InGroup<Nullability>;
11120
11121def warn_nullability_declspec : Warning<
11122  "nullability specifier %0 cannot be applied "
11123  "to non-pointer type %1; did you mean to apply the specifier to the "
11124  "%select{pointer|block pointer|member pointer|function pointer|"
11125  "member function pointer}2?">,
11126  InGroup<NullabilityDeclSpec>,
11127  DefaultError;
11128
11129def note_nullability_here : Note<"%0 specified here">;
11130
11131def err_nullability_nonpointer : Error<
11132  "nullability specifier %0 cannot be applied to non-pointer type %1">;
11133
11134def warn_nullability_lost : Warning<
11135  "implicit conversion from nullable pointer %0 to non-nullable pointer "
11136  "type %1">,
11137  InGroup<NullableToNonNullConversion>, DefaultIgnore;
11138def warn_zero_as_null_pointer_constant : Warning<
11139  "zero as null pointer constant">,
11140  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
11141
11142def err_nullability_cs_multilevel : Error<
11143  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
11144def note_nullability_type_specifier : Note<
11145  "use nullability type specifier %0 to affect the innermost "
11146  "pointer type of %1">;
11147
11148def warn_null_resettable_setter : Warning<
11149  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
11150  InGroup<Nullability>;
11151
11152def warn_nullability_missing : Warning<
11153  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
11154  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
11155  InGroup<NullabilityCompleteness>;
11156def warn_nullability_missing_array : Warning<
11157  "array parameter is missing a nullability type specifier (_Nonnull, "
11158  "_Nullable, or _Null_unspecified)">,
11159  InGroup<NullabilityCompletenessOnArrays>;
11160def note_nullability_fix_it : Note<
11161  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
11162  "%select{pointer|block pointer|member pointer|array parameter}1 "
11163  "%select{should never be null|may be null|should not declare nullability}0">;
11164
11165def warn_nullability_inferred_on_nested_type : Warning<
11166  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
11167  "deprecated">,
11168  InGroup<NullabilityInferredOnNestedType>;
11169
11170def err_objc_type_arg_explicit_nullability : Error<
11171  "type argument %0 cannot explicitly specify nullability">;
11172
11173def err_objc_type_param_bound_explicit_nullability : Error<
11174  "type parameter %0 bound %1 cannot explicitly specify nullability">;
11175
11176}
11177
11178let CategoryName = "Generics Issue" in {
11179
11180def err_objc_type_param_bound_nonobject : Error<
11181  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
11182
11183def err_objc_type_param_bound_missing_pointer : Error<
11184  "missing '*' in type bound %0 for type parameter %1">;
11185def err_objc_type_param_bound_qualified : Error<
11186  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
11187
11188def err_objc_type_param_redecl : Error<
11189  "redeclaration of type parameter %0">;
11190
11191def err_objc_type_param_arity_mismatch : Error<
11192  "%select{forward class declaration|class definition|category|extension}0 has "
11193  "too %select{few|many}1 type parameters (expected %2, have %3)">;
11194
11195def err_objc_type_param_bound_conflict : Error<
11196  "type bound %0 for type parameter %1 conflicts with "
11197  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
11198
11199def err_objc_type_param_variance_conflict : Error<
11200  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
11201  "%select{in|co|contra}2variant type parameter %3">;
11202
11203def note_objc_type_param_here : Note<"type parameter %0 declared here">;
11204
11205def err_objc_type_param_bound_missing : Error<
11206  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
11207
11208def err_objc_parameterized_category_nonclass : Error<
11209  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
11210  "parameters">;
11211
11212def err_objc_parameterized_forward_class : Error<
11213  "forward declaration of non-parameterized class %0 cannot have type "
11214  "parameters">;
11215
11216def err_objc_parameterized_forward_class_first : Error<
11217  "class %0 previously declared with type parameters">;
11218
11219def err_objc_type_arg_missing_star : Error<
11220  "type argument %0 must be a pointer (requires a '*')">;
11221def err_objc_type_arg_qualified : Error<
11222  "type argument %0 cannot be qualified with '%1'">;
11223
11224def err_objc_type_arg_missing : Error<
11225  "no type or protocol named %0">;
11226
11227def err_objc_type_args_and_protocols : Error<
11228  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
11229  "%select{protocol|type}0 (%2)">;
11230
11231def err_objc_type_args_non_class : Error<
11232  "type arguments cannot be applied to non-class type %0">;
11233
11234def err_objc_type_args_non_parameterized_class : Error<
11235  "type arguments cannot be applied to non-parameterized class %0">;
11236
11237def err_objc_type_args_specialized_class : Error<
11238  "type arguments cannot be applied to already-specialized class type %0">;
11239
11240def err_objc_type_args_wrong_arity : Error<
11241  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
11242}
11243
11244def err_objc_type_arg_not_id_compatible : Error<
11245  "type argument %0 is neither an Objective-C object nor a block type">;
11246
11247def err_objc_type_arg_does_not_match_bound : Error<
11248  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
11249
11250def warn_objc_redundant_qualified_class_type : Warning<
11251  "parameterized class %0 already conforms to the protocols listed; did you "
11252  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
11253
11254def warn_block_literal_attributes_on_omitted_return_type : Warning<
11255  "attribute %0 ignored, because it cannot be applied to omitted return type">,
11256  InGroup<IgnoredAttributes>;
11257
11258def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
11259  "'%0' qualifier on omitted return type %1 has no effect">,
11260  InGroup<IgnoredQualifiers>;
11261
11262def warn_shadow_field : Warning<
11263  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
11264  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
11265def note_shadow_field : Note<"declared here">;
11266
11267def err_multiversion_required_in_redecl : Error<
11268  "function declaration is missing %select{'target'|'cpu_specific' or "
11269  "'cpu_dispatch'}0 attribute in a multiversioned function">;
11270def note_multiversioning_caused_here : Note<
11271  "function multiversioning caused by this declaration">;
11272def err_multiversion_after_used : Error<
11273  "function declaration cannot become a multiversioned function after first "
11274  "usage">;
11275def err_bad_multiversion_option : Error<
11276  "function multiversioning doesn't support %select{feature|architecture}0 "
11277  "'%1'">;
11278def err_multiversion_duplicate : Error<
11279  "multiversioned function redeclarations require identical target attributes">;
11280def err_multiversion_noproto : Error<
11281  "multiversioned function must have a prototype">;
11282def err_multiversion_disallowed_other_attr
11283    : Error<"attribute "
11284            "'%select{|target|cpu_specific|cpu_dispatch|target_clones}0' "
11285            "multiversioning cannot be combined"
11286            " with attribute %1">;
11287def err_multiversion_mismatched_attrs
11288    : Error<"attributes on multiversioned functions must all match, attribute "
11289            "%0 %select{is missing|has different arguments}1">;
11290def err_multiversion_diff : Error<
11291  "multiversioned function declaration has a different %select{calling convention"
11292  "|return type|constexpr specification|inline specification|linkage|"
11293  "language linkage}0">;
11294def err_multiversion_doesnt_support
11295    : Error<"attribute "
11296            "'%select{|target|cpu_specific|cpu_dispatch|target_clones}0' "
11297            "multiversioned functions do not "
11298            "yet support %select{function templates|virtual functions|"
11299            "deduced return types|constructors|destructors|deleted functions|"
11300            "defaulted functions|constexpr functions|consteval "
11301            "function|lambdas}1">;
11302def err_multiversion_not_allowed_on_main : Error<
11303  "'main' cannot be a multiversioned function">;
11304def err_multiversion_not_supported : Error<
11305 "function multiversioning is not supported on the current target">;
11306def err_multiversion_types_mixed : Error<
11307  "multiversioning attributes cannot be combined">;
11308def err_cpu_dispatch_mismatch : Error<
11309 "'cpu_dispatch' function redeclared with different CPUs">;
11310def err_cpu_specific_multiple_defs : Error<
11311 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
11312def warn_multiversion_duplicate_entries : Warning<
11313 "CPU list contains duplicate entries; attribute ignored">,
11314  InGroup<FunctionMultiVersioning>;
11315def warn_dispatch_body_ignored : Warning<
11316  "body of cpu_dispatch function will be ignored">,
11317  InGroup<FunctionMultiVersioning>;
11318def err_target_clone_must_have_default
11319    : Error<"'target_clones' multiversioning requires a default target">;
11320def err_target_clone_doesnt_match
11321    : Error<"'target_clones' attribute does not match previous declaration">;
11322def warn_target_clone_mixed_values
11323    : ExtWarn<
11324          "mixing 'target_clones' specifier mechanisms is permitted for GCC "
11325          "compatibility; use a comma separated sequence of string literals, "
11326          "or a string literal containing a comma-separated list of versions">,
11327      InGroup<TargetClonesMixedSpecifiers>;
11328def warn_target_clone_duplicate_options
11329    : Warning<"version list contains duplicate entries">,
11330      InGroup<FunctionMultiVersioning>;
11331
11332// three-way comparison operator diagnostics
11333def err_implied_comparison_category_type_not_found : Error<
11334  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
11335  "because type '%0' was not found; include <compare>">;
11336def err_spaceship_argument_narrowing : Error<
11337  "argument to 'operator<=>' "
11338  "%select{cannot be narrowed from type %1 to %2|"
11339  "evaluates to %1, which cannot be narrowed to type %2}0">;
11340def err_std_compare_type_not_supported : Error<
11341  "standard library implementation of %0 is not supported; "
11342   "%select{member '%2' does not have expected form|"
11343   "member '%2' is missing|"
11344   "the type is not trivially copyable|"
11345   "the type does not have the expected form}1">;
11346def note_rewriting_operator_as_spaceship : Note<
11347  "while rewriting comparison as call to 'operator<=>' declared here">;
11348def err_three_way_vector_comparison : Error<
11349  "three-way comparison between vectors is not supported">;
11350
11351// Memory Tagging Extensions (MTE) diagnostics
11352def err_memtag_arg_null_or_pointer : Error<
11353  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
11354def err_memtag_any2arg_pointer : Error<
11355  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
11356def err_memtag_arg_must_be_pointer : Error<
11357  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
11358def err_memtag_arg_must_be_integer : Error<
11359  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
11360
11361def warn_dereference_of_noderef_type : Warning<
11362  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
11363def warn_dereference_of_noderef_type_no_decl : Warning<
11364  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
11365def warn_noderef_on_non_pointer_or_array : Warning<
11366  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
11367def warn_noderef_to_dereferenceable_pointer : Warning<
11368  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
11369
11370def err_builtin_launder_invalid_arg : Error<
11371  "%select{non-pointer|function pointer|void pointer}0 argument to "
11372  "'__builtin_launder' is not allowed">;
11373
11374def err_builtin_invalid_arg_type: Error <
11375  "%ordinal0 argument must be a "
11376  "%select{vector, integer or floating point type|matrix|"
11377  "pointer to a valid matrix element type|"
11378  "signed integer or floating point type|vector type|"
11379  "floating point type|"
11380  "vector of integers}1 (was %2)">;
11381
11382def err_builtin_matrix_disabled: Error<
11383  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
11384def err_matrix_index_not_integer: Error<
11385  "matrix %select{row|column}0 index is not an integer">;
11386def err_matrix_index_outside_range: Error<
11387  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
11388def err_matrix_incomplete_index: Error<
11389  "single subscript expressions are not allowed for matrix values">;
11390def err_matrix_separate_incomplete_index: Error<
11391  "matrix row and column subscripts cannot be separated by any expression">;
11392def err_matrix_subscript_comma: Error<
11393  "comma expressions are not allowed as indices in matrix subscript expressions">;
11394def err_builtin_matrix_scalar_unsigned_arg: Error<
11395  "%0 argument must be a constant unsigned integer expression">;
11396def err_builtin_matrix_pointer_arg_mismatch: Error<
11397  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
11398def err_builtin_matrix_store_to_const: Error<
11399  "cannot store matrix to read-only pointer">;
11400def err_builtin_matrix_stride_too_small: Error<
11401  "stride must be greater or equal to the number of rows">;
11402def err_builtin_matrix_invalid_dimension: Error<
11403  "%0 dimension is outside the allowed range [1, %1]">;
11404
11405def warn_mismatched_import : Warning<
11406  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
11407  "previous declaration">,
11408  InGroup<IgnoredAttributes>;
11409def warn_import_on_definition : Warning<
11410  "import %select{module|name}0 cannot be applied to a function with a definition">,
11411  InGroup<IgnoredAttributes>;
11412
11413def err_preserve_field_info_not_field : Error<
11414  "__builtin_preserve_field_info argument %0 not a field access">;
11415def err_preserve_field_info_not_const: Error<
11416  "__builtin_preserve_field_info argument %0 not a constant">;
11417def err_btf_type_id_not_const: Error<
11418  "__builtin_btf_type_id argument %0 not a constant">;
11419def err_preserve_type_info_invalid : Error<
11420  "__builtin_preserve_type_info argument %0 invalid">;
11421def err_preserve_type_info_not_const: Error<
11422  "__builtin_preserve_type_info argument %0 not a constant">;
11423def err_preserve_enum_value_invalid : Error<
11424  "__builtin_preserve_enum_value argument %0 invalid">;
11425def err_preserve_enum_value_not_const: Error<
11426  "__builtin_preserve_enum_value argument %0 not a constant">;
11427
11428def err_bit_cast_non_trivially_copyable : Error<
11429  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
11430def err_bit_cast_type_size_mismatch : Error<
11431  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
11432
11433// SYCL-specific diagnostics
11434def warn_sycl_kernel_num_of_template_params : Warning<
11435  "'sycl_kernel' attribute only applies to a function template with at least"
11436  " two template parameters">, InGroup<IgnoredAttributes>;
11437def warn_sycl_kernel_invalid_template_param_type : Warning<
11438  "template parameter of a function template with the 'sycl_kernel' attribute"
11439  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
11440def warn_sycl_kernel_num_of_function_params : Warning<
11441  "function template with 'sycl_kernel' attribute must have a single parameter">,
11442  InGroup<IgnoredAttributes>;
11443def warn_sycl_kernel_return_type : Warning<
11444  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
11445  InGroup<IgnoredAttributes>;
11446
11447def err_bit_int_bad_size : Error<"%select{signed|unsigned}0 _BitInt must "
11448                                 "have a bit size of at least %select{2|1}0">;
11449def err_bit_int_max_size : Error<"%select{signed|unsigned}0 _BitInt of bit "
11450                                 "sizes greater than %1 not supported">;
11451
11452// errors of expect.with.probability
11453def err_probability_not_constant_float : Error<
11454   "probability argument to __builtin_expect_with_probability must be constant "
11455   "floating-point expression">;
11456def err_probability_out_of_range : Error<
11457   "probability argument to __builtin_expect_with_probability is outside the "
11458   "range [0.0, 1.0]">;
11459
11460// TCB warnings
11461def err_tcb_conflicting_attributes : Error<
11462  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
11463def warn_tcb_enforcement_violation : Warning<
11464  "calling %0 is a violation of trusted computing base '%1'">,
11465  InGroup<DiagGroup<"tcb-enforcement">>;
11466
11467// RISC-V builtin required extension warning
11468def err_riscv_builtin_requires_extension : Error<
11469  "builtin requires '%0' extension support to be enabled">;
11470def err_riscv_builtin_invalid_lmul : Error<
11471  "LMUL argument must be in the range [0,3] or [5,7]">;
11472} // end of sema component.
11473