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
836
837/// main()
838// static main() is not an error in C, just in C++.
839def warn_static_main : Warning<"'main' should not be declared static">,
840    InGroup<Main>;
841def err_static_main : Error<"'main' is not allowed to be declared static">;
842def err_inline_main : Error<"'main' is not allowed to be declared inline">;
843def ext_variadic_main : ExtWarn<
844  "'main' is not allowed to be declared variadic">, InGroup<Main>;
845def ext_noreturn_main : ExtWarn<
846  "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
847def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
848def err_constexpr_main : Error<
849  "'main' is not allowed to be declared %select{constexpr|consteval}0">;
850def err_deleted_main : Error<"'main' is not allowed to be deleted">;
851def err_mainlike_template_decl : Error<"%0 cannot be a template">;
852def err_main_returns_nonint : Error<"'main' must return 'int'">;
853def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
854    InGroup<MainReturnType>;
855def note_main_change_return_type : Note<"change return type to 'int'">;
856def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
857    "must be 0, 2, or 3">;
858def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
859    InGroup<Main>;
860def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
861    "parameter of 'main' (%select{argument count|argument array|environment|"
862    "platform-specific data}0) must be of type %1">;
863def warn_main_returns_bool_literal : Warning<"bool literal returned from "
864    "'main'">, InGroup<Main>;
865def err_main_global_variable :
866    Error<"main cannot be declared as global variable">;
867def warn_main_redefined : Warning<"variable named 'main' with external linkage "
868    "has undefined behavior">, InGroup<Main>;
869def ext_main_used : Extension<
870  "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
871
872/// parser diagnostics
873def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
874  InGroup<MissingDeclarations>;
875def err_no_declarators : Error<"declaration does not declare anything">;
876def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
877  InGroup<MissingDeclarations>;
878def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
879
880def ext_non_c_like_anon_struct_in_typedef : ExtWarn<
881  "anonymous non-C-compatible type given name for linkage purposes "
882  "by %select{typedef|alias}0 declaration; "
883  "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>;
884def err_non_c_like_anon_struct_in_typedef : Error<
885  "anonymous non-C-compatible type given name for linkage purposes "
886  "by %select{typedef|alias}0 declaration after its linkage was computed; "
887  "add a tag name here to establish linkage prior to definition">;
888def err_typedef_changes_linkage : Error<
889  "unsupported: anonymous type given name for linkage purposes "
890  "by %select{typedef|alias}0 declaration after its linkage was computed; "
891  "add a tag name here to establish linkage prior to definition">;
892def note_non_c_like_anon_struct : Note<
893  "type is not C-compatible due to this "
894  "%select{base class|default member initializer|lambda expression|"
895  "friend declaration|member declaration}0">;
896def note_typedef_for_linkage_here : Note<
897  "type is given name %0 for linkage purposes by this "
898  "%select{typedef|alias}1 declaration">;
899
900def err_statically_allocated_object : Error<
901  "interface type cannot be statically allocated">;
902def err_object_cannot_be_passed_returned_by_value : Error<
903  "interface type %1 cannot be %select{returned|passed}0 by value"
904  "; did you forget * in %1?">;
905def err_parameters_retval_cannot_have_fp16_type : Error<
906  "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
907def err_opencl_half_load_store : Error<
908  "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
909  "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
910def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
911def err_opencl_half_declaration : Error<
912  "declaring variable of type %0 is not allowed">;
913def err_opencl_invalid_param : Error<
914  "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">;
915def err_opencl_invalid_return : Error<
916  "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
917def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
918def warn_pragma_options_align_reset_failed : Warning<
919  "#pragma options align=reset failed: %0">,
920  InGroup<IgnoredPragmas>;
921def err_pragma_options_align_mac68k_target_unsupported : Error<
922  "mac68k alignment pragma is not supported on this target">;
923def warn_pragma_align_not_xl_compatible : Warning<
924  "#pragma align(packed) may not be compatible with objects generated with AIX XL C/C++">,
925  InGroup<AIXCompat>;
926def warn_pragma_pack_invalid_alignment : Warning<
927  "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
928  InGroup<IgnoredPragmas>;
929def err_pragma_pack_invalid_alignment : Error<
930  warn_pragma_pack_invalid_alignment.Text>;
931def warn_pragma_pack_non_default_at_include : Warning<
932  "non-default #pragma pack value changes the alignment of struct or union "
933  "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
934  DefaultIgnore;
935def warn_pragma_pack_modified_after_include : Warning<
936  "the current #pragma pack alignment value is modified in the included "
937  "file">, InGroup<PragmaPack>;
938def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
939  "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
940def note_pragma_pack_here : Note<
941  "previous '#pragma pack' directive that modifies alignment is here">;
942def note_pragma_pack_pop_instead_reset : Note<
943  "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
944// Follow the Microsoft implementation.
945def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
946def warn_pragma_pack_pop_identifier_and_alignment : Warning<
947  "specifying both a name and alignment to 'pop' is undefined">;
948def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
949  InGroup<IgnoredPragmas>;
950def err_pragma_fc_pp_scope : Error<
951  "'#pragma float_control push/pop' can only appear at file or namespace scope "
952  "or within a language linkage specification">;
953def err_pragma_fc_noprecise_requires_nofenv : Error<
954  "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
955def err_pragma_fc_except_requires_precise : Error<
956  "'#pragma float_control(except, on)' is illegal when precise is disabled">;
957def err_pragma_fc_noprecise_requires_noexcept : Error<
958  "'#pragma float_control(precise, off)' is illegal when except is enabled">;
959def err_pragma_fenv_requires_precise : Error<
960  "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">;
961def warn_cxx_ms_struct :
962  Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
963          "with base classes or virtual functions">,
964  DefaultError, InGroup<IncompatibleMSStruct>;
965def err_pragma_pack_identifer_not_supported : Error<
966  "specifying an identifier within `#pragma pack` is not supported on this target">;
967def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
968def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
969def err_invalid_super_scope : Error<"invalid use of '__super', "
970  "this keyword can only be used inside class or member function scope">;
971def err_super_in_lambda_unsupported : Error<
972  "use of '__super' inside a lambda is unsupported">;
973
974def warn_pragma_unused_undeclared_var : Warning<
975  "undeclared variable %0 used as an argument for '#pragma unused'">,
976  InGroup<IgnoredPragmas>;
977def warn_atl_uuid_deprecated : Warning<
978  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
979  InGroup<DeprecatedDeclarations>;
980def warn_pragma_unused_expected_var_arg : Warning<
981  "only variables can be arguments to '#pragma unused'">,
982  InGroup<IgnoredPragmas>;
983def err_pragma_push_visibility_mismatch : Error<
984  "#pragma visibility push with no matching #pragma visibility pop">;
985def note_surrounding_namespace_ends_here : Note<
986  "surrounding namespace with visibility attribute ends here">;
987def err_pragma_pop_visibility_mismatch : Error<
988  "#pragma visibility pop with no matching #pragma visibility push">;
989def note_surrounding_namespace_starts_here : Note<
990  "surrounding namespace with visibility attribute starts here">;
991def err_pragma_loop_invalid_argument_type : Error<
992  "invalid argument of type %0; expected an integer type">;
993def err_pragma_loop_invalid_argument_value : Error<
994  "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
995def err_pragma_loop_compatibility : Error<
996  "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
997def err_pragma_loop_precedes_nonloop : Error<
998  "expected a for, while, or do-while loop to follow '%0'">;
999
1000def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
1001  "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
1002  "those declarations">;
1003def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
1004  "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
1005def err_pragma_attribute_invalid_matchers : Error<
1006  "attribute %0 can't be applied to %1">;
1007def err_pragma_attribute_stack_mismatch : Error<
1008  "'#pragma clang attribute %select{%1.|}0pop' with no matching"
1009  " '#pragma clang attribute %select{%1.|}0push'">;
1010def warn_pragma_attribute_unused : Warning<
1011  "unused attribute %0 in '#pragma clang attribute push' region">,
1012  InGroup<PragmaClangAttribute>;
1013def note_pragma_attribute_region_ends_here : Note<
1014  "'#pragma clang attribute push' regions ends here">;
1015def err_pragma_attribute_no_pop_eof : Error<"unterminated "
1016  "'#pragma clang attribute push' at end of file">;
1017def note_pragma_attribute_applied_decl_here : Note<
1018  "when applied to this declaration">;
1019def err_pragma_attr_attr_no_push : Error<
1020  "'#pragma clang attribute' attribute with no matching "
1021  "'#pragma clang attribute push'">;
1022
1023/// Objective-C parser diagnostics
1024def err_duplicate_class_def : Error<
1025  "duplicate interface definition for class %0">;
1026def err_undef_superclass : Error<
1027  "cannot find interface declaration for %0, superclass of %1">;
1028def err_forward_superclass : Error<
1029  "attempting to use the forward class %0 as superclass of %1">;
1030def err_no_nsconstant_string_class : Error<
1031  "cannot find interface declaration for %0">;
1032def err_recursive_superclass : Error<
1033  "trying to recursively use %0 as superclass of %1">;
1034def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
1035def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
1036def warn_duplicate_protocol_def : Warning<
1037  "duplicate protocol definition of %0 is ignored">,
1038  InGroup<DiagGroup<"duplicate-protocol">>;
1039def err_protocol_has_circular_dependency : Error<
1040  "protocol has circular dependency">;
1041def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
1042def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
1043def err_atprotocol_protocol : Error<
1044  "@protocol is using a forward protocol declaration of %0">;
1045def warn_readonly_property : Warning<
1046  "attribute 'readonly' of property %0 restricts attribute "
1047  "'readwrite' of property inherited from %1">,
1048  InGroup<PropertyAttr>;
1049
1050def warn_property_attribute : Warning<
1051  "'%1' attribute on property %0 does not match the property inherited from %2">,
1052  InGroup<PropertyAttr>;
1053def warn_property_types_are_incompatible : Warning<
1054  "property type %0 is incompatible with type %1 inherited from %2">,
1055  InGroup<DiagGroup<"incompatible-property-type">>;
1056def warn_protocol_property_mismatch : Warning<
1057  "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
1058  "getter %1|with setter %1}0 was selected for synthesis">,
1059  InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
1060def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
1061def err_undef_interface : Error<"cannot find interface declaration for %0">;
1062def err_category_forward_interface : Error<
1063  "cannot define %select{category|class extension}0 for undefined class %1">;
1064def err_class_extension_after_impl : Error<
1065  "cannot declare class extension for %0 after class implementation">;
1066def note_implementation_declared : Note<
1067  "class implementation is declared here">;
1068def note_while_in_implementation : Note<
1069  "detected while default synthesizing properties in class implementation">;
1070def note_class_declared : Note<
1071  "class is declared here">;
1072def note_receiver_class_declared : Note<
1073  "receiver is instance of class declared here">;
1074def note_receiver_expr_here : Note<
1075  "receiver expression is here">;
1076def note_receiver_is_id : Note<
1077  "receiver is treated with 'id' type for purpose of method lookup">;
1078def note_suppressed_class_declare : Note<
1079  "class with specified objc_requires_property_definitions attribute is declared here">;
1080def err_objc_root_class_subclass : Error<
1081  "objc_root_class attribute may only be specified on a root class declaration">;
1082def err_restricted_superclass_mismatch : Error<
1083  "cannot subclass a class that was declared with the "
1084  "'objc_subclassing_restricted' attribute">;
1085def err_class_stub_subclassing_mismatch : Error<
1086  "'objc_class_stub' attribute cannot be specified on a class that does not "
1087  "have the 'objc_subclassing_restricted' attribute">;
1088def err_implementation_of_class_stub : Error<
1089  "cannot declare implementation of a class declared with the "
1090  "'objc_class_stub' attribute">;
1091def warn_objc_root_class_missing : Warning<
1092  "class %0 defined without specifying a base class">,
1093  InGroup<ObjCRootClass>;
1094def err_objc_runtime_visible_category : Error<
1095  "cannot implement a category for class %0 that is only visible via the "
1096  "Objective-C runtime">;
1097def err_objc_runtime_visible_subclass : Error<
1098  "cannot implement subclass %0 of a superclass %1 that is only visible via the "
1099  "Objective-C runtime">;
1100def note_objc_needs_superclass : Note<
1101  "add a super class to fix this problem">;
1102def err_conflicting_super_class : Error<"conflicting super class name %0">;
1103def err_dup_implementation_class : Error<"reimplementation of class %0">;
1104def err_dup_implementation_category : Error<
1105  "reimplementation of category %1 for class %0">;
1106def err_conflicting_ivar_type : Error<
1107  "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
1108def err_duplicate_ivar_declaration : Error<
1109  "instance variable is already declared">;
1110def warn_on_superclass_use : Warning<
1111  "class implementation may not have super class">;
1112def err_conflicting_ivar_bitwidth : Error<
1113  "instance variable %0 has conflicting bit-field width">;
1114def err_conflicting_ivar_name : Error<
1115  "conflicting instance variable names: %0 vs %1">;
1116def err_inconsistent_ivar_count : Error<
1117  "inconsistent number of instance variables specified">;
1118def warn_undef_method_impl : Warning<"method definition for %0 not found">,
1119  InGroup<DiagGroup<"incomplete-implementation">>;
1120def warn_objc_boxing_invalid_utf8_string : Warning<
1121  "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
1122  InGroup<ObjCBoxing>;
1123
1124def err_objc_non_runtime_protocol_in_protocol_expr : Error<
1125  "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">;
1126def err_objc_direct_on_protocol : Error<
1127  "'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
1128  "declared in an Objective-C protocol">;
1129def err_objc_direct_duplicate_decl : Error<
1130  "%select{|direct }0%select{method|property}1 declaration conflicts "
1131  "with previous %select{|direct }2declaration of %select{method|property}1 %3">;
1132def err_objc_direct_impl_decl_mismatch : Error<
1133  "direct method was declared in %select{the primary interface|an extension|a category}0 "
1134  "but is implemented in %select{the primary interface|a category|a different category}1">;
1135def err_objc_direct_missing_on_decl : Error<
1136  "direct method implementation was previously declared not direct">;
1137def err_objc_direct_on_override : Error<
1138  "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">;
1139def err_objc_override_direct_method : Error<
1140  "cannot override a method that is declared direct by a superclass">;
1141def warn_objc_direct_ignored : Warning<
1142  "%0 attribute isn't implemented by this Objective-C runtime">,
1143  InGroup<IgnoredAttributes>;
1144def warn_objc_direct_property_ignored : Warning<
1145  "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
1146  InGroup<IgnoredAttributes>;
1147def err_objc_direct_dynamic_property : Error<
1148  "direct property cannot be @dynamic">;
1149def err_objc_direct_protocol_conformance : Error<
1150  "%select{category %1|class extension}0 cannot conform to protocol %2 because "
1151  "of direct members declared in interface %3">;
1152def note_direct_member_here : Note<"direct member declared here">;
1153
1154def warn_conflicting_overriding_ret_types : Warning<
1155  "conflicting return type in "
1156  "declaration of %0%diff{: $ vs $|}1,2">,
1157  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1158
1159def warn_conflicting_ret_types : Warning<
1160  "conflicting return type in "
1161  "implementation of %0%diff{: $ vs $|}1,2">,
1162  InGroup<MismatchedReturnTypes>;
1163
1164def warn_conflicting_overriding_ret_type_modifiers : Warning<
1165  "conflicting distributed object modifiers on return type "
1166  "in declaration of %0">,
1167  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1168
1169def warn_conflicting_ret_type_modifiers : Warning<
1170  "conflicting distributed object modifiers on return type "
1171  "in implementation of %0">,
1172  InGroup<DistributedObjectModifiers>;
1173
1174def warn_non_covariant_overriding_ret_types : Warning<
1175  "conflicting return type in "
1176  "declaration of %0: %1 vs %2">,
1177  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1178
1179def warn_non_covariant_ret_types : Warning<
1180  "conflicting return type in "
1181  "implementation of %0: %1 vs %2">,
1182  InGroup<MethodSignatures>, DefaultIgnore;
1183
1184def warn_conflicting_overriding_param_types : Warning<
1185  "conflicting parameter types in "
1186  "declaration of %0%diff{: $ vs $|}1,2">,
1187  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1188
1189def warn_conflicting_param_types : Warning<
1190  "conflicting parameter types in "
1191  "implementation of %0%diff{: $ vs $|}1,2">,
1192  InGroup<MismatchedParameterTypes>;
1193
1194def warn_conflicting_param_modifiers : Warning<
1195  "conflicting distributed object modifiers on parameter type "
1196  "in implementation of %0">,
1197  InGroup<DistributedObjectModifiers>;
1198
1199def warn_conflicting_overriding_param_modifiers : Warning<
1200  "conflicting distributed object modifiers on parameter type "
1201  "in declaration of %0">,
1202  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1203
1204def warn_non_contravariant_overriding_param_types : Warning<
1205  "conflicting parameter types in "
1206  "declaration of %0: %1 vs %2">,
1207  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1208
1209def warn_non_contravariant_param_types : Warning<
1210  "conflicting parameter types in "
1211  "implementation of %0: %1 vs %2">,
1212  InGroup<MethodSignatures>, DefaultIgnore;
1213
1214def warn_conflicting_overriding_variadic :Warning<
1215  "conflicting variadic declaration of method and its "
1216  "implementation">,
1217  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1218
1219def warn_conflicting_variadic :Warning<
1220  "conflicting variadic declaration of method and its "
1221  "implementation">;
1222
1223def warn_category_method_impl_match:Warning<
1224  "category is implementing a method which will also be implemented"
1225  " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1226
1227def warn_implements_nscopying : Warning<
1228"default assign attribute on property %0 which implements "
1229"NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1230
1231def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1232  InGroup<ObjCMultipleMethodNames>;
1233def warn_strict_multiple_method_decl : Warning<
1234  "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1235def warn_accessor_property_type_mismatch : Warning<
1236  "type of property %0 does not match type of accessor %1">;
1237def note_conv_function_declared_at : Note<"type conversion function declared here">;
1238def note_method_declared_at : Note<"method %0 declared here">;
1239def note_direct_method_declared_at : Note<"direct method %0 declared here">;
1240def note_property_attribute : Note<"property %0 is declared "
1241  "%select{deprecated|unavailable|partial}1 here">;
1242def err_setter_type_void : Error<"type of setter must be void">;
1243def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1244def warn_duplicate_method_decl :
1245  Warning<"multiple declarations of method %0 found and ignored">,
1246  InGroup<MethodDuplicate>, DefaultIgnore;
1247def warn_objc_cdirective_format_string :
1248  Warning<"using %0 directive in %select{NSString|CFString}1 "
1249          "which is being passed as a formatting argument to the formatting "
1250          "%select{method|CFfunction}2">,
1251  InGroup<ObjCCStringFormat>, DefaultIgnore;
1252def err_objc_var_decl_inclass :
1253    Error<"cannot declare variable inside @interface or @protocol">;
1254def err_missing_method_context : Error<
1255  "missing context for method declaration">;
1256def err_objc_property_attr_mutually_exclusive : Error<
1257  "property attributes '%0' and '%1' are mutually exclusive">;
1258def err_objc_property_requires_object : Error<
1259  "property with '%0' attribute must be of object type">;
1260def warn_objc_property_assign_on_object : Warning<
1261  "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1262  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1263def warn_objc_property_no_assignment_attribute : Warning<
1264  "no 'assign', 'retain', or 'copy' attribute is specified - "
1265  "'assign' is assumed">,
1266  InGroup<ObjCPropertyNoAttribute>;
1267def warn_objc_isa_use : Warning<
1268  "direct access to Objective-C's isa is deprecated in favor of "
1269  "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1270def warn_objc_isa_assign : Warning<
1271  "assignment to Objective-C's isa is deprecated in favor of "
1272  "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1273def warn_objc_pointer_masking : Warning<
1274  "bitmasking for introspection of Objective-C object pointers is strongly "
1275  "discouraged">,
1276  InGroup<ObjCPointerIntrospect>;
1277def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1278  InGroup<ObjCPointerIntrospectPerformSelector>;
1279def warn_objc_property_default_assign_on_object : Warning<
1280  "default property attribute 'assign' not appropriate for object">,
1281  InGroup<ObjCPropertyNoAttribute>;
1282def warn_property_attr_mismatch : Warning<
1283  "property attribute in class extension does not match the primary class">,
1284  InGroup<PropertyAttr>;
1285def warn_property_implicitly_mismatched : Warning <
1286  "primary property declaration is implicitly strong while redeclaration "
1287  "in class extension is weak">,
1288  InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1289def warn_objc_property_copy_missing_on_block : Warning<
1290    "'copy' attribute must be specified for the block property "
1291    "when -fobjc-gc-only is specified">;
1292def warn_objc_property_retain_of_block : Warning<
1293    "retain'ed block property does not copy the block "
1294    "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1295def warn_objc_readonly_property_has_setter : Warning<
1296    "setter cannot be specified for a readonly property">,
1297    InGroup<ObjCReadonlyPropertyHasSetter>;
1298def warn_atomic_property_rule : Warning<
1299  "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1300  "with a user defined %select{getter|setter}2">,
1301  InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1302def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1303  "synthesized, or both be user defined,or the property must be nonatomic">;
1304def err_atomic_property_nontrivial_assign_op : Error<
1305  "atomic property of reference type %0 cannot have non-trivial assignment"
1306  " operator">;
1307def warn_cocoa_naming_owned_rule : Warning<
1308  "property follows Cocoa naming"
1309  " convention for returning 'owned' objects">,
1310  InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1311def err_cocoa_naming_owned_rule : Error<
1312  "property follows Cocoa naming"
1313  " convention for returning 'owned' objects">;
1314def note_cocoa_naming_declare_family : Note<
1315  "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1316  "object">;
1317def warn_auto_synthesizing_protocol_property :Warning<
1318  "auto property synthesis will not synthesize property %0"
1319  " declared in protocol %1">,
1320  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1321def note_add_synthesize_directive : Note<
1322  "add a '@synthesize' directive">;
1323def warn_no_autosynthesis_shared_ivar_property : Warning <
1324  "auto property synthesis will not synthesize property "
1325  "%0 because it cannot share an ivar with another synthesized property">,
1326  InGroup<ObjCNoPropertyAutoSynthesis>;
1327def warn_no_autosynthesis_property : Warning<
1328  "auto property synthesis will not synthesize property "
1329  "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1330  "via another property">,
1331  InGroup<ObjCNoPropertyAutoSynthesis>;
1332def warn_autosynthesis_property_in_superclass : Warning<
1333  "auto property synthesis will not synthesize property "
1334  "%0; it will be implemented by its superclass, use @dynamic to "
1335  "acknowledge intention">,
1336  InGroup<ObjCNoPropertyAutoSynthesis>;
1337def warn_autosynthesis_property_ivar_match :Warning<
1338  "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1339  "%2, not existing instance variable %3">,
1340  InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1341def warn_missing_explicit_synthesis : Warning <
1342  "auto property synthesis is synthesizing property not explicitly synthesized">,
1343  InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1344def warn_property_getter_owning_mismatch : Warning<
1345  "property declared as returning non-retained objects"
1346  "; getter returning retained objects">;
1347def warn_property_redecl_getter_mismatch : Warning<
1348  "getter name mismatch between property redeclaration (%1) and its original "
1349  "declaration (%0)">, InGroup<PropertyAttr>;
1350def err_property_setter_ambiguous_use : Error<
1351  "synthesized properties %0 and %1 both claim setter %2 -"
1352  " use of this setter will cause unexpected behavior">;
1353def warn_default_atomic_custom_getter_setter : Warning<
1354  "atomic by default property %0 has a user defined %select{getter|setter}1 "
1355  "(property should be marked 'atomic' if this is intended)">,
1356  InGroup<CustomAtomic>, DefaultIgnore;
1357def err_use_continuation_class : Error<
1358  "illegal redeclaration of property in class extension %0"
1359  " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1360def err_type_mismatch_continuation_class : Error<
1361  "type of property %0 in class extension does not match "
1362  "property type in primary class">;
1363def err_use_continuation_class_redeclaration_readwrite : Error<
1364  "illegal redeclaration of 'readwrite' property in class extension %0"
1365  " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1366  "'readonly' public property?)">;
1367def err_continuation_class : Error<"class extension has no primary class">;
1368def err_property_type : Error<"property cannot have array or function type %0">;
1369def err_missing_property_context : Error<
1370  "missing context for property implementation declaration">;
1371def err_bad_property_decl : Error<
1372  "property implementation must have its declaration in interface %0 or one of "
1373  "its extensions">;
1374def err_category_property : Error<
1375  "property declared in category %0 cannot be implemented in "
1376  "class implementation">;
1377def note_property_declare : Note<
1378  "property declared here">;
1379def note_protocol_property_declare : Note<
1380  "it could also be property "
1381  "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1382  "%1|with setter %1}0 declared here">;
1383def note_property_synthesize : Note<
1384  "property synthesized here">;
1385def err_synthesize_category_decl : Error<
1386  "@synthesize not allowed in a category's implementation">;
1387def err_synthesize_on_class_property : Error<
1388  "@synthesize not allowed on a class property %0">;
1389def err_missing_property_interface : Error<
1390  "property implementation in a category with no category declaration">;
1391def err_bad_category_property_decl : Error<
1392  "property implementation must have its declaration in the category %0">;
1393def err_bad_property_context : Error<
1394  "property implementation must be in a class or category implementation">;
1395def err_missing_property_ivar_decl : Error<
1396  "synthesized property %0 must either be named the same as a compatible"
1397  " instance variable or must explicitly name an instance variable">;
1398def err_arc_perform_selector_retains : Error<
1399  "performSelector names a selector which retains the object">;
1400def warn_arc_perform_selector_leaks : Warning<
1401  "performSelector may cause a leak because its selector is unknown">,
1402  InGroup<DiagGroup<"arc-performSelector-leaks">>;
1403def warn_dealloc_in_category : Warning<
1404"-dealloc is being overridden in a category">,
1405InGroup<DeallocInCategory>;
1406def err_gc_weak_property_strong_type : Error<
1407  "weak attribute declared on a __strong type property in GC mode">;
1408def warn_arc_repeated_use_of_weak : Warning <
1409  "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1410  "accessed multiple times in this %select{function|method|block|lambda}2 "
1411  "but may be unpredictably set to nil; assign to a strong variable to keep "
1412  "the object alive">,
1413  InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1414def warn_implicitly_retains_self : Warning <
1415  "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1416  "this is intended behavior">,
1417  InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1418def warn_arc_possible_repeated_use_of_weak : Warning <
1419  "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1420  "be accessed multiple times in this %select{function|method|block|lambda}2 "
1421  "and may be unpredictably set to nil; assign to a strong variable to keep "
1422  "the object alive">,
1423  InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1424def note_arc_weak_also_accessed_here : Note<
1425  "also accessed here">;
1426def err_incomplete_synthesized_property : Error<
1427  "cannot synthesize property %0 with incomplete type %1">;
1428
1429def err_property_ivar_type : Error<
1430  "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1431def err_property_accessor_type : Error<
1432  "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1433def err_ivar_in_superclass_use : Error<
1434  "property %0 attempting to use instance variable %1 declared in super class %2">;
1435def err_weak_property : Error<
1436  "existing instance variable %1 for __weak property %0 must be __weak">;
1437def err_strong_property : Error<
1438  "existing instance variable %1 for strong property %0 may not be __weak">;
1439def err_dynamic_property_ivar_decl : Error<
1440  "dynamic property cannot have instance variable specification">;
1441def err_duplicate_ivar_use : Error<
1442  "synthesized properties %0 and %1 both claim instance variable %2">;
1443def err_property_implemented : Error<"property %0 is already implemented">;
1444def warn_objc_missing_super_call : Warning<
1445  "method possibly missing a [super %0] call">,
1446  InGroup<ObjCMissingSuperCalls>;
1447def err_dealloc_bad_result_type : Error<
1448  "dealloc return type must be correctly specified as 'void' under ARC, "
1449  "instead of %0">;
1450def warn_undeclared_selector : Warning<
1451  "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1452def warn_undeclared_selector_with_typo : Warning<
1453  "undeclared selector %0; did you mean %1?">,
1454  InGroup<UndeclaredSelector>, DefaultIgnore;
1455def warn_implicit_atomic_property : Warning<
1456  "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1457def note_auto_readonly_iboutlet_fixup_suggest : Note<
1458  "property should be changed to be readwrite">;
1459def warn_auto_readonly_iboutlet_property : Warning<
1460  "readonly IBOutlet property %0 when auto-synthesized may "
1461  "not work correctly with 'nib' loader">,
1462  InGroup<DiagGroup<"readonly-iboutlet-property">>;
1463def warn_auto_implicit_atomic_property : Warning<
1464  "property is assumed atomic when auto-synthesizing the property">,
1465  InGroup<ImplicitAtomic>, DefaultIgnore;
1466def warn_unimplemented_selector:  Warning<
1467  "no method with selector %0 is implemented in this translation unit">,
1468  InGroup<Selector>, DefaultIgnore;
1469def warn_unimplemented_protocol_method : Warning<
1470  "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1471def warn_multiple_selectors: Warning<
1472  "several methods with selector %0 of mismatched types are found "
1473  "for the @selector expression">,
1474  InGroup<SelectorTypeMismatch>, DefaultIgnore;
1475def err_direct_selector_expression : Error<
1476  "@selector expression formed with direct selector %0">;
1477def warn_potentially_direct_selector_expression : Warning<
1478  "@selector expression formed with potentially direct selector %0">,
1479  InGroup<ObjCPotentiallyDirectSelector>;
1480def warn_strict_potentially_direct_selector_expression : Warning<
1481  warn_potentially_direct_selector_expression.Text>,
1482  InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore;
1483
1484def err_objc_kindof_nonobject : Error<
1485  "'__kindof' specifier cannot be applied to non-object type %0">;
1486def err_objc_kindof_wrong_position : Error<
1487  "'__kindof' type specifier must precede the declarator">;
1488
1489def err_objc_method_unsupported_param_ret_type : Error<
1490  "%0 %select{parameter|return}1 type is unsupported; "
1491  "support for vector types for this target is introduced in %2">;
1492
1493def warn_messaging_unqualified_id : Warning<
1494  "messaging unqualified id">, DefaultIgnore,
1495  InGroup<DiagGroup<"objc-messaging-id">>;
1496def err_messaging_unqualified_id_with_direct_method : Error<
1497  "messaging unqualified id with a method that is possibly direct">;
1498def err_messaging_super_with_direct_method : Error<
1499  "messaging super with a direct method">;
1500def err_messaging_class_with_direct_method : Error<
1501  "messaging a Class with a method that is possibly direct">;
1502
1503// C++ declarations
1504def err_static_assert_expression_is_not_constant : Error<
1505  "static_assert expression is not an integral constant expression">;
1506def err_constexpr_if_condition_expression_is_not_constant : Error<
1507  "constexpr if condition is not a constant expression">;
1508def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1509def err_static_assert_requirement_failed : Error<
1510  "static_assert failed due to requirement '%0'%select{ %2|}1">;
1511
1512def warn_consteval_if_always_true : Warning<
1513  "consteval if is always true in an %select{unevaluated|immediate}0 context">,
1514  InGroup<DiagGroup<"redundant-consteval-if">>;
1515
1516def ext_inline_variable : ExtWarn<
1517  "inline variables are a C++17 extension">, InGroup<CXX17>;
1518def warn_cxx14_compat_inline_variable : Warning<
1519  "inline variables are incompatible with C++ standards before C++17">,
1520  DefaultIgnore, InGroup<CXXPre17Compat>;
1521
1522def warn_inline_namespace_reopened_noninline : Warning<
1523  "inline namespace reopened as a non-inline namespace">,
1524  InGroup<InlineNamespaceReopenedNoninline>;
1525def err_inline_namespace_mismatch : Error<
1526  "non-inline namespace cannot be reopened as inline">;
1527
1528def err_unexpected_friend : Error<
1529  "friends can only be classes or functions">;
1530def ext_enum_friend : ExtWarn<
1531  "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1532def warn_cxx98_compat_enum_friend : Warning<
1533  "befriending enumeration type %0 is incompatible with C++98">,
1534  InGroup<CXX98Compat>, DefaultIgnore;
1535def ext_nonclass_type_friend : ExtWarn<
1536  "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1537def warn_cxx98_compat_nonclass_type_friend : Warning<
1538  "non-class friend type %0 is incompatible with C++98">,
1539  InGroup<CXX98Compat>, DefaultIgnore;
1540def err_friend_is_member : Error<
1541  "friends cannot be members of the declaring class">;
1542def warn_cxx98_compat_friend_is_member : Warning<
1543  "friend declaration naming a member of the declaring class is incompatible "
1544  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1545def ext_unelaborated_friend_type : ExtWarn<
1546  "unelaborated friend declaration is a C++11 extension; specify "
1547  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1548  InGroup<CXX11>;
1549def warn_cxx98_compat_unelaborated_friend_type : Warning<
1550  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1551  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1552def err_qualified_friend_no_match : Error<
1553  "friend declaration of %0 does not match any declaration in %1">;
1554def err_introducing_special_friend : Error<
1555  "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1556  " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1557  "as a friend">;
1558def err_tagless_friend_type_template : Error<
1559  "friend type templates must use an elaborated type">;
1560def err_no_matching_local_friend : Error<
1561  "no matching function found in local scope">;
1562def err_no_matching_local_friend_suggest : Error<
1563  "no matching function %0 found in local scope; did you mean %3?">;
1564def err_partial_specialization_friend : Error<
1565  "partial specialization cannot be declared as a friend">;
1566def err_qualified_friend_def : Error<
1567  "friend function definition cannot be qualified with '%0'">;
1568def err_friend_def_in_local_class : Error<
1569  "friend function cannot be defined in a local class">;
1570def err_friend_not_first_in_declaration : Error<
1571  "'friend' must appear first in a non-function declaration">;
1572def err_using_decl_friend : Error<
1573  "cannot befriend target of using declaration">;
1574def warn_template_qualified_friend_unsupported : Warning<
1575  "dependent nested name specifier '%0' for friend class declaration is "
1576  "not supported; turning off access control for %1">,
1577  InGroup<UnsupportedFriend>;
1578def warn_template_qualified_friend_ignored : Warning<
1579  "dependent nested name specifier '%0' for friend template declaration is "
1580  "not supported; ignoring this friend declaration">,
1581  InGroup<UnsupportedFriend>;
1582def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1583  "unqualified friend declaration referring to type outside of the nearest "
1584  "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1585  InGroup<MicrosoftUnqualifiedFriend>;
1586def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1587
1588def err_invalid_base_in_interface : Error<
1589  "interface type cannot inherit from "
1590  "%select{struct|non-public interface|class}0 %1">;
1591
1592def err_abstract_type_in_decl : Error<
1593  "%select{return|parameter|variable|field|instance variable|"
1594  "synthesized instance variable}0 type %1 is an abstract class">;
1595def err_allocation_of_abstract_type : Error<
1596  "allocating an object of abstract class type %0">;
1597def err_throw_abstract_type : Error<
1598  "cannot throw an object of abstract type %0">;
1599def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1600def err_capture_of_abstract_type : Error<
1601  "by-copy capture of value of abstract type %0">;
1602def err_capture_of_incomplete_or_sizeless_type : Error<
1603  "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">;
1604def err_capture_default_non_local : Error<
1605  "non-local lambda expression cannot have a capture-default">;
1606
1607def err_multiple_final_overriders : Error<
1608  "virtual function %q0 has more than one final overrider in %1">;
1609def note_final_overrider : Note<"final overrider of %q0 in %1">;
1610
1611def err_type_defined_in_type_specifier : Error<
1612  "%0 cannot be defined in a type specifier">;
1613def err_type_defined_in_result_type : Error<
1614  "%0 cannot be defined in the result type of a function">;
1615def err_type_defined_in_param_type : Error<
1616  "%0 cannot be defined in a parameter type">;
1617def err_type_defined_in_alias_template : Error<
1618  "%0 cannot be defined in a type alias template">;
1619def err_type_defined_in_condition : Error<
1620  "%0 cannot be defined in a condition">;
1621def err_type_defined_in_enum : Error<
1622  "%0 cannot be defined in an enumeration">;
1623
1624def note_pure_virtual_function : Note<
1625  "unimplemented pure virtual method %0 in %1">;
1626
1627def note_pure_qualified_call_kext : Note<
1628  "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1629
1630def err_deleted_decl_not_first : Error<
1631  "deleted definition must be first declaration">;
1632
1633def err_deleted_override : Error<
1634  "deleted function %0 cannot override a non-deleted function">;
1635def err_non_deleted_override : Error<
1636  "non-deleted function %0 cannot override a deleted function">;
1637def err_consteval_override : Error<
1638  "consteval function %0 cannot override a non-consteval function">;
1639def err_non_consteval_override : Error<
1640  "non-consteval function %0 cannot override a consteval function">;
1641
1642def warn_weak_vtable : Warning<
1643  "%0 has no out-of-line virtual method definitions; its vtable will be "
1644  "emitted in every translation unit">,
1645  InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1646def warn_weak_template_vtable : Warning<
1647  "explicit template instantiation %0 will emit a vtable in every "
1648  "translation unit">,
1649  InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1650
1651def ext_using_undefined_std : ExtWarn<
1652  "using directive refers to implicitly-defined namespace 'std'">;
1653
1654// C++ exception specifications
1655def err_exception_spec_in_typedef : Error<
1656  "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1657def err_distant_exception_spec : Error<
1658  "exception specifications are not allowed beyond a single level "
1659  "of indirection">;
1660def err_incomplete_in_exception_spec : Error<
1661  "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1662  "in exception specification">;
1663def err_sizeless_in_exception_spec : Error<
1664  "%select{|reference to }0sizeless type %1 is not allowed "
1665  "in exception specification">;
1666def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1667  InGroup<MicrosoftExceptionSpec>;
1668def err_rref_in_exception_spec : Error<
1669  "rvalue reference type %0 is not allowed in exception specification">;
1670def err_mismatched_exception_spec : Error<
1671  "exception specification in declaration does not match previous declaration">;
1672def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1673  InGroup<MicrosoftExceptionSpec>;
1674def err_override_exception_spec : Error<
1675  "exception specification of overriding function is more lax than "
1676  "base version">;
1677def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1678  InGroup<MicrosoftExceptionSpec>;
1679def err_incompatible_exception_specs : Error<
1680  "target exception specification is not superset of source">;
1681def warn_incompatible_exception_specs : Warning<
1682  err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1683def err_deep_exception_specs_differ : Error<
1684  "exception specifications of %select{return|argument}0 types differ">;
1685def warn_deep_exception_specs_differ : Warning<
1686  err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1687def err_missing_exception_specification : Error<
1688  "%0 is missing exception specification '%1'">;
1689def ext_missing_exception_specification : ExtWarn<
1690  err_missing_exception_specification.Text>,
1691  InGroup<DiagGroup<"missing-exception-spec">>;
1692def ext_ms_missing_exception_specification : ExtWarn<
1693  err_missing_exception_specification.Text>,
1694  InGroup<MicrosoftExceptionSpec>;
1695def err_noexcept_needs_constant_expression : Error<
1696  "argument to noexcept specifier must be a constant expression">;
1697def err_exception_spec_not_parsed : Error<
1698  "exception specification is not available until end of class definition">;
1699def err_exception_spec_cycle : Error<
1700  "exception specification of %0 uses itself">;
1701def err_exception_spec_incomplete_type : Error<
1702  "exception specification needed for member of incomplete class %0">;
1703def warn_wasm_dynamic_exception_spec_ignored : ExtWarn<
1704  "dynamic exception specifications with types are currently ignored in wasm">,
1705  InGroup<WebAssemblyExceptionSpec>;
1706
1707// C++ access checking
1708def err_class_redeclared_with_different_access : Error<
1709  "%0 redeclared with '%1' access">;
1710def err_access : Error<
1711  "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1712def ext_ms_using_declaration_inaccessible : ExtWarn<
1713  "using declaration referring to inaccessible member '%0' (which refers "
1714  "to accessible member '%1') is a Microsoft compatibility extension">,
1715    AccessControl, InGroup<MicrosoftUsingDecl>;
1716def err_access_ctor : Error<
1717  "calling a %select{private|protected}0 constructor of class %2">,
1718  AccessControl;
1719def ext_rvalue_to_reference_access_ctor : Extension<
1720  "C++98 requires an accessible copy constructor for class %2 when binding "
1721  "a reference to a temporary; was %select{private|protected}0">,
1722  AccessControl, InGroup<BindToTemporaryCopy>;
1723def err_access_base_ctor : Error<
1724  // The ERRORs represent other special members that aren't constructors, in
1725  // hopes that someone will bother noticing and reporting if they appear
1726  "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1727  "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1728  "|*ERROR*|}2constructor">, AccessControl;
1729def err_access_field_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  "field of type %0 has %select{private|protected}2 "
1733  "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1734  AccessControl;
1735def err_access_friend_function : Error<
1736  "friend function %1 is a %select{private|protected}0 member of %3">,
1737  AccessControl;
1738
1739def err_access_dtor : Error<
1740  "calling a %select{private|protected}1 destructor of class %0">,
1741  AccessControl;
1742def err_access_dtor_base :
1743    Error<"base class %0 has %select{private|protected}1 destructor">,
1744    AccessControl;
1745def err_access_dtor_vbase :
1746    Error<"inherited virtual base class %1 has "
1747    "%select{private|protected}2 destructor">,
1748    AccessControl;
1749def err_access_dtor_temp :
1750    Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1751    AccessControl;
1752def err_access_dtor_exception :
1753    Error<"exception object of type %0 has %select{private|protected}1 "
1754          "destructor">, AccessControl;
1755def err_access_dtor_field :
1756    Error<"field of type %1 has %select{private|protected}2 destructor">,
1757    AccessControl;
1758def err_access_dtor_var :
1759    Error<"variable of type %1 has %select{private|protected}2 destructor">,
1760    AccessControl;
1761def err_access_dtor_ivar :
1762    Error<"instance variable of type %0 has %select{private|protected}1 "
1763          "destructor">,
1764    AccessControl;
1765def note_previous_access_declaration : Note<
1766  "previously declared '%1' here">;
1767def note_access_natural : Note<
1768  "%select{|implicitly }1declared %select{private|protected}0 here">;
1769def note_access_constrained_by_path : Note<
1770  "constrained by %select{|implicitly }1%select{private|protected}0"
1771  " inheritance here">;
1772def note_access_protected_restricted_noobject : Note<
1773  "must name member using the type of the current context %0">;
1774def note_access_protected_restricted_ctordtor : Note<
1775  "protected %select{constructor|destructor}0 can only be used to "
1776  "%select{construct|destroy}0 a base class subobject">;
1777def note_access_protected_restricted_object : Note<
1778  "can only access this member on an object of type %0">;
1779def warn_cxx98_compat_sfinae_access_control : Warning<
1780  "substitution failure due to access control is incompatible with C++98">,
1781  InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1782
1783// C++ name lookup
1784def err_incomplete_nested_name_spec : Error<
1785  "incomplete type %0 named in nested name specifier">;
1786def err_incomplete_enum : Error<
1787  "enumeration %0 is incomplete">;
1788def err_dependent_nested_name_spec : Error<
1789  "nested name specifier for a declaration cannot depend on a template "
1790  "parameter">;
1791def err_nested_name_member_ref_lookup_ambiguous : Error<
1792  "lookup of %0 in member access expression is ambiguous">;
1793def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1794  "lookup of %0 in member access expression is ambiguous; using member of %1">,
1795  InGroup<AmbigMemberTemplate>;
1796def note_ambig_member_ref_object_type : Note<
1797  "lookup in the object type %0 refers here">;
1798def note_ambig_member_ref_scope : Note<
1799  "lookup from the current scope refers here">;
1800def err_qualified_member_nonclass : Error<
1801  "qualified member access refers to a member in %0">;
1802def err_incomplete_member_access : Error<
1803  "member access into incomplete type %0">;
1804def err_incomplete_type : Error<
1805  "incomplete type %0 where a complete type is required">;
1806def warn_cxx98_compat_enum_nested_name_spec : Warning<
1807  "enumeration type in nested name specifier is incompatible with C++98">,
1808  InGroup<CXX98Compat>, DefaultIgnore;
1809def err_nested_name_spec_is_not_class : Error<
1810  "%0 cannot appear before '::' because it is not a class"
1811  "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1812def ext_nested_name_spec_is_enum : ExtWarn<
1813  "use of enumeration in a nested name specifier is a C++11 extension">,
1814  InGroup<CXX11>;
1815def err_out_of_line_qualified_id_type_names_constructor : Error<
1816  "qualified reference to %0 is a constructor name rather than a "
1817  "%select{template name|type}1 in this context">;
1818def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1819  "ISO C++ specifies that "
1820  "qualified reference to %0 is a constructor name rather than a "
1821  "%select{template name|type}1 in this context, despite preceding "
1822  "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1823  InGroup<DiagGroup<"injected-class-name">>;
1824
1825// C++ class members
1826def err_storageclass_invalid_for_member : Error<
1827  "storage class specified for a member declaration">;
1828def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1829def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1830def ext_mutable_reference : ExtWarn<
1831  "'mutable' on a reference type is a Microsoft extension">,
1832  InGroup<MicrosoftMutableReference>;
1833def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1834def err_mutable_nonmember : Error<
1835  "'mutable' can only be applied to member variables">;
1836def err_virtual_in_union : Error<
1837  "unions cannot have virtual functions">;
1838def err_virtual_non_function : Error<
1839  "'virtual' can only appear on non-static member functions">;
1840def err_virtual_out_of_class : Error<
1841  "'virtual' can only be specified inside the class definition">;
1842def err_virtual_member_function_template : Error<
1843  "'virtual' cannot be specified on member function templates">;
1844def err_static_overrides_virtual : Error<
1845  "'static' member function %0 overrides a virtual function in a base class">;
1846def err_explicit_non_function : Error<
1847  "'explicit' can only appear on non-static member functions">;
1848def err_explicit_out_of_class : Error<
1849  "'explicit' can only be specified inside the class definition">;
1850def err_explicit_non_ctor_or_conv_function : Error<
1851  "'explicit' can only be applied to a constructor or conversion function">;
1852def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1853def err_static_out_of_line : Error<
1854  "'static' can only be specified inside the class definition">;
1855def ext_static_out_of_line : ExtWarn<
1856  err_static_out_of_line.Text>,
1857  InGroup<MicrosoftTemplate>;
1858def err_storage_class_for_static_member : Error<
1859  "static data member definition cannot specify a storage class">;
1860def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1861def err_not_integral_type_bitfield : Error<
1862  "bit-field %0 has non-integral type %1">;
1863def err_not_integral_type_anon_bitfield : Error<
1864  "anonymous bit-field has non-integral type %0">;
1865def err_anon_bitfield_qualifiers : Error<
1866  "anonymous bit-field cannot have qualifiers">;
1867def err_member_function_initialization : Error<
1868  "initializer on function does not look like a pure-specifier">;
1869def err_non_virtual_pure : Error<
1870  "%0 is not virtual and cannot be declared pure">;
1871def ext_pure_function_definition : ExtWarn<
1872  "function definition with pure-specifier is a Microsoft extension">,
1873  InGroup<MicrosoftPureDefinition>;
1874def err_qualified_member_of_unrelated : Error<
1875  "%q0 is not a member of class %1">;
1876
1877def err_member_function_call_bad_cvr : Error<
1878  "'this' argument to member function %0 has type %1, but function is not marked "
1879  "%select{const|restrict|const or restrict|volatile|const or volatile|"
1880  "volatile or restrict|const, volatile, or restrict}2">;
1881def err_member_function_call_bad_ref : Error<
1882  "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1883  "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1884def err_member_function_call_bad_type : Error<
1885  "cannot initialize object parameter of type %0 with an expression "
1886  "of type %1">;
1887
1888def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1889  "call to pure virtual member function %0 has undefined behavior; "
1890  "overrides of %0 in subclasses are not available in the "
1891  "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
1892
1893def select_special_member_kind : TextSubstitution<
1894  "%select{default constructor|copy constructor|move constructor|"
1895  "copy assignment operator|move assignment operator|destructor}0">;
1896
1897def note_member_declared_at : Note<"member is declared here">;
1898def note_ivar_decl : Note<"instance variable is declared here">;
1899def note_bitfield_decl : Note<"bit-field is declared here">;
1900def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1901def note_member_synthesized_at : Note<
1902  "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 "
1903  "first required here">;
1904def note_comparison_synthesized_at : Note<
1905  "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 "
1906  "first required here">;
1907def err_missing_default_ctor : Error<
1908  "%select{constructor for %1 must explicitly initialize the|"
1909  "implicit default constructor for %1 must explicitly initialize the|"
1910  "cannot use constructor inherited from base class %4;}0 "
1911  "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1912  "does not have a default constructor">;
1913def note_due_to_dllexported_class : Note<
1914  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1915
1916def err_illegal_union_or_anon_struct_member : Error<
1917  "%select{anonymous struct|union}0 member %1 has a non-trivial "
1918  "%sub{select_special_member_kind}2">;
1919
1920def warn_frame_address : Warning<
1921  "calling '%0' with a nonzero argument is unsafe">,
1922  InGroup<FrameAddress>, DefaultIgnore;
1923
1924def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1925  "%select{anonymous struct|union}0 member %1 with a non-trivial "
1926  "%sub{select_special_member_kind}2 is incompatible with C++98">,
1927  InGroup<CXX98Compat>, DefaultIgnore;
1928
1929def note_nontrivial_virtual_dtor : Note<
1930  "destructor for %0 is not trivial because it is virtual">;
1931def note_nontrivial_has_virtual : Note<
1932  "because type %0 has a virtual %select{member function|base class}1">;
1933def note_nontrivial_no_def_ctor : Note<
1934  "because %select{base class of |field of |}0type %1 has no "
1935  "default constructor">;
1936def note_user_declared_ctor : Note<
1937  "implicit default constructor suppressed by user-declared constructor">;
1938def note_nontrivial_no_copy : Note<
1939  "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1940  "assignment operator|<<ERROR>>}2 can be used to "
1941  "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1942  "%select{base class|field|an object}0 of type %3">;
1943def note_nontrivial_user_provided : Note<
1944  "because %select{base class of |field of |}0type %1 has a user-provided "
1945  "%sub{select_special_member_kind}2">;
1946def note_nontrivial_default_member_init : Note<
1947  "because field %0 has an initializer">;
1948def note_nontrivial_param_type : Note<
1949  "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1950def note_nontrivial_default_arg : Note<"because it has a default argument">;
1951def note_nontrivial_variadic : Note<"because it is a variadic function">;
1952def note_nontrivial_subobject : Note<
1953  "because the function selected to %select{construct|copy|move|copy|move|"
1954  "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1955def note_nontrivial_objc_ownership : Note<
1956  "because type %0 has a member with %select{no|no|__strong|__weak|"
1957  "__autoreleasing}1 ownership">;
1958
1959/// Selector for a TagTypeKind value.
1960def select_tag_type_kind : TextSubstitution<
1961  "%select{struct|interface|union|class|enum}0">;
1962
1963def err_static_data_member_not_allowed_in_anon_struct : Error<
1964  "static data member %0 not allowed in anonymous "
1965  "%sub{select_tag_type_kind}1">;
1966def ext_static_data_member_in_union : ExtWarn<
1967  "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1968def warn_cxx98_compat_static_data_member_in_union : Warning<
1969  "static data member %0 in union is incompatible with C++98">,
1970  InGroup<CXX98Compat>, DefaultIgnore;
1971def ext_union_member_of_reference_type : ExtWarn<
1972  "union member %0 has reference type %1, which is a Microsoft extension">,
1973  InGroup<MicrosoftUnionMemberReference>;
1974def err_union_member_of_reference_type : Error<
1975  "union member %0 has reference type %1">;
1976def ext_anonymous_struct_union_qualified : Extension<
1977  "anonymous %select{struct|union}0 cannot be '%1'">;
1978def err_different_return_type_for_overriding_virtual_function : Error<
1979  "virtual function %0 has a different return type "
1980  "%diff{($) than the function it overrides (which has return type $)|"
1981  "than the function it overrides}1,2">;
1982def note_overridden_virtual_function : Note<
1983  "overridden virtual function is here">;
1984def err_conflicting_overriding_cc_attributes : Error<
1985  "virtual function %0 has different calling convention attributes "
1986  "%diff{($) than the function it overrides (which has calling convention $)|"
1987  "than the function it overrides}1,2">;
1988def warn_overriding_method_missing_noescape : Warning<
1989  "parameter of overriding method should be annotated with "
1990  "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1991def note_overridden_marked_noescape : Note<
1992  "parameter of overridden method is annotated with __attribute__((noescape))">;
1993def note_cat_conform_to_noescape_prot : Note<
1994  "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
1995
1996def err_covariant_return_inaccessible_base : Error<
1997  "invalid covariant return for virtual function: %1 is a "
1998  "%select{private|protected}2 base class of %0">, AccessControl;
1999def err_covariant_return_ambiguous_derived_to_base_conv : Error<
2000  "return type of virtual function %3 is not covariant with the return type of "
2001  "the function it overrides (ambiguous conversion from derived class "
2002  "%0 to base class %1:%2)">;
2003def err_covariant_return_not_derived : Error<
2004  "return type of virtual function %0 is not covariant with the return type of "
2005  "the function it overrides (%1 is not derived from %2)">;
2006def err_covariant_return_incomplete : Error<
2007  "return type of virtual function %0 is not covariant with the return type of "
2008  "the function it overrides (%1 is incomplete)">;
2009def err_covariant_return_type_different_qualifications : Error<
2010  "return type of virtual function %0 is not covariant with the return type of "
2011  "the function it overrides (%1 has different qualifiers than %2)">;
2012def err_covariant_return_type_class_type_more_qualified : Error<
2013  "return type of virtual function %0 is not covariant with the return type of "
2014  "the function it overrides (class type %1 is more qualified than class "
2015  "type %2">;
2016
2017// C++ implicit special member functions
2018def note_in_declaration_of_implicit_special_member : Note<
2019  "while declaring the implicit %sub{select_special_member_kind}1"
2020  " for %0">;
2021
2022// C++ constructors
2023def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
2024def err_invalid_qualified_constructor : Error<
2025  "'%0' qualifier is not allowed on a constructor">;
2026def err_ref_qualifier_constructor : Error<
2027  "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
2028
2029def err_constructor_return_type : Error<
2030  "constructor cannot have a return type">;
2031def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
2032def err_constructor_byvalue_arg : Error<
2033  "copy constructor must pass its first argument by reference">;
2034def warn_no_constructor_for_refconst : Warning<
2035  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
2036  "constructor to initialize its non-modifiable members">;
2037def note_refconst_member_not_initialized : Note<
2038  "%select{const|reference}0 member %1 will never be initialized">;
2039def ext_ms_explicit_constructor_call : ExtWarn<
2040  "explicit constructor calls are a Microsoft extension">,
2041  InGroup<MicrosoftExplicitConstructorCall>;
2042
2043// C++ destructors
2044def err_destructor_not_member : Error<
2045  "destructor must be a non-static member function">;
2046def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
2047def err_invalid_qualified_destructor : Error<
2048  "'%0' qualifier is not allowed on a destructor">;
2049def err_ref_qualifier_destructor : Error<
2050  "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
2051def err_destructor_return_type : Error<"destructor cannot have a return type">;
2052def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
2053def err_destructor_with_params : Error<"destructor cannot have any parameters">;
2054def err_destructor_variadic : Error<"destructor cannot be variadic">;
2055def ext_destructor_typedef_name : ExtWarn<
2056  "destructor cannot be declared using a %select{typedef|type alias}1 %0 "
2057  "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>;
2058def err_undeclared_destructor_name : Error<
2059  "undeclared identifier %0 in destructor name">;
2060def err_destructor_name : Error<
2061  "expected the class name after '~' to name the enclosing class">;
2062def err_destructor_name_nontype : Error<
2063  "identifier %0 after '~' in destructor name does not name a type">;
2064def err_destructor_expr_mismatch : Error<
2065  "identifier %0 in object destruction expression does not name the type "
2066  "%1 of the object being destroyed">;
2067def err_destructor_expr_nontype : Error<
2068  "identifier %0 in object destruction expression does not name a type">;
2069def err_destructor_expr_type_mismatch : Error<
2070  "destructor type %0 in object destruction expression does not match the "
2071  "type %1 of the object being destroyed">;
2072def note_destructor_type_here : Note<
2073  "type %0 found by destructor name lookup">;
2074def note_destructor_nontype_here : Note<
2075  "non-type declaration found by destructor name lookup">;
2076def ext_dtor_named_in_wrong_scope : Extension<
2077  "ISO C++ requires the name after '::~' to be found in the same scope as "
2078  "the name before '::~'">, InGroup<DtorName>;
2079def ext_qualified_dtor_named_in_lexical_scope : ExtWarn<
2080  "qualified destructor name only found in lexical scope; omit the qualifier "
2081  "to find this type name by unqualified lookup">, InGroup<DtorName>;
2082def ext_dtor_name_ambiguous : Extension<
2083  "ISO C++ considers this destructor name lookup to be ambiguous">,
2084  InGroup<DtorName>;
2085
2086def err_destroy_attr_on_non_static_var : Error<
2087  "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
2088  " variable with static or thread storage duration">;
2089
2090def err_destructor_template : Error<
2091  "destructor cannot be declared as a template">;
2092
2093// C++ initialization
2094def err_init_conversion_failed : Error<
2095  "cannot initialize %select{a variable|a parameter|template parameter|"
2096  "return object|statement expression result|an "
2097  "exception object|a member subobject|an array element|a new value|a value|a "
2098  "base class|a constructor delegation|a vector element|a block element|a "
2099  "block element|a complex element|a lambda capture|a compound literal "
2100  "initializer|a related result|a parameter of CF audited function}0 "
2101  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2102  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2103  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2104  "|: different number of parameters (%5 vs %6)"
2105  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2106  "|: different return type%diff{ ($ vs $)|}5,6"
2107  "|: different qualifiers (%5 vs %6)"
2108  "|: different exception specifications}4">;
2109def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2110  "declared here; conversion would be valid if it was derived from %1">;
2111
2112def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2113  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2114def err_lvalue_reference_bind_to_initlist : Error<
2115  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2116  "initializer list temporary">;
2117def err_lvalue_reference_bind_to_temporary : Error<
2118  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2119  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2120def err_lvalue_reference_bind_to_unrelated : Error<
2121  "%select{non-const|volatile}0 lvalue reference "
2122  "%diff{to type $ cannot bind to a value of unrelated type $|"
2123  "cannot bind to a value of unrelated type}1,2">;
2124def err_reference_bind_drops_quals : Error<
2125  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2126  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2127  "not permitted due to incompatible qualifiers}2">;
2128def err_reference_bind_failed : Error<
2129  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2130  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2131  "incompatible type}0,3">;
2132def err_reference_bind_temporary_addrspace : Error<
2133  "reference of type %0 cannot bind to a temporary object because of "
2134  "address space mismatch">;
2135def err_reference_bind_init_list : Error<
2136  "reference to type %0 cannot bind to an initializer list">;
2137def err_init_list_bad_dest_type : Error<
2138  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2139  "list">;
2140def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2141  "aggregate initialization of type %0 with user-declared constructors "
2142  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2143
2144def err_reference_bind_to_bitfield : Error<
2145  "%select{non-const|volatile}0 reference cannot bind to "
2146  "bit-field%select{| %1}2">;
2147def err_reference_bind_to_vector_element : Error<
2148  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2149def err_reference_bind_to_matrix_element : Error<
2150  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2151def err_reference_var_requires_init : Error<
2152  "declaration of reference variable %0 requires an initializer">;
2153def err_reference_without_init : Error<
2154  "reference to type %0 requires an initializer">;
2155def note_value_initialization_here : Note<
2156  "in value-initialization of type %0 here">;
2157def err_reference_has_multiple_inits : Error<
2158  "reference cannot be initialized with multiple values">;
2159def err_init_non_aggr_init_list : Error<
2160  "initialization of non-aggregate type %0 with an initializer list">;
2161def err_init_reference_member_uninitialized : Error<
2162  "reference member of type %0 uninitialized">;
2163def note_uninit_reference_member : Note<
2164  "uninitialized reference member is here">;
2165def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2166  InGroup<Uninitialized>;
2167def warn_base_class_is_uninit : Warning<
2168  "base class %0 is uninitialized when used here to access %q1">,
2169  InGroup<Uninitialized>;
2170def warn_reference_field_is_uninit : Warning<
2171  "reference %0 is not yet bound to a value when used here">,
2172  InGroup<Uninitialized>;
2173def note_uninit_in_this_constructor : Note<
2174  "during field initialization in %select{this|the implicit default}0 "
2175  "constructor">;
2176def warn_static_self_reference_in_init : Warning<
2177  "static variable %0 is suspiciously used within its own initialization">,
2178  InGroup<UninitializedStaticSelfInit>;
2179def warn_uninit_self_reference_in_init : Warning<
2180  "variable %0 is uninitialized when used within its own initialization">,
2181  InGroup<Uninitialized>;
2182def warn_uninit_self_reference_in_reference_init : Warning<
2183  "reference %0 is not yet bound to a value when used within its own"
2184  " initialization">,
2185  InGroup<Uninitialized>;
2186def warn_uninit_var : Warning<
2187  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2188  InGroup<Uninitialized>, DefaultIgnore;
2189def warn_sometimes_uninit_var : Warning<
2190  "variable %0 is %select{used|captured}1 uninitialized whenever "
2191  "%select{'%3' condition is %select{true|false}4|"
2192  "'%3' loop %select{is entered|exits because its condition is false}4|"
2193  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2194  "switch %3 is taken|"
2195  "its declaration is reached|"
2196  "%3 is called}2">,
2197  InGroup<UninitializedSometimes>, DefaultIgnore;
2198def warn_maybe_uninit_var : Warning<
2199  "variable %0 may be uninitialized when "
2200  "%select{used here|captured by block}1">,
2201  InGroup<UninitializedMaybe>, DefaultIgnore;
2202def note_var_declared_here : Note<"variable %0 is declared here">;
2203def note_uninit_var_use : Note<
2204  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2205def warn_uninit_byref_blockvar_captured_by_block : Warning<
2206  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2207  "block">, InGroup<Uninitialized>, DefaultIgnore;
2208def note_block_var_fixit_add_initialization : Note<
2209  "did you mean to use __block %0?">;
2210def note_in_omitted_aggregate_initializer : Note<
2211  "in implicit initialization of %select{"
2212  "array element %1 with omitted initializer|"
2213  "field %1 with omitted initializer|"
2214  "trailing array elements in runtime-sized array new}0">;
2215def note_in_reference_temporary_list_initializer : Note<
2216  "in initialization of temporary of type %0 created to "
2217  "list-initialize this reference">;
2218def note_var_fixit_add_initialization : Note<
2219  "initialize the variable %0 to silence this warning">;
2220def note_uninit_fixit_remove_cond : Note<
2221  "remove the %select{'%1' if its condition|condition if it}0 "
2222  "is always %select{false|true}2">;
2223def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2224def err_list_init_in_parens : Error<
2225  "cannot initialize %select{non-class|reference}0 type %1 with a "
2226  "parenthesized initializer list">;
2227
2228def warn_uninit_const_reference : Warning<
2229  "variable %0 is uninitialized when passed as a const reference argument "
2230  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2231
2232def warn_unsequenced_mod_mod : Warning<
2233  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2234def warn_unsequenced_mod_use : Warning<
2235  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2236
2237def select_initialized_entity_kind : TextSubstitution<
2238  "%select{copying variable|copying parameter|initializing template parameter|"
2239  "returning object|initializing statement expression result|"
2240  "throwing object|copying member subobject|copying array element|"
2241  "allocating object|copying temporary|initializing base subobject|"
2242  "initializing vector element|capturing value}0">;
2243
2244def err_temp_copy_no_viable : Error<
2245  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2246def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2247  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2248  "C++98 requires a copy constructor when binding a reference to a temporary">,
2249  InGroup<BindToTemporaryCopy>;
2250def err_temp_copy_ambiguous : Error<
2251  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2252  "of type %1">;
2253def err_temp_copy_deleted : Error<
2254  "%sub{select_initialized_entity_kind}0 of type %1 "
2255  "invokes deleted constructor">;
2256def err_temp_copy_incomplete : Error<
2257  "copying a temporary object of incomplete type %0">;
2258def warn_cxx98_compat_temp_copy : Warning<
2259  "%sub{select_initialized_entity_kind}1 "
2260  "of type %2 when binding a reference to a temporary would %select{invoke "
2261  "an inaccessible constructor|find no viable constructor|find ambiguous "
2262  "constructors|invoke a deleted constructor}0 in C++98">,
2263  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2264def err_selected_explicit_constructor : Error<
2265  "chosen constructor is explicit in copy-initialization">;
2266def note_explicit_ctor_deduction_guide_here : Note<
2267  "explicit %select{constructor|deduction guide}0 declared here">;
2268
2269// C++11 decltype
2270def err_decltype_in_declarator : Error<
2271    "'decltype' cannot be used to name a declaration">;
2272
2273// C++11 auto
2274def warn_cxx98_compat_auto_type_specifier : Warning<
2275  "'auto' type specifier is incompatible with C++98">,
2276  InGroup<CXX98Compat>, DefaultIgnore;
2277def err_auto_variable_cannot_appear_in_own_initializer : Error<
2278  "variable %0 declared with deduced type %1 "
2279  "cannot appear in its own initializer">;
2280def err_binding_cannot_appear_in_own_initializer : Error<
2281  "binding %0 cannot appear in the initializer of its own "
2282  "decomposition declaration">;
2283def err_illegal_decl_array_of_auto : Error<
2284  "'%0' declared as array of %1">;
2285def err_new_array_of_auto : Error<
2286  "cannot allocate array of 'auto'">;
2287def err_auto_not_allowed : Error<
2288  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2289  "use of "
2290  "%select{class template|function template|variable template|alias template|"
2291  "template template parameter|concept|template}2 %3 requires template "
2292  "arguments; argument deduction}0 not allowed "
2293  "%select{in function prototype"
2294  "|in non-static struct member|in struct member"
2295  "|in non-static union member|in union member"
2296  "|in non-static class member|in interface member"
2297  "|in exception declaration|in template parameter until C++17|in block literal"
2298  "|in template argument|in typedef|in type alias|in function return type"
2299  "|in conversion function type|here|in lambda parameter"
2300  "|in type allocated by 'new'|in K&R-style function parameter"
2301  "|in template parameter|in friend declaration|in function prototype that is "
2302  "not a function declaration|in requires expression parameter}1">;
2303def err_dependent_deduced_tst : Error<
2304  "typename specifier refers to "
2305  "%select{class template|function template|variable template|alias template|"
2306  "template template parameter|template}0 member in %1; "
2307  "argument deduction not allowed here">;
2308def err_deduced_tst : Error<
2309  "typename specifier refers to "
2310  "%select{class template|function template|variable template|alias template|"
2311  "template template parameter|template}0; argument deduction not allowed "
2312  "here">;
2313def err_auto_not_allowed_var_inst : Error<
2314  "'auto' variable template instantiation is not allowed">;
2315def err_auto_var_requires_init : Error<
2316  "declaration of variable %0 with deduced type %1 requires an initializer">;
2317def err_auto_new_requires_ctor_arg : Error<
2318  "new expression for type %0 requires a constructor argument">;
2319def ext_auto_new_list_init : Extension<
2320  "ISO C++ standards before C++17 do not allow new expression for "
2321  "type %0 to use list-initialization">, InGroup<CXX17>;
2322def err_auto_var_init_no_expression : Error<
2323  "initializer for variable %0 with type %1 is empty">;
2324def err_auto_var_init_multiple_expressions : Error<
2325  "initializer for variable %0 with type %1 contains multiple expressions">;
2326def err_auto_var_init_paren_braces : Error<
2327  "cannot deduce type for variable %1 with type %2 from "
2328  "%select{parenthesized|nested}0 initializer list">;
2329def err_auto_new_ctor_multiple_expressions : Error<
2330  "new expression for type %0 contains multiple constructor arguments">;
2331def err_auto_missing_trailing_return : Error<
2332  "'auto' return without trailing return type; deduced return types are a "
2333  "C++14 extension">;
2334def err_deduced_return_type : Error<
2335  "deduced return types are a C++14 extension">;
2336def err_trailing_return_without_auto : Error<
2337  "function with trailing return type must specify return type 'auto', not %0">;
2338def err_trailing_return_in_parens : Error<
2339  "trailing return type may not be nested within parentheses">;
2340def err_auto_var_deduction_failure : Error<
2341  "variable %0 with type %1 has incompatible initializer of type %2">;
2342def err_auto_var_deduction_failure_from_init_list : Error<
2343  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2344def err_auto_new_deduction_failure : Error<
2345  "new expression for type %0 has incompatible constructor argument of type %1">;
2346def err_auto_inconsistent_deduction : Error<
2347  "deduced conflicting types %diff{($ vs $) |}0,1"
2348  "for initializer list element type">;
2349def err_auto_different_deductions : Error<
2350  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2351  "deduced as %1 in declaration of %2 and "
2352  "deduced as %3 in declaration of %4">;
2353def err_auto_non_deduced_not_alone : Error<
2354  "%select{function with deduced return type|"
2355  "declaration with trailing return type}0 "
2356  "must be the only declaration in its group">;
2357def err_implied_std_initializer_list_not_found : Error<
2358  "cannot deduce type of initializer list because std::initializer_list was "
2359  "not found; include <initializer_list>">;
2360def err_malformed_std_initializer_list : Error<
2361  "std::initializer_list must be a class template with a single type parameter">;
2362def err_auto_init_list_from_c : Error<
2363  "cannot use __auto_type with initializer list in C">;
2364def err_auto_bitfield : Error<
2365  "cannot pass bit-field as __auto_type initializer in C">;
2366
2367// C++1y decltype(auto) type
2368def err_decltype_auto_invalid : Error<
2369  "'decltype(auto)' not allowed here">;
2370def err_decltype_auto_cannot_be_combined : Error<
2371  "'decltype(auto)' cannot be combined with other type specifiers">;
2372def err_decltype_auto_function_declarator_not_declaration : Error<
2373  "'decltype(auto)' can only be used as a return type "
2374  "in a function declaration">;
2375def err_decltype_auto_compound_type : Error<
2376  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2377def err_decltype_auto_initializer_list : Error<
2378  "cannot deduce 'decltype(auto)' from initializer list">;
2379
2380// C++17 deduced class template specialization types
2381def err_deduced_class_template_compound_type : Error<
2382  "cannot %select{form pointer to|form reference to|form array of|"
2383  "form function returning|use parentheses when declaring variable with}0 "
2384  "deduced class template specialization type">;
2385def err_deduced_non_class_template_specialization_type : Error<
2386  "%select{<error>|function template|variable template|alias template|"
2387  "template template parameter|concept|template}0 %1 requires template "
2388  "arguments; argument deduction only allowed for class templates">;
2389def err_deduced_class_template_ctor_ambiguous : Error<
2390  "ambiguous deduction for template arguments of %0">;
2391def err_deduced_class_template_ctor_no_viable : Error<
2392  "no viable constructor or deduction guide for deduction of "
2393  "template arguments of %0">;
2394def err_deduced_class_template_incomplete : Error<
2395  "template %0 has no definition and no %select{|viable }1deduction guides "
2396  "for deduction of template arguments">;
2397def err_deduced_class_template_deleted : Error<
2398  "class template argument deduction for %0 selected a deleted constructor">;
2399def err_deduced_class_template_explicit : Error<
2400  "class template argument deduction for %0 selected an explicit "
2401  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2402def err_deduction_guide_no_trailing_return_type : Error<
2403  "deduction guide declaration without trailing return type">;
2404def err_deduction_guide_bad_trailing_return_type : Error<
2405  "deduced type %1 of deduction guide is not %select{|written as }2"
2406  "a specialization of template %0">;
2407def err_deduction_guide_with_complex_decl : Error<
2408  "cannot specify any part of a return type in the "
2409  "declaration of a deduction guide">;
2410def err_deduction_guide_invalid_specifier : Error<
2411  "deduction guide cannot be declared '%0'">;
2412def err_deduction_guide_name_not_class_template : Error<
2413  "cannot specify deduction guide for "
2414  "%select{<error>|function template|variable template|alias template|"
2415  "template template parameter|concept|dependent template name}0 %1">;
2416def err_deduction_guide_wrong_scope : Error<
2417  "deduction guide must be declared in the same scope as template %q0">;
2418def err_deduction_guide_defines_function : Error<
2419  "deduction guide cannot have a function definition">;
2420def err_deduction_guide_redeclared : Error<
2421  "redeclaration of deduction guide">;
2422def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2423  "%select{explicitly instantiated|explicitly specialized}0">;
2424def err_deduction_guide_template_not_deducible : Error<
2425  "deduction guide template contains "
2426  "%select{a template parameter|template parameters}0 that cannot be "
2427  "deduced">;
2428def err_deduction_guide_wrong_access : Error<
2429  "deduction guide has different access from the corresponding "
2430  "member template">;
2431def note_deduction_guide_template_access : Note<
2432  "member template declared %0 here">;
2433def note_deduction_guide_access : Note<
2434  "deduction guide declared %0 by intervening access specifier">;
2435def warn_cxx14_compat_class_template_argument_deduction : Warning<
2436  "class template argument deduction is incompatible with C++ standards "
2437  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2438  InGroup<CXXPre17Compat>, DefaultIgnore;
2439def warn_ctad_maybe_unsupported : Warning<
2440  "%0 may not intend to support class template argument deduction">,
2441  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2442def note_suppress_ctad_maybe_unsupported : Note<
2443  "add a deduction guide to suppress this warning">;
2444
2445
2446// C++14 deduced return types
2447def err_auto_fn_deduction_failure : Error<
2448  "cannot deduce return type %0 from returned value of type %1">;
2449def err_auto_fn_different_deductions : Error<
2450  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2451  "deduced as %2 in earlier return statement">;
2452def err_auto_fn_used_before_defined : Error<
2453  "function %0 with deduced return type cannot be used before it is defined">;
2454def err_auto_fn_no_return_but_not_auto : Error<
2455  "cannot deduce return type %0 for function with no return statements">;
2456def err_auto_fn_return_void_but_not_auto : Error<
2457  "cannot deduce return type %0 from omitted return expression">;
2458def err_auto_fn_return_init_list : Error<
2459  "cannot deduce return type from initializer list">;
2460def err_auto_fn_virtual : Error<
2461  "function with deduced return type cannot be virtual">;
2462def warn_cxx11_compat_deduced_return_type : Warning<
2463  "return type deduction is incompatible with C++ standards before C++14">,
2464  InGroup<CXXPre14Compat>, DefaultIgnore;
2465
2466// C++11 override control
2467def override_keyword_only_allowed_on_virtual_member_functions : Error<
2468  "only virtual member functions can be marked '%0'">;
2469def override_keyword_hides_virtual_member_function : Error<
2470  "non-virtual member function marked '%0' hides virtual member "
2471  "%select{function|functions}1">;
2472def err_function_marked_override_not_overriding : Error<
2473  "%0 marked 'override' but does not override any member functions">;
2474def warn_destructor_marked_not_override_overriding : TextSubstitution <
2475  "%0 overrides a destructor but is not marked 'override'">;
2476def warn_function_marked_not_override_overriding : TextSubstitution <
2477  "%0 overrides a member function but is not marked 'override'">;
2478def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2479  "%sub{warn_destructor_marked_not_override_overriding}0">,
2480  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2481def warn_inconsistent_function_marked_not_override_overriding : Warning <
2482  "%sub{warn_function_marked_not_override_overriding}0">,
2483  InGroup<CXX11WarnInconsistentOverrideMethod>;
2484def warn_suggest_destructor_marked_not_override_overriding : Warning <
2485  "%sub{warn_destructor_marked_not_override_overriding}0">,
2486  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2487def warn_suggest_function_marked_not_override_overriding : Warning <
2488  "%sub{warn_function_marked_not_override_overriding}0">,
2489  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2490def err_class_marked_final_used_as_base : Error<
2491  "base %0 is marked '%select{final|sealed}1'">;
2492def warn_abstract_final_class : Warning<
2493  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2494def warn_final_dtor_non_final_class : Warning<
2495  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2496  InGroup<FinalDtorNonFinalClass>;
2497def note_final_dtor_non_final_class_silence : Note<
2498  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2499
2500// C++11 attributes
2501def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2502
2503// C++11 final
2504def err_final_function_overridden : Error<
2505  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2506
2507// C++11 scoped enumerations
2508def err_enum_invalid_underlying : Error<
2509  "non-integral type %0 is an invalid underlying type">;
2510def err_enumerator_too_large : Error<
2511  "enumerator value is not representable in the underlying type %0">;
2512def ext_enumerator_too_large : Extension<
2513  "enumerator value is not representable in the underlying type %0">,
2514  InGroup<MicrosoftEnumValue>;
2515def err_enumerator_wrapped : Error<
2516  "enumerator value %0 is not representable in the underlying type %1">;
2517def err_enum_redeclare_type_mismatch : Error<
2518  "enumeration redeclared with different underlying type %0 (was %1)">;
2519def err_enum_redeclare_fixed_mismatch : Error<
2520  "enumeration previously declared with %select{non|}0fixed underlying type">;
2521def err_enum_redeclare_scoped_mismatch : Error<
2522  "enumeration previously declared as %select{un|}0scoped">;
2523def err_only_enums_have_underlying_types : Error<
2524  "only enumeration types have underlying types">;
2525def err_underlying_type_of_incomplete_enum : Error<
2526  "cannot determine underlying type of incomplete enumeration type %0">;
2527
2528// C++11 delegating constructors
2529def err_delegating_ctor : Error<
2530  "delegating constructors are permitted only in C++11">;
2531def warn_cxx98_compat_delegating_ctor : Warning<
2532  "delegating constructors are incompatible with C++98">,
2533  InGroup<CXX98Compat>, DefaultIgnore;
2534def err_delegating_initializer_alone : Error<
2535  "an initializer for a delegating constructor must appear alone">;
2536def warn_delegating_ctor_cycle : Warning<
2537  "constructor for %0 creates a delegation cycle">, DefaultError,
2538  InGroup<DelegatingCtorCycles>;
2539def note_it_delegates_to : Note<"it delegates to">;
2540def note_which_delegates_to : Note<"which delegates to">;
2541
2542// C++11 range-based for loop
2543def err_for_range_decl_must_be_var : Error<
2544  "for range declaration must declare a variable">;
2545def err_for_range_storage_class : Error<
2546  "loop variable %0 may not be declared %select{'extern'|'static'|"
2547  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2548def err_type_defined_in_for_range : Error<
2549  "types may not be defined in a for range declaration">;
2550def err_for_range_deduction_failure : Error<
2551  "cannot use type %0 as a range">;
2552def err_for_range_incomplete_type : Error<
2553  "cannot use incomplete type %0 as a range">;
2554def err_for_range_iter_deduction_failure : Error<
2555  "cannot use type %0 as an iterator">;
2556def ext_for_range_begin_end_types_differ : ExtWarn<
2557  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2558  InGroup<CXX17>;
2559def warn_for_range_begin_end_types_differ : Warning<
2560  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2561  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2562def note_in_for_range: Note<
2563  "when looking up '%select{begin|end}0' function for range expression "
2564  "of type %1">;
2565def err_for_range_invalid: Error<
2566  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2567  "function available">;
2568def note_for_range_member_begin_end_ignored : Note<
2569  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2570def err_range_on_array_parameter : Error<
2571  "cannot build range expression with array function parameter %0 since "
2572  "parameter with array type %1 is treated as pointer type %2">;
2573def err_for_range_dereference : Error<
2574  "invalid range expression of type %0; did you mean to dereference it "
2575  "with '*'?">;
2576def note_for_range_invalid_iterator : Note <
2577  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2578def note_for_range_begin_end : Note<
2579  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2580def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2581  "loop variable %0 "
2582  "%diff{of type $ binds to a temporary constructed from type $"
2583  "|binds to a temporary constructed from a different type}1,2">,
2584  InGroup<RangeLoopConstruct>, DefaultIgnore;
2585def note_use_type_or_non_reference : Note<
2586  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2587def warn_for_range_ref_binds_ret_temp : Warning<
2588  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2589  InGroup<RangeLoopBindReference>, DefaultIgnore;
2590def note_use_non_reference_type : Note<"use non-reference type %0">;
2591def warn_for_range_copy : Warning<
2592  "loop variable %0 creates a copy from type %1">,
2593  InGroup<RangeLoopConstruct>, DefaultIgnore;
2594def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2595def err_objc_for_range_init_stmt : Error<
2596  "initialization statement is not supported when iterating over Objective-C "
2597  "collection">;
2598
2599// C++11 constexpr
2600def warn_cxx98_compat_constexpr : Warning<
2601  "'constexpr' specifier is incompatible with C++98">,
2602  InGroup<CXX98Compat>, DefaultIgnore;
2603// FIXME: Maybe this should also go in -Wc++14-compat?
2604def warn_cxx14_compat_constexpr_not_const : Warning<
2605  "'constexpr' non-static member function will not be implicitly 'const' "
2606  "in C++14; add 'const' to avoid a change in behavior">,
2607  InGroup<DiagGroup<"constexpr-not-const">>;
2608def err_invalid_consteval_take_address : Error<
2609  "cannot take address of consteval function %0 outside"
2610  " of an immediate invocation">;
2611def err_invalid_consteval_call : Error<
2612  "call to consteval function %q0 is not a constant expression">;
2613def err_invalid_consteval_decl_kind : Error<
2614  "%0 cannot be declared consteval">;
2615def err_invalid_constexpr : Error<
2616  "%select{function parameter|typedef}0 "
2617  "cannot be %sub{select_constexpr_spec_kind}1">;
2618def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2619  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2620def err_constexpr_tag : Error<
2621  "%select{class|struct|interface|union|enum}0 "
2622  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2623def err_constexpr_dtor : Error<
2624  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2625def err_constexpr_dtor_subobject : Error<
2626  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2627  "%select{data member %2|base class %3}1 does not have a "
2628  "constexpr destructor">;
2629def note_constexpr_dtor_subobject : Note<
2630  "%select{data member %1|base class %2}0 declared here">;
2631def err_constexpr_wrong_decl_kind : Error<
2632  "%sub{select_constexpr_spec_kind}0 can only be used "
2633  "in %select{|variable and function|function|variable}0 declarations">;
2634def err_invalid_constexpr_var_decl : Error<
2635  "constexpr variable declaration must be a definition">;
2636def err_constexpr_static_mem_var_requires_init : Error<
2637  "declaration of constexpr static data member %0 requires an initializer">;
2638def err_constexpr_var_non_literal : Error<
2639  "constexpr variable cannot have non-literal type %0">;
2640def err_constexpr_var_requires_const_init : Error<
2641  "constexpr variable %0 must be initialized by a constant expression">;
2642def err_constexpr_var_requires_const_destruction : Error<
2643  "constexpr variable %0 must have constant destruction">;
2644def err_constexpr_redecl_mismatch : Error<
2645  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2646  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2647def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2648def warn_cxx17_compat_constexpr_virtual : Warning<
2649  "virtual constexpr functions are incompatible with "
2650  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2651def err_constexpr_virtual_base : Error<
2652  "constexpr %select{member function|constructor}0 not allowed in "
2653  "%select{struct|interface|class}1 with virtual base "
2654  "%plural{1:class|:classes}2">;
2655def note_non_literal_incomplete : Note<
2656  "incomplete type %0 is not a literal type">;
2657def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2658  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2659def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2660def err_constexpr_non_literal_return : Error<
2661  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2662def err_constexpr_non_literal_param : Error<
2663  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2664  "not a literal type">;
2665def err_constexpr_body_invalid_stmt : Error<
2666  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2667def ext_constexpr_body_invalid_stmt : ExtWarn<
2668  "use of this statement in a constexpr %select{function|constructor}0 "
2669  "is a C++14 extension">, InGroup<CXX14>;
2670def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2671  "use of this statement in a constexpr %select{function|constructor}0 "
2672  "is incompatible with C++ standards before C++14">,
2673  InGroup<CXXPre14Compat>, DefaultIgnore;
2674def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2675  "use of this statement in a constexpr %select{function|constructor}0 "
2676  "is a C++20 extension">, InGroup<CXX20>;
2677def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2678  "use of this statement in a constexpr %select{function|constructor}0 "
2679  "is incompatible with C++ standards before C++20">,
2680  InGroup<CXXPre20Compat>, DefaultIgnore;
2681def ext_constexpr_type_definition : ExtWarn<
2682  "type definition in a constexpr %select{function|constructor}0 "
2683  "is a C++14 extension">, InGroup<CXX14>;
2684def warn_cxx11_compat_constexpr_type_definition : Warning<
2685  "type definition in a constexpr %select{function|constructor}0 "
2686  "is incompatible with C++ standards before C++14">,
2687  InGroup<CXXPre14Compat>, DefaultIgnore;
2688def err_constexpr_vla : Error<
2689  "variably-modified type %0 cannot be used in a constexpr "
2690  "%select{function|constructor}1">;
2691def ext_constexpr_local_var : ExtWarn<
2692  "variable declaration in a constexpr %select{function|constructor}0 "
2693  "is a C++14 extension">, InGroup<CXX14>;
2694def warn_cxx11_compat_constexpr_local_var : Warning<
2695  "variable declaration in a constexpr %select{function|constructor}0 "
2696  "is incompatible with C++ standards before C++14">,
2697  InGroup<CXXPre14Compat>, DefaultIgnore;
2698def err_constexpr_local_var_static : Error<
2699  "%select{static|thread_local}1 variable not permitted in a constexpr "
2700  "%select{function|constructor}0">;
2701def err_constexpr_local_var_non_literal_type : Error<
2702  "variable of non-literal type %1 cannot be defined in a constexpr "
2703  "%select{function|constructor}0">;
2704def ext_constexpr_local_var_no_init : ExtWarn<
2705  "uninitialized variable in a constexpr %select{function|constructor}0 "
2706  "is a C++20 extension">, InGroup<CXX20>;
2707def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2708  "uninitialized variable in a constexpr %select{function|constructor}0 "
2709  "is incompatible with C++ standards before C++20">,
2710  InGroup<CXXPre20Compat>, DefaultIgnore;
2711def ext_constexpr_function_never_constant_expr : ExtWarn<
2712  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2713  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2714def err_attr_cond_never_constant_expr : Error<
2715  "%0 attribute expression never produces a constant expression">;
2716def err_diagnose_if_invalid_diagnostic_type : Error<
2717  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2718  "instead">;
2719def err_constexpr_body_no_return : Error<
2720  "no return statement in %select{constexpr|consteval}0 function">;
2721def err_constexpr_return_missing_expr : Error<
2722  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2723def warn_cxx11_compat_constexpr_body_no_return : Warning<
2724  "constexpr function with no return statements is incompatible with C++ "
2725  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2726def ext_constexpr_body_multiple_return : ExtWarn<
2727  "multiple return statements in constexpr function is a C++14 extension">,
2728  InGroup<CXX14>;
2729def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2730  "multiple return statements in constexpr function "
2731  "is incompatible with C++ standards before C++14">,
2732  InGroup<CXXPre14Compat>, DefaultIgnore;
2733def note_constexpr_body_previous_return : Note<
2734  "previous return statement is here">;
2735
2736// C++20 function try blocks in constexpr
2737def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2738  "function try block in constexpr %select{function|constructor}0 is "
2739  "a C++20 extension">, InGroup<CXX20>;
2740def warn_cxx17_compat_constexpr_function_try_block : Warning<
2741  "function try block in constexpr %select{function|constructor}0 is "
2742  "incompatible with C++ standards before C++20">,
2743  InGroup<CXXPre20Compat>, DefaultIgnore;
2744
2745def ext_constexpr_union_ctor_no_init : ExtWarn<
2746  "constexpr union constructor that does not initialize any member "
2747  "is a C++20 extension">, InGroup<CXX20>;
2748def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2749  "constexpr union constructor that does not initialize any member "
2750  "is incompatible with C++ standards before C++20">,
2751  InGroup<CXXPre20Compat>, DefaultIgnore;
2752def ext_constexpr_ctor_missing_init : ExtWarn<
2753  "constexpr constructor that does not initialize all members "
2754  "is a C++20 extension">, InGroup<CXX20>;
2755def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2756  "constexpr constructor that does not initialize all members "
2757  "is incompatible with C++ standards before C++20">,
2758  InGroup<CXXPre20Compat>, DefaultIgnore;
2759def note_constexpr_ctor_missing_init : Note<
2760  "member not initialized by constructor">;
2761def note_non_literal_no_constexpr_ctors : Note<
2762  "%0 is not literal because it is not an aggregate and has no constexpr "
2763  "constructors other than copy or move constructors">;
2764def note_non_literal_base_class : Note<
2765  "%0 is not literal because it has base class %1 of non-literal type">;
2766def note_non_literal_field : Note<
2767  "%0 is not literal because it has data member %1 of "
2768  "%select{non-literal|volatile}3 type %2">;
2769def note_non_literal_user_provided_dtor : Note<
2770  "%0 is not literal because it has a user-provided destructor">;
2771def note_non_literal_nontrivial_dtor : Note<
2772  "%0 is not literal because it has a non-trivial destructor">;
2773def note_non_literal_non_constexpr_dtor : Note<
2774  "%0 is not literal because its destructor is not constexpr">;
2775def note_non_literal_lambda : Note<
2776  "lambda closure types are non-literal types before C++17">;
2777def warn_private_extern : Warning<
2778  "use of __private_extern__ on a declaration may not produce external symbol "
2779  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2780def note_private_extern : Note<
2781  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2782
2783// C++ Concepts
2784def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2785  "concept declarations may only appear in global or namespace scope">;
2786def err_concept_no_parameters : Error<
2787  "concept template parameter list must have at least one parameter; explicit "
2788  "specialization of concepts is not allowed">;
2789def err_concept_extra_headers : Error<
2790  "extraneous template parameter list in concept definition">;
2791def err_concept_no_associated_constraints : Error<
2792  "concept cannot have associated constraints">;
2793def err_non_constant_constraint_expression : Error<
2794  "substitution into constraint expression resulted in a non-constant "
2795  "expression">;
2796def err_non_bool_atomic_constraint : Error<
2797  "atomic constraint must be of type 'bool' (found %0)">;
2798def err_template_arg_list_constraints_not_satisfied : Error<
2799  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
2800  "template template parameter|template}0 %1%2">;
2801def note_substituted_constraint_expr_is_ill_formed : Note<
2802  "because substituted constraint expression is ill-formed%0">;
2803def note_atomic_constraint_evaluated_to_false : Note<
2804  "%select{and|because}0 '%1' evaluated to false">;
2805def note_concept_specialization_constraint_evaluated_to_false : Note<
2806  "%select{and|because}0 '%1' evaluated to false">;
2807def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
2808  "%select{and|because}0 %1 does not satisfy %2">;
2809def note_atomic_constraint_evaluated_to_false_elaborated : Note<
2810  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
2811def err_constrained_virtual_method : Error<
2812  "virtual function cannot have a requires clause">;
2813def err_trailing_requires_clause_on_deduction_guide : Error<
2814  "deduction guide cannot have a requires clause">;
2815def err_reference_to_function_with_unsatisfied_constraints : Error<
2816  "invalid reference to function %0: constraints not satisfied">;
2817def err_requires_expr_local_parameter_default_argument : Error<
2818  "default arguments not allowed for parameters of a requires expression">;
2819def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
2820  "constraint variable %0 cannot be used in an evaluated context">;
2821def note_expr_requirement_expr_substitution_error : Note<
2822  "%select{and|because}0 '%1' would be invalid: %2">;
2823def note_expr_requirement_expr_unknown_substitution_error : Note<
2824  "%select{and|because}0 '%1' would be invalid">;
2825def note_expr_requirement_noexcept_not_met : Note<
2826  "%select{and|because}0 '%1' may throw an exception">;
2827def note_expr_requirement_type_requirement_substitution_error : Note<
2828  "%select{and|because}0 '%1' would be invalid: %2">;
2829def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
2830  "%select{and|because}0 '%1' would be invalid">;
2831def note_expr_requirement_constraints_not_satisfied : Note<
2832  "%select{and|because}0 type constraint '%1' was not satisfied:">;
2833def note_expr_requirement_constraints_not_satisfied_simple : Note<
2834  "%select{and|because}0 %1 does not satisfy %2:">;
2835def note_type_requirement_substitution_error : Note<
2836  "%select{and|because}0 '%1' would be invalid: %2">;
2837def note_type_requirement_unknown_substitution_error : Note<
2838  "%select{and|because}0 '%1' would be invalid">;
2839def note_nested_requirement_substitution_error : Note<
2840  "%select{and|because}0 '%1' would be invalid: %2">;
2841def note_nested_requirement_unknown_substitution_error : Note<
2842  "%select{and|because}0 '%1' would be invalid">;
2843def note_ambiguous_atomic_constraints : Note<
2844  "similar constraint expressions not considered equivalent; constraint "
2845  "expressions cannot be considered equivalent unless they originate from the "
2846  "same concept">;
2847def note_ambiguous_atomic_constraints_similar_expression : Note<
2848  "similar constraint expression here">;
2849def err_unsupported_placeholder_constraint : Error<
2850  "constrained placeholder types other than simple 'auto' on non-type template "
2851  "parameters not supported yet">;
2852
2853def err_template_different_requires_clause : Error<
2854  "requires clause differs in template redeclaration">;
2855def err_template_different_type_constraint : Error<
2856  "type constraint differs in template redeclaration">;
2857def err_template_template_parameter_not_at_least_as_constrained : Error<
2858  "template template argument %0 is more constrained than template template "
2859  "parameter %1">;
2860
2861def err_type_constraint_non_type_concept : Error<
2862  "concept named in type constraint is not a type concept">;
2863def err_type_constraint_missing_arguments : Error<
2864  "%0 requires more than 1 template argument; provide the remaining arguments "
2865  "explicitly to use it here">;
2866def err_placeholder_constraints_not_satisfied : Error<
2867  "deduced type %0 does not satisfy %1">;
2868
2869// C++11 char16_t/char32_t
2870def warn_cxx98_compat_unicode_type : Warning<
2871  "'%0' type specifier is incompatible with C++98">,
2872  InGroup<CXX98Compat>, DefaultIgnore;
2873def warn_cxx17_compat_unicode_type : Warning<
2874  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2875  InGroup<CXXPre20Compat>, DefaultIgnore;
2876
2877// __make_integer_seq
2878def err_integer_sequence_negative_length : Error<
2879  "integer sequences must have non-negative sequence length">;
2880def err_integer_sequence_integral_element_type : Error<
2881  "integer sequences must have integral element type">;
2882
2883// __type_pack_element
2884def err_type_pack_element_out_of_bounds : Error<
2885  "a parameter pack may not be accessed at an out of bounds index">;
2886
2887// Objective-C++
2888def err_objc_decls_may_only_appear_in_global_scope : Error<
2889  "Objective-C declarations may only appear in global scope">;
2890def warn_auto_var_is_id : Warning<
2891  "'auto' deduced as 'id' in declaration of %0">,
2892  InGroup<DiagGroup<"auto-var-id">>;
2893
2894// Attributes
2895def warn_nomerge_attribute_ignored_in_stmt: Warning<
2896  "%0 attribute is ignored because there exists no call expression inside the "
2897  "statement">,
2898  InGroup<IgnoredAttributes>;
2899
2900def err_musttail_needs_trivial_args : Error<
2901  "tail call requires that the return value, all parameters, and any "
2902  "temporaries created by the expression are trivially destructible">;
2903def err_musttail_needs_call : Error<
2904  "%0 attribute requires that the return value is the result of a function call"
2905  >;
2906def err_musttail_needs_prototype : Error<
2907  "%0 attribute requires that both caller and callee functions have a "
2908  "prototype">;
2909def note_musttail_fix_non_prototype : Note<
2910  "add 'void' to the parameter list to turn an old-style K&R function "
2911  "declaration into a prototype">;
2912def err_musttail_structors_forbidden : Error<"cannot perform a tail call "
2913  "%select{from|to}0 a %select{constructor|destructor}1">;
2914def note_musttail_structors_forbidden : Note<"target "
2915  "%select{constructor|destructor}0 is declared here">;
2916def err_musttail_forbidden_from_this_context : Error<
2917  "%0 attribute cannot be used from "
2918  "%select{a block|an Objective-C function|this context}1">;
2919def err_musttail_member_mismatch : Error<
2920  "%select{non-member|static member|non-static member}0 "
2921  "function cannot perform a tail call to "
2922  "%select{non-member|static member|non-static member|pointer-to-member}1 "
2923  "function%select{| %3}2">;
2924def note_musttail_callee_defined_here : Note<"%0 declared here">;
2925def note_tail_call_required : Note<"tail call required by %0 attribute here">;
2926def err_musttail_mismatch : Error<
2927  "cannot perform a tail call to function%select{| %1}0 because its signature "
2928  "is incompatible with the calling function">;
2929def note_musttail_mismatch : Note<
2930    "target function "
2931    "%select{is a member of different class%diff{ (expected $ but has $)|}1,2"
2932    "|has different number of parameters (expected %1 but has %2)"
2933    "|has type mismatch at %ordinal3 parameter"
2934    "%diff{ (expected $ but has $)|}1,2"
2935    "|has different return type%diff{ ($ expected but has $)|}1,2}0">;
2936def err_musttail_callconv_mismatch : Error<
2937  "cannot perform a tail call to function%select{| %1}0 because it uses an "
2938  "incompatible calling convention">;
2939def note_musttail_callconv_mismatch : Note<
2940  "target function has calling convention %1 (expected %0)">;
2941def err_musttail_scope : Error<
2942  "cannot perform a tail call from this return statement">;
2943def err_musttail_no_variadic : Error<
2944  "%0 attribute may not be used with variadic functions">;
2945
2946def err_nsobject_attribute : Error<
2947  "'NSObject' attribute is for pointer types only">;
2948def err_attributes_are_not_compatible : Error<
2949  "%0 and %1 attributes are not compatible">;
2950def err_attribute_invalid_argument : Error<
2951  "%select{a reference type|an array type|a non-vector or "
2952  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
2953def err_attribute_wrong_number_arguments : Error<
2954  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2955  ":requires exactly %1 arguments}1">;
2956def err_attribute_too_many_arguments : Error<
2957  "%0 attribute takes no more than %1 argument%s1">;
2958def err_attribute_too_few_arguments : Error<
2959  "%0 attribute takes at least %1 argument%s1">;
2960def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2961def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
2962def err_attribute_bad_neon_vector_size : Error<
2963  "Neon vector size must be 64 or 128 bits">;
2964def err_attribute_invalid_sve_type : Error<
2965  "%0 attribute applied to non-SVE type %1">;
2966def err_attribute_bad_sve_vector_size : Error<
2967  "invalid SVE vector size '%0', must match value set by "
2968  "'-msve-vector-bits' ('%1')">;
2969def err_attribute_arm_feature_sve_bits_unsupported : Error<
2970  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
2971  "value of 128, 256, 512, 1024 or 2048.">;
2972def err_attribute_requires_positive_integer : Error<
2973  "%0 attribute requires a %select{positive|non-negative}1 "
2974  "integral compile time constant expression">;
2975def err_attribute_requires_opencl_version : Error<
2976  "attribute %0 is supported in the OpenCL version %1%select{| onwards}2">;
2977def err_invalid_branch_protection_spec : Error<
2978  "invalid or misplaced branch protection specification '%0'">;
2979def warn_unsupported_target_attribute
2980    : Warning<"%select{unsupported|duplicate|unknown}0%select{| architecture|"
2981              " tune CPU}1 '%2' in the 'target' attribute string; 'target' "
2982              "attribute ignored">,
2983      InGroup<IgnoredAttributes>;
2984def err_attribute_unsupported
2985    : Error<"%0 attribute is not supported on targets missing %1;"
2986            " specify an appropriate -march= or -mcpu=">;
2987// The err_*_attribute_argument_not_int are separate because they're used by
2988// VerifyIntegerConstantExpression.
2989def err_aligned_attribute_argument_not_int : Error<
2990  "'aligned' attribute requires integer constant">;
2991def err_align_value_attribute_argument_not_int : Error<
2992  "'align_value' attribute requires integer constant">;
2993def err_alignas_attribute_wrong_decl_type : Error<
2994  "%0 attribute cannot be applied to a %select{function parameter|"
2995  "variable with 'register' storage class|'catch' variable|bit-field}1">;
2996def err_alignas_missing_on_definition : Error<
2997  "%0 must be specified on definition if it is specified on any declaration">;
2998def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2999def err_alignas_mismatch : Error<
3000  "redeclaration has different alignment requirement (%1 vs %0)">;
3001def err_alignas_underaligned : Error<
3002  "requested alignment is less than minimum alignment of %1 for type %0">;
3003def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Text>,
3004  InGroup<IgnoredAttributes>;
3005def err_attribute_sizeless_type : Error<
3006  "%0 attribute cannot be applied to sizeless type %1">;
3007def err_attribute_argument_n_type : Error<
3008  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
3009  "constant|a string|an identifier|a constant expression}2">;
3010def err_attribute_argument_type : Error<
3011  "%0 attribute requires %select{int or bool|an integer "
3012  "constant|a string|an identifier}1">;
3013def err_attribute_argument_out_of_range : Error<
3014  "%0 attribute requires integer constant between %1 and %2 inclusive">;
3015def err_init_priority_object_attr : Error<
3016  "can only use 'init_priority' attribute on file-scope definitions "
3017  "of objects of class type">;
3018def err_attribute_argument_out_of_bounds : Error<
3019  "%0 attribute parameter %1 is out of bounds">;
3020def err_attribute_only_once_per_parameter : Error<
3021  "%0 attribute can only be applied once per parameter">;
3022def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
3023def note_previous_uuid : Note<"previous uuid specified here">;
3024def warn_attribute_pointers_only : Warning<
3025  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
3026  InGroup<IgnoredAttributes>;
3027def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
3028def err_attribute_integers_only : Error<
3029  "%0 attribute argument may only refer to a function parameter of integer "
3030  "type">;
3031def warn_attribute_return_pointers_only : Warning<
3032  "%0 attribute only applies to return values that are pointers">,
3033  InGroup<IgnoredAttributes>;
3034def warn_attribute_return_pointers_refs_only : Warning<
3035  "%0 attribute only applies to return values that are pointers or references">,
3036  InGroup<IgnoredAttributes>;
3037def warn_attribute_pointer_or_reference_only : Warning<
3038  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
3039  InGroup<IgnoredAttributes>;
3040def err_attribute_no_member_pointers : Error<
3041  "%0 attribute cannot be used with pointers to members">;
3042def err_attribute_invalid_implicit_this_argument : Error<
3043  "%0 attribute is invalid for the implicit this argument">;
3044def err_ownership_type : Error<
3045  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
3046def err_ownership_returns_index_mismatch : Error<
3047  "'ownership_returns' attribute index does not match; here it is %0">;
3048def note_ownership_returns_index_mismatch : Note<
3049  "declared with index %0 here">;
3050def err_format_strftime_third_parameter : Error<
3051  "strftime format attribute requires 3rd parameter to be 0">;
3052def err_format_attribute_requires_variadic : Error<
3053  "format attribute requires variadic function">;
3054def err_format_attribute_not : Error<"format argument not %0">;
3055def err_format_attribute_result_not : Error<"function does not return %0">;
3056def err_format_attribute_implicit_this_format_string : Error<
3057  "format attribute cannot specify the implicit this argument as the format "
3058  "string">;
3059def err_callback_attribute_no_callee : Error<
3060  "'callback' attribute specifies no callback callee">;
3061def err_callback_attribute_invalid_callee : Error<
3062  "'callback' attribute specifies invalid callback callee">;
3063def err_callback_attribute_multiple : Error<
3064  "multiple 'callback' attributes specified">;
3065def err_callback_attribute_argument_unknown : Error<
3066  "'callback' attribute argument %0 is not a known function parameter">;
3067def err_callback_callee_no_function_type : Error<
3068  "'callback' attribute callee does not have function type">;
3069def err_callback_callee_is_variadic : Error<
3070  "'callback' attribute callee may not be variadic">;
3071def err_callback_implicit_this_not_available : Error<
3072  "'callback' argument at position %0 references unavailable implicit 'this'">;
3073def err_init_method_bad_return_type : Error<
3074  "init methods must return an object pointer type, not %0">;
3075def err_attribute_invalid_size : Error<
3076  "vector size not an integral multiple of component size">;
3077def err_attribute_zero_size : Error<"zero %0 size">;
3078def err_attribute_size_too_large : Error<"%0 size too large">;
3079def err_typecheck_sve_ambiguous : Error<
3080  "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">;
3081def err_typecheck_sve_gnu_ambiguous : Error<
3082  "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">;
3083def err_typecheck_vector_not_convertable_implict_truncation : Error<
3084   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
3085   " %2 as implicit conversion would cause truncation">;
3086def err_typecheck_vector_not_convertable : Error<
3087  "cannot convert between vector values of different size (%0 and %1)">;
3088def err_typecheck_vector_not_convertable_non_scalar : Error<
3089  "cannot convert between vector and non-scalar values (%0 and %1)">;
3090def err_typecheck_vector_lengths_not_equal : Error<
3091  "vector operands do not have the same number of elements (%0 and %1)">;
3092def warn_typecheck_vector_element_sizes_not_equal : Warning<
3093  "vector operands do not have the same elements sizes (%0 and %1)">,
3094  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
3095def err_ext_vector_component_exceeds_length : Error<
3096  "vector component access exceeds type %0">;
3097def err_ext_vector_component_name_illegal : Error<
3098  "illegal vector component name '%0'">;
3099def err_attribute_address_space_negative : Error<
3100  "address space is negative">;
3101def err_attribute_address_space_too_high : Error<
3102  "address space is larger than the maximum supported (%0)">;
3103def err_attribute_address_multiple_qualifiers : Error<
3104  "multiple address spaces specified for type">;
3105def warn_attribute_address_multiple_identical_qualifiers : Warning<
3106  "multiple identical address spaces specified for type">,
3107  InGroup<DuplicateDeclSpecifier>;
3108def err_attribute_not_clinkage : Error<
3109  "function type with %0 attribute must have C linkage">;
3110def err_function_decl_cmse_ns_call : Error<
3111  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
3112def err_attribute_address_function_type : Error<
3113  "function type may not be qualified with an address space">;
3114def err_as_qualified_auto_decl : Error<
3115  "automatic variable qualified with an%select{| invalid}0 address space">;
3116def err_arg_with_address_space : Error<
3117  "parameter may not be qualified with an address space">;
3118def err_field_with_address_space : Error<
3119  "field may not be qualified with an address space">;
3120def err_compound_literal_with_address_space : Error<
3121  "compound literal in function scope may not be qualified with an address space">;
3122def err_address_space_mismatch_templ_inst : Error<
3123  "conflicting address space qualifiers are provided between types %0 and %1">;
3124def err_attr_objc_ownership_redundant : Error<
3125  "the type %0 is already explicitly ownership-qualified">;
3126def err_invalid_nsnumber_type : Error<
3127  "%0 is not a valid literal type for NSNumber">;
3128def err_objc_illegal_boxed_expression_type : Error<
3129  "illegal type %0 used in a boxed expression">;
3130def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3131  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3132def err_objc_incomplete_boxed_expression_type : Error<
3133  "incomplete type %0 used in a boxed expression">;
3134def err_undeclared_objc_literal_class : Error<
3135  "definition of class %0 must be available to use Objective-C "
3136  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3137  "string literals}1">;
3138def err_undeclared_boxing_method : Error<
3139  "declaration of %0 is missing in %1 class">;
3140def err_objc_literal_method_sig : Error<
3141  "literal construction method %0 has incompatible signature">;
3142def note_objc_literal_method_param : Note<
3143  "%select{first|second|third}0 parameter has unexpected type %1 "
3144  "(should be %2)">;
3145def note_objc_literal_method_return : Note<
3146  "method returns unexpected type %0 (should be an object type)">;
3147def err_invalid_collection_element : Error<
3148  "collection element of type %0 is not an Objective-C object">;
3149def err_box_literal_collection : Error<
3150  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3151  "in a collection">;
3152def warn_objc_literal_comparison : Warning<
3153  "direct comparison of %select{an array literal|a dictionary literal|"
3154  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3155  InGroup<ObjCLiteralComparison>;
3156def err_missing_atsign_prefix : Error<
3157  "%select{string|numeric}0 literal must be prefixed by '@'">;
3158def warn_objc_string_literal_comparison : Warning<
3159  "direct comparison of a string literal has undefined behavior">,
3160  InGroup<ObjCStringComparison>;
3161def warn_concatenated_literal_array_init : Warning<
3162  "suspicious concatenation of string literals in an array initialization; "
3163  "did you mean to separate the elements with a comma?">,
3164  InGroup<StringConcatation>, DefaultIgnore;
3165def warn_concatenated_nsarray_literal : Warning<
3166  "concatenated NSString literal for an NSArray expression - "
3167  "possibly missing a comma">,
3168  InGroup<ObjCStringConcatenation>;
3169def note_objc_literal_comparison_isequal : Note<
3170  "use 'isEqual:' instead">;
3171def warn_objc_collection_literal_element : Warning<
3172  "object of type %0 is not compatible with "
3173  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3174  InGroup<ObjCLiteralConversion>;
3175def warn_nsdictionary_duplicate_key : Warning<
3176  "duplicate key in dictionary literal">,
3177  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3178def note_nsdictionary_duplicate_key_here : Note<
3179  "previous equal key is here">;
3180def err_swift_param_attr_not_swiftcall : Error<
3181  "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 "
3182  "calling convention%select{|s}1">;
3183def err_swift_indirect_result_not_first : Error<
3184  "'swift_indirect_result' parameters must be first parameters of function">;
3185def err_swift_error_result_not_after_swift_context : Error<
3186  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3187def err_swift_abi_parameter_wrong_type : Error<
3188  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3189  "type here is %2">;
3190
3191def err_attribute_argument_invalid : Error<
3192  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3193  "min must not be greater than max}1">;
3194def err_attribute_argument_is_zero : Error<
3195  "%0 attribute must be greater than 0">;
3196def warn_attribute_argument_n_negative : Warning<
3197  "%0 attribute parameter %1 is negative and will be ignored">,
3198  InGroup<CudaCompat>;
3199def err_property_function_in_objc_container : Error<
3200  "use of Objective-C property in function nested in Objective-C "
3201  "container not supported, move function outside its container">;
3202
3203let CategoryName = "Cocoa API Issue" in {
3204def warn_objc_redundant_literal_use : Warning<
3205  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3206}
3207
3208def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3209  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3210
3211def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
3212
3213def err_tls_var_aligned_over_maximum : Error<
3214  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3215  "alignment (%2) for a thread-local variable on this target">;
3216
3217def err_only_annotate_after_access_spec : Error<
3218  "access specifier can only have annotation attributes">;
3219
3220def err_attribute_section_invalid_for_target : Error<
3221  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3222def err_pragma_section_invalid_for_target : Error<
3223  "argument to #pragma section is not valid for this target: %0">;
3224def warn_attribute_section_drectve : Warning<
3225  "#pragma %0(\".drectve\") has undefined behavior, "
3226  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3227def warn_mismatched_section : Warning<
3228  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3229def warn_attribute_section_on_redeclaration : Warning<
3230  "section attribute is specified on redeclared variable">, InGroup<Section>;
3231def err_mismatched_code_seg_base : Error<
3232  "derived class must specify the same code segment as its base classes">;
3233def err_mismatched_code_seg_override : Error<
3234  "overriding virtual function must specify the same code segment as its overridden function">;
3235def err_conflicting_codeseg_attribute : Error<
3236  "conflicting code segment specifiers">;
3237def warn_duplicate_codeseg_attribute : Warning<
3238  "duplicate code segment specifiers">, InGroup<Section>;
3239
3240def err_anonymous_property: Error<
3241  "anonymous property is not supported">;
3242def err_property_is_variably_modified : Error<
3243  "property %0 has a variably modified type">;
3244def err_no_accessor_for_property : Error<
3245  "no %select{getter|setter}0 defined for property %1">;
3246def err_cannot_find_suitable_accessor : Error<
3247  "cannot find suitable %select{getter|setter}0 for property %1">;
3248
3249def warn_alloca : Warning<
3250  "use of function %0 is discouraged; there is no way to check for failure but "
3251  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3252  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3253
3254def warn_alloca_align_alignof : Warning<
3255  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3256  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3257
3258def err_alignment_too_small : Error<
3259  "requested alignment must be %0 or greater">;
3260def err_alignment_too_big : Error<
3261  "requested alignment must be %0 or smaller">;
3262def err_alignment_not_power_of_two : Error<
3263  "requested alignment is not a power of 2">;
3264def warn_alignment_not_power_of_two : Warning<
3265  err_alignment_not_power_of_two.Text>,
3266  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3267def err_alignment_dependent_typedef_name : Error<
3268  "requested alignment is dependent but declaration is not dependent">;
3269
3270def warn_alignment_builtin_useless : Warning<
3271  "%select{aligning a value|the result of checking whether a value is aligned}0"
3272  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3273def err_attribute_aligned_too_great : Error<
3274  "requested alignment must be %0 bytes or smaller">;
3275def warn_assume_aligned_too_great
3276    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3277              "alignment assumed">,
3278      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3279def warn_not_xl_compatible
3280    : Warning<"requesting an alignment of 16 bytes or greater for struct"
3281              " members is not binary compatible with AIX XL 16.1 and older">,
3282      InGroup<AIXCompat>;
3283def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3284  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3285  InGroup<MicrosoftInconsistentDllImport>;
3286def warn_redeclaration_without_import_attribute : Warning<
3287  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3288  InGroup<MicrosoftInconsistentDllImport>;
3289def warn_dllimport_dropped_from_inline_function : Warning<
3290  "%q0 redeclared inline; %1 attribute ignored">,
3291  InGroup<IgnoredAttributes>;
3292def warn_attribute_ignored : Warning<"%0 attribute ignored">,
3293  InGroup<IgnoredAttributes>;
3294def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3295  " exception specification; attribute ignored">,
3296  InGroup<IgnoredAttributes>;
3297def warn_attribute_ignored_on_non_definition :
3298  Warning<"%0 attribute ignored on a non-definition declaration">,
3299  InGroup<IgnoredAttributes>;
3300def warn_attribute_ignored_on_inline :
3301  Warning<"%0 attribute ignored on inline function">,
3302  InGroup<IgnoredAttributes>;
3303def warn_nocf_check_attribute_ignored :
3304  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3305  InGroup<IgnoredAttributes>;
3306def warn_attribute_after_definition_ignored : Warning<
3307  "attribute %0 after definition is ignored">,
3308   InGroup<IgnoredAttributes>;
3309def warn_attributes_likelihood_ifstmt_conflict
3310    : Warning<"conflicting attributes %0 are ignored">,
3311      InGroup<IgnoredAttributes>;
3312def warn_cxx11_gnu_attribute_on_type : Warning<
3313  "attribute %0 ignored, because it cannot be applied to a type">,
3314  InGroup<IgnoredAttributes>;
3315def warn_unhandled_ms_attribute_ignored : Warning<
3316  "__declspec attribute %0 is not supported">,
3317  InGroup<IgnoredAttributes>;
3318def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3319  "attribute %0 has no effect when annotating an infinite loop">,
3320   InGroup<IgnoredAttributes>;
3321def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3322  "annotating the infinite loop here">;
3323def warn_attribute_has_no_effect_on_compile_time_if : Warning<
3324  "attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">,
3325   InGroup<IgnoredAttributes>;
3326def note_attribute_has_no_effect_on_compile_time_if_here : Note<
3327  "annotating the 'if %select{constexpr|consteval}0' statement here">;
3328def err_decl_attribute_invalid_on_stmt : Error<
3329  "%0 attribute cannot be applied to a statement">;
3330def err_stmt_attribute_invalid_on_decl : Error<
3331  "%0 attribute cannot be applied to a declaration">;
3332def warn_declspec_attribute_ignored : Warning<
3333  "attribute %0 is ignored, place it after "
3334  "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
3335  "type declaration">, InGroup<IgnoredAttributes>;
3336def warn_attribute_precede_definition : Warning<
3337  "attribute declaration must precede definition">,
3338  InGroup<IgnoredAttributes>;
3339def warn_attribute_void_function_method : Warning<
3340  "attribute %0 cannot be applied to "
3341  "%select{functions|Objective-C method}1 without return value">,
3342  InGroup<IgnoredAttributes>;
3343def warn_attribute_weak_on_field : Warning<
3344  "__weak attribute cannot be specified on a field declaration">,
3345  InGroup<IgnoredAttributes>;
3346def warn_gc_attribute_weak_on_local : Warning<
3347  "Objective-C GC does not allow weak variables on the stack">,
3348  InGroup<IgnoredAttributes>;
3349def warn_nsobject_attribute : Warning<
3350  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3351  InGroup<NSobjectAttribute>;
3352def warn_independentclass_attribute : Warning<
3353  "'objc_independent_class' attribute may be put on a typedef only; "
3354  "attribute is ignored">,
3355  InGroup<IndependentClassAttribute>;
3356def warn_ptr_independentclass_attribute : Warning<
3357  "'objc_independent_class' attribute may be put on Objective-C object "
3358  "pointer type only; attribute is ignored">,
3359  InGroup<IndependentClassAttribute>;
3360def warn_attribute_weak_on_local : Warning<
3361  "__weak attribute cannot be specified on an automatic variable when ARC "
3362  "is not enabled">,
3363  InGroup<IgnoredAttributes>;
3364def warn_weak_identifier_undeclared : Warning<
3365  "weak identifier %0 never declared">;
3366def warn_attribute_cmse_entry_static : Warning<
3367  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3368  InGroup<IgnoredAttributes>;
3369def warn_cmse_nonsecure_union : Warning<
3370  "passing union across security boundary via %select{parameter %1|return value}0 "
3371  "may leak information">,
3372  InGroup<DiagGroup<"cmse-union-leak">>;
3373def err_attribute_weak_static : Error<
3374  "weak declaration cannot have internal linkage">;
3375def err_attribute_selectany_non_extern_data : Error<
3376  "'selectany' can only be applied to data items with external linkage">;
3377def err_declspec_thread_on_thread_variable : Error<
3378  "'__declspec(thread)' applied to variable that already has a "
3379  "thread-local storage specifier">;
3380def err_attribute_dll_not_extern : Error<
3381  "%q0 must have external linkage when declared %q1">;
3382def err_attribute_dll_thread_local : Error<
3383  "%q0 cannot be thread local when declared %q1">;
3384def err_attribute_dll_lambda : Error<
3385  "lambda cannot be declared %0">;
3386def warn_attribute_invalid_on_definition : Warning<
3387  "'%0' attribute cannot be specified on a definition">,
3388  InGroup<IgnoredAttributes>;
3389def err_attribute_dll_redeclaration : Error<
3390  "redeclaration of %q0 cannot add %q1 attribute">;
3391def warn_attribute_dll_redeclaration : Warning<
3392  "redeclaration of %q0 should not add %q1 attribute">,
3393  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3394def err_attribute_dllimport_function_definition : Error<
3395  "dllimport cannot be applied to non-inline function definition">;
3396def err_attribute_dll_deleted : Error<
3397  "attribute %q0 cannot be applied to a deleted function">;
3398def err_attribute_dllimport_data_definition : Error<
3399  "definition of dllimport data">;
3400def err_attribute_dllimport_static_field_definition : Error<
3401  "definition of dllimport static field not allowed">;
3402def warn_attribute_dllimport_static_field_definition : Warning<
3403  "definition of dllimport static field">,
3404  InGroup<DiagGroup<"dllimport-static-field-def">>;
3405def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3406  "explicit instantiation declaration should not be 'dllexport'">,
3407  InGroup<DllexportExplicitInstantiationDecl>;
3408def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3409  "'dllexport' attribute ignored on explicit instantiation definition">,
3410  InGroup<IgnoredAttributes>;
3411def warn_invalid_initializer_from_system_header : Warning<
3412  "invalid constructor from class in system header, should not be explicit">,
3413  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3414def note_used_in_initialization_here : Note<"used in initialization here">;
3415def err_attribute_dll_member_of_dll_class : Error<
3416  "attribute %q0 cannot be applied to member of %q1 class">;
3417def warn_attribute_dll_instantiated_base_class : Warning<
3418  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3419  "base class template without dll attribute is not supported">,
3420  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3421def err_attribute_dll_ambiguous_default_ctor : Error<
3422  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3423def err_attribute_weakref_not_static : Error<
3424  "weakref declaration must have internal linkage">;
3425def err_attribute_weakref_not_global_context : Error<
3426  "weakref declaration of %0 must be in a global context">;
3427def err_attribute_weakref_without_alias : Error<
3428  "weakref declaration of %0 must also have an alias attribute">;
3429def err_alias_not_supported_on_darwin : Error <
3430  "aliases are not supported on darwin">;
3431def warn_attribute_wrong_decl_type_str : Warning<
3432  "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
3433def err_attribute_wrong_decl_type_str : Error<
3434  warn_attribute_wrong_decl_type_str.Text>;
3435def warn_attribute_wrong_decl_type : Warning<
3436  "%0 attribute only applies to %select{"
3437  "functions"
3438  "|unions"
3439  "|variables and functions"
3440  "|functions and methods"
3441  "|functions, methods and blocks"
3442  "|functions, methods, and parameters"
3443  "|variables"
3444  "|variables and fields"
3445  "|variables, data members and tag types"
3446  "|types and namespaces"
3447  "|variables, functions and classes"
3448  "|kernel functions"
3449  "|non-K&R-style functions}1">,
3450  InGroup<IgnoredAttributes>;
3451def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
3452def warn_type_attribute_wrong_type : Warning<
3453  "'%0' only applies to %select{function|pointer|"
3454  "Objective-C object or block pointer}1 types; type here is %2">,
3455  InGroup<IgnoredAttributes>;
3456def warn_incomplete_encoded_type : Warning<
3457  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3458  InGroup<DiagGroup<"encode-type">>;
3459def warn_gnu_inline_attribute_requires_inline : Warning<
3460  "'gnu_inline' attribute requires function to be marked 'inline',"
3461  " attribute ignored">,
3462  InGroup<IgnoredAttributes>;
3463def warn_gnu_inline_cplusplus_without_extern : Warning<
3464  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3465  " available, this changed in Clang 10">,
3466  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3467def err_attribute_vecreturn_only_vector_member : Error<
3468  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3469def err_attribute_vecreturn_only_pod_record : Error<
3470  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3471def err_cconv_change : Error<
3472  "function declared '%0' here was previously declared "
3473  "%select{'%2'|without calling convention}1">;
3474def warn_cconv_unsupported : Warning<
3475  "%0 calling convention is not supported %select{"
3476  // Use CallingConventionIgnoredReason Enum to specify these.
3477  "for this target"
3478  "|on variadic function"
3479  "|on constructor/destructor"
3480  "|on builtin function"
3481  "}1">,
3482  InGroup<IgnoredAttributes>;
3483def error_cconv_unsupported : Error<warn_cconv_unsupported.Text>;
3484def err_cconv_knr : Error<
3485  "function with no prototype cannot use the %0 calling convention">;
3486def warn_cconv_knr : Warning<
3487  err_cconv_knr.Text>,
3488  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3489def err_cconv_varargs : Error<
3490  "variadic function cannot use %0 calling convention">;
3491def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3492  "attribute was previously declared "
3493  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3494def err_function_attribute_mismatch : Error<
3495  "function declared with %0 attribute "
3496  "was previously declared without the %0 attribute">;
3497def err_objc_precise_lifetime_bad_type : Error<
3498  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3499def warn_objc_precise_lifetime_meaningless : Error<
3500  "objc_precise_lifetime is not meaningful for "
3501  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3502def err_invalid_pcs : Error<"invalid PCS type">;
3503def warn_attribute_not_on_decl : Warning<
3504  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3505def err_base_specifier_attribute : Error<
3506  "%0 attribute cannot be applied to a base specifier">;
3507def err_invalid_attribute_on_virtual_function : Error<
3508  "%0 attribute cannot be applied to virtual functions">;
3509def warn_declspec_allocator_nonpointer : Warning<
3510  "ignoring __declspec(allocator) because the function return type %0 is not "
3511  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3512def err_cconv_incomplete_param_type : Error<
3513  "parameter %0 must have a complete type to use function %1 with the %2 "
3514  "calling convention">;
3515def err_attribute_output_parameter : Error<
3516  "attribute only applies to output parameters">;
3517
3518def ext_cannot_use_trivial_abi : ExtWarn<
3519  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3520def note_cannot_use_trivial_abi_reason : Note<
3521  "'trivial_abi' is disallowed on %0 because %select{"
3522  "its copy constructors and move constructors are all deleted|"
3523  "it is polymorphic|"
3524  "it has a base of a non-trivial class type|it has a virtual base|"
3525  "it has a __weak field|it has a field of a non-trivial class type}1">;
3526
3527// Availability attribute
3528def warn_availability_unknown_platform : Warning<
3529  "unknown platform %0 in availability macro">, InGroup<Availability>;
3530def warn_availability_version_ordering : Warning<
3531  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3532  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3533  "attribute ignored">, InGroup<Availability>;
3534def warn_mismatched_availability: Warning<
3535  "availability does not match previous declaration">, InGroup<Availability>;
3536def warn_mismatched_availability_override : Warning<
3537  "%select{|overriding }4method %select{introduced after|"
3538  "deprecated before|obsoleted before}0 "
3539  "%select{the protocol method it implements|overridden method}4 "
3540  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3541def warn_mismatched_availability_override_unavail : Warning<
3542  "%select{|overriding }1method cannot be unavailable on %0 when "
3543  "%select{the protocol method it implements|its overridden method}1 is "
3544  "available">,
3545  InGroup<Availability>;
3546def warn_availability_on_static_initializer : Warning<
3547  "ignoring availability attribute %select{on '+load' method|"
3548  "with constructor attribute|with destructor attribute}0">,
3549  InGroup<Availability>;
3550def note_overridden_method : Note<
3551  "overridden method is here">;
3552def warn_availability_swift_unavailable_deprecated_only : Warning<
3553  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3554  InGroup<Availability>;
3555def note_protocol_method : Note<
3556  "protocol method is here">;
3557def warn_availability_fuchsia_unavailable_minor : Warning<
3558  "Fuchsia API Level prohibits specifying a minor or sub-minor version">,
3559  InGroup<Availability>;
3560
3561def warn_unguarded_availability :
3562  Warning<"%0 is only available on %1 %2 or newer">,
3563  InGroup<UnguardedAvailability>, DefaultIgnore;
3564def warn_unguarded_availability_new :
3565  Warning<warn_unguarded_availability.Text>,
3566  InGroup<UnguardedAvailabilityNew>;
3567def note_decl_unguarded_availability_silence : Note<
3568  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3569def note_unguarded_available_silence : Note<
3570  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3571  " this warning">;
3572def warn_at_available_unchecked_use : Warning<
3573  "%select{@available|__builtin_available}0 does not guard availability here; "
3574  "use if (%select{@available|__builtin_available}0) instead">,
3575  InGroup<DiagGroup<"unsupported-availability-guard">>;
3576
3577def warn_missing_sdksettings_for_availability_checking : Warning<
3578  "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
3579  InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
3580
3581// Thread Safety Attributes
3582def warn_thread_attribute_ignored : Warning<
3583  "ignoring %0 attribute because its argument is invalid">,
3584  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3585def warn_thread_attribute_not_on_non_static_member : Warning<
3586  "%0 attribute without capability arguments can only be applied to non-static "
3587  "methods of a class">,
3588  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3589def warn_thread_attribute_not_on_capability_member : Warning<
3590  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3591  "annotated with 'capability' or 'scoped_lockable' attribute">,
3592  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3593def warn_thread_attribute_argument_not_lockable : Warning<
3594  "%0 attribute requires arguments whose type is annotated "
3595  "with 'capability' attribute; type here is %1">,
3596  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3597def warn_thread_attribute_decl_not_lockable : Warning<
3598  "%0 attribute can only be applied in a context annotated "
3599  "with 'capability' attribute">,
3600  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3601def warn_thread_attribute_decl_not_pointer : Warning<
3602  "%0 only applies to pointer types; type here is %1">,
3603  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3604def err_attribute_argument_out_of_bounds_extra_info : Error<
3605  "%0 attribute parameter %1 is out of bounds: "
3606  "%plural{0:no parameters to index into|"
3607  "1:can only be 1, since there is one parameter|"
3608  ":must be between 1 and %2}2">;
3609
3610// Thread Safety Analysis
3611def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3612  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3613def warn_unlock_kind_mismatch : Warning<
3614  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3615  "%select{shared|exclusive}3 access">,
3616  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3617def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3618  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3619def warn_no_unlock : Warning<
3620  "%0 '%1' is still held at the end of function">,
3621  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3622def warn_expecting_locked : Warning<
3623  "expecting %0 '%1' to be held at the end of function">,
3624  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3625// FIXME: improve the error message about locks not in scope
3626def warn_lock_some_predecessors : Warning<
3627  "%0 '%1' is not held on every path through here">,
3628  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3629def warn_expecting_lock_held_on_loop : Warning<
3630  "expecting %0 '%1' to be held at start of each loop">,
3631  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3632def note_locked_here : Note<"%0 acquired here">;
3633def note_unlocked_here : Note<"%0 released here">;
3634def warn_lock_exclusive_and_shared : Warning<
3635  "%0 '%1' is acquired exclusively and shared in the same scope">,
3636  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3637def note_lock_exclusive_and_shared : Note<
3638  "the other acquisition of %0 '%1' is here">;
3639def warn_variable_requires_any_lock : Warning<
3640  "%select{reading|writing}1 variable %0 requires holding "
3641  "%select{any mutex|any mutex exclusively}1">,
3642  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3643def warn_var_deref_requires_any_lock : Warning<
3644  "%select{reading|writing}1 the value pointed to by %0 requires holding "
3645  "%select{any mutex|any mutex exclusively}1">,
3646  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3647def warn_fun_excludes_mutex : Warning<
3648  "cannot call function '%1' while %0 '%2' is held">,
3649  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3650def warn_cannot_resolve_lock : Warning<
3651  "cannot resolve lock expression">,
3652  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3653def warn_acquired_before : Warning<
3654  "%0 '%1' must be acquired before '%2'">,
3655  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3656def warn_acquired_before_after_cycle : Warning<
3657  "Cycle in acquired_before/after dependencies, starting with '%0'">,
3658  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3659
3660
3661// Thread safety warnings negative capabilities
3662def warn_acquire_requires_negative_cap : Warning<
3663  "acquiring %0 '%1' requires negative capability '%2'">,
3664  InGroup<ThreadSafetyNegative>, DefaultIgnore;
3665def warn_fun_requires_negative_cap : Warning<
3666  "calling function %0 requires negative capability '%1'">,
3667  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3668
3669// Thread safety warnings on pass by reference
3670def warn_guarded_pass_by_reference : Warning<
3671  "passing variable %1 by reference requires holding %0 "
3672  "%select{'%2'|'%2' exclusively}3">,
3673  InGroup<ThreadSafetyReference>, DefaultIgnore;
3674def warn_pt_guarded_pass_by_reference : Warning<
3675  "passing the value that %1 points to by reference requires holding %0 "
3676  "%select{'%2'|'%2' exclusively}3">,
3677  InGroup<ThreadSafetyReference>, DefaultIgnore;
3678
3679// Imprecise thread safety warnings
3680def warn_variable_requires_lock : Warning<
3681  "%select{reading|writing}3 variable %1 requires holding %0 "
3682  "%select{'%2'|'%2' exclusively}3">,
3683  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3684def warn_var_deref_requires_lock : Warning<
3685  "%select{reading|writing}3 the value pointed to by %1 requires "
3686  "holding %0 %select{'%2'|'%2' exclusively}3">,
3687  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3688def warn_fun_requires_lock : Warning<
3689  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3690  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3691
3692// Precise thread safety warnings
3693def warn_variable_requires_lock_precise :
3694  Warning<warn_variable_requires_lock.Text>,
3695  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3696def warn_var_deref_requires_lock_precise :
3697  Warning<warn_var_deref_requires_lock.Text>,
3698  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3699def warn_fun_requires_lock_precise :
3700  Warning<warn_fun_requires_lock.Text>,
3701  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3702def note_found_mutex_near_match : Note<"found near match '%0'">;
3703
3704// Verbose thread safety warnings
3705def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
3706  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3707def note_thread_warning_in_fun : Note<"thread warning in function %0">;
3708def note_guarded_by_declared_here : Note<"guarded_by declared here">;
3709
3710// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3711def warn_thread_safety_beta : Warning<"thread safety beta warning">,
3712  InGroup<ThreadSafetyBeta>, DefaultIgnore;
3713
3714// Consumed warnings
3715def warn_use_in_invalid_state : Warning<
3716  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3717  "state">, InGroup<Consumed>, DefaultIgnore;
3718def warn_use_of_temp_in_invalid_state : Warning<
3719  "invalid invocation of method '%0' on a temporary object while it is in the "
3720  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3721def warn_attr_on_unconsumable_class : Warning<
3722  "consumed analysis attribute is attached to member of class %0 which isn't "
3723  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3724def warn_return_typestate_for_unconsumable_type : Warning<
3725  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3726  DefaultIgnore;
3727def warn_return_typestate_mismatch : Warning<
3728  "return value not in expected state; expected '%0', observed '%1'">,
3729  InGroup<Consumed>, DefaultIgnore;
3730def warn_loop_state_mismatch : Warning<
3731  "state of variable '%0' must match at the entry and exit of loop">,
3732  InGroup<Consumed>, DefaultIgnore;
3733def warn_param_return_typestate_mismatch : Warning<
3734  "parameter '%0' not in expected state when the function returns: expected "
3735  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3736def warn_param_typestate_mismatch : Warning<
3737  "argument not in expected state; expected '%0', observed '%1'">,
3738  InGroup<Consumed>, DefaultIgnore;
3739
3740// no_sanitize attribute
3741def warn_unknown_sanitizer_ignored : Warning<
3742  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3743
3744def warn_impcast_vector_scalar : Warning<
3745  "implicit conversion turns vector to scalar: %0 to %1">,
3746  InGroup<Conversion>, DefaultIgnore;
3747def warn_impcast_complex_scalar : Warning<
3748  "implicit conversion discards imaginary component: %0 to %1">,
3749  InGroup<Conversion>, DefaultIgnore;
3750def err_impcast_complex_scalar : Error<
3751  "implicit conversion from %0 to %1 is not permitted in C++">;
3752def warn_impcast_float_precision : Warning<
3753  "implicit conversion loses floating-point precision: %0 to %1">,
3754  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3755def warn_impcast_float_result_precision : Warning<
3756  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3757  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3758def warn_impcast_double_promotion : Warning<
3759  "implicit conversion increases floating-point precision: %0 to %1">,
3760  InGroup<DoublePromotion>, DefaultIgnore;
3761def warn_impcast_integer_sign : Warning<
3762  "implicit conversion changes signedness: %0 to %1">,
3763  InGroup<SignConversion>, DefaultIgnore;
3764def warn_impcast_integer_sign_conditional : Warning<
3765  "operand of ? changes signedness: %0 to %1">,
3766  InGroup<SignConversion>, DefaultIgnore;
3767def warn_impcast_integer_precision : Warning<
3768  "implicit conversion loses integer precision: %0 to %1">,
3769  InGroup<ImplicitIntConversion>, DefaultIgnore;
3770def warn_impcast_high_order_zero_bits : Warning<
3771  "higher order bits are zeroes after implicit conversion">,
3772  InGroup<ImplicitIntConversion>, DefaultIgnore;
3773def warn_impcast_nonnegative_result : Warning<
3774  "the resulting value is always non-negative after implicit conversion">,
3775  InGroup<SignConversion>, DefaultIgnore;
3776def warn_impcast_integer_64_32 : Warning<
3777  "implicit conversion loses integer precision: %0 to %1">,
3778  InGroup<Shorten64To32>, DefaultIgnore;
3779def warn_impcast_integer_precision_constant : Warning<
3780  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3781  InGroup<ConstantConversion>;
3782def warn_impcast_bitfield_precision_constant : Warning<
3783  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3784  InGroup<BitFieldConstantConversion>;
3785def warn_impcast_constant_value_to_objc_bool : Warning<
3786  "implicit conversion from constant value %0 to 'BOOL'; "
3787  "the only well defined values for 'BOOL' are YES and NO">,
3788  InGroup<ObjCBoolConstantConversion>;
3789
3790def warn_impcast_fixed_point_range : Warning<
3791  "implicit conversion from %0 cannot fit within the range of values for %1">,
3792  InGroup<ImplicitFixedPointConversion>;
3793
3794def warn_impcast_literal_float_to_integer : Warning<
3795  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3796  InGroup<LiteralConversion>;
3797def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3798  "implicit conversion of out of range value from %0 to %1 is undefined">,
3799  InGroup<LiteralConversion>;
3800def warn_impcast_float_integer : Warning<
3801  "implicit conversion turns floating-point number into integer: %0 to %1">,
3802  InGroup<FloatConversion>, DefaultIgnore;
3803def warn_impcast_float_to_objc_signed_char_bool : Warning<
3804  "implicit conversion from floating-point type %0 to 'BOOL'">,
3805  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
3806def warn_impcast_int_to_objc_signed_char_bool : Warning<
3807  "implicit conversion from integral type %0 to 'BOOL'">,
3808  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
3809
3810// Implicit int -> float conversion precision loss warnings.
3811def warn_impcast_integer_float_precision : Warning<
3812  "implicit conversion from %0 to %1 may lose precision">,
3813  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
3814def warn_impcast_integer_float_precision_constant : Warning<
3815  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3816  InGroup<ImplicitConstIntFloatConversion>;
3817
3818def warn_impcast_float_to_integer : Warning<
3819  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3820  InGroup<FloatOverflowConversion>, DefaultIgnore;
3821def warn_impcast_float_to_integer_out_of_range : Warning<
3822  "implicit conversion of out of range value from %0 to %1 is undefined">,
3823  InGroup<FloatOverflowConversion>, DefaultIgnore;
3824def warn_impcast_float_to_integer_zero : Warning<
3825  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3826  InGroup<FloatZeroConversion>, DefaultIgnore;
3827
3828def warn_impcast_string_literal_to_bool : Warning<
3829  "implicit conversion turns string literal into bool: %0 to %1">,
3830  InGroup<StringConversion>, DefaultIgnore;
3831def warn_impcast_different_enum_types : Warning<
3832  "implicit conversion from enumeration type %0 to different enumeration type "
3833  "%1">, InGroup<EnumConversion>;
3834def warn_impcast_bool_to_null_pointer : Warning<
3835    "initialization of pointer of type %0 to null from a constant boolean "
3836    "expression">, InGroup<BoolConversion>;
3837def warn_non_literal_null_pointer : Warning<
3838    "expression which evaluates to zero treated as a null pointer constant of "
3839    "type %0">, InGroup<NonLiteralNullConversion>;
3840def warn_pointer_compare : Warning<
3841    "comparing a pointer to a null character constant; did you mean "
3842    "to compare to %select{NULL|(void *)0}0?">,
3843    InGroup<DiagGroup<"pointer-compare">>;
3844def warn_impcast_null_pointer_to_integer : Warning<
3845    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3846    InGroup<NullConversion>;
3847def warn_impcast_floating_point_to_bool : Warning<
3848    "implicit conversion turns floating-point number into bool: %0 to %1">,
3849    InGroup<ImplicitConversionFloatingPointToBool>;
3850def ext_ms_impcast_fn_obj : ExtWarn<
3851  "implicit conversion between pointer-to-function and pointer-to-object is a "
3852  "Microsoft extension">, InGroup<MicrosoftCast>;
3853
3854def warn_impcast_pointer_to_bool : Warning<
3855    "address of%select{| function| array}0 '%1' will always evaluate to "
3856    "'true'">,
3857    InGroup<PointerBoolConversion>;
3858def warn_cast_nonnull_to_bool : Warning<
3859    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3860    "'true' on first encounter">,
3861    InGroup<PointerBoolConversion>;
3862def warn_this_bool_conversion : Warning<
3863  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3864  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3865def warn_address_of_reference_bool_conversion : Warning<
3866  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3867  "code; pointer may be assumed to always convert to true">,
3868  InGroup<UndefinedBoolConversion>;
3869
3870def warn_xor_used_as_pow : Warning<
3871  "result of '%0' is %1; did you mean exponentiation?">,
3872  InGroup<XorUsedAsPow>;
3873def warn_xor_used_as_pow_base_extra : Warning<
3874  "result of '%0' is %1; did you mean '%2' (%3)?">,
3875  InGroup<XorUsedAsPow>;
3876def warn_xor_used_as_pow_base : Warning<
3877  "result of '%0' is %1; did you mean '%2'?">,
3878  InGroup<XorUsedAsPow>;
3879def note_xor_used_as_pow_silence : Note<
3880  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
3881
3882def warn_null_pointer_compare : Warning<
3883    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3884    "equal to a null pointer is always %select{true|false}2">,
3885    InGroup<TautologicalPointerCompare>;
3886def warn_nonnull_expr_compare : Warning<
3887    "comparison of nonnull %select{function call|parameter}0 '%1' "
3888    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3889    "encounter">,
3890    InGroup<TautologicalPointerCompare>;
3891def warn_this_null_compare : Warning<
3892  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3893  "assumed to always evaluate to %select{true|false}0">,
3894  InGroup<TautologicalUndefinedCompare>;
3895def warn_address_of_reference_null_compare : Warning<
3896  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3897  "code; comparison may be assumed to always evaluate to "
3898  "%select{true|false}0">,
3899  InGroup<TautologicalUndefinedCompare>;
3900def note_reference_is_return_value : Note<"%0 returns a reference">;
3901
3902def note_pointer_declared_here : Note<
3903  "pointer %0 declared here">;
3904def warn_division_sizeof_ptr : Warning<
3905  "'%0' will return the size of the pointer, not the array itself">,
3906  InGroup<DiagGroup<"sizeof-pointer-div">>;
3907def warn_division_sizeof_array : Warning<
3908  "expression does not compute the number of elements in this array; element "
3909  "type is %0, not %1">,
3910  InGroup<DiagGroup<"sizeof-array-div">>;
3911
3912def note_function_warning_silence : Note<
3913    "prefix with the address-of operator to silence this warning">;
3914def note_function_to_function_call : Note<
3915    "suffix with parentheses to turn this into a function call">;
3916def warn_impcast_objective_c_literal_to_bool : Warning<
3917    "implicit boolean conversion of Objective-C object literal always "
3918    "evaluates to true">,
3919    InGroup<ObjCLiteralConversion>;
3920
3921def warn_cast_align : Warning<
3922  "cast from %0 to %1 increases required alignment from %2 to %3">,
3923  InGroup<CastAlign>, DefaultIgnore;
3924def warn_old_style_cast : Warning<
3925  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3926
3927// Separate between casts to void* and non-void* pointers.
3928// Some APIs use (abuse) void* for something like a user context,
3929// and often that value is an integer even if it isn't a pointer itself.
3930// Having a separate warning flag allows users to control the warning
3931// for their workflow.
3932def warn_int_to_pointer_cast : Warning<
3933  "cast to %1 from smaller integer type %0">,
3934  InGroup<IntToPointerCast>;
3935def warn_int_to_void_pointer_cast : Warning<
3936  "cast to %1 from smaller integer type %0">,
3937  InGroup<IntToVoidPointerCast>;
3938def warn_pointer_to_int_cast : Warning<
3939  "cast to smaller integer type %1 from %0">,
3940  InGroup<PointerToIntCast>;
3941def warn_pointer_to_enum_cast : Warning<
3942  warn_pointer_to_int_cast.Text>,
3943  InGroup<PointerToEnumCast>;
3944def warn_void_pointer_to_int_cast : Warning<
3945  "cast to smaller integer type %1 from %0">,
3946  InGroup<VoidPointerToIntCast>;
3947def warn_void_pointer_to_enum_cast : Warning<
3948  warn_void_pointer_to_int_cast.Text>,
3949  InGroup<VoidPointerToEnumCast>;
3950
3951def warn_attribute_ignored_for_field_of_type : Warning<
3952  "%0 attribute ignored for field of type %1">,
3953  InGroup<IgnoredAttributes>;
3954def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3955  "enums in the Microsoft ABI are signed integers by default; consider giving "
3956  "the enum %0 an unsigned underlying type to make this code portable">,
3957  InGroup<SignedEnumBitfield>, DefaultIgnore;
3958def warn_attribute_packed_for_bitfield : Warning<
3959  "'packed' attribute was ignored on bit-fields with single-byte alignment "
3960  "in older versions of GCC and Clang">,
3961  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3962def warn_transparent_union_attribute_field_size_align : Warning<
3963  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3964  "%select{alignment|size}0 of the first field in transparent union; "
3965  "transparent_union attribute ignored">,
3966  InGroup<IgnoredAttributes>;
3967def note_transparent_union_first_field_size_align : Note<
3968  "%select{alignment|size}0 of first field is %1 bits">;
3969def warn_transparent_union_attribute_not_definition : Warning<
3970  "transparent_union attribute can only be applied to a union definition; "
3971  "attribute ignored">,
3972  InGroup<IgnoredAttributes>;
3973def warn_transparent_union_attribute_floating : Warning<
3974  "first field of a transparent union cannot have %select{floating point|"
3975  "vector}0 type %1; transparent_union attribute ignored">,
3976  InGroup<IgnoredAttributes>;
3977def warn_transparent_union_attribute_zero_fields : Warning<
3978  "transparent union definition must contain at least one field; "
3979  "transparent_union attribute ignored">,
3980  InGroup<IgnoredAttributes>;
3981def warn_attribute_type_not_supported : Warning<
3982  "%0 attribute argument not supported: %1">,
3983  InGroup<IgnoredAttributes>;
3984def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3985  InGroup<IgnoredAttributes>;
3986def warn_attribute_protected_visibility :
3987  Warning<"target does not support 'protected' visibility; using 'default'">,
3988  InGroup<DiagGroup<"unsupported-visibility">>;
3989def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3990def note_previous_attribute : Note<"previous attribute is here">;
3991def note_conflicting_attribute : Note<"conflicting attribute is here">;
3992def note_attribute : Note<"attribute is here">;
3993def err_mismatched_ms_inheritance : Error<
3994  "inheritance model does not match %select{definition|previous declaration}0">;
3995def warn_ignored_ms_inheritance : Warning<
3996  "inheritance model ignored on %select{primary template|partial specialization}0">,
3997  InGroup<IgnoredAttributes>;
3998def note_previous_ms_inheritance : Note<
3999  "previous inheritance model specified here">;
4000def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
4001def err_mode_not_primitive : Error<
4002  "mode attribute only supported for integer and floating-point types">;
4003def err_mode_wrong_type : Error<
4004  "type of machine mode does not match type of base type">;
4005def warn_vector_mode_deprecated : Warning<
4006  "specifying vector types with the 'mode' attribute is deprecated; "
4007  "use the 'vector_size' attribute instead">,
4008  InGroup<DeprecatedAttributes>;
4009def err_complex_mode_vector_type : Error<
4010  "type of machine mode does not support base vector types">;
4011def err_enum_mode_vector_type : Error<
4012  "mode %0 is not supported for enumeration types">;
4013def warn_attribute_nonnull_no_pointers : Warning<
4014  "'nonnull' attribute applied to function with no pointer arguments">,
4015  InGroup<IgnoredAttributes>;
4016def warn_attribute_nonnull_parm_no_args : Warning<
4017  "'nonnull' attribute when used on parameters takes no arguments">,
4018  InGroup<IgnoredAttributes>;
4019def note_declared_nonnull : Note<
4020  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
4021def warn_attribute_sentinel_named_arguments : Warning<
4022  "'sentinel' attribute requires named arguments">,
4023  InGroup<IgnoredAttributes>;
4024def warn_attribute_sentinel_not_variadic : Warning<
4025  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
4026  InGroup<IgnoredAttributes>;
4027def warn_deprecated_ignored_on_using : Warning<
4028  "%0 currently has no effect on a using declaration">,
4029  InGroup<IgnoredAttributes>;
4030def err_attribute_sentinel_less_than_zero : Error<
4031  "'sentinel' parameter 1 less than zero">;
4032def err_attribute_sentinel_not_zero_or_one : Error<
4033  "'sentinel' parameter 2 not 0 or 1">;
4034def warn_cleanup_ext : Warning<
4035  "GCC does not allow the 'cleanup' attribute argument to be anything other "
4036  "than a simple identifier">,
4037  InGroup<GccCompat>;
4038def err_attribute_cleanup_arg_not_function : Error<
4039  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
4040def err_attribute_cleanup_func_must_take_one_arg : Error<
4041  "'cleanup' function %0 must take 1 parameter">;
4042def err_attribute_cleanup_func_arg_incompatible_type : Error<
4043  "'cleanup' function %0 parameter has "
4044  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
4045def err_attribute_regparm_wrong_platform : Error<
4046  "'regparm' is not valid on this platform">;
4047def err_attribute_regparm_invalid_number : Error<
4048  "'regparm' parameter must be between 0 and %0 inclusive">;
4049def err_attribute_not_supported_in_lang : Error<
4050  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
4051def err_attribute_not_supported_on_arch
4052    : Error<"%0 attribute is not supported on '%1'">;
4053def warn_gcc_ignores_type_attr : Warning<
4054  "GCC does not allow the %0 attribute to be written on a type">,
4055  InGroup<GccCompat>;
4056
4057// Clang-Specific Attributes
4058def warn_attribute_iboutlet : Warning<
4059  "%0 attribute can only be applied to instance variables or properties">,
4060  InGroup<IgnoredAttributes>;
4061def err_iboutletcollection_type : Error<
4062  "invalid type %0 as argument of iboutletcollection attribute">;
4063def err_iboutletcollection_builtintype : Error<
4064  "type argument of iboutletcollection attribute cannot be a builtin type">;
4065def warn_iboutlet_object_type : Warning<
4066  "%select{instance variable|property}2 with %0 attribute must "
4067  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
4068def warn_iboutletcollection_property_assign : Warning<
4069  "IBOutletCollection properties should be copy/strong and not assign">,
4070  InGroup<ObjCInvalidIBOutletProperty>;
4071
4072def err_attribute_overloadable_mismatch : Error<
4073  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
4074def note_attribute_overloadable_prev_overload : Note<
4075  "previous %select{unmarked |}0overload of function is here">;
4076def err_attribute_overloadable_no_prototype : Error<
4077  "'overloadable' function %0 must have a prototype">;
4078def err_attribute_overloadable_multiple_unmarked_overloads : Error<
4079  "at most one overload for a given name may lack the 'overloadable' "
4080  "attribute">;
4081def warn_attribute_no_builtin_invalid_builtin_name : Warning<
4082  "'%0' is not a valid builtin name for %1">,
4083  InGroup<DiagGroup<"invalid-no-builtin-names">>;
4084def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
4085  "empty %0 cannot be composed with named ones">;
4086def err_attribute_no_builtin_on_non_definition : Error<
4087  "%0 attribute is permitted on definitions only">;
4088def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
4089  "%0 attribute has no effect on defaulted or deleted functions">;
4090def warn_ns_attribute_wrong_return_type : Warning<
4091  "%0 attribute only applies to %select{functions|methods|properties}1 that "
4092  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
4093  InGroup<IgnoredAttributes>;
4094def err_ns_attribute_wrong_parameter_type : Error<
4095  "%0 attribute only applies to "
4096  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
4097def warn_ns_attribute_wrong_parameter_type : Warning<
4098  "%0 attribute only applies to "
4099  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
4100  InGroup<IgnoredAttributes>;
4101def warn_objc_requires_super_protocol : Warning<
4102  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
4103  InGroup<DiagGroup<"requires-super-attribute">>;
4104def note_protocol_decl : Note<
4105  "protocol is declared here">;
4106def note_protocol_decl_undefined : Note<
4107  "protocol %0 has no definition">;
4108def err_attribute_preferred_name_arg_invalid : Error<
4109  "argument %0 to 'preferred_name' attribute is not a typedef for "
4110  "a specialization of %1">;
4111def err_attribute_builtin_alias : Error<
4112  "%0 attribute can only be applied to a ARM or RISC-V builtin">;
4113
4114// called-once attribute diagnostics.
4115def err_called_once_attribute_wrong_type : Error<
4116  "'called_once' attribute only applies to function-like parameters">;
4117
4118def warn_completion_handler_never_called : Warning<
4119  "%select{|captured }1completion handler is never called">,
4120  InGroup<CompletionHandler>, DefaultIgnore;
4121def warn_called_once_never_called : Warning<
4122  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
4123  InGroup<CalledOnceParameter>;
4124
4125def warn_completion_handler_never_called_when : Warning<
4126  "completion handler is never %select{used|called}1 when "
4127  "%select{taking true branch|taking false branch|"
4128  "handling this case|none of the cases applies|"
4129  "entering the loop|skipping the loop|taking one of the branches}2">,
4130  InGroup<CompletionHandler>, DefaultIgnore;
4131def warn_called_once_never_called_when : Warning<
4132  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
4133  "%select{taking true branch|taking false branch|"
4134  "handling this case|none of the cases applies|"
4135  "entering the loop|skipping the loop|taking one of the branches}2">,
4136  InGroup<CalledOnceParameter>;
4137
4138def warn_completion_handler_called_twice : Warning<
4139  "completion handler is called twice">,
4140  InGroup<CompletionHandler>, DefaultIgnore;
4141def warn_called_once_gets_called_twice : Warning<
4142  "%0 parameter marked 'called_once' is called twice">,
4143  InGroup<CalledOnceParameter>;
4144def note_called_once_gets_called_twice : Note<
4145  "previous call is here%select{; set to nil to indicate "
4146  "it cannot be called afterwards|}0">;
4147
4148// objc_designated_initializer attribute diagnostics.
4149def warn_objc_designated_init_missing_super_call : Warning<
4150  "designated initializer missing a 'super' call to a designated initializer of the super class">,
4151  InGroup<ObjCDesignatedInit>;
4152def note_objc_designated_init_marked_here : Note<
4153  "method marked as designated initializer of the class here">;
4154def warn_objc_designated_init_non_super_designated_init_call : Warning<
4155  "designated initializer should only invoke a designated initializer on 'super'">,
4156  InGroup<ObjCDesignatedInit>;
4157def warn_objc_designated_init_non_designated_init_call : Warning<
4158  "designated initializer invoked a non-designated initializer">,
4159  InGroup<ObjCDesignatedInit>;
4160def warn_objc_secondary_init_super_init_call : Warning<
4161  "convenience initializer should not invoke an initializer on 'super'">,
4162  InGroup<ObjCDesignatedInit>;
4163def warn_objc_secondary_init_missing_init_call : Warning<
4164  "convenience initializer missing a 'self' call to another initializer">,
4165  InGroup<ObjCDesignatedInit>;
4166def warn_objc_implementation_missing_designated_init_override : Warning<
4167  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4168  InGroup<ObjCDesignatedInit>;
4169def err_designated_init_attr_non_init : Error<
4170  "'objc_designated_initializer' attribute only applies to init methods "
4171  "of interface or class extension declarations">;
4172
4173// objc_bridge attribute diagnostics.
4174def err_objc_attr_not_id : Error<
4175  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4176def err_objc_attr_typedef_not_id : Error<
4177  "parameter of %0 attribute must be 'id' when used on a typedef">;
4178def err_objc_attr_typedef_not_void_pointer : Error<
4179  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4180def err_objc_cf_bridged_not_interface : Error<
4181  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4182def err_objc_ns_bridged_invalid_cfobject : Error<
4183  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
4184def warn_objc_invalid_bridge : Warning<
4185  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4186def warn_objc_invalid_bridge_to_cf : Warning<
4187  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4188
4189// objc_bridge_related attribute diagnostics.
4190def err_objc_bridged_related_invalid_class : Error<
4191  "could not find Objective-C class %0 to convert %1 to %2">;
4192def err_objc_bridged_related_invalid_class_name : Error<
4193  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4194def err_objc_bridged_related_known_method : Error<
4195 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4196 "method for this conversion">;
4197
4198def err_objc_attr_protocol_requires_definition : Error<
4199  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4200
4201// Swift attributes.
4202def warn_attr_swift_name_function
4203  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4204    InGroup<SwiftNameAttribute>;
4205def warn_attr_swift_name_invalid_identifier
4206  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4207    InGroup<SwiftNameAttribute>;
4208def warn_attr_swift_name_decl_kind
4209  : Warning<"%0 attribute cannot be applied to this declaration">,
4210    InGroup<SwiftNameAttribute>;
4211def warn_attr_swift_name_subscript_invalid_parameter
4212  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4213        "have at least one parameter|"
4214        "have a 'self:' parameter}1">,
4215    InGroup<SwiftNameAttribute>;
4216def warn_attr_swift_name_missing_parameters
4217  : Warning<"%0 attribute is missing parameter label clause">,
4218    InGroup<SwiftNameAttribute>;
4219def warn_attr_swift_name_setter_parameters
4220  : Warning<"%0 attribute for setter must have one parameter for new value">,
4221    InGroup<SwiftNameAttribute>;
4222def warn_attr_swift_name_multiple_selfs
4223  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4224    InGroup<SwiftNameAttribute>;
4225def warn_attr_swift_name_getter_parameters
4226  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4227    InGroup<SwiftNameAttribute>;
4228def warn_attr_swift_name_subscript_setter_no_newValue
4229  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4230    InGroup<SwiftNameAttribute>;
4231def warn_attr_swift_name_subscript_setter_multiple_newValues
4232  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4233    InGroup<SwiftNameAttribute>;
4234def warn_attr_swift_name_subscript_getter_newValue
4235  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4236    InGroup<SwiftNameAttribute>;
4237def warn_attr_swift_name_num_params
4238  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4239            "the %1 attribute (expected %2; got %3)">,
4240    InGroup<SwiftNameAttribute>;
4241def warn_attr_swift_name_decl_missing_params
4242  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4243            "with no parameters">,
4244    InGroup<SwiftNameAttribute>;
4245
4246def err_attr_swift_error_no_error_parameter : Error<
4247  "%0 attribute can only be applied to a %select{function|method}1 with an "
4248  "error parameter">;
4249def err_attr_swift_error_return_type : Error<
4250  "%0 attribute with '%1' convention can only be applied to a "
4251  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4252
4253def err_swift_async_no_access : Error<
4254  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4255  "'not_swift_private'">;
4256def err_swift_async_bad_block_type : Error<
4257  "'swift_async' completion handler parameter must have block type returning"
4258  " 'void', type here is %0">;
4259
4260def err_swift_async_error_without_swift_async : Error<
4261  "%0 attribute must be applied to a %select{function|method}1 annotated "
4262  "with non-'none' attribute 'swift_async'">;
4263def err_swift_async_error_no_error_parameter : Error<
4264  "%0 attribute with 'nonnull_error' convention can only be applied to a "
4265  "%select{function|method}1 with a completion handler with an error "
4266  "parameter">;
4267def err_swift_async_error_non_integral : Error<
4268  "%0 attribute with '%1' convention must have an integral-typed parameter "
4269  "in completion handler at index %2, type here is %3">;
4270
4271def warn_ignored_objc_externally_retained : Warning<
4272  "'objc_externally_retained' can only be applied to local variables "
4273  "%select{of retainable type|with strong ownership}0">,
4274  InGroup<IgnoredAttributes>;
4275
4276// Function Parameter Semantic Analysis.
4277def err_param_with_void_type : Error<"argument may not have 'void' type">;
4278def err_void_only_param : Error<
4279  "'void' must be the first and only parameter if specified">;
4280def err_void_param_qualified : Error<
4281  "'void' as parameter must not have type qualifiers">;
4282def err_ident_list_in_fn_declaration : Error<
4283  "a parameter list without types is only allowed in a function definition">;
4284def ext_param_not_declared : Extension<
4285  "parameter %0 was not declared, defaulting to type 'int'">;
4286def err_param_default_argument : Error<
4287  "C does not support default arguments">;
4288def err_param_default_argument_redefinition : Error<
4289  "redefinition of default argument">;
4290def ext_param_default_argument_redefinition : ExtWarn<
4291  err_param_default_argument_redefinition.Text>,
4292  InGroup<MicrosoftDefaultArgRedefinition>;
4293def err_param_default_argument_missing : Error<
4294  "missing default argument on parameter">;
4295def err_param_default_argument_missing_name : Error<
4296  "missing default argument on parameter %0">;
4297def err_param_default_argument_references_param : Error<
4298  "default argument references parameter %0">;
4299def err_param_default_argument_references_local : Error<
4300  "default argument references local variable %0 of enclosing function">;
4301def err_param_default_argument_references_this : Error<
4302  "default argument references 'this'">;
4303def err_param_default_argument_nonfunc : Error<
4304  "default arguments can only be specified for parameters in a function "
4305  "declaration">;
4306def err_param_default_argument_template_redecl : Error<
4307  "default arguments cannot be added to a function template that has already "
4308  "been declared">;
4309def err_param_default_argument_member_template_redecl : Error<
4310  "default arguments cannot be added to an out-of-line definition of a member "
4311  "of a %select{class template|class template partial specialization|nested "
4312  "class in a template}0">;
4313def err_param_default_argument_on_parameter_pack : Error<
4314  "parameter pack cannot have a default argument">;
4315def err_uninitialized_member_for_assign : Error<
4316  "cannot define the implicit copy assignment operator for %0, because "
4317  "non-static %select{reference|const}1 member %2 cannot use copy "
4318  "assignment operator">;
4319def err_uninitialized_member_in_ctor : Error<
4320  "%select{constructor for %1|"
4321  "implicit default constructor for %1|"
4322  "cannot use constructor inherited from %1:}0 must explicitly "
4323  "initialize the %select{reference|const}2 member %3">;
4324def err_default_arg_makes_ctor_special : Error<
4325  "addition of default argument on redeclaration makes this constructor a "
4326  "%select{default|copy|move}0 constructor">;
4327
4328def err_use_of_default_argument_to_function_declared_later : Error<
4329  "use of default argument to function %0 that is declared later in class %1">;
4330def note_default_argument_declared_here : Note<
4331  "default argument declared here">;
4332def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4333def note_recursive_default_argument_used_here : Note<
4334  "default argument used here">;
4335
4336def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4337  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4338  "parameter type $|promoted type of K&R function parameter is not compatible "
4339  "with parameter type}0,1 declared in a previous prototype">,
4340  InGroup<KNRPromotedParameter>;
4341
4342
4343// C++ Overloading Semantic Analysis.
4344def err_ovl_diff_return_type : Error<
4345  "functions that differ only in their return type cannot be overloaded">;
4346def err_ovl_static_nonstatic_member : Error<
4347  "static and non-static member functions with the same parameter types "
4348  "cannot be overloaded">;
4349
4350let Deferrable = 1 in {
4351
4352def err_ovl_no_viable_function_in_call : Error<
4353  "no matching function for call to %0">;
4354def err_ovl_no_viable_member_function_in_call : Error<
4355  "no matching member function for call to %0">;
4356def err_ovl_ambiguous_call : Error<
4357  "call to %0 is ambiguous">;
4358def err_ovl_deleted_call : Error<"call to deleted function %0">;
4359def err_ovl_ambiguous_member_call : Error<
4360  "call to member function %0 is ambiguous">;
4361def err_ovl_deleted_member_call : Error<
4362  "call to deleted member function %0">;
4363def note_ovl_too_many_candidates : Note<
4364    "remaining %0 candidate%s0 omitted; "
4365    "pass -fshow-overloads=all to show them">;
4366
4367def select_ovl_candidate_kind : TextSubstitution<
4368  "%select{function|function|function (with reversed parameter order)|"
4369    "constructor|"
4370    "constructor (the implicit default constructor)|"
4371    "constructor (the implicit copy constructor)|"
4372    "constructor (the implicit move constructor)|"
4373    "function (the implicit copy assignment operator)|"
4374    "function (the implicit move assignment operator)|"
4375    "function (the implicit 'operator==' for this 'operator<=>)'|"
4376    "inherited constructor}0%select{| template| %2}1">;
4377
4378def note_ovl_candidate : Note<
4379    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4380    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4381    "| has different number of parameters (expected %5 but has %6)"
4382    "| has type mismatch at %ordinal5 parameter"
4383    "%diff{ (expected $ but has $)|}6,7"
4384    "| has different return type%diff{ ($ expected but has $)|}5,6"
4385    "| has different qualifiers (expected %5 but found %6)"
4386    "| has different exception specification}4">;
4387
4388def note_ovl_candidate_explicit : Note<
4389    "explicit %select{constructor|conversion function|deduction guide}0 "
4390    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4391def note_ovl_candidate_inherited_constructor : Note<
4392    "constructor from base class %0 inherited here">;
4393def note_ovl_candidate_inherited_constructor_slice : Note<
4394    "candidate %select{constructor|template}0 ignored: "
4395    "inherited constructor cannot be used to %select{copy|move}1 object">;
4396def note_ovl_candidate_illegal_constructor : Note<
4397    "candidate %select{constructor|template}0 ignored: "
4398    "instantiation %select{takes|would take}0 its own class type by value">;
4399def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4400    "candidate constructor ignored: cannot be used to construct an object "
4401    "in address space %0">;
4402def note_ovl_candidate_bad_deduction : Note<
4403    "candidate template ignored: failed template argument deduction">;
4404def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4405    "couldn't infer template argument %0">;
4406def note_ovl_candidate_incomplete_deduction_pack : Note<
4407    "candidate template ignored: "
4408    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4409    "expanded parameter in deduced argument pack %2">;
4410def note_ovl_candidate_inconsistent_deduction : Note<
4411    "candidate template ignored: deduced %select{conflicting types|"
4412    "conflicting values|conflicting templates|packs of different lengths}0 "
4413    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4414def note_ovl_candidate_inconsistent_deduction_types : Note<
4415    "candidate template ignored: deduced values %diff{"
4416    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4417    "%1 and %3 of conflicting types for parameter %0}2,4">;
4418def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4419    "candidate template ignored: invalid explicitly-specified argument "
4420    "for template parameter %0">;
4421def note_ovl_candidate_unsatisfied_constraints : Note<
4422    "candidate template ignored: constraints not satisfied%0">;
4423def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4424    "candidate template ignored: invalid explicitly-specified argument "
4425    "for %ordinal0 template parameter">;
4426def note_ovl_candidate_instantiation_depth : Note<
4427    "candidate template ignored: substitution exceeded maximum template "
4428    "instantiation depth">;
4429def note_ovl_candidate_underqualified : Note<
4430    "candidate template ignored: cannot deduce a type for %0 that would "
4431    "make %2 equal %1">;
4432def note_ovl_candidate_substitution_failure : Note<
4433    "candidate template ignored: substitution failure%0%1">;
4434def note_ovl_candidate_disabled_by_enable_if : Note<
4435    "candidate template ignored: disabled by %0%1">;
4436def note_ovl_candidate_disabled_by_requirement : Note<
4437    "candidate template ignored: requirement '%0' was not satisfied%1">;
4438def note_ovl_candidate_has_pass_object_size_params: Note<
4439    "candidate address cannot be taken because parameter %0 has "
4440    "pass_object_size attribute">;
4441def err_diagnose_if_succeeded : Error<"%0">;
4442def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4443    ShowInSystemHeader;
4444def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4445    "candidate disabled: %0">;
4446def err_addrof_function_disabled_by_enable_if_attr : Error<
4447    "cannot take address of function %0 because it has one or more "
4448    "non-tautological enable_if conditions">;
4449def err_addrof_function_constraints_not_satisfied : Error<
4450    "cannot take address of function %0 because its constraints are not "
4451    "satisfied">;
4452def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4453    "candidate function made ineligible by enable_if">;
4454def note_ovl_candidate_deduced_mismatch : Note<
4455    "candidate template ignored: deduced type "
4456    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4457    "adjusted type $ of %select{|element of }4argument"
4458    "|of %select{|element of }4%ordinal0 parameter does not match "
4459    "adjusted type of %select{|element of }4argument}1,2%3">;
4460def note_ovl_candidate_non_deduced_mismatch : Note<
4461    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4462// This note is needed because the above note would sometimes print two
4463// different types with the same name.  Remove this note when the above note
4464// can handle that case properly.
4465def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4466    "candidate template ignored: could not match %q0 against %q1">;
4467
4468// Note that we don't treat templates differently for this diagnostic.
4469def note_ovl_candidate_arity : Note<"candidate "
4470    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4471    "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
4472    "%plural{1:was|:were}5 provided">;
4473
4474def note_ovl_candidate_arity_one : Note<"candidate "
4475    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4476    "%select{requires at least|allows at most single|requires single}3 "
4477    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4478
4479def note_ovl_candidate_deleted : Note<
4480    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4481    "%select{explicitly made unavailable|explicitly deleted|"
4482    "implicitly deleted}3">;
4483
4484// Giving the index of the bad argument really clutters this message, and
4485// it's relatively unimportant because 1) it's generally obvious which
4486// argument(s) are of the given object type and 2) the fix is usually
4487// to complete the type, which doesn't involve changes to the call line
4488// anyway.  If people complain, we can change it.
4489def note_ovl_candidate_bad_conv_incomplete : Note<
4490    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4491    "cannot convert argument of incomplete type "
4492    "%diff{$ to $|to parameter type}3,4 for "
4493    "%select{%ordinal6 argument|object argument}5"
4494    "%select{|; dereference the argument with *|"
4495    "; take the address of the argument with &|"
4496    "; remove *|"
4497    "; remove &}7">;
4498def note_ovl_candidate_bad_list_argument : Note<
4499    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4500    "%select{cannot convert initializer list|too few initializers in list"
4501    "|too many initializers in list}7 argument to %4">;
4502def note_ovl_candidate_bad_overload : Note<
4503    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4504    "no overload of %4 matching %3 for %ordinal5 argument">;
4505def note_ovl_candidate_bad_conv : Note<
4506    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4507    "no known conversion "
4508    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4509    "%select{%ordinal6 argument|object argument}5"
4510    "%select{|; dereference the argument with *|"
4511    "; take the address of the argument with &|"
4512    "; remove *|"
4513    "; remove &}7">;
4514def note_ovl_candidate_bad_arc_conv : Note<
4515    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4516    "cannot implicitly convert argument "
4517    "%diff{of type $ to $|type to parameter type}3,4 for "
4518    "%select{%ordinal6 argument|object argument}5 under ARC">;
4519def note_ovl_candidate_bad_value_category : Note<
4520    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4521    "expects an %select{lvalue|rvalue}5 for "
4522    "%select{%ordinal4 argument|object argument}3">;
4523def note_ovl_candidate_bad_addrspace : Note<
4524    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4525    "cannot %select{pass pointer to|bind reference in}5 %3 "
4526    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4527    "argument">;
4528def note_ovl_candidate_bad_addrspace_this : Note<
4529    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4530    "'this' object is in %3, but method expects object in %4">;
4531def note_ovl_candidate_bad_gc : Note<
4532    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4533    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4534    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4535def note_ovl_candidate_bad_ownership : Note<
4536    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4537    "%select{%ordinal7|'this'}6 argument (%3) has "
4538    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4539    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4540    "__autoreleasing}5 ownership">;
4541def note_ovl_candidate_bad_cvr_this : Note<
4542    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4543    "'this' argument has type %3, but method is not marked "
4544    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4545    "volatile or restrict|const, volatile, or restrict}4">;
4546def note_ovl_candidate_bad_cvr : Note<
4547    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4548    "%ordinal5 argument (%3) would lose "
4549    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4550    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4551    "%select{||s||s|s|s}4">;
4552def note_ovl_candidate_bad_unaligned : Note<
4553    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4554    "%ordinal5 argument (%3) would lose __unaligned qualifier">;
4555def note_ovl_candidate_bad_base_to_derived_conv : Note<
4556    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4557    "cannot %select{convert from|convert from|bind}3 "
4558    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4559    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4560    "%ordinal6 argument">;
4561def note_ovl_candidate_bad_target : Note<
4562    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4563    "call to "
4564    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4565    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4566def note_ovl_candidate_constraints_not_satisfied : Note<
4567    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4568    "not satisfied">;
4569def note_implicit_member_target_infer_collision : Note<
4570    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4571    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4572    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4573
4574def note_ambiguous_type_conversion: Note<
4575    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4576def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4577def err_ovl_no_viable_function_in_init : Error<
4578  "no matching constructor for initialization of %0">;
4579def err_ovl_no_conversion_in_cast : Error<
4580  "cannot convert %1 to %2 without a conversion operator">;
4581def err_ovl_no_viable_conversion_in_cast : Error<
4582  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4583  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4584def err_ovl_ambiguous_conversion_in_cast : Error<
4585  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4586  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4587def err_ovl_deleted_conversion_in_cast : Error<
4588  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4589  "functional-style cast|}0 from %1 to %2 uses deleted function">;
4590def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4591def err_ref_init_ambiguous : Error<
4592  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4593def err_ovl_deleted_init : Error<
4594  "call to deleted constructor of %0">;
4595def err_ovl_deleted_special_init : Error<
4596  "call to implicitly-deleted %select{default constructor|copy constructor|"
4597  "move constructor|copy assignment operator|move assignment operator|"
4598  "destructor|function}0 of %1">;
4599def err_ovl_ambiguous_oper_unary : Error<
4600  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4601def err_ovl_ambiguous_oper_binary : Error<
4602  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4603def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4604  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4605  "and %2) to be ambiguous despite there being a unique best viable function"
4606  "%select{ with non-reversed arguments|}3">,
4607  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4608def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4609  "ambiguity is between a regular call to this operator and a call with the "
4610  "argument order reversed">;
4611def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4612  "candidate function with non-reversed arguments">;
4613def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
4614  "ambiguous candidate function with reversed arguments">;
4615def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
4616def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
4617def err_ovl_deleted_oper : Error<
4618  "overload resolution selected deleted operator '%0'">;
4619def err_ovl_deleted_special_oper : Error<
4620  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
4621  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
4622  "implicitly deleted">;
4623def err_ovl_deleted_comparison : Error<
4624  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
4625def err_ovl_rewrite_equalequal_not_bool : Error<
4626  "return type %0 of selected 'operator==' function for rewritten "
4627  "'%1' comparison is not 'bool'">;
4628def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
4629  "ISO C++20 requires return type of selected 'operator==' function for "
4630  "rewritten '%1' comparison to be 'bool', not %0">,
4631  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
4632def err_ovl_no_viable_subscript :
4633    Error<"no viable overloaded operator[] for type %0">;
4634def err_ovl_no_oper :
4635    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
4636def err_ovl_unresolvable : Error<
4637  "reference to %select{overloaded|multiversioned}1 function could not be "
4638  "resolved; did you mean to call it%select{| with no arguments}0?">;
4639def err_bound_member_function : Error<
4640  "reference to non-static member function must be called"
4641  "%select{|; did you mean to call it with no arguments?}0">;
4642def note_possible_target_of_call : Note<"possible target for call">;
4643
4644def err_ovl_no_viable_object_call : Error<
4645  "no matching function for call to object of type %0">;
4646def err_ovl_ambiguous_object_call : Error<
4647  "call to object of type %0 is ambiguous">;
4648def err_ovl_deleted_object_call : Error<
4649  "call to deleted function call operator in type %0">;
4650def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
4651def err_member_call_without_object : Error<
4652  "call to non-static member function without an object argument">;
4653
4654// C++ Address of Overloaded Function
4655def err_addr_ovl_no_viable : Error<
4656  "address of overloaded function %0 does not match required type %1">;
4657def err_addr_ovl_ambiguous : Error<
4658  "address of overloaded function %0 is ambiguous">;
4659def err_addr_ovl_not_func_ptrref : Error<
4660  "address of overloaded function %0 cannot be converted to type %1">;
4661def err_addr_ovl_no_qualifier : Error<
4662  "cannot form member pointer of type %0 without '&' and class name">;
4663
4664} // let Deferrable
4665
4666// C++11 Literal Operators
4667def err_ovl_no_viable_literal_operator : Error<
4668  "no matching literal operator for call to %0"
4669  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
4670  "%select{| or 'const char *'}4"
4671  "%select{|, and no matching literal operator template}5">;
4672
4673// C++ Template Declarations
4674def err_template_param_shadow : Error<
4675  "declaration of %0 shadows template parameter">;
4676def ext_template_param_shadow : ExtWarn<
4677  err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>;
4678def note_template_param_here : Note<"template parameter is declared here">;
4679def warn_template_export_unsupported : Warning<
4680  "exported templates are unsupported">;
4681def err_template_outside_namespace_or_class_scope : Error<
4682  "templates can only be declared in namespace or class scope">;
4683def err_template_inside_local_class : Error<
4684  "templates cannot be declared inside of a local class">;
4685def err_template_linkage : Error<"templates must have C++ linkage">;
4686def err_template_typedef : Error<"a typedef cannot be a template">;
4687def err_template_unnamed_class : Error<
4688  "cannot declare a class template with no name">;
4689def err_template_param_list_different_arity : Error<
4690  "%select{too few|too many}0 template parameters in template "
4691  "%select{|template parameter }1redeclaration">;
4692def note_template_param_list_different_arity : Note<
4693  "%select{too few|too many}0 template parameters in template template "
4694  "argument">;
4695def note_template_prev_declaration : Note<
4696  "previous template %select{declaration|template parameter}0 is here">;
4697def err_template_param_different_kind : Error<
4698  "template parameter has a different kind in template "
4699  "%select{|template parameter }0redeclaration">;
4700def note_template_param_different_kind : Note<
4701  "template parameter has a different kind in template argument">;
4702
4703def err_invalid_decl_specifier_in_nontype_parm : Error<
4704  "invalid declaration specifier in template non-type parameter">;
4705
4706def err_template_nontype_parm_different_type : Error<
4707  "template non-type parameter has a different type %0 in template "
4708  "%select{|template parameter }1redeclaration">;
4709
4710def note_template_nontype_parm_different_type : Note<
4711  "template non-type parameter has a different type %0 in template argument">;
4712def note_template_nontype_parm_prev_declaration : Note<
4713  "previous non-type template parameter with type %0 is here">;
4714def err_template_nontype_parm_bad_type : Error<
4715  "a non-type template parameter cannot have type %0">;
4716def err_template_nontype_parm_bad_structural_type : Error<
4717  "a non-type template parameter cannot have type %0 before C++20">;
4718def err_template_nontype_parm_incomplete : Error<
4719  "non-type template parameter has incomplete type %0">;
4720def err_template_nontype_parm_not_literal : Error<
4721  "non-type template parameter has non-literal type %0">;
4722def err_template_nontype_parm_rvalue_ref : Error<
4723  "non-type template parameter has rvalue reference type %0">;
4724def err_template_nontype_parm_not_structural : Error<
4725  "type %0 of non-type template parameter is not a structural type">;
4726def note_not_structural_non_public : Note<
4727  "%0 is not a structural type because it has a "
4728  "%select{non-static data member|base class}1 that is not public">;
4729def note_not_structural_mutable_field : Note<
4730  "%0 is not a structural type because it has a mutable "
4731  "non-static data member">;
4732def note_not_structural_rvalue_ref_field : Note<
4733  "%0 is not a structural type because it has a non-static data member "
4734  "of rvalue reference type">;
4735def note_not_structural_subobject : Note<
4736  "%0 is not a structural type because it has a "
4737  "%select{non-static data member|base class}1 of non-structural type %2">;
4738def warn_cxx17_compat_template_nontype_parm_type : Warning<
4739  "non-type template parameter of type %0 is incompatible with "
4740  "C++ standards before C++20">,
4741  DefaultIgnore, InGroup<CXXPre20Compat>;
4742def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
4743  "non-type template parameters declared with %0 are incompatible with C++ "
4744  "standards before C++17">,
4745  DefaultIgnore, InGroup<CXXPre17Compat>;
4746def err_template_param_default_arg_redefinition : Error<
4747  "template parameter redefines default argument">;
4748def note_template_param_prev_default_arg : Note<
4749  "previous default template argument defined here">;
4750def err_template_param_default_arg_missing : Error<
4751  "template parameter missing a default argument">;
4752def ext_template_parameter_default_in_function_template : ExtWarn<
4753  "default template arguments for a function template are a C++11 extension">,
4754  InGroup<CXX11>;
4755def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
4756  "default template arguments for a function template are incompatible with C++98">,
4757  InGroup<CXX98Compat>, DefaultIgnore;
4758def err_template_parameter_default_template_member : Error<
4759  "cannot add a default template argument to the definition of a member of a "
4760  "class template">;
4761def err_template_parameter_default_friend_template : Error<
4762  "default template argument not permitted on a friend template">;
4763def err_template_template_parm_no_parms : Error<
4764  "template template parameter must have its own template parameters">;
4765
4766def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4767  InGroup<CXX14>;
4768def warn_cxx11_compat_variable_template : Warning<
4769  "variable templates are incompatible with C++ standards before C++14">,
4770  InGroup<CXXPre14Compat>, DefaultIgnore;
4771def err_template_variable_noparams : Error<
4772  "extraneous 'template<>' in declaration of variable %0">;
4773def err_template_member : Error<"member %0 declared as a template">;
4774def err_template_member_noparams : Error<
4775  "extraneous 'template<>' in declaration of member %0">;
4776def err_template_tag_noparams : Error<
4777  "extraneous 'template<>' in declaration of %0 %1">;
4778
4779def warn_cxx17_compat_adl_only_template_id : Warning<
4780  "use of function template name with no prior function template "
4781  "declaration in function call with explicit template arguments "
4782  "is incompatible with C++ standards before C++20">,
4783  InGroup<CXXPre20Compat>, DefaultIgnore;
4784def ext_adl_only_template_id : ExtWarn<
4785  "use of function template name with no prior declaration in function call "
4786  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
4787
4788// C++ Template Argument Lists
4789def err_template_missing_args : Error<
4790  "use of "
4791  "%select{class template|function template|variable template|alias template|"
4792  "template template parameter|concept|template}0 %1 requires template "
4793  "arguments">;
4794def err_template_arg_list_different_arity : Error<
4795  "%select{too few|too many}0 template arguments for "
4796  "%select{class template|function template|variable template|alias template|"
4797  "template template parameter|concept|template}1 %2">;
4798def note_template_decl_here : Note<"template is declared here">;
4799def err_template_arg_must_be_type : Error<
4800  "template argument for template type parameter must be a type">;
4801def err_template_arg_must_be_type_suggest : Error<
4802  "template argument for template type parameter must be a type; "
4803  "did you forget 'typename'?">;
4804def ext_ms_template_type_arg_missing_typename : ExtWarn<
4805  "template argument for template type parameter must be a type; "
4806  "omitted 'typename' is a Microsoft extension">,
4807  InGroup<MicrosoftTemplate>;
4808def err_template_arg_must_be_expr : Error<
4809  "template argument for non-type template parameter must be an expression">;
4810def err_template_arg_nontype_ambig : Error<
4811  "template argument for non-type template parameter is treated as function type %0">;
4812def err_template_arg_must_be_template : Error<
4813  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4814def ext_template_arg_local_type : ExtWarn<
4815  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4816def ext_template_arg_unnamed_type : ExtWarn<
4817  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4818def warn_cxx98_compat_template_arg_local_type : Warning<
4819  "local type %0 as template argument is incompatible with C++98">,
4820  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4821def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4822  "unnamed type as template argument is incompatible with C++98">,
4823  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4824def note_template_unnamed_type_here : Note<
4825  "unnamed type used in template argument was declared here">;
4826def err_template_arg_overload_type : Error<
4827  "template argument is the type of an unresolved overloaded function">;
4828def err_template_arg_not_valid_template : Error<
4829  "template argument does not refer to a class or alias template, or template "
4830  "template parameter">;
4831def note_template_arg_refers_here_func : Note<
4832  "template argument refers to function template %0, here">;
4833def err_template_arg_template_params_mismatch : Error<
4834  "template template argument has different template parameters than its "
4835  "corresponding template template parameter">;
4836def err_template_arg_not_integral_or_enumeral : Error<
4837  "non-type template argument of type %0 must have an integral or enumeration"
4838  " type">;
4839def err_template_arg_not_ice : Error<
4840  "non-type template argument of type %0 is not an integral constant "
4841  "expression">;
4842def err_template_arg_not_address_constant : Error<
4843  "non-type template argument of type %0 is not a constant expression">;
4844def warn_cxx98_compat_template_arg_null : Warning<
4845  "use of null pointer as non-type template argument is incompatible with "
4846  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4847def err_template_arg_untyped_null_constant : Error<
4848  "null non-type template argument must be cast to template parameter type %0">;
4849def err_template_arg_wrongtype_null_constant : Error<
4850  "null non-type template argument of type %0 does not match template parameter "
4851  "of type %1">;
4852def err_non_type_template_parm_type_deduction_failure : Error<
4853  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4854def err_deduced_non_type_template_arg_type_mismatch : Error<
4855  "deduced non-type template argument does not have the same type as the "
4856  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4857def err_non_type_template_arg_subobject : Error<
4858  "non-type template argument refers to subobject '%0'">;
4859def err_non_type_template_arg_addr_label_diff : Error<
4860  "template argument / label address difference / what did you expect?">;
4861def err_non_type_template_arg_unsupported : Error<
4862  "sorry, non-type template argument of type %0 is not yet supported">;
4863def err_template_arg_not_convertible : Error<
4864  "non-type template argument of type %0 cannot be converted to a value "
4865  "of type %1">;
4866def warn_template_arg_negative : Warning<
4867  "non-type template argument with value '%0' converted to '%1' for unsigned "
4868  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4869def warn_template_arg_too_large : Warning<
4870  "non-type template argument value '%0' truncated to '%1' for "
4871  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4872def err_template_arg_no_ref_bind : Error<
4873  "non-type template parameter of reference type "
4874  "%diff{$ cannot bind to template argument of type $"
4875  "|cannot bind to template of incompatible argument type}0,1">;
4876def err_template_arg_ref_bind_ignores_quals : Error<
4877  "reference binding of non-type template parameter "
4878  "%diff{of type $ to template argument of type $|to template argument}0,1 "
4879  "ignores qualifiers">;
4880def err_template_arg_not_decl_ref : Error<
4881  "non-type template argument does not refer to any declaration">;
4882def err_template_arg_not_address_of : Error<
4883  "non-type template argument for template parameter of pointer type %0 must "
4884  "have its address taken">;
4885def err_template_arg_address_of_non_pointer : Error<
4886  "address taken in non-type template argument for template parameter of "
4887  "reference type %0">;
4888def err_template_arg_reference_var : Error<
4889  "non-type template argument of reference type %0 is not an object">;
4890def err_template_arg_field : Error<
4891  "non-type template argument refers to non-static data member %0">;
4892def err_template_arg_method : Error<
4893  "non-type template argument refers to non-static member function %0">;
4894def err_template_arg_object_no_linkage : Error<
4895  "non-type template argument refers to %select{function|object}0 %1 that "
4896  "does not have linkage">;
4897def warn_cxx98_compat_template_arg_object_internal : Warning<
4898  "non-type template argument referring to %select{function|object}0 %1 with "
4899  "internal linkage is incompatible with C++98">,
4900  InGroup<CXX98Compat>, DefaultIgnore;
4901def ext_template_arg_object_internal : ExtWarn<
4902  "non-type template argument referring to %select{function|object}0 %1 with "
4903  "internal linkage is a C++11 extension">, InGroup<CXX11>;
4904def err_template_arg_thread_local : Error<
4905  "non-type template argument refers to thread-local object">;
4906def note_template_arg_internal_object : Note<
4907  "non-type template argument refers to %select{function|object}0 here">;
4908def note_template_arg_refers_here : Note<
4909  "non-type template argument refers here">;
4910def err_template_arg_not_object_or_func : Error<
4911  "non-type template argument does not refer to an object or function">;
4912def err_template_arg_not_pointer_to_member_form : Error<
4913  "non-type template argument is not a pointer to member constant">;
4914def err_template_arg_member_ptr_base_derived_not_supported : Error<
4915  "sorry, non-type template argument of pointer-to-member type %1 that refers "
4916  "to member %q0 of a different class is not supported yet">;
4917def ext_template_arg_extra_parens : ExtWarn<
4918  "address non-type template argument cannot be surrounded by parentheses">;
4919def warn_cxx98_compat_template_arg_extra_parens : Warning<
4920  "redundant parentheses surrounding address non-type template argument are "
4921  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4922def err_pointer_to_member_type : Error<
4923  "invalid use of pointer to member type after %select{.*|->*}0">;
4924def err_pointer_to_member_call_drops_quals : Error<
4925  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4926def err_pointer_to_member_oper_value_classify: Error<
4927  "pointer-to-member function type %0 can only be called on an "
4928  "%select{rvalue|lvalue}1">;
4929def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4930  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
4931  InGroup<CXX20>, SFINAEFailure;
4932def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4933  "invoking a pointer to a 'const &' member function on an rvalue is "
4934  "incompatible with C++ standards before C++20">,
4935  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
4936def ext_ms_deref_template_argument: ExtWarn<
4937  "non-type template argument containing a dereference operation is a "
4938  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4939def ext_ms_delayed_template_argument: ExtWarn<
4940  "using the undeclared type %0 as a default template argument is a "
4941  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4942def err_template_arg_deduced_incomplete_pack : Error<
4943  "deduced incomplete pack %0 for template parameter %1">;
4944
4945// C++ template specialization
4946def err_template_spec_unknown_kind : Error<
4947  "can only provide an explicit specialization for a class template, function "
4948  "template, variable template, or a member function, static data member, "
4949  "%select{or member class|member class, or member enumeration}0 of a "
4950  "class template">;
4951def note_specialized_entity : Note<
4952  "explicitly specialized declaration is here">;
4953def note_explicit_specialization_declared_here : Note<
4954  "explicit specialization declared here">;
4955def err_template_spec_decl_function_scope : Error<
4956  "explicit specialization of %0 in function scope">;
4957def err_template_spec_decl_friend : Error<
4958  "cannot declare an explicit specialization in a friend">;
4959def err_template_spec_redecl_out_of_scope : Error<
4960  "%select{class template|class template partial|variable template|"
4961  "variable template partial|function template|member "
4962  "function|static data member|member class|member enumeration}0 "
4963  "specialization of %1 not in %select{a namespace enclosing %2|"
4964  "class %2 or an enclosing namespace}3">;
4965def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4966  "%select{class template|class template partial|variable template|"
4967  "variable template partial|function template|member "
4968  "function|static data member|member class|member enumeration}0 "
4969  "specialization of %1 not in %select{a namespace enclosing %2|"
4970  "class %2 or an enclosing namespace}3 "
4971  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4972def err_template_spec_redecl_global_scope : Error<
4973  "%select{class template|class template partial|variable template|"
4974  "variable template partial|function template|member "
4975  "function|static data member|member class|member enumeration}0 "
4976  "specialization of %1 must occur at global scope">;
4977def err_spec_member_not_instantiated : Error<
4978  "specialization of member %q0 does not specialize an instantiated member">;
4979def note_specialized_decl : Note<"attempt to specialize declaration here">;
4980def err_specialization_after_instantiation : Error<
4981  "explicit specialization of %0 after instantiation">;
4982def note_instantiation_required_here : Note<
4983  "%select{implicit|explicit}0 instantiation first required here">;
4984def err_template_spec_friend : Error<
4985  "template specialization declaration cannot be a friend">;
4986def err_template_spec_default_arg : Error<
4987  "default argument not permitted on an explicit "
4988  "%select{instantiation|specialization}0 of function %1">;
4989def err_not_class_template_specialization : Error<
4990  "cannot specialize a %select{dependent template|template template "
4991  "parameter}0">;
4992def ext_explicit_specialization_storage_class : ExtWarn<
4993  "explicit specialization cannot have a storage class">;
4994def err_explicit_specialization_inconsistent_storage_class : Error<
4995  "explicit specialization has extraneous, inconsistent storage class "
4996  "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4997def err_dependent_function_template_spec_no_match : Error<
4998  "no candidate function template was found for dependent"
4999  " friend function template specialization">;
5000def note_dependent_function_template_spec_discard_reason : Note<
5001  "candidate ignored: %select{not a function template"
5002  "|not a member of the enclosing namespace;"
5003  " did you mean to explicitly qualify the specialization?}0">;
5004
5005// C++ class template specializations and out-of-line definitions
5006def err_template_spec_needs_header : Error<
5007  "template specialization requires 'template<>'">;
5008def err_template_spec_needs_template_parameters : Error<
5009  "template specialization or definition requires a template parameter list "
5010  "corresponding to the nested type %0">;
5011def err_template_param_list_matches_nontemplate : Error<
5012  "template parameter list matching the non-templated nested type %0 should "
5013  "be empty ('template<>')">;
5014def err_alias_template_extra_headers : Error<
5015  "extraneous template parameter list in alias template declaration">;
5016def err_template_spec_extra_headers : Error<
5017  "extraneous template parameter list in template specialization or "
5018  "out-of-line template definition">;
5019def warn_template_spec_extra_headers : Warning<
5020  "extraneous template parameter list in template specialization">;
5021def note_explicit_template_spec_does_not_need_header : Note<
5022  "'template<>' header not required for explicitly-specialized class %0 "
5023  "declared here">;
5024def err_template_qualified_declarator_no_match : Error<
5025  "nested name specifier '%0' for declaration does not refer into a class, "
5026  "class template or class template partial specialization">;
5027def err_specialize_member_of_template : Error<
5028  "cannot specialize %select{|(with 'template<>') }0a member of an "
5029  "unspecialized template">;
5030
5031// C++ Class Template Partial Specialization
5032def err_default_arg_in_partial_spec : Error<
5033    "default template argument in a class template partial specialization">;
5034def err_dependent_non_type_arg_in_partial_spec : Error<
5035    "type of specialized non-type template argument depends on a template "
5036    "parameter of the partial specialization">;
5037def note_dependent_non_type_default_arg_in_partial_spec : Note<
5038    "template parameter is used in default argument declared here">;
5039def err_dependent_typed_non_type_arg_in_partial_spec : Error<
5040    "non-type template argument specializes a template parameter with "
5041    "dependent type %0">;
5042def err_partial_spec_args_match_primary_template : Error<
5043    "%select{class|variable}0 template partial specialization does not "
5044    "specialize any template argument; to %select{declare|define}1 the "
5045    "primary template, remove the template argument list">;
5046def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
5047    "%select{class|variable}0 template partial specialization is not "
5048    "more specialized than the primary template">, DefaultError,
5049    InGroup<DiagGroup<"invalid-partial-specialization">>;
5050def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
5051def ext_partial_specs_not_deducible : ExtWarn<
5052    "%select{class|variable}0 template partial specialization contains "
5053    "%select{a template parameter|template parameters}1 that cannot be "
5054    "deduced; this partial specialization will never be used">,
5055    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
5056def note_non_deducible_parameter : Note<
5057    "non-deducible template parameter %0">;
5058def err_partial_spec_ordering_ambiguous : Error<
5059    "ambiguous partial specializations of %0">;
5060def note_partial_spec_match : Note<"partial specialization matches %0">;
5061def err_partial_spec_redeclared : Error<
5062  "class template partial specialization %0 cannot be redeclared">;
5063def note_partial_specialization_declared_here : Note<
5064  "explicit specialization declared here">;
5065def note_prev_partial_spec_here : Note<
5066  "previous declaration of class template partial specialization %0 is here">;
5067def err_partial_spec_fully_specialized : Error<
5068  "partial specialization of %0 does not use any of its template parameters">;
5069
5070// C++ Variable Template Partial Specialization
5071def err_var_partial_spec_redeclared : Error<
5072  "variable template partial specialization %0 cannot be redefined">;
5073def note_var_prev_partial_spec_here : Note<
5074  "previous declaration of variable template partial specialization is here">;
5075def err_var_spec_no_template : Error<
5076  "no variable template matches%select{| partial}0 specialization">;
5077def err_var_spec_no_template_but_method : Error<
5078  "no variable template matches specialization; "
5079  "did you mean to use %0 as function template instead?">;
5080
5081// C++ Function template specializations
5082def err_function_template_spec_no_match : Error<
5083    "no function template matches function template specialization %0">;
5084def err_function_template_spec_ambiguous : Error<
5085    "function template specialization %0 ambiguously refers to more than one "
5086    "function template; explicitly specify%select{| additional}1 template "
5087    "arguments to identify a particular function template">;
5088def note_function_template_spec_matched : Note<
5089    "function template %q0 matches specialization %1">;
5090def err_function_template_partial_spec : Error<
5091    "function template partial specialization is not allowed">;
5092
5093// C++ Template Instantiation
5094def err_template_recursion_depth_exceeded : Error<
5095  "recursive template instantiation exceeded maximum depth of %0">,
5096  DefaultFatal, NoSFINAE;
5097def note_template_recursion_depth : Note<
5098  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
5099
5100def err_template_instantiate_within_definition : Error<
5101  "%select{implicit|explicit}0 instantiation of template %1 within its"
5102  " own definition">;
5103def err_template_instantiate_undefined : Error<
5104  "%select{implicit|explicit}0 instantiation of undefined template %1">;
5105def err_implicit_instantiate_member_undefined : Error<
5106  "implicit instantiation of undefined member %0">;
5107def note_template_class_instantiation_was_here : Note<
5108  "class template %0 was instantiated here">;
5109def note_template_class_explicit_specialization_was_here : Note<
5110  "class template %0 was explicitly specialized here">;
5111def note_template_class_instantiation_here : Note<
5112  "in instantiation of template class %q0 requested here">;
5113def note_template_member_class_here : Note<
5114  "in instantiation of member class %q0 requested here">;
5115def note_template_member_function_here : Note<
5116  "in instantiation of member function %q0 requested here">;
5117def note_function_template_spec_here : Note<
5118  "in instantiation of function template specialization %q0 requested here">;
5119def note_template_static_data_member_def_here : Note<
5120  "in instantiation of static data member %q0 requested here">;
5121def note_template_variable_def_here : Note<
5122  "in instantiation of variable template specialization %q0 requested here">;
5123def note_template_enum_def_here : Note<
5124  "in instantiation of enumeration %q0 requested here">;
5125def note_template_nsdmi_here : Note<
5126  "in instantiation of default member initializer %q0 requested here">;
5127def note_template_type_alias_instantiation_here : Note<
5128  "in instantiation of template type alias %0 requested here">;
5129def note_template_exception_spec_instantiation_here : Note<
5130  "in instantiation of exception specification for %0 requested here">;
5131def note_template_requirement_instantiation_here : Note<
5132  "in instantiation of requirement here">;
5133def warn_var_template_missing : Warning<"instantiation of variable %q0 "
5134  "required here, but no definition is available">,
5135  InGroup<UndefinedVarTemplate>;
5136def warn_func_template_missing : Warning<"instantiation of function %q0 "
5137  "required here, but no definition is available">,
5138  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
5139def note_forward_template_decl : Note<
5140  "forward declaration of template entity is here">;
5141def note_inst_declaration_hint : Note<"add an explicit instantiation "
5142  "declaration to suppress this warning if %q0 is explicitly instantiated in "
5143  "another translation unit">;
5144def note_evaluating_exception_spec_here : Note<
5145  "in evaluation of exception specification for %q0 needed here">;
5146
5147def note_default_arg_instantiation_here : Note<
5148  "in instantiation of default argument for '%0' required here">;
5149def note_default_function_arg_instantiation_here : Note<
5150  "in instantiation of default function argument expression "
5151  "for '%0' required here">;
5152def note_explicit_template_arg_substitution_here : Note<
5153  "while substituting explicitly-specified template arguments into function "
5154  "template %0 %1">;
5155def note_function_template_deduction_instantiation_here : Note<
5156  "while substituting deduced template arguments into function template %0 "
5157  "%1">;
5158def note_deduced_template_arg_substitution_here : Note<
5159  "during template argument deduction for %select{class|variable}0 template "
5160  "%select{partial specialization |}1%2 %3">;
5161def note_prior_template_arg_substitution : Note<
5162  "while substituting prior template arguments into %select{non-type|template}0"
5163  " template parameter%1 %2">;
5164def note_template_default_arg_checking : Note<
5165  "while checking a default template argument used here">;
5166def note_concept_specialization_here : Note<
5167  "while checking the satisfaction of concept '%0' requested here">;
5168def note_nested_requirement_here : Note<
5169  "while checking the satisfaction of nested requirement requested here">;
5170def note_checking_constraints_for_template_id_here : Note<
5171  "while checking constraint satisfaction for template '%0' required here">;
5172def note_checking_constraints_for_var_spec_id_here : Note<
5173  "while checking constraint satisfaction for variable template "
5174  "partial specialization '%0' required here">;
5175def note_checking_constraints_for_class_spec_id_here : Note<
5176  "while checking constraint satisfaction for class template partial "
5177  "specialization '%0' required here">;
5178def note_checking_constraints_for_function_here : Note<
5179  "while checking constraint satisfaction for function '%0' required here">;
5180def note_constraint_substitution_here : Note<
5181  "while substituting template arguments into constraint expression here">;
5182def note_constraint_normalization_here : Note<
5183  "while calculating associated constraint of template '%0' here">;
5184def note_parameter_mapping_substitution_here : Note<
5185  "while substituting into concept arguments here; substitution failures not "
5186  "allowed in concept arguments">;
5187def note_instantiation_contexts_suppressed : Note<
5188  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5189  "see all)">;
5190
5191def err_field_instantiates_to_function : Error<
5192  "data member instantiated with function type %0">;
5193def err_variable_instantiates_to_function : Error<
5194  "%select{variable|static data member}0 instantiated with function type %1">;
5195def err_nested_name_spec_non_tag : Error<
5196  "type %0 cannot be used prior to '::' because it has no members">;
5197
5198def err_using_pack_expansion_empty : Error<
5199  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5200
5201// C++ Explicit Instantiation
5202def err_explicit_instantiation_duplicate : Error<
5203    "duplicate explicit instantiation of %0">;
5204def ext_explicit_instantiation_duplicate : ExtWarn<
5205    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5206    InGroup<MicrosoftTemplate>;
5207def note_previous_explicit_instantiation : Note<
5208    "previous explicit instantiation is here">;
5209def warn_explicit_instantiation_after_specialization : Warning<
5210  "explicit instantiation of %0 that occurs after an explicit "
5211  "specialization has no effect">,
5212  InGroup<DiagGroup<"instantiation-after-specialization">>;
5213def note_previous_template_specialization : Note<
5214    "previous template specialization is here">;
5215def err_explicit_instantiation_nontemplate_type : Error<
5216    "explicit instantiation of non-templated type %0">;
5217def note_nontemplate_decl_here : Note<
5218    "non-templated declaration is here">;
5219def err_explicit_instantiation_in_class : Error<
5220  "explicit instantiation of %0 in class scope">;
5221def err_explicit_instantiation_out_of_scope : Error<
5222  "explicit instantiation of %0 not in a namespace enclosing %1">;
5223def err_explicit_instantiation_must_be_global : Error<
5224  "explicit instantiation of %0 must occur at global scope">;
5225def warn_explicit_instantiation_out_of_scope_0x : Warning<
5226  "explicit instantiation of %0 not in a namespace enclosing %1">,
5227  InGroup<CXX11Compat>, DefaultIgnore;
5228def warn_explicit_instantiation_must_be_global_0x : Warning<
5229  "explicit instantiation of %0 must occur at global scope">,
5230  InGroup<CXX11Compat>, DefaultIgnore;
5231
5232def err_explicit_instantiation_requires_name : Error<
5233  "explicit instantiation declaration requires a name">;
5234def err_explicit_instantiation_of_typedef : Error<
5235  "explicit instantiation of typedef %0">;
5236def err_explicit_instantiation_storage_class : Error<
5237  "explicit instantiation cannot have a storage class">;
5238def err_explicit_instantiation_internal_linkage : Error<
5239  "explicit instantiation declaration of %0 with internal linkage">;
5240def err_explicit_instantiation_not_known : Error<
5241  "explicit instantiation of %0 does not refer to a function template, "
5242  "variable template, member function, member class, or static data member">;
5243def note_explicit_instantiation_here : Note<
5244  "explicit instantiation refers here">;
5245def err_explicit_instantiation_data_member_not_instantiated : Error<
5246  "explicit instantiation refers to static data member %q0 that is not an "
5247  "instantiation">;
5248def err_explicit_instantiation_member_function_not_instantiated : Error<
5249  "explicit instantiation refers to member function %q0 that is not an "
5250  "instantiation">;
5251def err_explicit_instantiation_ambiguous : Error<
5252  "partial ordering for explicit instantiation of %0 is ambiguous">;
5253def note_explicit_instantiation_candidate : Note<
5254  "explicit instantiation candidate function %q0 template here %1">;
5255def err_explicit_instantiation_inline : Error<
5256  "explicit instantiation cannot be 'inline'">;
5257def warn_explicit_instantiation_inline_0x : Warning<
5258  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5259  DefaultIgnore;
5260def err_explicit_instantiation_constexpr : Error<
5261  "explicit instantiation cannot be 'constexpr'">;
5262def ext_explicit_instantiation_without_qualified_id : Extension<
5263  "qualifier in explicit instantiation of %q0 requires a template-id "
5264  "(a typedef is not permitted)">;
5265def err_explicit_instantiation_without_template_id : Error<
5266  "explicit instantiation of %q0 must specify a template argument list">;
5267def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5268  "explicit instantiation of %q0 must occur in namespace %1">;
5269def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5270  "explicit instantiation of %q0 must occur in namespace %1">,
5271  InGroup<CXX11Compat>, DefaultIgnore;
5272def err_explicit_instantiation_undefined_member : Error<
5273  "explicit instantiation of undefined %select{member class|member function|"
5274  "static data member}0 %1 of class template %2">;
5275def err_explicit_instantiation_undefined_func_template : Error<
5276  "explicit instantiation of undefined function template %0">;
5277def err_explicit_instantiation_undefined_var_template : Error<
5278  "explicit instantiation of undefined variable template %q0">;
5279def err_explicit_instantiation_declaration_after_definition : Error<
5280  "explicit instantiation declaration (with 'extern') follows explicit "
5281  "instantiation definition (without 'extern')">;
5282def note_explicit_instantiation_definition_here : Note<
5283  "explicit instantiation definition is here">;
5284def err_invalid_var_template_spec_type : Error<"type %2 "
5285  "of %select{explicit instantiation|explicit specialization|"
5286  "partial specialization|redeclaration}0 of %1 does not match"
5287  " expected type %3">;
5288def err_mismatched_exception_spec_explicit_instantiation : Error<
5289  "exception specification in explicit instantiation does not match "
5290  "instantiated one">;
5291def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5292  err_mismatched_exception_spec_explicit_instantiation.Text>,
5293  InGroup<MicrosoftExceptionSpec>;
5294def err_explicit_instantiation_dependent : Error<
5295  "explicit instantiation has dependent template arguments">;
5296
5297// C++ typename-specifiers
5298def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5299def err_typename_nested_not_found_enable_if : Error<
5300  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5301  "this declaration">;
5302def err_typename_nested_not_found_requirement : Error<
5303  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5304  "declaration">;
5305def err_typename_nested_not_type : Error<
5306    "typename specifier refers to non-type member %0 in %1">;
5307def err_typename_not_type : Error<
5308    "typename specifier refers to non-type %0">;
5309def note_typename_member_refers_here : Note<
5310    "referenced member %0 is declared here">;
5311def note_typename_refers_here : Note<
5312    "referenced %0 is declared here">;
5313def err_typename_missing : Error<
5314  "missing 'typename' prior to dependent type name '%0%1'">;
5315def err_typename_missing_template : Error<
5316  "missing 'typename' prior to dependent type template name '%0%1'">;
5317def ext_typename_missing : ExtWarn<
5318  "missing 'typename' prior to dependent type name '%0%1'">,
5319  InGroup<DiagGroup<"typename-missing">>;
5320def ext_typename_outside_of_template : ExtWarn<
5321  "'typename' occurs outside of a template">, InGroup<CXX11>;
5322def warn_cxx98_compat_typename_outside_of_template : Warning<
5323  "use of 'typename' outside of a template is incompatible with C++98">,
5324  InGroup<CXX98Compat>, DefaultIgnore;
5325def err_typename_refers_to_using_value_decl : Error<
5326  "typename specifier refers to a dependent using declaration for a value "
5327  "%0 in %1">;
5328def note_using_value_decl_missing_typename : Note<
5329  "add 'typename' to treat this using declaration as a type">;
5330
5331def err_template_kw_refers_to_non_template : Error<
5332  "%0%select{| following the 'template' keyword}1 "
5333  "does not refer to a template">;
5334def note_template_kw_refers_to_non_template : Note<
5335  "declared as a non-template here">;
5336def err_template_kw_refers_to_dependent_non_template : Error<
5337  "%0%select{| following the 'template' keyword}1 "
5338  "cannot refer to a dependent template">;
5339def err_template_kw_refers_to_class_template : Error<
5340  "'%0%1' instantiated to a class template, not a function template">;
5341def note_referenced_class_template : Note<
5342  "class template declared here">;
5343def err_template_kw_missing : Error<
5344  "missing 'template' keyword prior to dependent template name '%0%1'">;
5345def ext_template_outside_of_template : ExtWarn<
5346  "'template' keyword outside of a template">, InGroup<CXX11>;
5347def warn_cxx98_compat_template_outside_of_template : Warning<
5348  "use of 'template' keyword outside of a template is incompatible with C++98">,
5349  InGroup<CXX98Compat>, DefaultIgnore;
5350
5351def err_non_type_template_in_nested_name_specifier : Error<
5352  "qualified name refers into a specialization of %select{function|variable}0 "
5353  "template %1">;
5354def err_template_id_not_a_type : Error<
5355  "template name refers to non-type template %0">;
5356def note_template_declared_here : Note<
5357  "%select{function template|class template|variable template"
5358  "|type alias template|template template parameter}0 "
5359  "%1 declared here">;
5360def err_template_expansion_into_fixed_list : Error<
5361  "pack expansion used as argument for non-pack parameter of %select{alias "
5362  "template|concept}0">;
5363def note_parameter_type : Note<
5364  "parameter of type %0 is declared here">;
5365
5366// C++11 Variadic Templates
5367def err_template_param_pack_default_arg : Error<
5368  "template parameter pack cannot have a default argument">;
5369def err_template_param_pack_must_be_last_template_parameter : Error<
5370  "template parameter pack must be the last template parameter">;
5371
5372def err_template_parameter_pack_non_pack : Error<
5373  "%select{template type|non-type template|template template}0 parameter"
5374  "%select{| pack}1 conflicts with previous %select{template type|"
5375  "non-type template|template template}0 parameter%select{ pack|}1">;
5376def note_template_parameter_pack_non_pack : Note<
5377  "%select{template type|non-type template|template template}0 parameter"
5378  "%select{| pack}1 does not match %select{template type|non-type template"
5379  "|template template}0 parameter%select{ pack|}1 in template argument">;
5380def note_template_parameter_pack_here : Note<
5381  "previous %select{template type|non-type template|template template}0 "
5382  "parameter%select{| pack}1 declared here">;
5383
5384def err_unexpanded_parameter_pack : Error<
5385  "%select{expression|base type|declaration type|data member type|bit-field "
5386  "size|static assertion|fixed underlying type|enumerator value|"
5387  "using declaration|friend declaration|qualifier|initializer|default argument|"
5388  "non-type template parameter type|exception type|partial specialization|"
5389  "__if_exists name|__if_not_exists name|lambda|block|type constraint|"
5390  "requirement|requires clause}0 "
5391  "contains%plural{0: an|:}1 unexpanded parameter pack"
5392  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5393
5394def err_pack_expansion_without_parameter_packs : Error<
5395  "pack expansion does not contain any unexpanded parameter packs">;
5396def err_pack_expansion_length_conflict : Error<
5397  "pack expansion contains parameter packs %0 and %1 that have different "
5398  "lengths (%2 vs. %3)">;
5399def err_pack_expansion_length_conflict_multilevel : Error<
5400  "pack expansion contains parameter pack %0 that has a different "
5401  "length (%1 vs. %2) from outer parameter packs">;
5402def err_pack_expansion_length_conflict_partial : Error<
5403  "pack expansion contains parameter pack %0 that has a different "
5404  "length (at least %1 vs. %2) from outer parameter packs">;
5405def err_pack_expansion_member_init : Error<
5406  "pack expansion for initialization of member %0">;
5407
5408def err_function_parameter_pack_without_parameter_packs : Error<
5409  "type %0 of function parameter pack does not contain any unexpanded "
5410  "parameter packs">;
5411def err_ellipsis_in_declarator_not_parameter : Error<
5412  "only function and template parameters can be parameter packs">;
5413
5414def err_sizeof_pack_no_pack_name : Error<
5415  "%0 does not refer to the name of a parameter pack">;
5416
5417def err_fold_expression_packs_both_sides : Error<
5418  "binary fold expression has unexpanded parameter packs in both operands">;
5419def err_fold_expression_empty : Error<
5420  "unary fold expression has empty expansion for operator '%0' "
5421  "with no fallback value">;
5422def err_fold_expression_bad_operand : Error<
5423  "expression not permitted as operand of fold expression">;
5424def err_fold_expression_limit_exceeded: Error<
5425  "instantiating fold expression with %0 arguments exceeded expression nesting "
5426  "limit of %1">, DefaultFatal, NoSFINAE;
5427
5428def err_unexpected_typedef : Error<
5429  "unexpected type name %0: expected expression">;
5430def err_unexpected_namespace : Error<
5431  "unexpected namespace name %0: expected expression">;
5432def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5433def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5434  "use of undeclared identifier %0; "
5435  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5436  InGroup<MicrosoftTemplate>;
5437def err_found_in_dependent_base : Error<
5438  "explicit qualification required to use member %0 from dependent base class">;
5439def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5440  "found via unqualified lookup into dependent bases of class templates is a "
5441  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5442def err_found_later_in_class : Error<"member %0 used before its declaration">;
5443def ext_found_later_in_class : ExtWarn<
5444  "use of member %0 before its declaration is a Microsoft extension">,
5445  InGroup<MicrosoftTemplate>;
5446def note_dependent_member_use : Note<
5447  "must qualify identifier to find this declaration in dependent base class">;
5448def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5449    "visible in the template definition nor found by argument-dependent lookup">;
5450def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5451    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5452def err_undeclared_use : Error<"use of undeclared %0">;
5453def warn_deprecated : Warning<"%0 is deprecated">,
5454    InGroup<DeprecatedDeclarations>;
5455def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5456def warn_property_method_deprecated :
5457    Warning<"property access is using %0 method which is deprecated">,
5458    InGroup<DeprecatedDeclarations>;
5459def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5460    InGroup<DeprecatedDeclarations>;
5461def warn_deprecated_anonymous_namespace : Warning<
5462  "'deprecated' attribute on anonymous namespace ignored">,
5463  InGroup<IgnoredAttributes>;
5464def warn_deprecated_fwdclass_message : Warning<
5465    "%0 may be deprecated because the receiver type is unknown">,
5466    InGroup<DeprecatedDeclarations>;
5467def warn_deprecated_def : Warning<
5468  "implementing deprecated %select{method|class|category}0">,
5469  InGroup<DeprecatedImplementations>, DefaultIgnore;
5470def warn_unavailable_def : Warning<
5471  "implementing unavailable method">,
5472  InGroup<DeprecatedImplementations>, DefaultIgnore;
5473def err_unavailable : Error<"%0 is unavailable">;
5474def err_property_method_unavailable :
5475    Error<"property access is using %0 method which is unavailable">;
5476def err_unavailable_message : Error<"%0 is unavailable: %1">;
5477def warn_unavailable_fwdclass_message : Warning<
5478    "%0 may be unavailable because the receiver type is unknown">,
5479    InGroup<UnavailableDeclarations>;
5480def note_availability_specified_here : Note<
5481  "%0 has been explicitly marked "
5482  "%select{unavailable|deleted|deprecated}1 here">;
5483def note_partial_availability_specified_here : Note<
5484  "%0 has been marked as being introduced in %1 %2 here, "
5485  "but the deployment target is %1 %3">;
5486def note_implicitly_deleted : Note<
5487  "explicitly defaulted function was implicitly deleted here">;
5488def warn_not_enough_argument : Warning<
5489  "not enough variable arguments in %0 declaration to fit a sentinel">,
5490  InGroup<Sentinel>;
5491def warn_missing_sentinel : Warning <
5492  "missing sentinel in %select{function call|method dispatch|block call}0">,
5493  InGroup<Sentinel>;
5494def note_sentinel_here : Note<
5495  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5496def warn_missing_prototype : Warning<
5497  "no previous prototype for function %0">,
5498  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5499def note_declaration_not_a_prototype : Note<
5500  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5501  "to make it %select{a prototype for a zero-parameter function|one}0">;
5502def warn_strict_prototypes : Warning<
5503  "this %select{function declaration is not|block declaration is not|"
5504  "old-style function definition is not preceded by}0 a prototype">,
5505  InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
5506def warn_missing_variable_declarations : Warning<
5507  "no previous extern declaration for non-static variable %0">,
5508  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5509def note_static_for_internal_linkage : Note<
5510  "declare 'static' if the %select{variable|function}0 is not intended to be "
5511  "used outside of this translation unit">;
5512def err_static_data_member_reinitialization :
5513  Error<"static data member %0 already has an initializer">;
5514def err_redefinition : Error<"redefinition of %0">;
5515def err_alias_after_tentative :
5516  Error<"alias definition of %0 after tentative definition">;
5517def err_alias_is_definition :
5518  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5519def err_definition_of_implicitly_declared_member : Error<
5520  "definition of implicitly declared %select{default constructor|copy "
5521  "constructor|move constructor|copy assignment operator|move assignment "
5522  "operator|destructor|function}1">;
5523def err_definition_of_explicitly_defaulted_member : Error<
5524  "definition of explicitly defaulted %select{default constructor|copy "
5525  "constructor|move constructor|copy assignment operator|move assignment "
5526  "operator|destructor|function}0">;
5527def err_redefinition_extern_inline : Error<
5528  "redefinition of a 'extern inline' function %0 is not supported in "
5529  "%select{C99 mode|C++}1">;
5530def warn_attr_abi_tag_namespace : Warning<
5531  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5532  InGroup<IgnoredAttributes>;
5533def err_abi_tag_on_redeclaration : Error<
5534  "cannot add 'abi_tag' attribute in a redeclaration">;
5535def err_new_abi_tag_on_redeclaration : Error<
5536  "'abi_tag' %0 missing in original declaration">;
5537def note_use_ifdef_guards : Note<
5538  "unguarded header; consider using #ifdef guards or #pragma once">;
5539
5540def note_deleted_dtor_no_operator_delete : Note<
5541  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5542def note_deleted_special_member_class_subobject : Note<
5543  "%select{default constructor of|copy constructor of|move constructor of|"
5544  "copy assignment operator of|move assignment operator of|destructor of|"
5545  "constructor inherited by}0 "
5546  "%1 is implicitly deleted because "
5547  "%select{base class %3|%select{||||variant }4field %3}2 "
5548  "%select{has "
5549  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
5550  "%select{%select{default constructor|copy constructor|move constructor|copy "
5551  "assignment operator|move assignment operator|destructor|"
5552  "%select{default|corresponding|default|default|default}4 constructor}0|"
5553  "destructor}5"
5554  "%select{||s||}4"
5555  "|is an ObjC pointer}6">;
5556def note_deleted_default_ctor_uninit_field : Note<
5557  "%select{default constructor of|constructor inherited by}0 "
5558  "%1 is implicitly deleted because field %2 of "
5559  "%select{reference|const-qualified}4 type %3 would not be initialized">;
5560def note_deleted_default_ctor_all_const : Note<
5561  "%select{default constructor of|constructor inherited by}0 "
5562  "%1 is implicitly deleted because all "
5563  "%select{data members|data members of an anonymous union member}2"
5564  " are const-qualified">;
5565def note_deleted_copy_ctor_rvalue_reference : Note<
5566  "copy constructor of %0 is implicitly deleted because field %1 is of "
5567  "rvalue reference type %2">;
5568def note_deleted_copy_user_declared_move : Note<
5569  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
5570  " %1 has a user-declared move %select{constructor|assignment operator}2">;
5571def note_deleted_assign_field : Note<
5572  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
5573  "because field %2 is of %select{reference|const-qualified}4 type %3">;
5574
5575// These should be errors.
5576def warn_undefined_internal : Warning<
5577  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
5578  InGroup<DiagGroup<"undefined-internal">>;
5579def err_undefined_internal_type : Error<
5580  "%select{function|variable}0 %q1 is used but not defined in this "
5581  "translation unit, and cannot be defined in any other translation unit "
5582  "because its type does not have linkage">;
5583def ext_undefined_internal_type : Extension<
5584  "ISO C++ requires a definition in this translation unit for "
5585  "%select{function|variable}0 %q1 because its type does not have linkage">,
5586  InGroup<DiagGroup<"undefined-internal-type">>;
5587def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
5588  InGroup<DiagGroup<"undefined-inline">>;
5589def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
5590def note_used_here : Note<"used here">;
5591
5592def err_attribute_missing_on_first_decl : Error<
5593  "%0 attribute does not appear on the first declaration">;
5594def warn_internal_linkage_local_storage : Warning<
5595  "'internal_linkage' attribute on a non-static local variable is ignored">,
5596  InGroup<IgnoredAttributes>;
5597
5598def ext_internal_in_extern_inline : ExtWarn<
5599  "static %select{function|variable}0 %1 is used in an inline function with "
5600  "external linkage">, InGroup<StaticInInline>;
5601def ext_internal_in_extern_inline_quiet : Extension<
5602  "static %select{function|variable}0 %1 is used in an inline function with "
5603  "external linkage">, InGroup<StaticInInline>;
5604def warn_static_local_in_extern_inline : Warning<
5605  "non-constant static local variable in inline function may be different "
5606  "in different files">, InGroup<StaticLocalInInline>;
5607def note_convert_inline_to_static : Note<
5608  "use 'static' to give inline function %0 internal linkage">;
5609
5610def ext_redefinition_of_typedef : ExtWarn<
5611  "redefinition of typedef %0 is a C11 feature">,
5612  InGroup<DiagGroup<"typedef-redefinition"> >;
5613def err_redefinition_variably_modified_typedef : Error<
5614  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
5615
5616def err_inline_decl_follows_def : Error<
5617  "inline declaration of %0 follows non-inline definition">;
5618def err_inline_declaration_block_scope : Error<
5619  "inline declaration of %0 not allowed in block scope">;
5620def err_static_non_static : Error<
5621  "static declaration of %0 follows non-static declaration">;
5622def err_different_language_linkage : Error<
5623  "declaration of %0 has a different language linkage">;
5624def ext_retained_language_linkage : Extension<
5625  "friend function %0 retaining previous language linkage is an extension">,
5626  InGroup<DiagGroup<"retained-language-linkage">>;
5627def err_extern_c_global_conflict : Error<
5628  "declaration of %1 %select{with C language linkage|in global scope}0 "
5629  "conflicts with declaration %select{in global scope|with C language linkage}0">;
5630def note_extern_c_global_conflict : Note<
5631  "declared %select{in global scope|with C language linkage}0 here">;
5632def note_extern_c_begins_here : Note<
5633  "extern \"C\" language linkage specification begins here">;
5634def warn_weak_import : Warning <
5635  "an already-declared variable is made a weak_import declaration %0">;
5636def ext_static_non_static : Extension<
5637  "redeclaring non-static %0 as static is a Microsoft extension">,
5638  InGroup<MicrosoftRedeclareStatic>;
5639def err_non_static_static : Error<
5640  "non-static declaration of %0 follows static declaration">;
5641def err_extern_non_extern : Error<
5642  "extern declaration of %0 follows non-extern declaration">;
5643def err_non_extern_extern : Error<
5644  "non-extern declaration of %0 follows extern declaration">;
5645def err_non_thread_thread : Error<
5646  "non-thread-local declaration of %0 follows thread-local declaration">;
5647def err_thread_non_thread : Error<
5648  "thread-local declaration of %0 follows non-thread-local declaration">;
5649def err_thread_thread_different_kind : Error<
5650  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
5651  "follows declaration with %select{dynamic|static}1 initialization">;
5652def err_mismatched_owning_module : Error<
5653  "declaration of %0 in %select{the global module|module %2}1 follows "
5654  "declaration in %select{the global module|module %4}3">;
5655def err_redefinition_different_type : Error<
5656  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
5657def err_redefinition_different_kind : Error<
5658  "redefinition of %0 as different kind of symbol">;
5659def err_redefinition_different_namespace_alias : Error<
5660  "redefinition of %0 as an alias for a different namespace">;
5661def note_previous_namespace_alias : Note<
5662  "previously defined as an alias for %0">;
5663def warn_forward_class_redefinition : Warning<
5664  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
5665  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
5666def err_redefinition_different_typedef : Error<
5667  "%select{typedef|type alias|type alias template}0 "
5668  "redefinition with different types%diff{ ($ vs $)|}1,2">;
5669def err_tag_reference_non_tag : Error<
5670  "%select{non-struct type|non-class type|non-union type|non-enum "
5671  "type|typedef|type alias|template|type alias template|template "
5672  "template argument}1 %0 cannot be referenced with a "
5673  "%select{struct|interface|union|class|enum}2 specifier">;
5674def err_tag_reference_conflict : Error<
5675  "implicit declaration introduced by elaborated type conflicts with a "
5676  "%select{non-struct type|non-class type|non-union type|non-enum "
5677  "type|typedef|type alias|template|type alias template|template "
5678  "template argument}0 of the same name">;
5679def err_dependent_tag_decl : Error<
5680  "%select{declaration|definition}0 of "
5681  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
5682def err_tag_definition_of_typedef : Error<
5683  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
5684def err_conflicting_types : Error<"conflicting types for %0">;
5685def err_different_pass_object_size_params : Error<
5686  "conflicting pass_object_size attributes on parameters">;
5687def err_late_asm_label_name : Error<
5688  "cannot apply asm label to %select{variable|function}0 after its first use">;
5689def err_different_asm_label : Error<"conflicting asm label">;
5690def err_nested_redefinition : Error<"nested redefinition of %0">;
5691def err_use_with_wrong_tag : Error<
5692  "use of %0 with tag type that does not match previous declaration">;
5693def warn_struct_class_tag_mismatch : Warning<
5694  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
5695  "declared as a %select{struct|interface|class}3%select{| template}1; "
5696  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5697  InGroup<MismatchedTags>, DefaultIgnore;
5698def warn_struct_class_previous_tag_mismatch : Warning<
5699  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
5700  "here but previously declared as "
5701  "%select{a struct|an interface|a class}3%select{| template}1; "
5702  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5703  InGroup<MismatchedTags>, DefaultIgnore;
5704def note_struct_class_suggestion : Note<
5705  "did you mean %select{struct|interface|class}0 here?">;
5706def ext_forward_ref_enum : Extension<
5707  "ISO C forbids forward references to 'enum' types">;
5708def err_forward_ref_enum : Error<
5709  "ISO C++ forbids forward references to 'enum' types">;
5710def ext_ms_forward_ref_enum : ExtWarn<
5711  "forward references to 'enum' types are a Microsoft extension">,
5712  InGroup<MicrosoftEnumForwardReference>;
5713def ext_forward_ref_enum_def : Extension<
5714  "redeclaration of already-defined enum %0 is a GNU extension">,
5715  InGroup<GNURedeclaredEnum>;
5716
5717def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
5718def err_duplicate_member : Error<"duplicate member %0">;
5719def err_misplaced_ivar : Error<
5720  "instance variables may not be placed in %select{categories|class extension}0">;
5721def warn_ivars_in_interface : Warning<
5722  "declaration of instance variables in the interface is deprecated">,
5723  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
5724def ext_enum_value_not_int : Extension<
5725  "ISO C restricts enumerator values to range of 'int' (%0 is too "
5726  "%select{small|large}1)">;
5727def ext_enum_too_large : ExtWarn<
5728  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
5729def ext_enumerator_increment_too_large : ExtWarn<
5730  "incremented enumerator value %0 is not representable in the "
5731  "largest integer type">, InGroup<EnumTooLarge>;
5732def warn_flag_enum_constant_out_of_range : Warning<
5733  "enumeration value %0 is out of range of flags in enumeration type %1">,
5734  InGroup<FlagEnum>;
5735
5736def err_vm_decl_in_file_scope : Error<
5737  "variably modified type declaration not allowed at file scope">;
5738def err_vm_decl_has_extern_linkage : Error<
5739  "variably modified type declaration cannot have 'extern' linkage">;
5740def err_typecheck_field_variable_size : Error<
5741  "fields must have a constant size: 'variable length array in structure' "
5742  "extension will never be supported">;
5743def err_vm_func_decl : Error<
5744  "function declaration cannot have variably modified type">;
5745def err_array_too_large : Error<
5746  "array is too large (%0 elements)">;
5747
5748def err_typecheck_negative_array_size : Error<"array size is negative">;
5749def warn_typecheck_function_qualifiers_ignored : Warning<
5750  "'%0' qualifier on function type %1 has no effect">,
5751  InGroup<IgnoredQualifiers>;
5752def warn_typecheck_function_qualifiers_unspecified : Warning<
5753  "'%0' qualifier on function type %1 has unspecified behavior">;
5754def warn_typecheck_reference_qualifiers : Warning<
5755  "'%0' qualifier on reference type %1 has no effect">,
5756  InGroup<IgnoredReferenceQualifiers>;
5757def err_typecheck_invalid_restrict_not_pointer : Error<
5758  "restrict requires a pointer or reference (%0 is invalid)">;
5759def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
5760  "restrict requires a pointer or reference">;
5761def err_typecheck_invalid_restrict_invalid_pointee : Error<
5762  "pointer to function type %0 may not be 'restrict' qualified">;
5763def ext_typecheck_zero_array_size : Extension<
5764  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
5765def err_typecheck_zero_array_size : Error<
5766  "zero-length arrays are not permitted in C++">;
5767def err_array_size_non_int : Error<"size of array has non-integer type %0">;
5768def err_init_element_not_constant : Error<
5769  "initializer element is not a compile-time constant">;
5770def ext_aggregate_init_not_constant : Extension<
5771  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
5772def err_local_cant_init : Error<
5773  "'__local' variable cannot have an initializer">;
5774def err_loader_uninitialized_cant_init
5775    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
5776            "initializer">;
5777def err_loader_uninitialized_trivial_ctor
5778    : Error<"variable with 'loader_uninitialized' attribute must have a "
5779            "trivial default constructor">;
5780def err_loader_uninitialized_redeclaration
5781    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
5782def err_loader_uninitialized_extern_decl
5783    : Error<"variable %0 cannot be declared both 'extern' and with the "
5784            "'loader_uninitialized' attribute">;
5785def err_block_extern_cant_init : Error<
5786  "'extern' variable cannot have an initializer">;
5787def warn_extern_init : Warning<"'extern' variable has an initializer">,
5788  InGroup<DiagGroup<"extern-initializer">>;
5789def err_variable_object_no_init : Error<
5790  "variable-sized object may not be initialized">;
5791def err_excess_initializers : Error<
5792  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
5793def ext_excess_initializers : ExtWarn<
5794  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
5795  InGroup<ExcessInitializers>;
5796def err_excess_initializers_for_sizeless_type : Error<
5797  "excess elements in initializer for indivisible sizeless type %0">;
5798def ext_excess_initializers_for_sizeless_type : ExtWarn<
5799  "excess elements in initializer for indivisible sizeless type %0">,
5800  InGroup<ExcessInitializers>;
5801def err_excess_initializers_in_char_array_initializer : Error<
5802  "excess elements in char array initializer">;
5803def ext_excess_initializers_in_char_array_initializer : ExtWarn<
5804  "excess elements in char array initializer">,
5805  InGroup<ExcessInitializers>;
5806def err_initializer_string_for_char_array_too_long : Error<
5807  "initializer-string for char array is too long">;
5808def ext_initializer_string_for_char_array_too_long : ExtWarn<
5809  "initializer-string for char array is too long">,
5810  InGroup<ExcessInitializers>;
5811def warn_missing_field_initializers : Warning<
5812  "missing field %0 initializer">,
5813  InGroup<MissingFieldInitializers>, DefaultIgnore;
5814def warn_braces_around_init : Warning<
5815  "braces around %select{scalar |}0initializer">,
5816  InGroup<DiagGroup<"braced-scalar-init">>;
5817def ext_many_braces_around_init : ExtWarn<
5818  "too many braces around %select{scalar |}0initializer">,
5819  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5820def ext_complex_component_init : Extension<
5821  "complex initialization specifying real and imaginary components "
5822  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5823def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5824def err_empty_sizeless_initializer : Error<
5825  "initializer for sizeless type %0 cannot be empty">;
5826def warn_cxx98_compat_empty_scalar_initializer : Warning<
5827  "scalar initialized from empty initializer list is incompatible with C++98">,
5828  InGroup<CXX98Compat>, DefaultIgnore;
5829def warn_cxx98_compat_empty_sizeless_initializer : Warning<
5830  "initializing %0 from an empty initializer list is incompatible with C++98">,
5831  InGroup<CXX98Compat>, DefaultIgnore;
5832def warn_cxx98_compat_reference_list_init : Warning<
5833  "reference initialized from initializer list is incompatible with C++98">,
5834  InGroup<CXX98Compat>, DefaultIgnore;
5835def warn_cxx98_compat_initializer_list_init : Warning<
5836  "initialization of initializer_list object is incompatible with C++98">,
5837  InGroup<CXX98Compat>, DefaultIgnore;
5838def warn_cxx98_compat_ctor_list_init : Warning<
5839  "constructor call from initializer list is incompatible with C++98">,
5840  InGroup<CXX98Compat>, DefaultIgnore;
5841def err_illegal_initializer : Error<
5842  "illegal initializer (only variables can be initialized)">;
5843def err_illegal_initializer_type : Error<"illegal initializer type %0">;
5844def ext_init_list_type_narrowing : ExtWarn<
5845  "type %0 cannot be narrowed to %1 in initializer list">,
5846  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5847def ext_init_list_variable_narrowing : ExtWarn<
5848  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5849  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5850def ext_init_list_constant_narrowing : ExtWarn<
5851  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
5852  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5853def warn_init_list_type_narrowing : Warning<
5854  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
5855  InGroup<CXX11Narrowing>, DefaultIgnore;
5856def warn_init_list_variable_narrowing : Warning<
5857  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5858  "initializer list in C++11">,
5859  InGroup<CXX11Narrowing>, DefaultIgnore;
5860def warn_init_list_constant_narrowing : Warning<
5861  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
5862  "C++11">,
5863  InGroup<CXX11Narrowing>, DefaultIgnore;
5864def note_init_list_narrowing_silence : Note<
5865  "insert an explicit cast to silence this issue">;
5866def err_init_objc_class : Error<
5867  "cannot initialize Objective-C class type %0">;
5868def err_implicit_empty_initializer : Error<
5869  "initializer for aggregate with no elements requires explicit braces">;
5870def err_bitfield_has_negative_width : Error<
5871  "bit-field %0 has negative width (%1)">;
5872def err_anon_bitfield_has_negative_width : Error<
5873  "anonymous bit-field has negative width (%0)">;
5874def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
5875def err_bitfield_width_exceeds_type_width : Error<
5876  "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the "
5877  "%select{width|size}3 of its type (%4 bit%s4)">;
5878def err_incorrect_number_of_vector_initializers : Error<
5879  "number of elements must be either one or match the size of the vector">;
5880
5881// Used by C++ which allows bit-fields that are wider than the type.
5882def warn_bitfield_width_exceeds_type_width: Warning<
5883  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
5884  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
5885def err_bitfield_too_wide : Error<
5886  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
5887def warn_bitfield_too_small_for_enum : Warning<
5888  "bit-field %0 is not wide enough to store all enumerators of %1">,
5889  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5890def note_widen_bitfield : Note<
5891  "widen this field to %0 bits to store all values of %1">;
5892def warn_unsigned_bitfield_assigned_signed_enum : Warning<
5893  "assigning value of signed enum type %1 to unsigned bit-field %0; "
5894  "negative enumerators of enum %1 will be converted to positive values">,
5895  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5896def warn_signed_bitfield_enum_conversion : Warning<
5897  "signed bit-field %0 needs an extra bit to represent the largest positive "
5898  "enumerators of %1">,
5899  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5900def note_change_bitfield_sign : Note<
5901  "consider making the bitfield type %select{unsigned|signed}0">;
5902
5903def warn_missing_braces : Warning<
5904  "suggest braces around initialization of subobject">,
5905  InGroup<MissingBraces>, DefaultIgnore;
5906
5907def err_redefinition_of_label : Error<"redefinition of label %0">;
5908def err_undeclared_label_use : Error<"use of undeclared label %0">;
5909def err_goto_ms_asm_label : Error<
5910  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5911def note_goto_ms_asm_label : Note<
5912  "inline assembly label %0 declared here">;
5913def warn_unused_label : Warning<"unused label %0">,
5914  InGroup<UnusedLabel>, DefaultIgnore;
5915
5916def err_continue_from_cond_var_init : Error<
5917  "cannot jump from this continue statement to the loop increment; "
5918  "jump bypasses initialization of loop condition variable">;
5919def err_goto_into_protected_scope : Error<
5920  "cannot jump from this goto statement to its label">;
5921def ext_goto_into_protected_scope : ExtWarn<
5922  "jump from this goto statement to its label is a Microsoft extension">,
5923  InGroup<MicrosoftGoto>;
5924def warn_cxx98_compat_goto_into_protected_scope : Warning<
5925  "jump from this goto statement to its label is incompatible with C++98">,
5926  InGroup<CXX98Compat>, DefaultIgnore;
5927def err_switch_into_protected_scope : Error<
5928  "cannot jump from switch statement to this case label">;
5929def warn_cxx98_compat_switch_into_protected_scope : Warning<
5930  "jump from switch statement to this case label is incompatible with C++98">,
5931  InGroup<CXX98Compat>, DefaultIgnore;
5932def err_indirect_goto_without_addrlabel : Error<
5933  "indirect goto in function with no address-of-label expressions">;
5934def err_indirect_goto_in_protected_scope : Error<
5935  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
5936def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5937  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
5938  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5939def note_indirect_goto_target : Note<
5940  "possible target of %select{indirect|asm}0 goto statement">;
5941def note_protected_by_variable_init : Note<
5942  "jump bypasses variable initialization">;
5943def note_protected_by_variable_nontriv_destructor : Note<
5944  "jump bypasses variable with a non-trivial destructor">;
5945def note_protected_by_variable_non_pod : Note<
5946  "jump bypasses initialization of non-POD variable">;
5947def note_protected_by_cleanup : Note<
5948  "jump bypasses initialization of variable with __attribute__((cleanup))">;
5949def note_protected_by_vla_typedef : Note<
5950  "jump bypasses initialization of VLA typedef">;
5951def note_protected_by_vla_type_alias : Note<
5952  "jump bypasses initialization of VLA type alias">;
5953def note_protected_by_constexpr_if : Note<
5954  "jump enters controlled statement of constexpr if">;
5955def note_protected_by_consteval_if : Note<
5956  "jump enters controlled statement of consteval if">;
5957def note_protected_by_if_available : Note<
5958  "jump enters controlled statement of if available">;
5959def note_protected_by_vla : Note<
5960  "jump bypasses initialization of variable length array">;
5961def note_protected_by_objc_fast_enumeration : Note<
5962  "jump enters Objective-C fast enumeration loop">;
5963def note_protected_by_objc_try : Note<
5964  "jump bypasses initialization of @try block">;
5965def note_protected_by_objc_catch : Note<
5966  "jump bypasses initialization of @catch block">;
5967def note_protected_by_objc_finally : Note<
5968  "jump bypasses initialization of @finally block">;
5969def note_protected_by_objc_synchronized : Note<
5970  "jump bypasses initialization of @synchronized block">;
5971def note_protected_by_objc_autoreleasepool : Note<
5972  "jump bypasses auto release push of @autoreleasepool block">;
5973def note_protected_by_cxx_try : Note<
5974  "jump bypasses initialization of try block">;
5975def note_protected_by_cxx_catch : Note<
5976  "jump bypasses initialization of catch block">;
5977def note_protected_by_seh_try : Note<
5978  "jump bypasses initialization of __try block">;
5979def note_protected_by_seh_except : Note<
5980  "jump bypasses initialization of __except block">;
5981def note_protected_by_seh_finally : Note<
5982  "jump bypasses initialization of __finally block">;
5983def note_protected_by___block : Note<
5984  "jump bypasses setup of __block variable">;
5985def note_protected_by_objc_strong_init : Note<
5986  "jump bypasses initialization of __strong variable">;
5987def note_protected_by_objc_weak_init : Note<
5988  "jump bypasses initialization of __weak variable">;
5989def note_protected_by_non_trivial_c_struct_init : Note<
5990  "jump bypasses initialization of variable of non-trivial C struct type">;
5991def note_enters_block_captures_cxx_obj : Note<
5992  "jump enters lifetime of block which captures a destructible C++ object">;
5993def note_enters_block_captures_strong : Note<
5994  "jump enters lifetime of block which strongly captures a variable">;
5995def note_enters_block_captures_weak : Note<
5996  "jump enters lifetime of block which weakly captures a variable">;
5997def note_enters_block_captures_non_trivial_c_struct : Note<
5998  "jump enters lifetime of block which captures a C struct that is non-trivial "
5999  "to destroy">;
6000def note_enters_compound_literal_scope : Note<
6001  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
6002
6003def note_exits_cleanup : Note<
6004  "jump exits scope of variable with __attribute__((cleanup))">;
6005def note_exits_dtor : Note<
6006  "jump exits scope of variable with non-trivial destructor">;
6007def note_exits_temporary_dtor : Note<
6008  "jump exits scope of lifetime-extended temporary with non-trivial "
6009  "destructor">;
6010def note_exits___block : Note<
6011  "jump exits scope of __block variable">;
6012def note_exits_objc_try : Note<
6013  "jump exits @try block">;
6014def note_exits_objc_catch : Note<
6015  "jump exits @catch block">;
6016def note_exits_objc_finally : Note<
6017  "jump exits @finally block">;
6018def note_exits_objc_synchronized : Note<
6019  "jump exits @synchronized block">;
6020def note_exits_cxx_try : Note<
6021  "jump exits try block">;
6022def note_exits_cxx_catch : Note<
6023  "jump exits catch block">;
6024def note_exits_seh_try : Note<
6025  "jump exits __try block">;
6026def note_exits_seh_except : Note<
6027  "jump exits __except block">;
6028def note_exits_seh_finally : Note<
6029  "jump exits __finally block">;
6030def note_exits_objc_autoreleasepool : Note<
6031  "jump exits autoreleasepool block">;
6032def note_exits_objc_strong : Note<
6033  "jump exits scope of __strong variable">;
6034def note_exits_objc_weak : Note<
6035  "jump exits scope of __weak variable">;
6036def note_exits_block_captures_cxx_obj : Note<
6037  "jump exits lifetime of block which captures a destructible C++ object">;
6038def note_exits_block_captures_strong : Note<
6039  "jump exits lifetime of block which strongly captures a variable">;
6040def note_exits_block_captures_weak : Note<
6041  "jump exits lifetime of block which weakly captures a variable">;
6042def note_exits_block_captures_non_trivial_c_struct : Note<
6043  "jump exits lifetime of block which captures a C struct that is non-trivial "
6044  "to destroy">;
6045def note_exits_compound_literal_scope : Note<
6046  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
6047
6048def err_func_returning_qualified_void : ExtWarn<
6049  "function cannot return qualified void type %0">,
6050  InGroup<DiagGroup<"qualified-void-return-type">>;
6051def err_func_returning_array_function : Error<
6052  "function cannot return %select{array|function}0 type %1">;
6053def err_field_declared_as_function : Error<"field %0 declared as a function">;
6054def err_field_incomplete_or_sizeless : Error<
6055  "field has %select{incomplete|sizeless}0 type %1">;
6056def ext_variable_sized_type_in_struct : ExtWarn<
6057  "field %0 with variable sized type %1 not at the end of a struct or class is"
6058  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
6059
6060def ext_c99_flexible_array_member : Extension<
6061  "flexible array members are a C99 feature">, InGroup<C99>;
6062def err_flexible_array_virtual_base : Error<
6063  "flexible array member %0 not allowed in "
6064  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
6065def err_flexible_array_empty_aggregate : Error<
6066  "flexible array member %0 not allowed in otherwise empty "
6067  "%select{struct|interface|union|class|enum}1">;
6068def err_flexible_array_has_nontrivial_dtor : Error<
6069  "flexible array member %0 of type %1 with non-trivial destruction">;
6070def ext_flexible_array_in_struct : Extension<
6071  "%0 may not be nested in a struct due to flexible array member">,
6072  InGroup<FlexibleArrayExtensions>;
6073def ext_flexible_array_in_array : Extension<
6074  "%0 may not be used as an array element due to flexible array member">,
6075  InGroup<FlexibleArrayExtensions>;
6076def err_flexible_array_init : Error<
6077  "initialization of flexible array member is not allowed">;
6078def ext_flexible_array_empty_aggregate_ms : Extension<
6079  "flexible array member %0 in otherwise empty "
6080  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
6081  InGroup<MicrosoftFlexibleArray>;
6082def err_flexible_array_union : Error<
6083  "flexible array member %0 in a union is not allowed">;
6084def ext_flexible_array_union_ms : Extension<
6085  "flexible array member %0 in a union is a Microsoft extension">,
6086  InGroup<MicrosoftFlexibleArray>;
6087def ext_flexible_array_empty_aggregate_gnu : Extension<
6088  "flexible array member %0 in otherwise empty "
6089  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
6090  InGroup<GNUEmptyStruct>;
6091def ext_flexible_array_union_gnu : Extension<
6092  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
6093
6094def err_flexible_array_not_at_end : Error<
6095  "flexible array member %0 with type %1 is not at the end of"
6096  " %select{struct|interface|union|class|enum}2">;
6097def err_objc_variable_sized_type_not_at_end : Error<
6098  "field %0 with variable sized type %1 is not at the end of class">;
6099def note_next_field_declaration : Note<
6100  "next field declaration is here">;
6101def note_next_ivar_declaration : Note<
6102  "next %select{instance variable declaration|synthesized instance variable}0"
6103  " is here">;
6104def err_synthesize_variable_sized_ivar : Error<
6105  "synthesized property with variable size type %0"
6106  " requires an existing instance variable">;
6107def err_flexible_array_arc_retainable : Error<
6108  "ARC forbids flexible array members with retainable object type">;
6109def warn_variable_sized_ivar_visibility : Warning<
6110  "field %0 with variable sized type %1 is not visible to subclasses and"
6111  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
6112def warn_superclass_variable_sized_type_not_at_end : Warning<
6113  "field %0 can overwrite instance variable %1 with variable sized type %2"
6114  " in superclass %3">, InGroup<ObjCFlexibleArray>;
6115
6116let CategoryName = "ARC Semantic Issue" in {
6117
6118// ARC-mode diagnostics.
6119
6120let CategoryName = "ARC Weak References" in {
6121
6122def err_arc_weak_no_runtime : Error<
6123  "cannot create __weak reference because the current deployment target "
6124  "does not support weak references">;
6125def err_arc_weak_disabled : Error<
6126  "cannot create __weak reference in file using manual reference counting">;
6127def err_synthesizing_arc_weak_property_disabled : Error<
6128  "cannot synthesize weak property in file using manual reference counting">;
6129def err_synthesizing_arc_weak_property_no_runtime : Error<
6130  "cannot synthesize weak property because the current deployment target "
6131  "does not support weak references">;
6132def err_arc_unsupported_weak_class : Error<
6133  "class is incompatible with __weak references">;
6134def err_arc_weak_unavailable_assign : Error<
6135  "assignment of a weak-unavailable object to a __weak object">;
6136def err_arc_weak_unavailable_property : Error<
6137  "synthesizing __weak instance variable of type %0, which does not "
6138  "support weak references">;
6139def note_implemented_by_class : Note<
6140  "when implemented by class %0">;
6141def err_arc_convesion_of_weak_unavailable : Error<
6142  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
6143  " a __weak object of type %2">;
6144
6145} // end "ARC Weak References" category
6146
6147let CategoryName = "ARC Restrictions" in {
6148
6149def err_unavailable_in_arc : Error<
6150  "%0 is unavailable in ARC">;
6151def note_arc_forbidden_type : Note<
6152  "declaration uses type that is ill-formed in ARC">;
6153def note_performs_forbidden_arc_conversion : Note<
6154  "inline function performs a conversion which is forbidden in ARC">;
6155def note_arc_init_returns_unrelated : Note<
6156  "init method must return a type related to its receiver type">;
6157def note_arc_weak_disabled : Note<
6158  "declaration uses __weak, but ARC is disabled">;
6159def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
6160  "the current deployment target does not support">;
6161def note_arc_field_with_ownership : Note<
6162  "field has non-trivial ownership qualification">;
6163
6164def err_arc_illegal_explicit_message : Error<
6165  "ARC forbids explicit message send of %0">;
6166def err_arc_unused_init_message : Error<
6167  "the result of a delegate init call must be immediately returned "
6168  "or assigned to 'self'">;
6169def err_arc_mismatched_cast : Error<
6170  "%select{implicit conversion|cast}0 of "
6171  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6172  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6173  " to %3 is disallowed with ARC">;
6174def err_arc_nolifetime_behavior : Error<
6175  "explicit ownership qualifier on cast result has no effect">;
6176def err_arc_objc_property_default_assign_on_object : Error<
6177  "ARC forbids synthesizing a property of an Objective-C object "
6178  "with unspecified ownership or storage attribute">;
6179def err_arc_illegal_selector : Error<
6180  "ARC forbids use of %0 in a @selector">;
6181def err_arc_illegal_method_def : Error<
6182  "ARC forbids %select{implementation|synthesis}0 of %1">;
6183def warn_arc_strong_pointer_objc_pointer : Warning<
6184  "method parameter of type %0 with no explicit ownership">,
6185  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6186
6187} // end "ARC Restrictions" category
6188
6189def err_arc_lost_method_convention : Error<
6190  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6191  "method, but its implementation doesn't match because %select{"
6192  "its result type is not an object pointer|"
6193  "its result type is unrelated to its receiver type}1">;
6194def note_arc_lost_method_convention : Note<"declaration in interface">;
6195def err_arc_gained_method_convention : Error<
6196  "method implementation does not match its declaration">;
6197def note_arc_gained_method_convention : Note<
6198  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6199  "family because %select{its result type is not an object pointer|"
6200  "its result type is unrelated to its receiver type}1">;
6201def err_typecheck_arc_assign_self : Error<
6202  "cannot assign to 'self' outside of a method in the init family">;
6203def err_typecheck_arc_assign_self_class_method : Error<
6204  "cannot assign to 'self' in a class method">;
6205def err_typecheck_arr_assign_enumeration : Error<
6206  "fast enumeration variables cannot be modified in ARC by default; "
6207  "declare the variable __strong to allow this">;
6208def err_typecheck_arc_assign_externally_retained : Error<
6209  "variable declared with 'objc_externally_retained' "
6210  "cannot be modified in ARC">;
6211def warn_arc_retained_assign : Warning<
6212  "assigning retained object to %select{weak|unsafe_unretained}0 "
6213  "%select{property|variable}1"
6214  "; object will be released after assignment">,
6215  InGroup<ARCUnsafeRetainedAssign>;
6216def warn_arc_retained_property_assign : Warning<
6217  "assigning retained object to unsafe property"
6218  "; object will be released after assignment">,
6219  InGroup<ARCUnsafeRetainedAssign>;
6220def warn_arc_literal_assign : Warning<
6221  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6222  " to a weak %select{property|variable}1"
6223  "; object will be released after assignment">,
6224  InGroup<ARCUnsafeRetainedAssign>;
6225def err_arc_new_array_without_ownership : Error<
6226  "'new' cannot allocate an array of %0 with no explicit ownership">;
6227def err_arc_autoreleasing_var : Error<
6228  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6229  "__autoreleasing ownership">;
6230def err_arc_autoreleasing_capture : Error<
6231  "cannot capture __autoreleasing variable in a "
6232  "%select{block|lambda by copy}0">;
6233def err_arc_thread_ownership : Error<
6234  "thread-local variable has non-trivial ownership: type is %0">;
6235def err_arc_indirect_no_ownership : Error<
6236  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6237def err_arc_array_param_no_ownership : Error<
6238  "must explicitly describe intended ownership of an object array parameter">;
6239def err_arc_pseudo_dtor_inconstant_quals : Error<
6240  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6241  "type %1">;
6242def err_arc_init_method_unrelated_result_type : Error<
6243  "init methods must return a type related to the receiver type">;
6244def err_arc_nonlocal_writeback : Error<
6245  "passing address of %select{non-local|non-scalar}0 object to "
6246  "__autoreleasing parameter for write-back">;
6247def err_arc_method_not_found : Error<
6248  "no known %select{instance|class}1 method for selector %0">;
6249def err_arc_receiver_forward_class : Error<
6250  "receiver %0 for class message is a forward declaration">;
6251def err_arc_may_not_respond : Error<
6252  "no visible @interface for %0 declares the selector %1">;
6253def err_arc_receiver_forward_instance : Error<
6254  "receiver type %0 for instance message is a forward declaration">;
6255def warn_receiver_forward_instance : Warning<
6256  "receiver type %0 for instance message is a forward declaration">,
6257  InGroup<ForwardClassReceiver>, DefaultIgnore;
6258def err_arc_collection_forward : Error<
6259  "collection expression type %0 is a forward declaration">;
6260def err_arc_multiple_method_decl : Error<
6261  "multiple methods named %0 found with mismatched result, "
6262  "parameter type or attributes">;
6263def warn_arc_lifetime_result_type : Warning<
6264  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6265  "lifetime qualifier on return type is ignored">,
6266  InGroup<IgnoredQualifiers>;
6267
6268let CategoryName = "ARC Retain Cycle" in {
6269
6270def warn_arc_retain_cycle : Warning<
6271  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6272  InGroup<ARCRetainCycles>;
6273def note_arc_retain_cycle_owner : Note<
6274  "block will be retained by %select{the captured object|an object strongly "
6275  "retained by the captured object}0">;
6276
6277} // end "ARC Retain Cycle" category
6278
6279def warn_arc_object_memaccess : Warning<
6280  "%select{destination for|source of}0 this %1 call is a pointer to "
6281  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6282
6283let CategoryName = "ARC and @properties" in {
6284
6285def err_arc_strong_property_ownership : Error<
6286  "existing instance variable %1 for strong property %0 may not be "
6287  "%select{|__unsafe_unretained||__weak}2">;
6288def err_arc_assign_property_ownership : Error<
6289  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6290  "attribute must be __unsafe_unretained">;
6291def err_arc_inconsistent_property_ownership : Error<
6292  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6293  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6294
6295} // end "ARC and @properties" category
6296
6297def warn_block_capture_autoreleasing : Warning<
6298  "block captures an autoreleasing out-parameter, which may result in "
6299  "use-after-free bugs">,
6300  InGroup<BlockCaptureAutoReleasing>;
6301def note_declare_parameter_strong : Note<
6302  "declare the parameter __strong or capture a __block __strong variable to "
6303  "keep values alive across autorelease pools">;
6304
6305def err_arc_atomic_ownership : Error<
6306  "cannot perform atomic operation on a pointer to type %0: type has "
6307  "non-trivial ownership">;
6308
6309let CategoryName = "ARC Casting Rules" in {
6310
6311def err_arc_bridge_cast_incompatible : Error<
6312  "incompatible types casting %0 to %1 with a %select{__bridge|"
6313  "__bridge_transfer|__bridge_retained}2 cast">;
6314def err_arc_bridge_cast_wrong_kind : Error<
6315  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6316  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6317  "__bridge_transfer|__bridge_retained}4">;
6318def err_arc_cast_requires_bridge : Error<
6319  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6320  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6321  "requires a bridged cast">;
6322def note_arc_bridge : Note<
6323  "use __bridge to convert directly (no change in ownership)">;
6324def note_arc_cstyle_bridge : Note<
6325  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6326def note_arc_bridge_transfer : Note<
6327  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6328  "ownership of a +1 %0 into ARC">;
6329def note_arc_cstyle_bridge_transfer : Note<
6330  "use __bridge_transfer with C-style cast to transfer "
6331  "ownership of a +1 %0 into ARC">;
6332def note_arc_bridge_retained : Note<
6333  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6334  "ARC object available as a +1 %0">;
6335def note_arc_cstyle_bridge_retained : Note<
6336  "use __bridge_retained with C-style cast to make an "
6337  "ARC object available as a +1 %0">;
6338
6339} // ARC Casting category
6340
6341} // ARC category name
6342
6343def err_flexible_array_init_needs_braces : Error<
6344  "flexible array requires brace-enclosed initializer">;
6345def err_illegal_decl_array_of_functions : Error<
6346  "'%0' declared as array of functions of type %1">;
6347def err_array_incomplete_or_sizeless_type : Error<
6348  "array has %select{incomplete|sizeless}0 element type %1">;
6349def err_illegal_message_expr_incomplete_type : Error<
6350  "Objective-C message has incomplete result type %0">;
6351def err_illegal_decl_array_of_references : Error<
6352  "'%0' declared as array of references of type %1">;
6353def err_decl_negative_array_size : Error<
6354  "'%0' declared as an array with a negative size">;
6355def err_array_static_outside_prototype : Error<
6356  "%0 used in array declarator outside of function prototype">;
6357def err_array_static_not_outermost : Error<
6358  "%0 used in non-outermost array type derivation">;
6359def err_array_star_outside_prototype : Error<
6360  "star modifier used outside of function prototype">;
6361def err_illegal_decl_pointer_to_reference : Error<
6362  "'%0' declared as a pointer to a reference of type %1">;
6363def err_illegal_decl_mempointer_to_reference : Error<
6364  "'%0' declared as a member pointer to a reference of type %1">;
6365def err_illegal_decl_mempointer_to_void : Error<
6366  "'%0' declared as a member pointer to void">;
6367def err_illegal_decl_mempointer_in_nonclass : Error<
6368  "'%0' does not point into a class">;
6369def err_mempointer_in_nonclass_type : Error<
6370  "member pointer refers into non-class type %0">;
6371def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6372def err_nonfunction_block_type : Error<
6373  "block pointer to non-function type is invalid">;
6374def err_return_block_has_expr : Error<"void block should not return a value">;
6375def err_block_return_missing_expr : Error<
6376  "non-void block should return a value">;
6377def err_func_def_incomplete_result : Error<
6378  "incomplete result type %0 in function definition">;
6379def err_atomic_specifier_bad_type
6380    : Error<"_Atomic cannot be applied to "
6381            "%select{incomplete |array |function |reference |atomic |qualified "
6382            "|sizeless ||integer }0type "
6383            "%1 %select{|||||||which is not trivially copyable|}0">;
6384
6385// Expressions.
6386def ext_sizeof_alignof_function_type : Extension<
6387  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6388def ext_sizeof_alignof_void_type : Extension<
6389  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6390def err_opencl_sizeof_alignof_type : Error<
6391  "invalid application of '%0' to a void type">;
6392def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6393  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6394def err_sizeof_alignof_function_type : Error<
6395  "invalid application of '%0' to a function type">;
6396def err_openmp_default_simd_align_expr : Error<
6397  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6398def err_sizeof_alignof_typeof_bitfield : Error<
6399  "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
6400def err_alignof_member_of_incomplete_type : Error<
6401  "invalid application of 'alignof' to a field of a class still being defined">;
6402def err_vecstep_non_scalar_vector_type : Error<
6403  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6404def err_offsetof_incomplete_type : Error<
6405  "offsetof of incomplete type %0">;
6406def err_offsetof_record_type : Error<
6407  "offsetof requires struct, union, or class type, %0 invalid">;
6408def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6409def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6410  InGroup<InvalidOffsetof>;
6411def ext_offsetof_non_standardlayout_type : ExtWarn<
6412  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6413def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6414def err_offsetof_field_of_virtual_base : Error<
6415  "invalid application of 'offsetof' to a field of a virtual base">;
6416def warn_sub_ptr_zero_size_types : Warning<
6417  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6418  InGroup<PointerArith>;
6419def warn_pointer_arith_null_ptr : Warning<
6420  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6421  InGroup<NullPointerArithmetic>, DefaultIgnore;
6422def warn_gnu_null_ptr_arith : Warning<
6423  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6424  InGroup<NullPointerArithmetic>, DefaultIgnore;
6425def warn_pointer_sub_null_ptr : Warning<
6426  "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
6427  InGroup<NullPointerSubtraction>, DefaultIgnore;
6428
6429def warn_floatingpoint_eq : Warning<
6430  "comparing floating point with == or != is unsafe">,
6431  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6432
6433def warn_remainder_division_by_zero : Warning<
6434  "%select{remainder|division}0 by zero is undefined">,
6435  InGroup<DivZero>;
6436def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6437  InGroup<DiagGroup<"shift-negative-value">>;
6438def warn_shift_negative : Warning<"shift count is negative">,
6439  InGroup<DiagGroup<"shift-count-negative">>;
6440def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6441  InGroup<DiagGroup<"shift-count-overflow">>;
6442def warn_shift_result_gt_typewidth : Warning<
6443  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6444  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6445def warn_shift_result_sets_sign_bit : Warning<
6446  "signed shift result (%0) sets the sign bit of the shift expression's "
6447  "type (%1) and becomes negative">,
6448  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6449
6450def warn_precedence_bitwise_rel : Warning<
6451  "%0 has lower precedence than %1; %1 will be evaluated first">,
6452  InGroup<Parentheses>;
6453def note_precedence_bitwise_first : Note<
6454  "place parentheses around the %0 expression to evaluate it first">;
6455def note_precedence_silence : Note<
6456  "place parentheses around the '%0' expression to silence this warning">;
6457
6458def warn_precedence_conditional : Warning<
6459  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6460  InGroup<Parentheses>;
6461def warn_precedence_bitwise_conditional : Warning<
6462  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6463  InGroup<BitwiseConditionalParentheses>;
6464def note_precedence_conditional_first : Note<
6465  "place parentheses around the '?:' expression to evaluate it first">;
6466
6467def warn_enum_constant_in_bool_context : Warning<
6468  "converting the enum constant to a boolean">,
6469  InGroup<IntInBoolContext>, DefaultIgnore;
6470def warn_left_shift_in_bool_context : Warning<
6471  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6472  InGroup<IntInBoolContext>, DefaultIgnore;
6473def warn_logical_instead_of_bitwise : Warning<
6474  "use of logical '%0' with constant operand">,
6475  InGroup<DiagGroup<"constant-logical-operand">>;
6476def note_logical_instead_of_bitwise_change_operator : Note<
6477  "use '%0' for a bitwise operation">;
6478def note_logical_instead_of_bitwise_remove_constant : Note<
6479  "remove constant to silence this warning">;
6480
6481def warn_bitwise_op_in_bitwise_op : Warning<
6482  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
6483
6484def warn_logical_and_in_logical_or : Warning<
6485  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
6486
6487def warn_overloaded_shift_in_comparison :Warning<
6488  "overloaded operator %select{>>|<<}0 has higher precedence than "
6489  "comparison operator">,
6490  InGroup<OverloadedShiftOpParentheses>;
6491def note_evaluate_comparison_first :Note<
6492  "place parentheses around comparison expression to evaluate it first">;
6493
6494def note_concatenated_string_literal_silence :Note<
6495  "place parentheses around the string literal to silence warning">;
6496
6497def warn_addition_in_bitshift : Warning<
6498  "operator '%0' has lower precedence than '%1'; "
6499  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
6500
6501def warn_self_assignment_builtin : Warning<
6502  "explicitly assigning value of variable of type %0 to itself">,
6503  InGroup<SelfAssignment>, DefaultIgnore;
6504def warn_self_assignment_overloaded : Warning<
6505  "explicitly assigning value of variable of type %0 to itself">,
6506  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
6507def warn_self_move : Warning<
6508  "explicitly moving variable of type %0 to itself">,
6509  InGroup<SelfMove>, DefaultIgnore;
6510
6511def warn_redundant_move_on_return : Warning<
6512  "redundant move in return statement">,
6513  InGroup<RedundantMove>, DefaultIgnore;
6514def warn_pessimizing_move_on_return : Warning<
6515  "moving a local object in a return statement prevents copy elision">,
6516  InGroup<PessimizingMove>, DefaultIgnore;
6517def warn_pessimizing_move_on_initialization : Warning<
6518  "moving a temporary object prevents copy elision">,
6519  InGroup<PessimizingMove>, DefaultIgnore;
6520def note_remove_move : Note<"remove std::move call here">;
6521
6522def warn_string_plus_int : Warning<
6523  "adding %0 to a string does not append to the string">,
6524  InGroup<StringPlusInt>;
6525def warn_string_plus_char : Warning<
6526  "adding %0 to a string pointer does not append to the string">,
6527  InGroup<StringPlusChar>;
6528def note_string_plus_scalar_silence : Note<
6529  "use array indexing to silence this warning">;
6530
6531def warn_sizeof_array_param : Warning<
6532  "sizeof on array function parameter will return size of %0 instead of %1">,
6533  InGroup<SizeofArrayArgument>;
6534
6535def warn_sizeof_array_decay : Warning<
6536  "sizeof on pointer operation will return size of %0 instead of %1">,
6537  InGroup<SizeofArrayDecay>;
6538
6539def err_sizeof_nonfragile_interface : Error<
6540  "application of '%select{alignof|sizeof}1' to interface %0 is "
6541  "not supported on this architecture and platform">;
6542def err_atdef_nonfragile_interface : Error<
6543  "use of @defs is not supported on this architecture and platform">;
6544def err_subscript_nonfragile_interface : Error<
6545  "subscript requires size of interface %0, which is not constant for "
6546  "this architecture and platform">;
6547
6548def err_arithmetic_nonfragile_interface : Error<
6549  "arithmetic on pointer to interface %0, which is not a constant size for "
6550  "this architecture and platform">;
6551
6552def warn_deprecated_comma_subscript : Warning<
6553  "top-level comma expression in array subscript is deprecated">,
6554  InGroup<DeprecatedCommaSubscript>;
6555
6556def ext_subscript_non_lvalue : Extension<
6557  "ISO C90 does not allow subscripting non-lvalue array">;
6558def err_typecheck_subscript_value : Error<
6559  "subscripted value is not an array, pointer, or vector">;
6560def err_typecheck_subscript_not_integer : Error<
6561  "array subscript is not an integer">;
6562def err_subscript_function_type : Error<
6563  "subscript of pointer to function type %0">;
6564def err_subscript_incomplete_or_sizeless_type : Error<
6565  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
6566def err_dereference_incomplete_type : Error<
6567  "dereference of pointer to incomplete type %0">;
6568def ext_gnu_subscript_void_type : Extension<
6569  "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
6570def err_typecheck_member_reference_struct_union : Error<
6571  "member reference base type %0 is not a structure or union">;
6572def err_typecheck_member_reference_ivar : Error<
6573  "%0 does not have a member named %1">;
6574def err_arc_weak_ivar_access : Error<
6575  "dereferencing a __weak pointer is not allowed due to possible "
6576  "null value caused by race condition, assign it to strong variable first">;
6577def err_typecheck_member_reference_arrow : Error<
6578  "member reference type %0 is not a pointer">;
6579def err_typecheck_member_reference_suggestion : Error<
6580  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
6581def note_typecheck_member_reference_suggestion : Note<
6582  "did you mean to use '.' instead?">;
6583def note_member_reference_arrow_from_operator_arrow : Note<
6584  "'->' applied to return value of the operator->() declared here">;
6585def err_typecheck_member_reference_type : Error<
6586  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
6587def err_typecheck_member_reference_unknown : Error<
6588  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
6589def err_member_reference_needs_call : Error<
6590  "base of member reference is a function; perhaps you meant to call "
6591  "it%select{| with no arguments}0?">;
6592def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
6593  InGroup<CharSubscript>, DefaultIgnore;
6594
6595def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
6596def err_no_member : Error<"no member named %0 in %1">;
6597def err_no_member_overloaded_arrow : Error<
6598  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
6599
6600def err_member_not_yet_instantiated : Error<
6601  "no member %0 in %1; it has not yet been instantiated">;
6602def note_non_instantiated_member_here : Note<
6603  "not-yet-instantiated member is declared here">;
6604
6605def err_enumerator_does_not_exist : Error<
6606  "enumerator %0 does not exist in instantiation of %1">;
6607def note_enum_specialized_here : Note<
6608  "enum %0 was explicitly specialized here">;
6609
6610def err_specialization_not_primary_template : Error<
6611  "cannot reference member of primary template because deduced class "
6612  "template specialization %0 is %select{instantiated from a partial|"
6613  "an explicit}1 specialization">;
6614
6615def err_member_redeclared : Error<"class member cannot be redeclared">;
6616def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
6617  InGroup<RedeclaredClassMember>;
6618def err_member_redeclared_in_instantiation : Error<
6619  "multiple overloads of %0 instantiate to the same signature %1">;
6620def err_member_name_of_class : Error<"member %0 has the same name as its class">;
6621def err_member_def_undefined_record : Error<
6622  "out-of-line definition of %0 from class %1 without definition">;
6623def err_member_decl_does_not_match : Error<
6624  "out-of-line %select{declaration|definition}2 of %0 "
6625  "does not match any declaration in %1">;
6626def err_friend_decl_with_def_arg_must_be_def : Error<
6627  "friend declaration specifying a default argument must be a definition">;
6628def err_friend_decl_with_def_arg_redeclared : Error<
6629  "friend declaration specifying a default argument must be the only declaration">;
6630def err_friend_decl_does_not_match : Error<
6631  "friend declaration of %0 does not match any declaration in %1">;
6632def err_member_decl_does_not_match_suggest : Error<
6633  "out-of-line %select{declaration|definition}2 of %0 "
6634  "does not match any declaration in %1; did you mean %3?">;
6635def err_member_def_does_not_match_ret_type : Error<
6636  "return type of out-of-line definition of %q0 differs from "
6637  "that in the declaration">;
6638def err_nonstatic_member_out_of_line : Error<
6639  "non-static data member defined out-of-line">;
6640def err_qualified_typedef_declarator : Error<
6641  "typedef declarator cannot be qualified">;
6642def err_qualified_param_declarator : Error<
6643  "parameter declarator cannot be qualified">;
6644def ext_out_of_line_declaration : ExtWarn<
6645  "out-of-line declaration of a member must be a definition">,
6646  InGroup<OutOfLineDeclaration>, DefaultError;
6647def err_member_extra_qualification : Error<
6648  "extra qualification on member %0">;
6649def warn_member_extra_qualification : Warning<
6650  err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
6651def warn_namespace_member_extra_qualification : Warning<
6652  "extra qualification on member %0">,
6653  InGroup<DiagGroup<"extra-qualification">>;
6654def err_member_qualification : Error<
6655  "non-friend class member %0 cannot have a qualified name">;
6656def note_member_def_close_match : Note<"member declaration nearly matches">;
6657def note_member_def_close_const_match : Note<
6658  "member declaration does not match because "
6659  "it %select{is|is not}0 const qualified">;
6660def note_member_def_close_param_match : Note<
6661  "type of %ordinal0 parameter of member declaration does not match definition"
6662  "%diff{ ($ vs $)|}1,2">;
6663def note_local_decl_close_match : Note<"local declaration nearly matches">;
6664def note_local_decl_close_param_match : Note<
6665  "type of %ordinal0 parameter of local declaration does not match definition"
6666  "%diff{ ($ vs $)|}1,2">;
6667def err_typecheck_ivar_variable_size : Error<
6668  "instance variables must have a constant size">;
6669def err_ivar_reference_type : Error<
6670  "instance variables cannot be of reference type">;
6671def err_typecheck_illegal_increment_decrement : Error<
6672  "cannot %select{decrement|increment}1 value of type %0">;
6673def err_typecheck_expect_int : Error<
6674  "used type %0 where integer is required">;
6675def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
6676  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
6677def err_typecheck_pointer_arith_function_type : Error<
6678  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
6679  "function type%select{|s}2 %1%select{| and %3}2">;
6680def err_typecheck_pointer_arith_void_type : Error<
6681  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
6682def err_typecheck_decl_incomplete_type : Error<
6683  "variable has incomplete type %0">;
6684def ext_typecheck_decl_incomplete_type : ExtWarn<
6685  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
6686  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
6687def err_tentative_def_incomplete_type : Error<
6688  "tentative definition has type %0 that is never completed">;
6689def warn_tentative_incomplete_array : Warning<
6690  "tentative array definition assumed to have one element">;
6691def err_typecheck_incomplete_array_needs_initializer : Error<
6692  "definition of variable with array type needs an explicit size "
6693  "or an initializer">;
6694def err_array_init_not_init_list : Error<
6695  "array initializer must be an initializer "
6696  "list%select{| or string literal| or wide string literal}0">;
6697def err_array_init_narrow_string_into_wchar : Error<
6698  "initializing wide char array with non-wide string literal">;
6699def err_array_init_wide_string_into_char : Error<
6700  "initializing char array with wide string literal">;
6701def err_array_init_incompat_wide_string_into_wchar : Error<
6702  "initializing wide char array with incompatible wide string literal">;
6703def err_array_init_plain_string_into_char8_t : Error<
6704  "initializing 'char8_t' array with plain string literal">;
6705def note_array_init_plain_string_into_char8_t : Note<
6706  "add 'u8' prefix to form a 'char8_t' string literal">;
6707def err_array_init_utf8_string_into_char : Error<
6708  "%select{|ISO C++20 does not permit }0initialization of char array with "
6709  "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">;
6710def warn_cxx20_compat_utf8_string : Warning<
6711  "type of UTF-8 string literal will change from array of const char to "
6712  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
6713def note_cxx20_compat_utf8_string_remove_u8 : Note<
6714  "remove 'u8' prefix to avoid a change of behavior; "
6715  "Clang encodes unprefixed narrow string literals as UTF-8">;
6716def err_array_init_different_type : Error<
6717  "cannot initialize array %diff{of type $ with array of type $|"
6718  "with different type of array}0,1">;
6719def err_array_init_non_constant_array : Error<
6720  "cannot initialize array %diff{of type $ with non-constant array of type $|"
6721  "with different type of array}0,1">;
6722def ext_array_init_copy : Extension<
6723  "initialization of an array "
6724  "%diff{of type $ from a compound literal of type $|"
6725  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
6726// This is intentionally not disabled by -Wno-gnu.
6727def ext_array_init_parens : ExtWarn<
6728  "parenthesized initialization of a member array is a GNU extension">,
6729  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
6730def warn_deprecated_string_literal_conversion : Warning<
6731  "conversion from string literal to %0 is deprecated">,
6732  InGroup<CXX11CompatDeprecatedWritableStr>;
6733def ext_deprecated_string_literal_conversion : ExtWarn<
6734  "ISO C++11 does not allow conversion from string literal to %0">,
6735  InGroup<WritableStrings>, SFINAEFailure;
6736def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
6737def err_typecheck_sclass_fscope : Error<
6738  "illegal storage class on file-scoped variable">;
6739def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
6740  InGroup<MissingDeclarations>;
6741def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
6742  "of a type">, InGroup<MissingDeclarations>;
6743def err_standalone_class_nested_name_specifier : Error<
6744  "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
6745  "have a nested name specifier">;
6746def err_typecheck_sclass_func : Error<"illegal storage class on function">;
6747def err_static_block_func : Error<
6748  "function declared in block scope cannot have 'static' storage class">;
6749def err_typecheck_address_of : Error<"address of %select{bit-field"
6750  "|vector element|property expression|register variable|matrix element}0 requested">;
6751def ext_typecheck_addrof_void : Extension<
6752  "ISO C forbids taking the address of an expression of type 'void'">;
6753def err_unqualified_pointer_member_function : Error<
6754  "must explicitly qualify name of member function when taking its address">;
6755def err_invalid_form_pointer_member_function : Error<
6756  "cannot create a non-constant pointer to member function">;
6757def err_address_of_function_with_pass_object_size_params: Error<
6758  "cannot take address of function %0 because parameter %1 has "
6759  "pass_object_size attribute">;
6760def err_parens_pointer_member_function : Error<
6761  "cannot parenthesize the name of a method when forming a member pointer">;
6762def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
6763  "extra '&' taking address of overloaded function">;
6764def err_typecheck_invalid_lvalue_addrof : Error<
6765  "cannot take the address of an rvalue of type %0">;
6766def ext_typecheck_addrof_temporary : ExtWarn<
6767  "taking the address of a temporary object of type %0">,
6768  InGroup<AddressOfTemporary>, DefaultError;
6769def err_typecheck_addrof_temporary : Error<
6770  "taking the address of a temporary object of type %0">;
6771def err_typecheck_addrof_dtor : Error<
6772  "taking the address of a destructor">;
6773def err_typecheck_unary_expr : Error<
6774  "invalid argument type %0 to unary expression">;
6775def err_typecheck_indirection_requires_pointer : Error<
6776  "indirection requires pointer operand (%0 invalid)">;
6777def ext_typecheck_indirection_through_void_pointer : ExtWarn<
6778  "ISO C++ does not allow indirection on operand of type %0">,
6779  InGroup<DiagGroup<"void-ptr-dereference">>;
6780def warn_indirection_through_null : Warning<
6781  "indirection of non-volatile null pointer will be deleted, not trap">,
6782  InGroup<NullDereference>;
6783def warn_binding_null_to_reference : Warning<
6784  "binding dereferenced null pointer to reference has undefined behavior">,
6785  InGroup<NullDereference>;
6786def note_indirection_through_null : Note<
6787  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
6788def warn_pointer_indirection_from_incompatible_type : Warning<
6789  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
6790  "behavior">,
6791  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6792def warn_taking_address_of_packed_member : Warning<
6793  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
6794  InGroup<DiagGroup<"address-of-packed-member">>;
6795def warn_param_mismatched_alignment : Warning<
6796  "passing %0-byte aligned argument to %1-byte aligned parameter %2 of %3 may result in an unaligned pointer access">,
6797  InGroup<DiagGroup<"align-mismatch">>;
6798
6799def err_objc_object_assignment : Error<
6800  "cannot assign to class object (%0 invalid)">;
6801def err_typecheck_invalid_operands : Error<
6802  "invalid operands to binary expression (%0 and %1)">, Deferrable;
6803def note_typecheck_invalid_operands_converted : Note<
6804  "%select{first|second}0 operand was implicitly converted to type %1">;
6805def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
6806  "logical expression with vector %select{type %1 and non-vector type %2|types"
6807  " %1 and %2}0 is only supported in C++">;
6808def err_typecheck_sub_ptr_compatible : Error<
6809  "%diff{$ and $ are not pointers to compatible types|"
6810  "pointers to incompatible types}0,1">;
6811def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
6812  "ordered comparison between pointer and integer (%0 and %1)">;
6813def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
6814  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
6815def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
6816  "ordered comparison between pointer and zero (%0 and %1)">;
6817def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
6818  "three-way comparison between pointer and zero">;
6819def ext_typecheck_compare_complete_incomplete_pointers : Extension<
6820  "pointer comparisons before C11 "
6821  "need to be between two complete or two incomplete types; "
6822  "%0 is %select{|in}2complete and "
6823  "%1 is %select{|in}3complete">,
6824  InGroup<C11>;
6825def warn_typecheck_ordered_comparison_of_function_pointers : Warning<
6826  "ordered comparison of function pointers (%0 and %1)">,
6827  InGroup<OrderedCompareFunctionPointers>;
6828def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
6829  "ordered comparison of function pointers (%0 and %1)">,
6830  InGroup<OrderedCompareFunctionPointers>;
6831def err_typecheck_ordered_comparison_of_function_pointers : Error<
6832  "ordered comparison of function pointers (%0 and %1)">;
6833def ext_typecheck_comparison_of_fptr_to_void : Extension<
6834  "equality comparison between function pointer and void pointer (%0 and %1)">;
6835def err_typecheck_comparison_of_fptr_to_void : Error<
6836  "equality comparison between function pointer and void pointer (%0 and %1)">;
6837def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
6838  "comparison between pointer and integer (%0 and %1)">,
6839  InGroup<DiagGroup<"pointer-integer-compare">>;
6840def err_typecheck_comparison_of_pointer_integer : Error<
6841  "comparison between pointer and integer (%0 and %1)">;
6842def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
6843  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
6844  InGroup<CompareDistinctPointerType>;
6845def ext_typecheck_cond_incompatible_operands : ExtWarn<
6846  "incompatible operand types (%0 and %1)">;
6847def err_cond_voidptr_arc : Error <
6848  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
6849  "in ARC mode">;
6850def err_typecheck_comparison_of_distinct_pointers : Error<
6851  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
6852def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
6853  "%select{comparison between %diff{ ($ and $)|}0,1"
6854  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
6855  "|conditional operator with the second and third operands of type "
6856  "%diff{ ($ and $)|}0,1}2"
6857  " which are pointers to non-overlapping address spaces">;
6858
6859def select_arith_conv_kind : TextSubstitution<
6860  "%select{arithmetic between|bitwise operation between|comparison of|"
6861  "conditional expression between|compound assignment of}0">;
6862def warn_arith_conv_enum_float : Warning<
6863  "%sub{select_arith_conv_kind}0 "
6864  "%select{floating-point|enumeration}1 type %2 "
6865  "%plural{2:with|4:from|:and}0 "
6866  "%select{enumeration|floating-point}1 type %3">,
6867  InGroup<EnumFloatConversion>, DefaultIgnore;
6868def warn_arith_conv_enum_float_cxx20 : Warning<
6869  "%sub{select_arith_conv_kind}0 "
6870  "%select{floating-point|enumeration}1 type %2 "
6871  "%plural{2:with|4:from|:and}0 "
6872  "%select{enumeration|floating-point}1 type %3 is deprecated">,
6873  InGroup<DeprecatedEnumFloatConversion>;
6874def warn_arith_conv_mixed_enum_types : Warning<
6875  "%sub{select_arith_conv_kind}0 "
6876  "different enumeration types%diff{ ($ and $)|}1,2">,
6877  InGroup<EnumEnumConversion>, DefaultIgnore;
6878def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
6879  "%sub{select_arith_conv_kind}0 "
6880  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
6881  InGroup<DeprecatedEnumEnumConversion>;
6882def warn_arith_conv_mixed_anon_enum_types : Warning<
6883  warn_arith_conv_mixed_enum_types.Text>,
6884  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
6885def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
6886  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6887  InGroup<DeprecatedAnonEnumEnumConversion>;
6888def warn_conditional_mixed_enum_types : Warning<
6889  warn_arith_conv_mixed_enum_types.Text>,
6890  InGroup<EnumCompareConditional>, DefaultIgnore;
6891def warn_conditional_mixed_enum_types_cxx20 : Warning<
6892  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6893  InGroup<DeprecatedEnumCompareConditional>;
6894def warn_comparison_mixed_enum_types : Warning<
6895  warn_arith_conv_mixed_enum_types.Text>,
6896  InGroup<EnumCompare>;
6897def warn_comparison_mixed_enum_types_cxx20 : Warning<
6898  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6899  InGroup<DeprecatedEnumCompare>;
6900def warn_comparison_of_mixed_enum_types_switch : Warning<
6901  "comparison of different enumeration types in switch statement"
6902  "%diff{ ($ and $)|}0,1">,
6903  InGroup<EnumCompareSwitch>;
6904
6905def err_typecheck_assign_const : Error<
6906  "%select{"
6907  "cannot assign to return value because function %1 returns a const value|"
6908  "cannot assign to variable %1 with const-qualified type %2|"
6909  "cannot assign to %select{non-|}1static data member %2 "
6910  "with const-qualified type %3|"
6911  "cannot assign to non-static data member within const member function %1|"
6912  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
6913  "with %select{|nested }3const-qualified data member %4|"
6914  "read-only variable is not assignable}0">;
6915
6916def note_typecheck_assign_const : Note<
6917  "%select{"
6918  "function %1 which returns const-qualified type %2 declared here|"
6919  "variable %1 declared const here|"
6920  "%select{non-|}1static data member %2 declared const here|"
6921  "member function %q1 is declared const here|"
6922  "%select{|nested }1data member %2 declared const here}0">;
6923
6924def warn_unsigned_always_true_comparison : Warning<
6925  "result of comparison of %select{%3|unsigned expression}0 %2 "
6926  "%select{unsigned expression|%3}0 is always %4">,
6927  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
6928def warn_unsigned_char_always_true_comparison : Warning<
6929  "result of comparison of %select{%3|char expression}0 %2 "
6930  "%select{char expression|%3}0 is always %4, since char is interpreted as "
6931  "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore;
6932def warn_unsigned_enum_always_true_comparison : Warning<
6933  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
6934  "%select{unsigned enum expression|%3}0 is always %4">,
6935  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
6936def warn_tautological_constant_compare : Warning<
6937  "result of comparison %select{%3|%1}0 %2 "
6938  "%select{%1|%3}0 is always %4">,
6939  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
6940def warn_tautological_compare_objc_bool : Warning<
6941  "result of comparison of constant %0 with expression of type 'BOOL'"
6942  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
6943  InGroup<TautologicalObjCBoolCompare>;
6944def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
6945def warn_tautological_compare_value_range : Warning<
6946  "result of comparison of "
6947  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
6948  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
6949  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
6950
6951def warn_mixed_sign_comparison : Warning<
6952  "comparison of integers of different signs: %0 and %1">,
6953  InGroup<SignCompare>, DefaultIgnore;
6954def warn_out_of_range_compare : Warning<
6955  "result of comparison of %select{constant %0|true|false}1 with "
6956  "%select{expression of type %2|boolean expression}3 is always %4">,
6957  InGroup<TautologicalOutOfRangeCompare>;
6958def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
6959  InGroup<TautologicalConstantCompare>;
6960def warn_integer_constants_in_conditional_always_true : Warning<
6961  "converting the result of '?:' with integer constants to a boolean always "
6962  "evaluates to 'true'">,
6963  InGroup<TautologicalConstantCompare>;
6964def warn_left_shift_always : Warning<
6965  "converting the result of '<<' to a boolean always evaluates "
6966  "to %select{false|true}0">,
6967  InGroup<TautologicalConstantCompare>;
6968def warn_null_in_arithmetic_operation : Warning<
6969  "use of NULL in arithmetic operation">,
6970  InGroup<NullArithmetic>;
6971def warn_null_in_comparison_operation : Warning<
6972  "comparison between NULL and non-pointer "
6973  "%select{(%1 and NULL)|(NULL and %1)}0">,
6974  InGroup<NullArithmetic>;
6975def err_shift_rhs_only_vector : Error<
6976  "requested shift is a vector of type %0 but the first operand is not a "
6977  "vector (%1)">;
6978
6979def warn_logical_not_on_lhs_of_check : Warning<
6980  "logical not is only applied to the left hand side of this "
6981  "%select{comparison|bitwise operator}0">,
6982  InGroup<LogicalNotParentheses>;
6983def note_logical_not_fix : Note<
6984  "add parentheses after the '!' to evaluate the "
6985  "%select{comparison|bitwise operator}0 first">;
6986def note_logical_not_silence_with_parens : Note<
6987  "add parentheses around left hand side expression to silence this warning">;
6988
6989def err_invalid_this_use : Error<
6990  "invalid use of 'this' outside of a non-static member function">;
6991def err_this_static_member_func : Error<
6992  "'this' cannot be%select{| implicitly}0 used in a static member function "
6993  "declaration">;
6994def err_invalid_member_use_in_static_method : Error<
6995  "invalid use of member %0 in static member function">;
6996def err_invalid_qualified_function_type : Error<
6997  "%select{non-member function|static member function|deduction guide}0 "
6998  "%select{of type %2 |}1cannot have '%3' qualifier">;
6999def err_compound_qualified_function_type : Error<
7000  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
7001  "cannot have '%3' qualifier">;
7002def err_qualified_function_typeid : Error<
7003  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
7004
7005def err_ref_qualifier_overload : Error<
7006  "cannot overload a member function %select{without a ref-qualifier|with "
7007  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
7008  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
7009
7010def err_invalid_non_static_member_use : Error<
7011  "invalid use of non-static data member %0">;
7012def err_nested_non_static_member_use : Error<
7013  "%select{call to non-static member function|use of non-static data member}0 "
7014  "%2 of %1 from nested type %3">;
7015def warn_cxx98_compat_non_static_member_use : Warning<
7016  "use of non-static data member %0 in an unevaluated context is "
7017  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
7018def err_invalid_incomplete_type_use : Error<
7019  "invalid use of incomplete type %0">;
7020def err_builtin_func_cast_more_than_one_arg : Error<
7021  "function-style cast to a builtin type can only take one argument">;
7022def err_value_init_for_array_type : Error<
7023  "array types cannot be value-initialized">;
7024def err_init_for_function_type : Error<
7025  "cannot create object of function type %0">;
7026def warn_format_nonliteral_noargs : Warning<
7027  "format string is not a string literal (potentially insecure)">,
7028  InGroup<FormatSecurity>;
7029def warn_format_nonliteral : Warning<
7030  "format string is not a string literal">,
7031  InGroup<FormatNonLiteral>, DefaultIgnore;
7032
7033def err_unexpected_interface : Error<
7034  "unexpected interface name %0: expected expression">;
7035def err_ref_non_value : Error<"%0 does not refer to a value">;
7036def err_ref_vm_type : Error<
7037  "cannot refer to declaration with a variably modified type inside block">;
7038def err_ref_flexarray_type : Error<
7039  "cannot refer to declaration of structure variable with flexible array member "
7040  "inside block">;
7041def err_ref_array_type : Error<
7042  "cannot refer to declaration with an array type inside block">;
7043def err_property_not_found : Error<
7044  "property %0 not found on object of type %1">;
7045def err_invalid_property_name : Error<
7046  "%0 is not a valid property name (accessing an object of type %1)">;
7047def err_getter_not_found : Error<
7048  "no getter method for read from property">;
7049def err_objc_subscript_method_not_found : Error<
7050  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
7051  "found on object of type %0">;
7052def err_objc_subscript_index_type : Error<
7053  "method index parameter type %0 is not integral type">;
7054def err_objc_subscript_key_type : Error<
7055  "method key parameter type %0 is not object type">;
7056def err_objc_subscript_dic_object_type : Error<
7057  "method object parameter type %0 is not object type">;
7058def err_objc_subscript_object_type : Error<
7059  "cannot assign to this %select{dictionary|array}1 because assigning method's "
7060  "2nd parameter of type %0 is not an Objective-C pointer type">;
7061def err_objc_subscript_base_type : Error<
7062  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
7063def err_objc_multiple_subscript_type_conversion : Error<
7064  "indexing expression is invalid because subscript type %0 has "
7065  "multiple type conversion functions">;
7066def err_objc_subscript_type_conversion : Error<
7067  "indexing expression is invalid because subscript type %0 is not an integral"
7068  " or Objective-C pointer type">;
7069def err_objc_subscript_pointer : Error<
7070  "indexing expression is invalid because subscript type %0 is not an"
7071  " Objective-C pointer">;
7072def err_objc_indexing_method_result_type : Error<
7073  "method for accessing %select{dictionary|array}1 element must have Objective-C"
7074  " object return type instead of %0">;
7075def err_objc_index_incomplete_class_type : Error<
7076  "Objective-C index expression has incomplete class type %0">;
7077def err_illegal_container_subscripting_op : Error<
7078  "illegal operation on Objective-C container subscripting">;
7079def err_property_not_found_forward_class : Error<
7080  "property %0 cannot be found in forward class object %1">;
7081def err_property_not_as_forward_class : Error<
7082  "property %0 refers to an incomplete Objective-C class %1 "
7083  "(with no @interface available)">;
7084def note_forward_class : Note<
7085  "forward declaration of class here">;
7086def err_duplicate_property : Error<
7087  "property has a previous declaration">;
7088def ext_gnu_void_ptr : Extension<
7089  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
7090  InGroup<PointerArith>;
7091def ext_gnu_ptr_func_arith : Extension<
7092  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
7093  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
7094  InGroup<PointerArith>;
7095def err_readonly_message_assignment : Error<
7096  "assigning to 'readonly' return result of an Objective-C message not allowed">;
7097def ext_integer_increment_complex : Extension<
7098  "ISO C does not support '++'/'--' on complex integer type %0">;
7099def ext_integer_complement_complex : Extension<
7100  "ISO C does not support '~' for complex conjugation of %0">;
7101def err_nosetter_property_assignment : Error<
7102  "%select{assignment to readonly property|"
7103  "no setter method %1 for assignment to property}0">;
7104def err_nosetter_property_incdec : Error<
7105  "%select{%select{increment|decrement}1 of readonly property|"
7106  "no setter method %2 for %select{increment|decrement}1 of property}0">;
7107def err_nogetter_property_compound_assignment : Error<
7108  "a getter method is needed to perform a compound assignment on a property">;
7109def err_nogetter_property_incdec : Error<
7110  "no getter method %1 for %select{increment|decrement}0 of property">;
7111def err_no_subobject_property_setting : Error<
7112  "expression is not assignable">;
7113def err_qualified_objc_access : Error<
7114  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
7115
7116def ext_freestanding_complex : Extension<
7117  "complex numbers are an extension in a freestanding C99 implementation">;
7118
7119// FIXME: Remove when we support imaginary.
7120def err_imaginary_not_supported : Error<"imaginary types are not supported">;
7121
7122// Obj-c expressions
7123def warn_root_inst_method_not_found : Warning<
7124  "instance method %0 is being used on 'Class' which is not in the root class">,
7125  InGroup<MethodAccess>;
7126def warn_class_method_not_found : Warning<
7127  "class method %objcclass0 not found (return type defaults to 'id')">,
7128  InGroup<MethodAccess>;
7129def warn_instance_method_on_class_found : Warning<
7130  "instance method %0 found instead of class method %1">,
7131  InGroup<MethodAccess>;
7132def warn_inst_method_not_found : Warning<
7133  "instance method %objcinstance0 not found (return type defaults to 'id')">,
7134  InGroup<MethodAccess>;
7135def warn_instance_method_not_found_with_typo : Warning<
7136  "instance method %objcinstance0 not found (return type defaults to 'id')"
7137  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
7138def warn_class_method_not_found_with_typo : Warning<
7139  "class method %objcclass0 not found (return type defaults to 'id')"
7140  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
7141def err_method_not_found_with_typo : Error<
7142  "%select{instance|class}1 method %0 not found "
7143  "; did you mean %2?">;
7144def err_no_super_class_message : Error<
7145  "no @interface declaration found in class messaging of %0">;
7146def err_root_class_cannot_use_super : Error<
7147  "%0 cannot use 'super' because it is a root class">;
7148def err_invalid_receiver_to_message_super : Error<
7149  "'super' is only valid in a method body">;
7150def err_invalid_receiver_class_message : Error<
7151  "receiver type %0 is not an Objective-C class">;
7152def err_missing_open_square_message_send : Error<
7153  "missing '[' at start of message send expression">;
7154def warn_bad_receiver_type : Warning<
7155  "receiver type %0 is not 'id' or interface pointer, consider "
7156  "casting it to 'id'">,InGroup<ObjCReceiver>;
7157def err_bad_receiver_type : Error<"bad receiver type %0">;
7158def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
7159def err_unknown_receiver_suggest : Error<
7160  "unknown receiver %0; did you mean %1?">;
7161def err_objc_throw_expects_object : Error<
7162  "@throw requires an Objective-C object type (%0 invalid)">;
7163def err_objc_synchronized_expects_object : Error<
7164  "@synchronized requires an Objective-C object type (%0 invalid)">;
7165def err_rethrow_used_outside_catch : Error<
7166  "@throw (rethrow) used outside of a @catch block">;
7167def err_attribute_multiple_objc_gc : Error<
7168  "multiple garbage collection attributes specified for type">;
7169def err_catch_param_not_objc_type : Error<
7170  "@catch parameter is not a pointer to an interface type">;
7171def err_illegal_qualifiers_on_catch_parm : Error<
7172  "illegal qualifiers on @catch parameter">;
7173def err_storage_spec_on_catch_parm : Error<
7174  "@catch parameter cannot have storage specifier '%0'">;
7175def warn_register_objc_catch_parm : Warning<
7176  "'register' storage specifier on @catch parameter will be ignored">;
7177def err_qualified_objc_catch_parm : Error<
7178  "@catch parameter declarator cannot be qualified">;
7179def warn_objc_pointer_cxx_catch_fragile : Warning<
7180  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7181  "exception model">, InGroup<ObjCNonUnifiedException>;
7182def err_objc_object_catch : Error<
7183  "cannot catch an Objective-C object by value">;
7184def err_incomplete_type_objc_at_encode : Error<
7185  "'@encode' of incomplete type %0">;
7186def warn_objc_circular_container : Warning<
7187  "adding %0 to %1 might cause circular dependency in container">,
7188  InGroup<DiagGroup<"objc-circular-container">>;
7189def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7190def warn_objc_unsafe_perform_selector : Warning<
7191  "%0 is incompatible with selectors that return a "
7192  "%select{struct|union|vector}1 type">,
7193  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7194def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7195  "method %0 that returns %1 declared here">;
7196def err_attribute_arm_builtin_alias : Error<
7197  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7198def err_attribute_arm_mve_polymorphism : Error<
7199  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7200
7201def warn_setter_getter_impl_required : Warning<
7202  "property %0 requires method %1 to be defined - "
7203  "use @synthesize, @dynamic or provide a method implementation "
7204  "in this class implementation">,
7205  InGroup<ObjCPropertyImpl>;
7206def warn_setter_getter_impl_required_in_category : Warning<
7207  "property %0 requires method %1 to be defined - "
7208  "use @dynamic or provide a method implementation in this category">,
7209  InGroup<ObjCPropertyImpl>;
7210def note_parameter_named_here : Note<
7211  "passing argument to parameter %0 here">;
7212def note_parameter_here : Note<
7213  "passing argument to parameter here">;
7214def note_method_return_type_change : Note<
7215  "compiler has implicitly changed method %0 return type">;
7216
7217def warn_impl_required_for_class_property : Warning<
7218  "class property %0 requires method %1 to be defined - "
7219  "use @dynamic or provide a method implementation "
7220  "in this class implementation">,
7221  InGroup<ObjCPropertyImpl>;
7222def warn_impl_required_in_category_for_class_property : Warning<
7223  "class property %0 requires method %1 to be defined - "
7224  "use @dynamic or provide a method implementation in this category">,
7225  InGroup<ObjCPropertyImpl>;
7226
7227// C++ casts
7228// These messages adhere to the TryCast pattern: %0 is an int specifying the
7229// cast type, %1 is the source type, %2 is the destination type.
7230def err_bad_reinterpret_cast_overload : Error<
7231  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7232
7233def warn_reinterpret_different_from_static : Warning<
7234  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7235  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7236  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7237def note_reinterpret_updowncast_use_static: Note<
7238  "use 'static_cast' to adjust the pointer correctly while "
7239  "%select{upcasting|downcasting}0">;
7240
7241def err_bad_static_cast_overload : Error<
7242  "address of overloaded function %0 cannot be static_cast to type %1">;
7243
7244def err_bad_cstyle_cast_overload : Error<
7245  "address of overloaded function %0 cannot be cast to type %1">;
7246
7247
7248def err_bad_cxx_cast_generic : Error<
7249  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7250  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7251def err_bad_cxx_cast_unrelated_class : Error<
7252  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7253  "functional-style cast|}0 from %1 to %2, which are not related by "
7254  "inheritance, is not allowed">;
7255def note_type_incomplete : Note<"%0 is incomplete">;
7256def err_bad_cxx_cast_rvalue : Error<
7257  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7258  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7259def err_bad_cxx_cast_bitfield : Error<
7260  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7261  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7262def err_bad_cxx_cast_qualifiers_away : Error<
7263  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7264  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7265def err_bad_cxx_cast_addr_space_mismatch : Error<
7266  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7267  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7268  " spaces">;
7269def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7270  "ISO C++ does not allow "
7271  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7272  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7273  "even though the source and destination types are unrelated">,
7274  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7275def err_bad_const_cast_dest : Error<
7276  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7277  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7278def ext_cast_fn_obj : Extension<
7279  "cast between pointer-to-function and pointer-to-object is an extension">;
7280def ext_ms_cast_fn_obj : ExtWarn<
7281  "static_cast between pointer-to-function and pointer-to-object is a "
7282  "Microsoft extension">, InGroup<MicrosoftCast>;
7283def warn_cxx98_compat_cast_fn_obj : Warning<
7284  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7285  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7286def err_bad_reinterpret_cast_small_int : Error<
7287  "cast from pointer to smaller type %2 loses information">;
7288def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7289  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7290  "to scalar %2 of different size">;
7291def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7292  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7293  "to vector %2 of different size">;
7294def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7295  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7296  "to vector %2 of different size">;
7297def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7298  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7299  "changes address space of nested pointers">,
7300  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7301def err_bad_lvalue_to_rvalue_cast : Error<
7302  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7303  "not compatible">;
7304def err_bad_rvalue_to_rvalue_cast : Error<
7305  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7306  "not compatible">;
7307def err_bad_static_cast_pointer_nonpointer : Error<
7308  "cannot cast from type %1 to pointer type %2">;
7309def err_bad_static_cast_member_pointer_nonmp : Error<
7310  "cannot cast from type %1 to member pointer type %2">;
7311def err_bad_cxx_cast_member_pointer_size : Error<
7312  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7313  "type %1 to member pointer type %2 of different size">;
7314def err_bad_reinterpret_cast_reference : Error<
7315  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7316def warn_undefined_reinterpret_cast : Warning<
7317  "reinterpret_cast from %0 to %1 has undefined behavior">,
7318  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7319
7320// These messages don't adhere to the pattern.
7321// FIXME: Display the path somehow better.
7322def err_ambiguous_base_to_derived_cast : Error<
7323  "ambiguous cast from base %0 to derived %1:%2">;
7324def err_static_downcast_via_virtual : Error<
7325  "cannot cast %0 to %1 via virtual base %2">;
7326def err_downcast_from_inaccessible_base : Error<
7327  "cannot cast %select{private|protected}2 base class %1 to %0">;
7328def err_upcast_to_inaccessible_base : Error<
7329  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7330def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7331  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7332def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7333def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7334def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7335def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7336
7337// Other C++ expressions
7338def err_need_header_before_typeid : Error<
7339  "you need to include <typeinfo> before using the 'typeid' operator">;
7340def err_need_header_before_ms_uuidof : Error<
7341  "you need to include <guiddef.h> before using the '__uuidof' operator">;
7342def err_need_header_before_placement_new : Error<
7343  "no matching %0 function for non-allocating placement new expression; "
7344  "include <new>">;
7345def err_ms___leave_not_in___try : Error<
7346  "'__leave' statement not in __try block">;
7347def err_uuidof_without_guid : Error<
7348  "cannot call operator __uuidof on a type with no GUID">;
7349def err_uuidof_with_multiple_guids : Error<
7350  "cannot call operator __uuidof on a type with multiple GUIDs">;
7351def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7352def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7353def err_static_illegal_in_new : Error<
7354  "the 'static' modifier for the array size is not legal in new expressions">;
7355def err_array_new_needs_size : Error<
7356  "array size must be specified in new expression with no initializer">;
7357def err_bad_new_type : Error<
7358  "cannot allocate %select{function|reference}1 type %0 with new">;
7359def err_new_incomplete_or_sizeless_type : Error<
7360  "allocation of %select{incomplete|sizeless}0 type %1">;
7361def err_new_array_nonconst : Error<
7362  "only the first dimension of an allocated array may have dynamic size">;
7363def err_new_array_size_unknown_from_init : Error<
7364  "cannot determine allocated array size from initializer">;
7365def err_new_array_init_args : Error<
7366  "array 'new' cannot have initialization arguments">;
7367def ext_new_paren_array_nonconst : ExtWarn<
7368  "when type is in parentheses, array cannot have dynamic size">;
7369def err_placement_new_non_placement_delete : Error<
7370  "'new' expression with placement arguments refers to non-placement "
7371  "'operator delete'">;
7372def err_array_size_not_integral : Error<
7373  "array size expression must have integral or %select{|unscoped }0"
7374  "enumeration type, not %1">;
7375def err_array_size_incomplete_type : Error<
7376  "array size expression has incomplete class type %0">;
7377def err_array_size_explicit_conversion : Error<
7378  "array size expression of type %0 requires explicit conversion to type %1">;
7379def note_array_size_conversion : Note<
7380  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7381def err_array_size_ambiguous_conversion : Error<
7382  "ambiguous conversion of array size expression of type %0 to an integral or "
7383  "enumeration type">;
7384def ext_array_size_conversion : Extension<
7385  "implicit conversion from array size expression of type %0 to "
7386  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7387  InGroup<CXX11>;
7388def warn_cxx98_compat_array_size_conversion : Warning<
7389  "implicit conversion from array size expression of type %0 to "
7390  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7391  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7392def err_address_space_qualified_new : Error<
7393  "'new' cannot allocate objects of type %0 in address space '%1'">;
7394def err_address_space_qualified_delete : Error<
7395  "'delete' cannot delete objects of type %0 in address space '%1'">;
7396
7397def err_default_init_const : Error<
7398  "default initialization of an object of const type %0"
7399  "%select{| without a user-provided default constructor}1">;
7400def ext_default_init_const : ExtWarn<
7401  "default initialization of an object of const type %0"
7402  "%select{| without a user-provided default constructor}1 "
7403  "is a Microsoft extension">,
7404  InGroup<MicrosoftConstInit>;
7405def err_delete_operand : Error<"cannot delete expression of type %0">;
7406def ext_delete_void_ptr_operand : ExtWarn<
7407  "cannot delete expression with pointer-to-'void' type %0">,
7408  InGroup<DeleteIncomplete>;
7409def err_ambiguous_delete_operand : Error<
7410  "ambiguous conversion of delete expression of type %0 to a pointer">;
7411def warn_delete_incomplete : Warning<
7412  "deleting pointer to incomplete type %0 may cause undefined behavior">,
7413  InGroup<DeleteIncomplete>;
7414def err_delete_incomplete_class_type : Error<
7415  "deleting incomplete class type %0; no conversions to pointer type">;
7416def err_delete_explicit_conversion : Error<
7417  "converting delete expression from type %0 to type %1 invokes an explicit "
7418  "conversion function">;
7419def note_delete_conversion : Note<"conversion to pointer type %0">;
7420def warn_delete_array_type : Warning<
7421  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
7422def warn_mismatched_delete_new : Warning<
7423  "'delete%select{|[]}0' applied to a pointer that was allocated with "
7424  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
7425  InGroup<DiagGroup<"mismatched-new-delete">>;
7426def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
7427def err_no_suitable_delete_member_function_found : Error<
7428  "no suitable member %0 in %1">;
7429def err_ambiguous_suitable_delete_member_function_found : Error<
7430  "multiple suitable %0 functions in %1">;
7431def warn_ambiguous_suitable_delete_function_found : Warning<
7432  "multiple suitable %0 functions for %1; no 'operator delete' function "
7433  "will be invoked if initialization throws an exception">,
7434  InGroup<DiagGroup<"ambiguous-delete">>;
7435def note_member_declared_here : Note<
7436  "member %0 declared here">;
7437def note_member_first_declared_here : Note<
7438  "member %0 first declared here">;
7439def warn_bitwise_instead_of_logical : Warning<
7440  "use of bitwise '%0' with boolean operands">,
7441  InGroup<BitwiseInsteadOfLogical>, DefaultIgnore;
7442def warn_bitwise_negation_bool : Warning<
7443  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
7444  "did you mean logical negation?">,
7445  InGroup<BoolOperation>, DefaultIgnore;
7446def err_decrement_bool : Error<"cannot decrement expression of type bool">;
7447def warn_increment_bool : Warning<
7448  "incrementing expression of type bool is deprecated and "
7449  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
7450def ext_increment_bool : ExtWarn<
7451  "ISO C++17 does not allow incrementing expression of type bool">,
7452  DefaultError, InGroup<IncrementBool>;
7453def err_increment_decrement_enum : Error<
7454  "cannot %select{decrement|increment}0 expression of enum type %1">;
7455
7456def warn_deprecated_increment_decrement_volatile : Warning<
7457  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
7458  "is deprecated">, InGroup<DeprecatedVolatile>;
7459def warn_deprecated_simple_assign_volatile : Warning<
7460  "use of result of assignment to object of volatile-qualified type %0 "
7461  "is deprecated">, InGroup<DeprecatedVolatile>;
7462def warn_deprecated_compound_assign_volatile : Warning<
7463  "compound assignment to object of volatile-qualified type %0 is deprecated">,
7464  InGroup<DeprecatedVolatile>;
7465def warn_deprecated_volatile_return : Warning<
7466  "volatile-qualified return type %0 is deprecated">,
7467  InGroup<DeprecatedVolatile>;
7468def warn_deprecated_volatile_param : Warning<
7469  "volatile-qualified parameter type %0 is deprecated">,
7470  InGroup<DeprecatedVolatile>;
7471def warn_deprecated_volatile_structured_binding : Warning<
7472  "volatile qualifier in structured binding declaration is deprecated">,
7473  InGroup<DeprecatedVolatile>;
7474
7475def warn_deprecated_altivec_src_compat : Warning<
7476  "Current handling of vector bool and vector pixel types in this context are "
7477  "deprecated. The default behaviour will soon change to that implied by the "
7478  "'-altivec-compat=xl' option">,
7479  InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7480
7481def err_catch_incomplete_ptr : Error<
7482  "cannot catch pointer to incomplete type %0">;
7483def err_catch_incomplete_ref : Error<
7484  "cannot catch reference to incomplete type %0">;
7485def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
7486def err_catch_sizeless : Error<
7487  "cannot catch %select{|reference to }0sizeless type %1">;
7488def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
7489def err_catch_variably_modified : Error<
7490  "cannot catch variably modified type %0">;
7491def err_qualified_catch_declarator : Error<
7492  "exception declarator cannot be qualified">;
7493def err_early_catch_all : Error<"catch-all handler must come last">;
7494def err_bad_memptr_rhs : Error<
7495  "right hand operand to %0 has non-pointer-to-member type %1">;
7496def err_bad_memptr_lhs : Error<
7497  "left hand operand to %0 must be a %select{|pointer to }1class "
7498  "compatible with the right hand operand, but is %2">;
7499def err_memptr_incomplete : Error<
7500  "member pointer has incomplete base type %0">;
7501def warn_exception_caught_by_earlier_handler : Warning<
7502  "exception of type %0 will be caught by earlier handler">,
7503  InGroup<Exceptions>;
7504def note_previous_exception_handler : Note<"for type %0">;
7505def err_exceptions_disabled : Error<
7506  "cannot use '%0' with exceptions disabled">;
7507def err_objc_exceptions_disabled : Error<
7508  "cannot use '%0' with Objective-C exceptions disabled">;
7509def warn_throw_in_noexcept_func : Warning<
7510  "%0 has a non-throwing exception specification but can still throw">,
7511  InGroup<Exceptions>;
7512def note_throw_in_dtor : Note<
7513  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
7514  "non-throwing}1 exception specification">;
7515def note_throw_in_function : Note<"function declared non-throwing here">;
7516def err_seh_try_outside_functions : Error<
7517  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
7518def err_mixing_cxx_try_seh_try : Error<
7519  "cannot use C++ 'try' in the same function as SEH '__try'">;
7520def err_seh_try_unsupported : Error<
7521  "SEH '__try' is not supported on this target">;
7522def note_conflicting_try_here : Note<
7523  "conflicting %0 here">;
7524def warn_jump_out_of_seh_finally : Warning<
7525  "jump out of __finally block has undefined behavior">,
7526  InGroup<DiagGroup<"jump-seh-finally">>;
7527def warn_non_virtual_dtor : Warning<
7528  "%0 has virtual functions but non-virtual destructor">,
7529  InGroup<NonVirtualDtor>, DefaultIgnore;
7530def warn_delete_non_virtual_dtor : Warning<
7531  "%select{delete|destructor}0 called on non-final %1 that has "
7532  "virtual functions but non-virtual destructor">,
7533  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
7534def note_delete_non_virtual : Note<
7535  "qualify call to silence this warning">;
7536def warn_delete_abstract_non_virtual_dtor : Warning<
7537  "%select{delete|destructor}0 called on %1 that is abstract but has "
7538  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
7539def warn_overloaded_virtual : Warning<
7540  "%q0 hides overloaded virtual %select{function|functions}1">,
7541  InGroup<OverloadedVirtual>, DefaultIgnore;
7542def note_hidden_overloaded_virtual_declared_here : Note<
7543  "hidden overloaded virtual function %q0 declared here"
7544  "%select{|: different classes%diff{ ($ vs $)|}2,3"
7545  "|: different number of parameters (%2 vs %3)"
7546  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
7547  "|: different return type%diff{ ($ vs $)|}2,3"
7548  "|: different qualifiers (%2 vs %3)"
7549  "|: different exception specifications}1">;
7550def warn_using_directive_in_header : Warning<
7551  "using namespace directive in global context in header">,
7552  InGroup<HeaderHygiene>, DefaultIgnore;
7553def warn_overaligned_type : Warning<
7554  "type %0 requires %1 bytes of alignment and the default allocator only "
7555  "guarantees %2 bytes">,
7556  InGroup<OveralignedType>, DefaultIgnore;
7557def err_aligned_allocation_unavailable : Error<
7558  "aligned %select{allocation|deallocation}0 function of type '%1' is "
7559  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
7560def note_silence_aligned_allocation_unavailable : Note<
7561  "if you supply your own aligned allocation functions, use "
7562  "-faligned-allocation to silence this diagnostic">;
7563
7564def err_conditional_void_nonvoid : Error<
7565  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
7566  "is of type %0">;
7567def err_conditional_ambiguous : Error<
7568  "conditional expression is ambiguous; "
7569  "%diff{$ can be converted to $ and vice versa|"
7570  "types can be convert to each other}0,1">;
7571def err_conditional_ambiguous_ovl : Error<
7572  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
7573  "can be converted to several common types">;
7574def err_conditional_vector_size : Error<
7575  "vector condition type %0 and result type %1 do not have the same number "
7576  "of elements">;
7577def err_conditional_vector_element_size : Error<
7578  "vector condition type %0 and result type %1 do not have elements of the "
7579  "same size">;
7580def err_conditional_vector_has_void : Error<
7581  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
7582def err_conditional_vector_operand_type
7583    : Error<"enumeration type %0 is not allowed in a vector conditional">;
7584def err_conditional_vector_cond_result_mismatch
7585    : Error<"cannot mix vectors and extended vectors in a vector conditional">;
7586def err_conditional_vector_mismatched
7587    : Error<"vector operands to the vector conditional must be the same type "
7588            "%diff{($ and $)|}0,1}">;
7589
7590def err_throw_incomplete : Error<
7591  "cannot throw object of incomplete type %0">;
7592def err_throw_incomplete_ptr : Error<
7593  "cannot throw pointer to object of incomplete type %0">;
7594def err_throw_sizeless : Error<
7595  "cannot throw object of sizeless type %0">;
7596def warn_throw_underaligned_obj : Warning<
7597  "underaligned exception object thrown">,
7598  InGroup<UnderalignedExceptionObject>;
7599def note_throw_underaligned_obj : Note<
7600  "required alignment of type %0 (%1 bytes) is larger than the supported "
7601  "alignment of C++ exception objects on this target (%2 bytes)">;
7602def err_return_in_constructor_handler : Error<
7603  "return in the catch of a function try block of a constructor is illegal">;
7604def warn_cdtor_function_try_handler_mem_expr : Warning<
7605  "cannot refer to a non-static member from the handler of a "
7606  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
7607
7608let CategoryName = "Lambda Issue" in {
7609  def err_capture_more_than_once : Error<
7610    "%0 can appear only once in a capture list">;
7611  def err_reference_capture_with_reference_default : Error<
7612    "'&' cannot precede a capture when the capture default is '&'">;
7613  def err_copy_capture_with_copy_default : Error<
7614    "'&' must precede a capture when the capture default is '='">;
7615  def err_capture_does_not_name_variable : Error<
7616    "%0 in capture list does not name a variable">;
7617  def err_capture_non_automatic_variable : Error<
7618    "%0 cannot be captured because it does not have automatic storage "
7619    "duration">;
7620  def err_this_capture : Error<
7621    "'this' cannot be %select{implicitly |}0captured in this context">;
7622  def note_lambda_this_capture_fixit : Note<
7623    "explicitly capture 'this'">;
7624  def err_lambda_capture_anonymous_var : Error<
7625    "unnamed variable cannot be implicitly captured in a lambda expression">;
7626  def err_lambda_capture_flexarray_type : Error<
7627    "variable %0 with flexible array member cannot be captured in "
7628    "a lambda expression">;
7629  def err_lambda_impcap : Error<
7630    "variable %0 cannot be implicitly captured in a lambda with no "
7631    "capture-default specified">;
7632  def note_lambda_variable_capture_fixit : Note<
7633    "capture %0 by %select{value|reference}1">;
7634  def note_lambda_default_capture_fixit : Note<
7635    "default capture by %select{value|reference}0">;
7636  def note_lambda_decl : Note<"lambda expression begins here">;
7637  def err_lambda_unevaluated_operand : Error<
7638    "lambda expression in an unevaluated operand">;
7639  def err_lambda_in_constant_expression : Error<
7640    "a lambda expression may not appear inside of a constant expression">;
7641  def err_lambda_in_invalid_context : Error<
7642    "a lambda expression cannot appear in this context">;
7643  def err_lambda_return_init_list : Error<
7644    "cannot deduce lambda return type from initializer list">;
7645  def err_lambda_capture_default_arg : Error<
7646    "lambda expression in default argument cannot capture any entity">;
7647  def err_lambda_incomplete_result : Error<
7648    "incomplete result type %0 in lambda expression">;
7649  def err_noreturn_lambda_has_return_expr : Error<
7650    "lambda declared 'noreturn' should not return">;
7651  def warn_maybe_falloff_nonvoid_lambda : Warning<
7652    "non-void lambda does not return a value in all control paths">,
7653    InGroup<ReturnType>;
7654  def warn_falloff_nonvoid_lambda : Warning<
7655    "non-void lambda does not return a value">,
7656    InGroup<ReturnType>;
7657  def err_access_lambda_capture : Error<
7658    // The ERRORs represent other special members that aren't constructors, in
7659    // hopes that someone will bother noticing and reporting if they appear
7660    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
7661    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
7662    AccessControl;
7663  def note_lambda_to_block_conv : Note<
7664    "implicit capture of lambda object due to conversion to block pointer "
7665    "here">;
7666  def note_var_explicitly_captured_here : Note<"variable %0 is"
7667    "%select{| explicitly}1 captured here">;
7668
7669  // C++14 lambda init-captures.
7670  def warn_cxx11_compat_init_capture : Warning<
7671    "initialized lambda captures are incompatible with C++ standards "
7672    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
7673  def ext_init_capture : ExtWarn<
7674    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
7675  def err_init_capture_no_expression : Error<
7676    "initializer missing for lambda capture %0">;
7677  def err_init_capture_multiple_expressions : Error<
7678    "initializer for lambda capture %0 contains multiple expressions">;
7679  def err_init_capture_paren_braces : Error<
7680    "cannot deduce type for lambda capture %1 from "
7681    "%select{parenthesized|nested}0 initializer list">;
7682  def err_init_capture_deduction_failure : Error<
7683    "cannot deduce type for lambda capture %0 from initializer of type %2">;
7684  def err_init_capture_deduction_failure_from_init_list : Error<
7685    "cannot deduce type for lambda capture %0 from initializer list">;
7686  def warn_cxx17_compat_init_capture_pack : Warning<
7687    "initialized lambda capture packs are incompatible with C++ standards "
7688    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7689  def ext_init_capture_pack : ExtWarn<
7690    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
7691
7692  // C++14 generic lambdas.
7693  def warn_cxx11_compat_generic_lambda : Warning<
7694    "generic lambdas are incompatible with C++11">,
7695    InGroup<CXXPre14Compat>, DefaultIgnore;
7696
7697  // C++17 '*this' captures.
7698  def warn_cxx14_compat_star_this_lambda_capture : Warning<
7699    "by value capture of '*this' is incompatible with C++ standards before C++17">,
7700     InGroup<CXXPre17Compat>, DefaultIgnore;
7701  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
7702    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
7703
7704  // C++17 parameter shadows capture
7705  def err_parameter_shadow_capture : Error<
7706    "a lambda parameter cannot shadow an explicitly captured entity">;
7707
7708  // C++20 [=, this] captures.
7709  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
7710    "explicit capture of 'this' with a capture default of '=' is incompatible "
7711    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7712  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
7713    "explicit capture of 'this' with a capture default of '=' "
7714    "is a C++20 extension">, InGroup<CXX20>;
7715  def warn_deprecated_this_capture : Warning<
7716    "implicit capture of 'this' with a capture default of '=' is deprecated">,
7717    InGroup<DeprecatedThisCapture>, DefaultIgnore;
7718  def note_deprecated_this_capture : Note<
7719    "add an explicit capture of 'this' to capture '*this' by reference">;
7720
7721  // C++20 default constructible / assignable lambdas.
7722  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
7723    "%select{default construction|assignment}0 of lambda is incompatible with "
7724    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7725}
7726
7727def err_return_in_captured_stmt : Error<
7728  "cannot return from %0">;
7729def err_capture_block_variable : Error<
7730  "__block variable %0 cannot be captured in a "
7731  "%select{lambda expression|captured statement}1">;
7732
7733def err_operator_arrow_circular : Error<
7734  "circular pointer delegation detected">;
7735def err_operator_arrow_depth_exceeded : Error<
7736  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
7737  "'operator->' calls">;
7738def note_operator_arrow_here : Note<
7739  "'operator->' declared here produces an object of type %0">;
7740def note_operator_arrows_suppressed : Note<
7741  "(skipping %0 'operator->'%s0 in backtrace)">;
7742def note_operator_arrow_depth : Note<
7743  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
7744
7745def err_pseudo_dtor_base_not_scalar : Error<
7746  "object expression of non-scalar type %0 cannot be used in a "
7747  "pseudo-destructor expression">;
7748def ext_pseudo_dtor_on_void : ExtWarn<
7749  "pseudo-destructors on type void are a Microsoft extension">,
7750  InGroup<MicrosoftVoidPseudoDtor>;
7751def err_pseudo_dtor_type_mismatch : Error<
7752  "the type of object expression "
7753  "%diff{($) does not match the type being destroyed ($)|"
7754  "does not match the type being destroyed}0,1 "
7755  "in pseudo-destructor expression">;
7756def err_pseudo_dtor_call_with_args : Error<
7757  "call to pseudo-destructor cannot have any arguments">;
7758def err_dtor_expr_without_call : Error<
7759  "reference to %select{destructor|pseudo-destructor}0 must be called"
7760  "%select{|; did you mean to call it with no arguments?}1">;
7761def err_pseudo_dtor_destructor_non_type : Error<
7762  "%0 does not refer to a type name in pseudo-destructor expression; expected "
7763  "the name of type %1">;
7764def err_invalid_use_of_function_type : Error<
7765  "a function type is not allowed here">;
7766def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
7767def err_typecheck_bool_condition : Error<
7768  "value of type %0 is not contextually convertible to 'bool'">;
7769def err_typecheck_ambiguous_condition : Error<
7770  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
7771def err_typecheck_nonviable_condition : Error<
7772  "no viable conversion%select{%diff{ from $ to $|}1,2|"
7773  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
7774def err_typecheck_nonviable_condition_incomplete : Error<
7775  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
7776def err_typecheck_deleted_function : Error<
7777  "conversion function %diff{from $ to $|between types}0,1 "
7778  "invokes a deleted function">;
7779
7780def err_expected_class_or_namespace : Error<"%0 is not a class"
7781  "%select{ or namespace|, namespace, or enumeration}1">;
7782def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
7783  "because namespace %1 does not enclose namespace %2">;
7784def err_invalid_declarator_global_scope : Error<
7785  "definition or redeclaration of %0 cannot name the global scope">;
7786def err_invalid_declarator_in_function : Error<
7787  "definition or redeclaration of %0 not allowed inside a function">;
7788def err_invalid_declarator_in_block : Error<
7789  "definition or redeclaration of %0 not allowed inside a block">;
7790def err_not_tag_in_scope : Error<
7791  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
7792
7793def err_no_typeid_with_fno_rtti : Error<
7794  "use of typeid requires -frtti">;
7795def err_no_dynamic_cast_with_fno_rtti : Error<
7796  "use of dynamic_cast requires -frtti">;
7797def warn_no_dynamic_cast_with_rtti_disabled: Warning<
7798  "dynamic_cast will not work since RTTI data is disabled by "
7799  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7800def warn_no_typeid_with_rtti_disabled: Warning<
7801  "typeid will not work since RTTI data is disabled by "
7802  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7803
7804def err_cannot_form_pointer_to_member_of_reference_type : Error<
7805  "cannot form a pointer-to-member to member %0 of reference type %1">;
7806def err_incomplete_object_call : Error<
7807  "incomplete type in call to object of type %0">;
7808
7809def warn_condition_is_assignment : Warning<"using the result of an "
7810  "assignment as a condition without parentheses">,
7811  InGroup<Parentheses>;
7812def warn_free_nonheap_object
7813  : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">,
7814    InGroup<FreeNonHeapObject>;
7815
7816// Completely identical except off by default.
7817def warn_condition_is_idiomatic_assignment : Warning<"using the result "
7818  "of an assignment as a condition without parentheses">,
7819  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
7820def note_condition_assign_to_comparison : Note<
7821  "use '==' to turn this assignment into an equality comparison">;
7822def note_condition_or_assign_to_comparison : Note<
7823  "use '!=' to turn this compound assignment into an inequality comparison">;
7824def note_condition_assign_silence : Note<
7825  "place parentheses around the assignment to silence this warning">;
7826
7827def warn_equality_with_extra_parens : Warning<"equality comparison with "
7828  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
7829def note_equality_comparison_to_assign : Note<
7830  "use '=' to turn this equality comparison into an assignment">;
7831def note_equality_comparison_silence : Note<
7832  "remove extraneous parentheses around the comparison to silence this warning">;
7833
7834// assignment related diagnostics (also for argument passing, returning, etc).
7835// In most of these diagnostics the %2 is a value from the
7836// Sema::AssignmentAction enumeration
7837def err_typecheck_convert_incompatible : Error<
7838  "%select{%diff{assigning to $ from incompatible type $|"
7839  "assigning to type from incompatible type}0,1"
7840  "|%diff{passing $ to parameter of incompatible type $|"
7841  "passing type to parameter of incompatible type}0,1"
7842  "|%diff{returning $ from a function with incompatible result type $|"
7843  "returning type from a function with incompatible result type}0,1"
7844  "|%diff{converting $ to incompatible type $|"
7845  "converting type to incompatible type}0,1"
7846  "|%diff{initializing $ with an expression of incompatible type $|"
7847  "initializing type with an expression of incompatible type}0,1"
7848  "|%diff{sending $ to parameter of incompatible type $|"
7849  "sending type to parameter of incompatible type}0,1"
7850  "|%diff{casting $ to incompatible type $|"
7851  "casting type to incompatible type}0,1}2"
7852  "%select{|; dereference with *|"
7853  "; take the address with &|"
7854  "; remove *|"
7855  "; remove &}3"
7856  "%select{|: different classes%diff{ ($ vs $)|}5,6"
7857  "|: different number of parameters (%5 vs %6)"
7858  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
7859  "|: different return type%diff{ ($ vs $)|}5,6"
7860  "|: different qualifiers (%5 vs %6)"
7861  "|: different exception specifications}4">;
7862def err_typecheck_missing_return_type_incompatible : Error<
7863  "%diff{return type $ must match previous return type $|"
7864  "return type must match previous return type}0,1 when %select{block "
7865  "literal|lambda expression}2 has unspecified explicit return type">;
7866
7867def note_incomplete_class_and_qualified_id : Note<
7868  "conformance of forward class %0 to protocol %1 can not be confirmed">;
7869def warn_incompatible_qualified_id : Warning<
7870  "%select{%diff{assigning to $ from incompatible type $|"
7871  "assigning to type from incompatible type}0,1"
7872  "|%diff{passing $ to parameter of incompatible type $|"
7873  "passing type to parameter of incompatible type}0,1"
7874  "|%diff{returning $ from a function with incompatible result type $|"
7875  "returning type from a function with incompatible result type}0,1"
7876  "|%diff{converting $ to incompatible type $|"
7877  "converting type to incompatible type}0,1"
7878  "|%diff{initializing $ with an expression of incompatible type $|"
7879  "initializing type with an expression of incompatible type}0,1"
7880  "|%diff{sending $ to parameter of incompatible type $|"
7881  "sending type to parameter of incompatible type}0,1"
7882  "|%diff{casting $ to incompatible type $|"
7883  "casting type to incompatible type}0,1}2">;
7884def err_incompatible_qualified_id : Error<
7885  "%select{%diff{assigning to $ from incompatible type $|"
7886  "assigning to type from incompatible type}0,1"
7887  "|%diff{passing $ to parameter of incompatible type $|"
7888  "passing type to parameter of incompatible type}0,1"
7889  "|%diff{returning $ from a function with incompatible result type $|"
7890  "returning type from a function with incompatible result type}0,1"
7891  "|%diff{converting $ to incompatible type $|"
7892  "converting type to incompatible type}0,1"
7893  "|%diff{initializing $ with an expression of incompatible type $|"
7894  "initializing type with an expression of incompatible type}0,1"
7895  "|%diff{sending $ to parameter of incompatible type $|"
7896  "sending type to parameter of incompatible type}0,1"
7897  "|%diff{casting $ to incompatible type $|"
7898  "casting type to incompatible type}0,1}2">;
7899def ext_typecheck_convert_pointer_int : ExtWarn<
7900  "incompatible pointer to integer conversion "
7901  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7902  "|%diff{passing $ to parameter of type $|"
7903  "passing to parameter of different type}0,1"
7904  "|%diff{returning $ from a function with result type $|"
7905  "returning from function with different return type}0,1"
7906  "|%diff{converting $ to type $|converting between types}0,1"
7907  "|%diff{initializing $ with an expression of type $|"
7908  "initializing with expression of different type}0,1"
7909  "|%diff{sending $ to parameter of type $|"
7910  "sending to parameter of different type}0,1"
7911  "|%diff{casting $ to type $|casting between types}0,1}2"
7912  "%select{|; dereference with *|"
7913  "; take the address with &|"
7914  "; remove *|"
7915  "; remove &}3">,
7916  InGroup<IntConversion>;
7917def err_typecheck_convert_pointer_int : Error<
7918  "incompatible pointer to integer conversion "
7919  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7920  "|%diff{passing $ to parameter of type $|"
7921  "passing to parameter of different type}0,1"
7922  "|%diff{returning $ from a function with result type $|"
7923  "returning from function with different return type}0,1"
7924  "|%diff{converting $ to type $|converting between types}0,1"
7925  "|%diff{initializing $ with an expression of type $|"
7926  "initializing with expression of different type}0,1"
7927  "|%diff{sending $ to parameter of type $|"
7928  "sending to parameter of different type}0,1"
7929  "|%diff{casting $ to type $|casting between types}0,1}2"
7930  "%select{|; dereference with *|"
7931  "; take the address with &|"
7932  "; remove *|"
7933  "; remove &}3">;
7934def ext_typecheck_convert_int_pointer : ExtWarn<
7935  "incompatible integer to pointer conversion "
7936  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7937  "|%diff{passing $ to parameter of type $|"
7938  "passing to parameter of different type}0,1"
7939  "|%diff{returning $ from a function with result type $|"
7940  "returning from function with different return type}0,1"
7941  "|%diff{converting $ to type $|converting between types}0,1"
7942  "|%diff{initializing $ with an expression of type $|"
7943  "initializing with expression of different type}0,1"
7944  "|%diff{sending $ to parameter of type $|"
7945  "sending to parameter of different type}0,1"
7946  "|%diff{casting $ to type $|casting between types}0,1}2"
7947  "%select{|; dereference with *|"
7948  "; take the address with &|"
7949  "; remove *|"
7950  "; remove &}3">,
7951  InGroup<IntConversion>, SFINAEFailure;
7952def err_typecheck_convert_int_pointer : Error<
7953  "incompatible integer to pointer conversion "
7954  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7955  "|%diff{passing $ to parameter of type $|"
7956  "passing to parameter of different type}0,1"
7957  "|%diff{returning $ from a function with result type $|"
7958  "returning from function with different return type}0,1"
7959  "|%diff{converting $ to type $|converting between types}0,1"
7960  "|%diff{initializing $ with an expression of type $|"
7961  "initializing with expression of different type}0,1"
7962  "|%diff{sending $ to parameter of type $|"
7963  "sending to parameter of different type}0,1"
7964  "|%diff{casting $ to type $|casting between types}0,1}2"
7965  "%select{|; dereference with *|"
7966  "; take the address with &|"
7967  "; remove *|"
7968  "; remove &}3">;
7969def ext_typecheck_convert_pointer_void_func : Extension<
7970  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7971  "|%diff{passing $ to parameter of type $|"
7972  "passing to parameter of different type}0,1"
7973  "|%diff{returning $ from a function with result type $|"
7974  "returning from function with different return type}0,1"
7975  "|%diff{converting $ to type $|converting between types}0,1"
7976  "|%diff{initializing $ with an expression of type $|"
7977  "initializing with expression of different type}0,1"
7978  "|%diff{sending $ to parameter of type $|"
7979  "sending to parameter of different type}0,1"
7980  "|%diff{casting $ to type $|casting between types}0,1}2"
7981  " converts between void pointer and function pointer">;
7982def err_typecheck_convert_pointer_void_func : Error<
7983  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7984  "|%diff{passing $ to parameter of type $|"
7985  "passing to parameter of different type}0,1"
7986  "|%diff{returning $ from a function with result type $|"
7987  "returning from function with different return type}0,1"
7988  "|%diff{converting $ to type $|converting between types}0,1"
7989  "|%diff{initializing $ with an expression of type $|"
7990  "initializing with expression of different type}0,1"
7991  "|%diff{sending $ to parameter of type $|"
7992  "sending to parameter of different type}0,1"
7993  "|%diff{casting $ to type $|casting between types}0,1}2"
7994  " converts between void pointer and function pointer">;
7995def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
7996  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7997  "|%diff{passing $ to parameter of type $|"
7998  "passing to parameter of different type}0,1"
7999  "|%diff{returning $ from a function with result type $|"
8000  "returning from function with different return type}0,1"
8001  "|%diff{converting $ to type $|converting between types}0,1"
8002  "|%diff{initializing $ with an expression of type $|"
8003  "initializing with expression of different type}0,1"
8004  "|%diff{sending $ to parameter of type $|"
8005  "sending to parameter of different type}0,1"
8006  "|%diff{casting $ to type $|casting between types}0,1}2"
8007  " converts between pointers to integer types %select{with different sign|"
8008  "where one is of the unique plain 'char' type and the other is not}3">,
8009  InGroup<DiagGroup<"pointer-sign">>;
8010def err_typecheck_convert_incompatible_pointer_sign :
8011  Error<ext_typecheck_convert_incompatible_pointer_sign.Text>;
8012def ext_typecheck_convert_incompatible_pointer : ExtWarn<
8013  "incompatible pointer types "
8014  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8015  "|%diff{passing $ to parameter of type $|"
8016  "passing to parameter of different type}0,1"
8017  "|%diff{returning $ from a function with result type $|"
8018  "returning from function with different return type}0,1"
8019  "|%diff{converting $ to type $|converting between types}0,1"
8020  "|%diff{initializing $ with an expression of type $|"
8021  "initializing with expression of different type}0,1"
8022  "|%diff{sending $ to parameter of type $|"
8023  "sending to parameter of different type}0,1"
8024  "|%diff{casting $ to type $|casting between types}0,1}2"
8025  "%select{|; dereference with *|"
8026  "; take the address with &|"
8027  "; remove *|"
8028  "; remove &}3">,
8029  InGroup<IncompatiblePointerTypes>;
8030def err_typecheck_convert_incompatible_pointer : Error<
8031  "incompatible pointer types "
8032  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8033  "|%diff{passing $ to parameter of type $|"
8034  "passing to parameter of different type}0,1"
8035  "|%diff{returning $ from a function with result type $|"
8036  "returning from function with different return type}0,1"
8037  "|%diff{converting $ to type $|converting between types}0,1"
8038  "|%diff{initializing $ with an expression of type $|"
8039  "initializing with expression of different type}0,1"
8040  "|%diff{sending $ to parameter of type $|"
8041  "sending to parameter of different type}0,1"
8042  "|%diff{casting $ to type $|casting between types}0,1}2"
8043  "%select{|; dereference with *|"
8044  "; take the address with &|"
8045  "; remove *|"
8046  "; remove &}3">;
8047def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
8048  "incompatible function pointer types "
8049  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8050  "|%diff{passing $ to parameter of type $|"
8051  "passing to parameter of different type}0,1"
8052  "|%diff{returning $ from a function with result type $|"
8053  "returning from function with different return type}0,1"
8054  "|%diff{converting $ to type $|converting between types}0,1"
8055  "|%diff{initializing $ with an expression of type $|"
8056  "initializing with expression of different type}0,1"
8057  "|%diff{sending $ to parameter of type $|"
8058  "sending to parameter of different type}0,1"
8059  "|%diff{casting $ to type $|casting between types}0,1}2"
8060  "%select{|; dereference with *|"
8061  "; take the address with &|"
8062  "; remove *|"
8063  "; remove &}3">,
8064  InGroup<IncompatibleFunctionPointerTypes>;
8065def err_typecheck_convert_incompatible_function_pointer : Error<
8066  "incompatible function pointer types "
8067  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8068  "|%diff{passing $ to parameter of type $|"
8069  "passing to parameter of different type}0,1"
8070  "|%diff{returning $ from a function with result type $|"
8071  "returning from function with different return type}0,1"
8072  "|%diff{converting $ to type $|converting between types}0,1"
8073  "|%diff{initializing $ with an expression of type $|"
8074  "initializing with expression of different type}0,1"
8075  "|%diff{sending $ to parameter of type $|"
8076  "sending to parameter of different type}0,1"
8077  "|%diff{casting $ to type $|casting between types}0,1}2"
8078  "%select{|; dereference with *|"
8079  "; take the address with &|"
8080  "; remove *|"
8081  "; remove &}3">;
8082def ext_typecheck_convert_discards_qualifiers : ExtWarn<
8083  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8084  "|%diff{passing $ to parameter of type $|"
8085  "passing to parameter of different type}0,1"
8086  "|%diff{returning $ from a function with result type $|"
8087  "returning from function with different return type}0,1"
8088  "|%diff{converting $ to type $|converting between types}0,1"
8089  "|%diff{initializing $ with an expression of type $|"
8090  "initializing with expression of different type}0,1"
8091  "|%diff{sending $ to parameter of type $|"
8092  "sending to parameter of different type}0,1"
8093  "|%diff{casting $ to type $|casting between types}0,1}2"
8094  " discards qualifiers">,
8095  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8096def err_typecheck_convert_discards_qualifiers : Error<
8097  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8098  "|%diff{passing $ to parameter of type $|"
8099  "passing to parameter of different type}0,1"
8100  "|%diff{returning $ from a function with result type $|"
8101  "returning from function with different return type}0,1"
8102  "|%diff{converting $ to type $|converting between types}0,1"
8103  "|%diff{initializing $ with an expression of type $|"
8104  "initializing with expression of different type}0,1"
8105  "|%diff{sending $ to parameter of type $|"
8106  "sending to parameter of different type}0,1"
8107  "|%diff{casting $ to type $|casting between types}0,1}2"
8108  " discards qualifiers">;
8109def ext_nested_pointer_qualifier_mismatch : ExtWarn<
8110  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8111  "|%diff{passing $ to parameter of type $|"
8112  "passing to parameter of different type}0,1"
8113  "|%diff{returning $ from a function with result type $|"
8114  "returning from function with different return type}0,1"
8115  "|%diff{converting $ to type $|converting between types}0,1"
8116  "|%diff{initializing $ with an expression of type $|"
8117  "initializing with expression of different type}0,1"
8118  "|%diff{sending $ to parameter of type $|"
8119  "sending to parameter of different type}0,1"
8120  "|%diff{casting $ to type $|casting between types}0,1}2"
8121  " discards qualifiers in nested pointer types">,
8122  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8123def err_nested_pointer_qualifier_mismatch : Error<
8124  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8125  "|%diff{passing $ to parameter of type $|"
8126  "passing to parameter of different type}0,1"
8127  "|%diff{returning $ from a function with result type $|"
8128  "returning from function with different return type}0,1"
8129  "|%diff{converting $ to type $|converting between types}0,1"
8130  "|%diff{initializing $ with an expression of type $|"
8131  "initializing with expression of different type}0,1"
8132  "|%diff{sending $ to parameter of type $|"
8133  "sending to parameter of different type}0,1"
8134  "|%diff{casting $ to type $|casting between types}0,1}2"
8135  " discards qualifiers in nested pointer types">;
8136def warn_incompatible_vectors : Warning<
8137  "incompatible vector types "
8138  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8139  "|%diff{passing $ to parameter of type $|"
8140  "passing to parameter of different type}0,1"
8141  "|%diff{returning $ from a function with result type $|"
8142  "returning from function with different return type}0,1"
8143  "|%diff{converting $ to type $|converting between types}0,1"
8144  "|%diff{initializing $ with an expression of type $|"
8145  "initializing with expression of different type}0,1"
8146  "|%diff{sending $ to parameter of type $|"
8147  "sending to parameter of different type}0,1"
8148  "|%diff{casting $ to type $|casting between types}0,1}2">,
8149  InGroup<VectorConversion>, DefaultIgnore;
8150def err_incompatible_vectors : Error<
8151  "incompatible vector types "
8152  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8153  "|%diff{passing $ to parameter of type $|"
8154  "passing to parameter of different type}0,1"
8155  "|%diff{returning $ from a function with result type $|"
8156  "returning from function with different return type}0,1"
8157  "|%diff{converting $ to type $|converting between types}0,1"
8158  "|%diff{initializing $ with an expression of type $|"
8159  "initializing with expression of different type}0,1"
8160  "|%diff{sending $ to parameter of type $|"
8161  "sending to parameter of different type}0,1"
8162  "|%diff{casting $ to type $|casting between types}0,1}2">;
8163def err_int_to_block_pointer : Error<
8164  "invalid block pointer conversion "
8165  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8166  "|%diff{passing $ to parameter of type $|"
8167  "passing to parameter of different type}0,1"
8168  "|%diff{returning $ from a function with result type $|"
8169  "returning from function with different return type}0,1"
8170  "|%diff{converting $ to type $|converting between types}0,1"
8171  "|%diff{initializing $ with an expression of type $|"
8172  "initializing with expression of different type}0,1"
8173  "|%diff{sending $ to parameter of type $|"
8174  "sending to parameter of different type}0,1"
8175  "|%diff{casting $ to type $|casting between types}0,1}2">;
8176def err_typecheck_convert_incompatible_block_pointer : Error<
8177  "incompatible block pointer types "
8178  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8179  "|%diff{passing $ to parameter of type $|"
8180  "passing to parameter of different type}0,1"
8181  "|%diff{returning $ from a function with result type $|"
8182  "returning from function with different return type}0,1"
8183  "|%diff{converting $ to type $|converting between types}0,1"
8184  "|%diff{initializing $ with an expression of type $|"
8185  "initializing with expression of different type}0,1"
8186  "|%diff{sending $ to parameter of type $|"
8187  "sending to parameter of different type}0,1"
8188  "|%diff{casting $ to type $|casting between types}0,1}2">;
8189def err_typecheck_incompatible_address_space : Error<
8190  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8191  "|%diff{passing $ to parameter of type $|"
8192  "passing to parameter of different type}0,1"
8193  "|%diff{returning $ from a function with result type $|"
8194  "returning from function with different return type}0,1"
8195  "|%diff{converting $ to type $|converting between types}0,1"
8196  "|%diff{initializing $ with an expression of type $|"
8197  "initializing with expression of different type}0,1"
8198  "|%diff{sending $ to parameter of type $|"
8199  "sending to parameter of different type}0,1"
8200  "|%diff{casting $ to type $|casting between types}0,1}2"
8201  " changes address space of pointer">;
8202def err_typecheck_incompatible_nested_address_space : Error<
8203  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8204  "|%diff{passing $ to parameter of type $|"
8205  "passing to parameter of different type}0,1"
8206  "|%diff{returning $ from a function with result type $|"
8207  "returning from function with different return type}0,1"
8208  "|%diff{converting $ to type $|converting between types}0,1"
8209  "|%diff{initializing $ with an expression of type $|"
8210  "initializing with expression of different type}0,1"
8211  "|%diff{sending $ to parameter of type $|"
8212  "sending to parameter of different type}0,1"
8213  "|%diff{casting $ to type $|casting between types}0,1}2"
8214  " changes address space of nested pointer">;
8215def err_typecheck_incompatible_ownership : Error<
8216  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8217  "|%diff{passing $ to parameter of type $|"
8218  "passing to parameter of different type}0,1"
8219  "|%diff{returning $ from a function with result type $|"
8220  "returning from function with different return type}0,1"
8221  "|%diff{converting $ to type $|converting between types}0,1"
8222  "|%diff{initializing $ with an expression of type $|"
8223  "initializing with expression of different type}0,1"
8224  "|%diff{sending $ to parameter of type $|"
8225  "sending to parameter of different type}0,1"
8226  "|%diff{casting $ to type $|casting between types}0,1}2"
8227  " changes retain/release properties of pointer">;
8228def err_typecheck_comparison_of_distinct_blocks : Error<
8229  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8230
8231def err_typecheck_array_not_modifiable_lvalue : Error<
8232  "array type %0 is not assignable">;
8233def err_typecheck_non_object_not_modifiable_lvalue : Error<
8234  "non-object type %0 is not assignable">;
8235def err_typecheck_expression_not_modifiable_lvalue : Error<
8236  "expression is not assignable">;
8237def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8238  "incomplete type %0 is not assignable">;
8239def err_typecheck_lvalue_casts_not_supported : Error<
8240  "assignment to cast is illegal, lvalue casts are not supported">;
8241
8242def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8243  "vector is not assignable (contains duplicate components)">;
8244def err_block_decl_ref_not_modifiable_lvalue : Error<
8245  "variable is not assignable (missing __block type specifier)">;
8246def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8247  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8248def err_typecheck_call_not_function : Error<
8249  "called object type %0 is not a function or function pointer">;
8250def err_call_incomplete_return : Error<
8251  "calling function with incomplete return type %0">;
8252def err_call_function_incomplete_return : Error<
8253  "calling %0 with incomplete return type %1">;
8254def err_call_incomplete_argument : Error<
8255  "argument type %0 is incomplete">;
8256def err_typecheck_call_too_few_args : Error<
8257  "too few %select{|||execution configuration }0arguments to "
8258  "%select{function|block|method|kernel function}0 call, "
8259  "expected %1, have %2">;
8260def err_typecheck_call_too_few_args_one : Error<
8261  "too few %select{|||execution configuration }0arguments to "
8262  "%select{function|block|method|kernel function}0 call, "
8263  "single argument %1 was not specified">;
8264def err_typecheck_call_too_few_args_at_least : Error<
8265  "too few %select{|||execution configuration }0arguments to "
8266  "%select{function|block|method|kernel function}0 call, "
8267  "expected at least %1, have %2">;
8268def err_typecheck_call_too_few_args_at_least_one : Error<
8269  "too few %select{|||execution configuration }0arguments to "
8270  "%select{function|block|method|kernel function}0 call, "
8271  "at least argument %1 must be specified">;
8272def err_typecheck_call_too_few_args_suggest : Error<
8273  "too few %select{|||execution configuration }0arguments to "
8274  "%select{function|block|method|kernel function}0 call, "
8275  "expected %1, have %2; did you mean %3?">;
8276def err_typecheck_call_too_few_args_at_least_suggest : Error<
8277  "too few %select{|||execution configuration }0arguments to "
8278  "%select{function|block|method|kernel function}0 call, "
8279  "expected at least %1, have %2; did you mean %3?">;
8280def err_typecheck_call_too_many_args : Error<
8281  "too many %select{|||execution configuration }0arguments to "
8282  "%select{function|block|method|kernel function}0 call, "
8283  "expected %1, have %2">;
8284def err_typecheck_call_too_many_args_one : Error<
8285  "too many %select{|||execution configuration }0arguments to "
8286  "%select{function|block|method|kernel function}0 call, "
8287  "expected single argument %1, have %2 arguments">;
8288def err_typecheck_call_too_many_args_at_most : Error<
8289  "too many %select{|||execution configuration }0arguments to "
8290  "%select{function|block|method|kernel function}0 call, "
8291  "expected at most %1, have %2">;
8292def err_typecheck_call_too_many_args_at_most_one : Error<
8293  "too many %select{|||execution configuration }0arguments to "
8294  "%select{function|block|method|kernel function}0 call, "
8295  "expected at most single argument %1, have %2 arguments">;
8296def err_typecheck_call_too_many_args_suggest : Error<
8297  "too many %select{|||execution configuration }0arguments to "
8298  "%select{function|block|method|kernel function}0 call, "
8299  "expected %1, have %2; did you mean %3?">;
8300def err_typecheck_call_too_many_args_at_most_suggest : Error<
8301  "too many %select{|||execution configuration }0arguments to "
8302  "%select{function|block|method|kernel function}0 call, "
8303  "expected at most %1, have %2; did you mean %3?">;
8304
8305def err_arc_typecheck_convert_incompatible_pointer : Error<
8306  "incompatible pointer types passing retainable parameter of type %0"
8307  "to a CF function expecting %1 type">;
8308
8309def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8310
8311def warn_call_wrong_number_of_arguments : Warning<
8312  "too %select{few|many}0 arguments in call to %1">;
8313def err_atomic_builtin_must_be_pointer : Error<
8314  "address argument to atomic builtin must be a pointer (%0 invalid)">;
8315def err_atomic_builtin_must_be_pointer_intptr : Error<
8316  "address argument to atomic builtin must be a pointer to integer or pointer"
8317  " (%0 invalid)">;
8318def err_atomic_builtin_cannot_be_const : Error<
8319  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8320def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8321  "address argument to atomic builtin must be a pointer to integer,"
8322  " floating-point or pointer (%0 invalid)">;
8323def err_atomic_builtin_pointer_size : Error<
8324  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8325  "type (%0 invalid)">;
8326def err_atomic_exclusive_builtin_pointer_size : Error<
8327  "address argument to load or store exclusive builtin must be a pointer to"
8328  " 1,2,4 or 8 byte type (%0 invalid)">;
8329def err_atomic_builtin_ext_int_size : Error<
8330  "Atomic memory operand must have a power-of-two size">;
8331def err_atomic_builtin_ext_int_prohibit : Error<
8332  "argument to atomic builtin of type '_ExtInt' is not supported">;
8333def err_atomic_op_needs_atomic : Error<
8334  "address argument to atomic operation must be a pointer to _Atomic "
8335  "type (%0 invalid)">;
8336def err_atomic_op_needs_non_const_atomic : Error<
8337  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8338  "type (%1 invalid)">;
8339def err_atomic_op_needs_non_const_pointer : Error<
8340  "address argument to atomic operation must be a pointer to non-const "
8341  "type (%0 invalid)">;
8342def err_atomic_op_needs_trivial_copy : Error<
8343  "address argument to atomic operation must be a pointer to a "
8344  "trivially-copyable type (%0 invalid)">;
8345def err_atomic_op_needs_atomic_int_ptr_or_fp : Error<
8346  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8347  "integer, pointer or supported floating point type (%1 invalid)">;
8348def err_atomic_op_needs_atomic_int_or_ptr : Error<
8349  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8350  "integer or pointer (%1 invalid)">;
8351def err_atomic_op_needs_atomic_int : Error<
8352  "address argument to atomic operation must be a pointer to "
8353  "%select{|atomic }0integer (%1 invalid)">;
8354def warn_atomic_op_has_invalid_memory_order : Warning<
8355  "memory order argument to atomic operation is invalid">,
8356  InGroup<DiagGroup<"atomic-memory-ordering">>;
8357def err_atomic_op_has_invalid_synch_scope : Error<
8358  "synchronization scope argument to atomic operation is invalid">;
8359def warn_atomic_implicit_seq_cst : Warning<
8360  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8361  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8362
8363def err_overflow_builtin_must_be_int : Error<
8364  "operand argument to overflow builtin must be an integer (%0 invalid)">;
8365def err_overflow_builtin_must_be_ptr_int : Error<
8366  "result argument to overflow builtin must be a pointer "
8367  "to a non-const integer (%0 invalid)">;
8368def err_overflow_builtin_ext_int_max_size : Error<
8369  "__builtin_mul_overflow does not support signed _ExtInt operands of more "
8370  "than %0 bits">;
8371
8372def err_atomic_load_store_uses_lib : Error<
8373  "atomic %select{load|store}0 requires runtime support that is not "
8374  "available for this target">;
8375
8376def err_nontemporal_builtin_must_be_pointer : Error<
8377  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8378def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8379  "address argument to nontemporal builtin must be a pointer to integer, float, "
8380  "pointer, or a vector of such types (%0 invalid)">;
8381
8382def err_deleted_function_use : Error<"attempt to use a deleted function">;
8383def err_deleted_inherited_ctor_use : Error<
8384  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8385
8386def note_called_by : Note<"called by %0">;
8387def err_kern_type_not_void_return : Error<
8388  "kernel function type %0 must have void return type">;
8389def err_kern_is_nonstatic_method : Error<
8390  "kernel function %0 must be a free function or static member function">;
8391def err_config_scalar_return : Error<
8392  "CUDA special function '%0' must have scalar return type">;
8393def err_kern_call_not_global_function : Error<
8394  "kernel call to non-global function %0">;
8395def err_global_call_not_config : Error<
8396  "call to global function %0 not configured">;
8397def err_ref_bad_target : Error<
8398  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8399  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
8400def note_cuda_const_var_unpromoted : Note<
8401  "const variable cannot be emitted on device side due to dynamic initialization">;
8402def note_cuda_host_var : Note<
8403  "host variable declared here">;
8404def err_ref_bad_target_global_initializer : Error<
8405  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8406  "function %1 in global initializer">;
8407def err_capture_bad_target : Error<
8408  "capture host variable %0 by reference in device or host device lambda function">;
8409def warn_maybe_capture_bad_target_this_ptr : Warning<
8410  "capture host side class data member by this pointer in device or host device lambda function "
8411  "may result in invalid memory access if this pointer is not accessible on device side">,
8412  InGroup<DiagGroup<"gpu-maybe-wrong-side">>;
8413def warn_kern_is_method : Extension<
8414  "kernel function %0 is a member function; this may not be accepted by nvcc">,
8415  InGroup<CudaCompat>;
8416def warn_kern_is_inline : Warning<
8417  "ignored 'inline' attribute on kernel function %0">,
8418  InGroup<CudaCompat>;
8419def err_variadic_device_fn : Error<
8420  "CUDA device code does not support variadic functions">;
8421def err_va_arg_in_device : Error<
8422  "CUDA device code does not support va_arg">;
8423def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
8424def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
8425  "constexpr function %0 without __host__ or __device__ attributes cannot "
8426  "overload __device__ function with same signature.  Add a __host__ "
8427  "attribute, or build with -fno-cuda-host-device-constexpr.">;
8428def note_cuda_conflicting_device_function_declared_here : Note<
8429  "conflicting __device__ function declared here">;
8430def err_cuda_device_exceptions : Error<
8431  "cannot use '%0' in "
8432  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
8433def err_dynamic_var_init : Error<
8434    "dynamic initialization is not supported for "
8435    "__device__, __constant__, __shared__, and __managed__ variables.">;
8436def err_shared_var_init : Error<
8437    "initialization is not supported for __shared__ variables.">;
8438def err_cuda_vla : Error<
8439    "cannot use variable-length arrays in "
8440    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8441def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
8442def err_cuda_host_shared : Error<
8443    "__shared__ local variables not allowed in "
8444    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8445def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
8446    "__managed__ are not allowed on non-static local variables">;
8447def err_cuda_ovl_target : Error<
8448  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
8449  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
8450def note_cuda_ovl_candidate_target_mismatch : Note<
8451    "candidate template ignored: target attributes do not match">;
8452
8453def err_cuda_device_builtin_surftex_cls_template : Error<
8454    "illegal device builtin %select{surface|texture}0 reference "
8455    "class template %1 declared here">;
8456def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
8457    "%0 needs to have exactly %1 template parameters">;
8458def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
8459    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
8460    "%select{a type|an integer or enum value}2">;
8461
8462def err_cuda_device_builtin_surftex_ref_decl : Error<
8463    "illegal device builtin %select{surface|texture}0 reference "
8464    "type %1 declared here">;
8465def note_cuda_device_builtin_surftex_should_be_template_class : Note<
8466    "%0 needs to be instantiated from a class template with proper "
8467    "template arguments">;
8468
8469def err_hip_invalid_args_builtin_mangled_name : Error<
8470    "invalid argument: symbol must be a device-side function or global variable">;
8471
8472def warn_non_pod_vararg_with_format_string : Warning<
8473  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
8474  "%select{function|block|method|constructor}2; expected type from format "
8475  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
8476// The arguments to this diagnostic should match the warning above.
8477def err_cannot_pass_objc_interface_to_vararg_format : Error<
8478  "cannot pass object with interface type %1 by value to variadic "
8479  "%select{function|block|method|constructor}2; expected type from format "
8480  "string was %3">;
8481def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
8482  "cannot pass non-trivial C object of type %0 by value to variadic "
8483  "%select{function|block|method|constructor}1">;
8484
8485
8486def err_cannot_pass_objc_interface_to_vararg : Error<
8487  "cannot pass object with interface type %0 by value through variadic "
8488  "%select{function|block|method|constructor}1">;
8489def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
8490  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
8491  " %select{function|block|method|constructor}2; call will abort at runtime">,
8492  InGroup<NonPODVarargs>, DefaultError;
8493def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
8494  "passing object of trivial but non-POD type %0 through variadic"
8495  " %select{function|block|method|constructor}1 is incompatible with C++98">,
8496  InGroup<CXX98Compat>, DefaultIgnore;
8497def warn_pass_class_arg_to_vararg : Warning<
8498  "passing object of class type %0 through variadic "
8499  "%select{function|block|method|constructor}1"
8500  "%select{|; did you mean to call '%3'?}2">,
8501  InGroup<ClassVarargs>, DefaultIgnore;
8502def err_cannot_pass_to_vararg : Error<
8503  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8504  "%select{function|block|method|constructor}2">;
8505def err_cannot_pass_to_vararg_format : Error<
8506  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8507  "%select{function|block|method|constructor}2; expected type from format "
8508  "string was %3">;
8509
8510def err_typecheck_call_invalid_ordered_compare : Error<
8511  "ordered compare requires two args of floating point type"
8512  "%diff{ ($ and $)|}0,1">;
8513def err_typecheck_call_invalid_unary_fp : Error<
8514  "floating point classification requires argument of floating point type "
8515  "(passed in %0)">;
8516def err_typecheck_cond_expect_int_float : Error<
8517  "used type %0 where integer or floating point type is required">;
8518def err_typecheck_cond_expect_scalar : Error<
8519  "used type %0 where arithmetic or pointer type is required">;
8520def err_typecheck_cond_expect_nonfloat : Error<
8521  "used type %0 where floating point type is not allowed">;
8522def ext_typecheck_cond_one_void : Extension<
8523  "C99 forbids conditional expressions with only one void side">;
8524def err_typecheck_cast_to_incomplete : Error<
8525  "cast to incomplete type %0">;
8526def ext_typecheck_cast_nonscalar : Extension<
8527  "C99 forbids casting nonscalar type %0 to the same type">;
8528def ext_typecheck_cast_to_union : Extension<
8529  "cast to union type is a GNU extension">,
8530  InGroup<GNUUnionCast>;
8531def err_typecheck_cast_to_union_no_type : Error<
8532  "cast to union type from type %0 not present in union">;
8533def err_cast_pointer_from_non_pointer_int : Error<
8534  "operand of type %0 cannot be cast to a pointer type">;
8535def warn_cast_pointer_from_sel : Warning<
8536  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
8537  InGroup<SelTypeCast>;
8538def warn_function_def_in_objc_container : Warning<
8539  "function definition inside an Objective-C container is deprecated">,
8540  InGroup<FunctionDefInObjCContainer>;
8541def err_typecheck_call_requires_real_fp : Error<
8542  "argument type %0 is not a real floating point type">;
8543def err_typecheck_call_different_arg_types : Error<
8544  "arguments are of different types%diff{ ($ vs $)|}0,1">;
8545
8546def warn_cast_calling_conv : Warning<
8547  "cast between incompatible calling conventions '%0' and '%1'; "
8548  "calls through this pointer may abort at runtime">,
8549  InGroup<DiagGroup<"cast-calling-convention">>;
8550def note_change_calling_conv_fixit : Note<
8551  "consider defining %0 with the '%1' calling convention">;
8552def warn_bad_function_cast : Warning<
8553  "cast from function call of type %0 to non-matching type %1">,
8554  InGroup<BadFunctionCast>, DefaultIgnore;
8555def warn_cast_function_type : Warning<
8556  "cast %diff{from $ to $ |}0,1converts to incompatible function type">,
8557  InGroup<CastFunctionType>, DefaultIgnore;
8558def err_cast_pointer_to_non_pointer_int : Error<
8559  "pointer cannot be cast to type %0">;
8560def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">;
8561def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">;
8562def err_typecheck_expect_scalar_operand : Error<
8563  "operand of type %0 where arithmetic or pointer type is required">;
8564def err_typecheck_cond_incompatible_operands : Error<
8565  "incompatible operand types%diff{ ($ and $)|}0,1">;
8566def err_typecheck_expect_flt_or_vector : Error<
8567  "invalid operand of type %0 where floating, complex or "
8568  "a vector of such types is required">;
8569def err_cast_selector_expr : Error<
8570  "cannot type cast @selector expression">;
8571def ext_typecheck_cond_incompatible_pointers : ExtWarn<
8572  "pointer type mismatch%diff{ ($ and $)|}0,1">,
8573  InGroup<DiagGroup<"pointer-type-mismatch">>;
8574def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
8575  "pointer/integer type mismatch in conditional expression"
8576  "%diff{ ($ and $)|}0,1">,
8577  InGroup<DiagGroup<"conditional-type-mismatch">>;
8578def err_typecheck_choose_expr_requires_constant : Error<
8579  "'__builtin_choose_expr' requires a constant expression">;
8580def warn_unused_expr : Warning<"expression result unused">,
8581  InGroup<UnusedValue>;
8582def warn_unused_comma_left_operand : Warning<
8583  "left operand of comma operator has no effect">,
8584  InGroup<UnusedValue>;
8585def warn_unused_voidptr : Warning<
8586  "expression result unused; should this cast be to 'void'?">,
8587  InGroup<UnusedValue>;
8588def warn_unused_property_expr : Warning<
8589 "property access result unused - getters should not be used for side effects">,
8590  InGroup<UnusedGetterReturnValue>;
8591def warn_unused_container_subscript_expr : Warning<
8592 "container access result unused - container access should not be used for side effects">,
8593  InGroup<UnusedValue>;
8594def warn_unused_call : Warning<
8595  "ignoring return value of function declared with %0 attribute">,
8596  InGroup<UnusedValue>;
8597def warn_unused_constructor : Warning<
8598  "ignoring temporary created by a constructor declared with %0 attribute">,
8599  InGroup<UnusedValue>;
8600def warn_unused_constructor_msg : Warning<
8601  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
8602  InGroup<UnusedValue>;
8603def warn_side_effects_unevaluated_context : Warning<
8604  "expression with side effects has no effect in an unevaluated context">,
8605  InGroup<UnevaluatedExpression>;
8606def warn_side_effects_typeid : Warning<
8607  "expression with side effects will be evaluated despite being used as an "
8608  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
8609def warn_unused_result : Warning<
8610  "ignoring return value of function declared with %0 attribute">,
8611  InGroup<UnusedResult>;
8612def warn_unused_result_msg : Warning<
8613  "ignoring return value of function declared with %0 attribute: %1">,
8614  InGroup<UnusedResult>;
8615def warn_unused_volatile : Warning<
8616  "expression result unused; assign into a variable to force a volatile load">,
8617  InGroup<DiagGroup<"unused-volatile-lvalue">>;
8618
8619def ext_cxx14_attr : Extension<
8620  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
8621def ext_cxx17_attr : Extension<
8622  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
8623def ext_cxx20_attr : Extension<
8624  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20>;
8625
8626def warn_unused_comparison : Warning<
8627  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
8628  InGroup<UnusedComparison>;
8629def note_inequality_comparison_to_or_assign : Note<
8630  "use '|=' to turn this inequality comparison into an or-assignment">;
8631
8632def err_incomplete_type_used_in_type_trait_expr : Error<
8633  "incomplete type %0 used in type trait expression">;
8634
8635// C++20 constinit and require_constant_initialization attribute
8636def warn_cxx20_compat_constinit : Warning<
8637  "'constinit' specifier is incompatible with C++ standards before C++20">,
8638  InGroup<CXX20Compat>, DefaultIgnore;
8639def err_constinit_local_variable : Error<
8640  "local variable cannot be declared 'constinit'">;
8641def err_require_constant_init_failed : Error<
8642  "variable does not have a constant initializer">;
8643def note_declared_required_constant_init_here : Note<
8644  "required by %select{'require_constant_initialization' attribute|"
8645  "'constinit' specifier}0 here">;
8646def ext_constinit_missing : ExtWarn<
8647  "'constinit' specifier missing on initializing declaration of %0">,
8648  InGroup<DiagGroup<"missing-constinit">>;
8649def note_constinit_specified_here : Note<"variable declared constinit here">;
8650def err_constinit_added_too_late : Error<
8651  "'constinit' specifier added after initialization of variable">;
8652def warn_require_const_init_added_too_late : Warning<
8653  "'require_constant_initialization' attribute added after initialization "
8654  "of variable">, InGroup<IgnoredAttributes>;
8655def note_constinit_missing_here : Note<
8656  "add the "
8657  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
8658  "to the initializing declaration here">;
8659
8660def err_dimension_expr_not_constant_integer : Error<
8661  "dimension expression does not evaluate to a constant unsigned int">;
8662
8663def err_typecheck_cond_incompatible_operands_null : Error<
8664  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
8665def ext_empty_struct_union : Extension<
8666  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
8667def ext_no_named_members_in_struct_union : Extension<
8668  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
8669def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
8670  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8671  InGroup<CXXCompat>, DefaultIgnore;
8672def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
8673  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8674  InGroup<ExternCCompat>;
8675def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
8676  "volatile qualifiers|const qualifier|volatile qualifier}2">,
8677  InGroup<CastQual>, DefaultIgnore;
8678def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
8679  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
8680def warn_redefine_extname_not_applied : Warning<
8681  "#pragma redefine_extname is applicable to external C declarations only; "
8682  "not applied to %select{function|variable}0 %1">,
8683  InGroup<Pragmas>;
8684} // End of general sema category.
8685
8686// inline asm.
8687let CategoryName = "Inline Assembly Issue" in {
8688  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
8689  def err_asm_invalid_output_constraint : Error<
8690    "invalid output constraint '%0' in asm">;
8691  def err_asm_invalid_lvalue_in_input : Error<
8692    "invalid lvalue in asm input for constraint '%0'">;
8693  def err_asm_invalid_input_constraint : Error<
8694    "invalid input constraint '%0' in asm">;
8695  def err_asm_tying_incompatible_types : Error<
8696    "unsupported inline asm: input with type "
8697    "%diff{$ matching output with type $|}0,1">;
8698  def err_asm_unexpected_constraint_alternatives : Error<
8699    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
8700  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
8701  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
8702  def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">;
8703  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
8704    "global register variables on this target">;
8705  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
8706    "match variable size">;
8707  def err_asm_bad_register_type : Error<"bad type for named register variable">;
8708  def err_asm_invalid_input_size : Error<
8709    "invalid input size for constraint '%0'">;
8710  def err_asm_invalid_output_size : Error<
8711    "invalid output size for constraint '%0'">;
8712  def err_invalid_asm_cast_lvalue : Error<
8713    "invalid use of a cast in a inline asm context requiring an lvalue: "
8714    "remove the cast or build with -fheinous-gnu-extensions">;
8715  def err_invalid_asm_value_for_constraint
8716      : Error <"value '%0' out of range for constraint '%1'">;
8717  def err_asm_non_addr_value_in_memory_constraint : Error <
8718    "reference to a %select{bit-field|vector element|global register variable}0"
8719    " in asm %select{input|output}1 with a memory constraint '%2'">;
8720  def err_asm_input_duplicate_match : Error<
8721    "more than one input constraint matches the same output '%0'">;
8722
8723  def warn_asm_label_on_auto_decl : Warning<
8724    "ignored asm label '%0' on automatic variable">;
8725  def warn_invalid_asm_cast_lvalue : Warning<
8726    "invalid use of a cast in an inline asm context requiring an lvalue: "
8727    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
8728    "for this in the future">;
8729  def warn_asm_mismatched_size_modifier : Warning<
8730    "value size does not match register size specified by the constraint "
8731    "and modifier">,
8732    InGroup<ASMOperandWidths>;
8733
8734  def note_asm_missing_constraint_modifier : Note<
8735    "use constraint modifier \"%0\"">;
8736  def note_asm_input_duplicate_first : Note<
8737    "constraint '%0' is already present here">;
8738 def error_duplicate_asm_operand_name : Error<
8739    "duplicate use of asm operand name \"%0\"">;
8740 def note_duplicate_asm_operand_name : Note<
8741    "asm operand name \"%0\" first referenced here">;
8742}
8743
8744  def error_inoutput_conflict_with_clobber : Error<
8745    "asm-specifier for input or output variable conflicts with asm"
8746    " clobber list">;
8747
8748let CategoryName = "Semantic Issue" in {
8749
8750def err_invalid_conversion_between_matrixes : Error<
8751  "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">;
8752
8753def err_invalid_conversion_between_matrix_and_type : Error<
8754  "conversion between matrix type %0 and incompatible type %1 is not allowed">;
8755
8756def err_invalid_conversion_between_vectors : Error<
8757  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
8758  "size">;
8759def err_invalid_conversion_between_vector_and_integer : Error<
8760  "invalid conversion between vector type %0 and integer type %1 "
8761  "of different size">;
8762
8763def err_opencl_function_pointer : Error<
8764  "%select{pointers|references}0 to functions are not allowed">;
8765
8766def err_opencl_taking_address_capture : Error<
8767  "taking address of a capture is not allowed">;
8768
8769def err_invalid_conversion_between_vector_and_scalar : Error<
8770  "invalid conversion between vector type %0 and scalar type %1">;
8771
8772// C++ member initializers.
8773def err_only_constructors_take_base_inits : Error<
8774  "only constructors take base initializers">;
8775
8776def err_multiple_mem_initialization : Error <
8777  "multiple initializations given for non-static member %0">;
8778def err_multiple_mem_union_initialization : Error <
8779  "initializing multiple members of union">;
8780def err_multiple_base_initialization : Error <
8781  "multiple initializations given for base %0">;
8782
8783def err_mem_init_not_member_or_class : Error<
8784  "member initializer %0 does not name a non-static data member or base "
8785  "class">;
8786
8787def warn_initializer_out_of_order : Warning<
8788  "%select{field|base class}0 %1 will be initialized after "
8789  "%select{field|base}2 %3">,
8790  InGroup<ReorderCtor>, DefaultIgnore;
8791
8792def warn_some_initializers_out_of_order : Warning<
8793  "initializer order does not match the declaration order">,
8794  InGroup<ReorderCtor>, DefaultIgnore;
8795
8796def note_initializer_out_of_order : Note<
8797  "%select{field|base class}0 %1 will be initialized after "
8798  "%select{field|base}2 %3">;
8799
8800def warn_abstract_vbase_init_ignored : Warning<
8801  "initializer for virtual base class %0 of abstract class %1 "
8802  "will never be used">,
8803  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
8804
8805def err_base_init_does_not_name_class : Error<
8806  "constructor initializer %0 does not name a class">;
8807def err_base_init_direct_and_virtual : Error<
8808  "base class initializer %0 names both a direct base class and an "
8809  "inherited virtual base class">;
8810def err_not_direct_base_or_virtual : Error<
8811  "type %0 is not a direct or virtual base of %1">;
8812
8813def err_in_class_initializer_non_const : Error<
8814  "non-const static data member must be initialized out of line">;
8815def err_in_class_initializer_volatile : Error<
8816  "static const volatile data member must be initialized out of line">;
8817def err_in_class_initializer_bad_type : Error<
8818  "static data member of type %0 must be initialized out of line">;
8819def ext_in_class_initializer_float_type : ExtWarn<
8820  "in-class initializer for static data member of type %0 is a GNU extension">,
8821  InGroup<GNUStaticFloatInit>;
8822def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
8823  "in-class initializer for static data member of type %0 requires "
8824  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
8825def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
8826def err_in_class_initializer_literal_type : Error<
8827  "in-class initializer for static data member of type %0 requires "
8828  "'constexpr' specifier">;
8829def err_in_class_initializer_non_constant : Error<
8830  "in-class initializer for static data member is not a constant expression">;
8831def err_default_member_initializer_not_yet_parsed : Error<
8832  "default member initializer for %1 needed within definition of enclosing "
8833  "class %0 outside of member functions">;
8834def note_default_member_initializer_not_yet_parsed : Note<
8835  "default member initializer declared here">;
8836def err_default_member_initializer_cycle
8837    : Error<"default member initializer for %0 uses itself">;
8838
8839def ext_in_class_initializer_non_constant : Extension<
8840  "in-class initializer for static data member is not a constant expression; "
8841  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
8842
8843def err_thread_dynamic_init : Error<
8844  "initializer for thread-local variable must be a constant expression">;
8845def err_thread_nontrivial_dtor : Error<
8846  "type of thread-local variable has non-trivial destruction">;
8847def note_use_thread_local : Note<
8848  "use 'thread_local' to allow this">;
8849
8850// C++ anonymous unions and GNU anonymous structs/unions
8851def ext_anonymous_union : Extension<
8852  "anonymous unions are a C11 extension">, InGroup<C11>;
8853def ext_gnu_anonymous_struct : Extension<
8854  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
8855def ext_c11_anonymous_struct : Extension<
8856  "anonymous structs are a C11 extension">, InGroup<C11>;
8857def err_anonymous_union_not_static : Error<
8858  "anonymous unions at namespace or global scope must be declared 'static'">;
8859def err_anonymous_union_with_storage_spec : Error<
8860  "anonymous union at class scope must not have a storage specifier">;
8861def err_anonymous_struct_not_member : Error<
8862  "anonymous %select{structs|structs and classes}0 must be "
8863  "%select{struct or union|class}0 members">;
8864def err_anonymous_record_member_redecl : Error<
8865  "member of anonymous %select{struct|union}0 redeclares %1">;
8866def err_anonymous_record_with_type : Error<
8867  "types cannot be declared in an anonymous %select{struct|union}0">;
8868def ext_anonymous_record_with_type : Extension<
8869  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
8870  "extension">, InGroup<MicrosoftAnonTag>;
8871def ext_anonymous_record_with_anonymous_type : Extension<
8872  "anonymous types declared in an anonymous %select{struct|union}0 "
8873  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
8874def err_anonymous_record_with_function : Error<
8875  "functions cannot be declared in an anonymous %select{struct|union}0">;
8876def err_anonymous_record_with_static : Error<
8877  "static members cannot be declared in an anonymous %select{struct|union}0">;
8878def err_anonymous_record_bad_member : Error<
8879  "anonymous %select{struct|union}0 can only contain non-static data members">;
8880def err_anonymous_record_nonpublic_member : Error<
8881  "anonymous %select{struct|union}0 cannot contain a "
8882  "%select{private|protected}1 data member">;
8883def ext_ms_anonymous_record : ExtWarn<
8884  "anonymous %select{structs|unions}0 are a Microsoft extension">,
8885  InGroup<MicrosoftAnonTag>;
8886
8887// C++ local classes
8888def err_reference_to_local_in_enclosing_context : Error<
8889  "reference to local %select{variable|binding}1 %0 declared in enclosing "
8890  "%select{%3|block literal|lambda expression|context}2">;
8891
8892def err_static_data_member_not_allowed_in_local_class : Error<
8893  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
8894
8895// C++ derived classes
8896def err_base_clause_on_union : Error<"unions cannot have base classes">;
8897def err_base_must_be_class : Error<"base specifier must name a class">;
8898def err_union_as_base_class : Error<"unions cannot be base classes">;
8899def err_circular_inheritance : Error<
8900  "circular inheritance between %0 and %1">;
8901def err_base_class_has_flexible_array_member : Error<
8902  "base class %0 has a flexible array member">;
8903def err_incomplete_base_class : Error<"base class has incomplete type">;
8904def err_duplicate_base_class : Error<
8905  "base class %0 specified more than once as a direct base class">;
8906def warn_inaccessible_base_class : Warning<
8907  "direct base %0 is inaccessible due to ambiguity:%1">,
8908  InGroup<DiagGroup<"inaccessible-base">>;
8909// FIXME: better way to display derivation?  Pass entire thing into diagclient?
8910def err_ambiguous_derived_to_base_conv : Error<
8911  "ambiguous conversion from derived class %0 to base class %1:%2">;
8912def err_ambiguous_memptr_conv : Error<
8913  "ambiguous conversion from pointer to member of %select{base|derived}0 "
8914  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
8915def ext_ms_ambiguous_direct_base : ExtWarn<
8916  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
8917  InGroup<MicrosoftInaccessibleBase>;
8918
8919def err_memptr_conv_via_virtual : Error<
8920  "conversion from pointer to member of class %0 to pointer to member "
8921  "of class %1 via virtual base %2 is not allowed">;
8922
8923// C++ member name lookup
8924def err_ambiguous_member_multiple_subobjects : Error<
8925  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
8926def err_ambiguous_member_multiple_subobject_types : Error<
8927  "member %0 found in multiple base classes of different types">;
8928def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
8929def note_ambiguous_member_type_found : Note<
8930  "member type %0 found by ambiguous name lookup">;
8931def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
8932def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
8933def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
8934  "declaration in a different namespace">;
8935def note_hidden_tag : Note<"type declaration hidden">;
8936def note_hiding_object : Note<"declaration hides type">;
8937
8938// C++ operator overloading
8939def err_operator_overload_needs_class_or_enum : Error<
8940  "overloaded %0 must have at least one parameter of class "
8941  "or enumeration type">;
8942
8943def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
8944def err_operator_overload_static : Error<
8945  "overloaded %0 cannot be a static member function">;
8946def err_operator_overload_default_arg : Error<
8947  "parameter of overloaded %0 cannot have a default argument">;
8948def err_operator_overload_must_be : Error<
8949  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
8950  "(has %1 parameter%s1)">;
8951
8952def err_operator_overload_must_be_member : Error<
8953  "overloaded %0 must be a non-static member function">;
8954def err_operator_overload_post_incdec_must_be_int : Error<
8955  "parameter of overloaded post-%select{increment|decrement}1 operator must "
8956  "have type 'int' (not %0)">;
8957
8958// C++ allocation and deallocation functions.
8959def err_operator_new_delete_declared_in_namespace : Error<
8960  "%0 cannot be declared inside a namespace">;
8961def err_operator_new_delete_declared_static : Error<
8962  "%0 cannot be declared static in global scope">;
8963def ext_operator_new_delete_declared_inline : ExtWarn<
8964  "replacement function %0 cannot be declared 'inline'">,
8965  InGroup<DiagGroup<"inline-new-delete">>;
8966def err_operator_new_delete_invalid_result_type : Error<
8967  "%0 must return type %1">;
8968def err_operator_new_delete_dependent_result_type : Error<
8969  "%0 cannot have a dependent return type; use %1 instead">;
8970def err_operator_new_delete_too_few_parameters : Error<
8971  "%0 must have at least one parameter">;
8972def err_operator_new_delete_template_too_few_parameters : Error<
8973  "%0 template must have at least two parameters">;
8974def warn_operator_new_returns_null : Warning<
8975  "%0 should not return a null pointer unless it is declared 'throw()'"
8976  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
8977
8978def err_operator_new_dependent_param_type : Error<
8979  "%0 cannot take a dependent type as first parameter; "
8980  "use size_t (%1) instead">;
8981def err_operator_new_param_type : Error<
8982  "%0 takes type size_t (%1) as first parameter">;
8983def err_operator_new_default_arg: Error<
8984  "parameter of %0 cannot have a default argument">;
8985def err_operator_delete_dependent_param_type : Error<
8986  "%0 cannot take a dependent type as first parameter; use %1 instead">;
8987def err_operator_delete_param_type : Error<
8988  "first parameter of %0 must have type %1">;
8989def err_destroying_operator_delete_not_usual : Error<
8990  "destroying operator delete can have only an optional size and optional "
8991  "alignment parameter">;
8992def note_implicit_delete_this_in_destructor_here : Note<
8993  "while checking implicit 'delete this' for virtual destructor">;
8994def err_builtin_operator_new_delete_not_usual : Error<
8995  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
8996  "selects non-usual %select{allocation|deallocation}0 function">;
8997def note_non_usual_function_declared_here : Note<
8998  "non-usual %0 declared here">;
8999
9000// C++ literal operators
9001def err_literal_operator_outside_namespace : Error<
9002  "literal operator %0 must be in a namespace or global scope">;
9003def err_literal_operator_id_outside_namespace : Error<
9004  "non-namespace scope '%0' cannot have a literal operator member">;
9005def err_literal_operator_default_argument : Error<
9006  "literal operator cannot have a default argument">;
9007def err_literal_operator_bad_param_count : Error<
9008  "non-template literal operator must have one or two parameters">;
9009def err_literal_operator_invalid_param : Error<
9010  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
9011def err_literal_operator_param : Error<
9012  "invalid literal operator parameter type %0, did you mean %1?">;
9013def err_literal_operator_template_with_params : Error<
9014  "literal operator template cannot have any parameters">;
9015def err_literal_operator_template : Error<
9016  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
9017def err_literal_operator_extern_c : Error<
9018  "literal operator must have C++ linkage">;
9019def ext_string_literal_operator_template : ExtWarn<
9020  "string literal operator templates are a GNU extension">,
9021  InGroup<GNUStringLiteralOperatorTemplate>;
9022def warn_user_literal_reserved : Warning<
9023  "user-defined literal suffixes not starting with '_' are reserved"
9024  "%select{; no literal will invoke this operator|}0">,
9025  InGroup<UserDefinedLiterals>;
9026
9027// C++ conversion functions
9028def err_conv_function_not_member : Error<
9029  "conversion function must be a non-static member function">;
9030def err_conv_function_return_type : Error<
9031  "conversion function cannot have a return type">;
9032def err_conv_function_with_params : Error<
9033  "conversion function cannot have any parameters">;
9034def err_conv_function_variadic : Error<
9035  "conversion function cannot be variadic">;
9036def err_conv_function_to_array : Error<
9037  "conversion function cannot convert to an array type">;
9038def err_conv_function_to_function : Error<
9039  "conversion function cannot convert to a function type">;
9040def err_conv_function_with_complex_decl : Error<
9041  "cannot specify any part of a return type in the "
9042  "declaration of a conversion function"
9043  "%select{"
9044  "; put the complete type after 'operator'|"
9045  "; use a typedef to declare a conversion to %1|"
9046  "; use an alias template to declare a conversion to %1|"
9047  "}0">;
9048def err_conv_function_redeclared : Error<
9049  "conversion function cannot be redeclared">;
9050def warn_conv_to_self_not_used : Warning<
9051  "conversion function converting %0 to itself will never be used">,
9052  InGroup<ClassConversion>;
9053def warn_conv_to_base_not_used : Warning<
9054  "conversion function converting %0 to its base class %1 will never be used">,
9055  InGroup<ClassConversion>;
9056def warn_conv_to_void_not_used : Warning<
9057  "conversion function converting %0 to %1 will never be used">,
9058  InGroup<ClassConversion>;
9059
9060def warn_not_compound_assign : Warning<
9061  "use of unary operator that may be intended as compound assignment (%0=)">;
9062
9063// C++11 explicit conversion operators
9064def ext_explicit_conversion_functions : ExtWarn<
9065  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
9066def warn_cxx98_compat_explicit_conversion_functions : Warning<
9067  "explicit conversion functions are incompatible with C++98">,
9068  InGroup<CXX98Compat>, DefaultIgnore;
9069
9070// C++11 defaulted functions
9071def err_defaulted_special_member_params : Error<
9072  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9073  "have default arguments">;
9074def err_defaulted_special_member_variadic : Error<
9075  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9076  "be variadic">;
9077def err_defaulted_special_member_return_type : Error<
9078  "explicitly-defaulted %select{copy|move}0 assignment operator must "
9079  "return %1">;
9080def err_defaulted_special_member_quals : Error<
9081  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
9082  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
9083def err_defaulted_special_member_volatile_param : Error<
9084  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
9085  "may not be volatile">;
9086def err_defaulted_special_member_move_const_param : Error<
9087  "the parameter for an explicitly-defaulted move "
9088  "%select{constructor|assignment operator}0 may not be const">;
9089def err_defaulted_special_member_copy_const_param : Error<
9090  "the parameter for this explicitly-defaulted copy "
9091  "%select{constructor|assignment operator}0 is const, but a member or base "
9092  "requires it to be non-const">;
9093def err_defaulted_copy_assign_not_ref : Error<
9094  "the parameter for an explicitly-defaulted copy assignment operator must be an "
9095  "lvalue reference type">;
9096def err_incorrect_defaulted_constexpr : Error<
9097  "defaulted definition of %sub{select_special_member_kind}0 "
9098  "is not constexpr">;
9099def err_incorrect_defaulted_consteval : Error<
9100  "defaulted declaration of %sub{select_special_member_kind}0 "
9101  "cannot be consteval because implicit definition is not constexpr">;
9102def warn_defaulted_method_deleted : Warning<
9103  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
9104  "deleted">, InGroup<DefaultedFunctionDeleted>;
9105def err_out_of_line_default_deletes : Error<
9106  "defaulting this %sub{select_special_member_kind}0 "
9107  "would delete it after its first declaration">;
9108def note_deleted_type_mismatch : Note<
9109  "function is implicitly deleted because its declared type does not match "
9110  "the type of an implicit %sub{select_special_member_kind}0">;
9111def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
9112  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
9113  "different from the implicit type is incompatible with C++ standards before "
9114  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9115def warn_vbase_moved_multiple_times : Warning<
9116  "defaulted move assignment operator of %0 will move assign virtual base "
9117  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
9118def note_vbase_moved_here : Note<
9119  "%select{%1 is a virtual base class of base class %2 declared here|"
9120  "virtual base class %1 declared here}0">;
9121
9122// C++20 defaulted comparisons
9123// This corresponds to values of Sema::DefaultedComparisonKind.
9124def select_defaulted_comparison_kind : TextSubstitution<
9125  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
9126  "operator">;
9127def ext_defaulted_comparison : ExtWarn<
9128  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
9129def warn_cxx17_compat_defaulted_comparison : Warning<
9130  "defaulted comparison operators are incompatible with C++ standards "
9131  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9132def err_defaulted_comparison_template : Error<
9133  "comparison operator template cannot be defaulted">;
9134def err_defaulted_comparison_out_of_class : Error<
9135  "%sub{select_defaulted_comparison_kind}0 can only be defaulted in a class "
9136  "definition">;
9137def err_defaulted_comparison_param : Error<
9138  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
9139  "; found %1, expected %2%select{| or %4}3">;
9140def err_defaulted_comparison_param_mismatch : Error<
9141  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
9142  "must have the same type%diff{ (found $ vs $)|}1,2">;
9143def err_defaulted_comparison_non_const : Error<
9144  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
9145  "const-qualified">;
9146def err_defaulted_comparison_return_type_not_bool : Error<
9147  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9148  "must be 'bool', not %1">;
9149def err_defaulted_comparison_deduced_return_type_not_auto : Error<
9150  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9151  "must be 'auto', not %1">;
9152def warn_defaulted_comparison_deleted : Warning<
9153  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
9154  "deleted">, InGroup<DefaultedFunctionDeleted>;
9155def err_non_first_default_compare_deletes : Error<
9156  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
9157  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
9158  "would delete it after its first declaration">;
9159def note_defaulted_comparison_union : Note<
9160  "defaulted %0 is implicitly deleted because "
9161  "%2 is a %select{union-like class|union}1 with variant members">;
9162def note_defaulted_comparison_reference_member : Note<
9163  "defaulted %0 is implicitly deleted because "
9164  "class %1 has a reference member">;
9165def note_defaulted_comparison_ambiguous : Note<
9166  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
9167  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
9168def note_defaulted_comparison_inaccessible : Note<
9169  "defaulted %0 is implicitly deleted because it would invoke a "
9170  "%select{private|protected}3 %4%select{ member of %6|"
9171  " member of %6 to compare member %2| to compare base class %2}1">;
9172def note_defaulted_comparison_calls_deleted : Note<
9173  "defaulted %0 is implicitly deleted because it would invoke a deleted "
9174  "comparison function%select{| for member %2| for base class %2}1">;
9175def note_defaulted_comparison_no_viable_function : Note<
9176  "defaulted %0 is implicitly deleted because there is no viable "
9177  "%select{three-way comparison function|'operator=='}1 for "
9178  "%select{|member |base class }2%3">;
9179def note_defaulted_comparison_no_viable_function_synthesized : Note<
9180  "three-way comparison cannot be synthesized because there is no viable "
9181  "function for %select{'=='|'<'}0 comparison">;
9182def note_defaulted_comparison_not_rewritten_callee : Note<
9183  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
9184  "function would be the best match for the comparison">;
9185def note_defaulted_comparison_not_rewritten_conversion : Note<
9186  "defaulted %0 is implicitly deleted because a builtin comparison function "
9187  "using this conversion would be the best match for the comparison">;
9188def note_defaulted_comparison_cannot_deduce : Note<
9189  "return type of defaulted 'operator<=>' cannot be deduced because "
9190  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
9191  "is not a standard comparison category type">;
9192def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
9193  "return type of defaulted 'operator<=>' cannot be deduced because "
9194  "three-way comparison for %select{|member|base class}0 %1 "
9195  "has a deduced return type and is not yet defined">;
9196def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
9197  "%select{|member|base class}0 %1 declared here">;
9198def note_defaulted_comparison_cannot_deduce_callee : Note<
9199  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
9200def err_incorrect_defaulted_comparison_constexpr : Error<
9201  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
9202  "three-way comparison operator}0 "
9203  "cannot be declared %select{constexpr|consteval}2 because "
9204  "%select{it|the corresponding implicit 'operator=='}0 "
9205  "invokes a non-constexpr comparison function">;
9206def note_defaulted_comparison_not_constexpr : Note<
9207  "non-constexpr comparison function would be used to compare "
9208  "%select{|member %1|base class %1}0">;
9209def note_defaulted_comparison_not_constexpr_here : Note<
9210  "non-constexpr comparison function declared here">;
9211def note_in_declaration_of_implicit_equality_comparison : Note<
9212  "while declaring the corresponding implicit 'operator==' "
9213  "for this defaulted 'operator<=>'">;
9214
9215def ext_implicit_exception_spec_mismatch : ExtWarn<
9216  "function previously declared with an %select{explicit|implicit}0 exception "
9217  "specification redeclared with an %select{implicit|explicit}0 exception "
9218  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
9219
9220def warn_ptr_arith_precedes_bounds : Warning<
9221  "the pointer decremented by %0 refers before the beginning of the array">,
9222  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9223def warn_ptr_arith_exceeds_bounds : Warning<
9224  "the pointer incremented by %0 refers past the end of the array (that "
9225  "contains %1 element%s2)">,
9226  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9227def warn_array_index_precedes_bounds : Warning<
9228  "array index %0 is before the beginning of the array">,
9229  InGroup<ArrayBounds>;
9230def warn_array_index_exceeds_bounds : Warning<
9231  "array index %0 is past the end of the array (which contains %1 "
9232  "element%s2)">, InGroup<ArrayBounds>;
9233def warn_ptr_arith_exceeds_max_addressable_bounds : Warning<
9234  "the pointer incremented by %0 refers past the last possible element for an array in %1-bit "
9235  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9236  InGroup<ArrayBounds>;
9237def warn_array_index_exceeds_max_addressable_bounds : Warning<
9238  "array index %0 refers past the last possible element for an array in %1-bit "
9239  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9240  InGroup<ArrayBounds>;
9241def note_array_declared_here : Note<
9242  "array %0 declared here">;
9243
9244def warn_printf_insufficient_data_args : Warning<
9245  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9246def warn_printf_data_arg_not_used : Warning<
9247  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9248def warn_format_invalid_conversion : Warning<
9249  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9250def warn_printf_incomplete_specifier : Warning<
9251  "incomplete format specifier">, InGroup<Format>;
9252def warn_missing_format_string : Warning<
9253  "format string missing">, InGroup<Format>;
9254def warn_scanf_nonzero_width : Warning<
9255  "zero field width in scanf format string is unused">,
9256  InGroup<Format>;
9257def warn_format_conversion_argument_type_mismatch : Warning<
9258  "format specifies type %0 but the argument has "
9259  "%select{type|underlying type}2 %1">,
9260  InGroup<Format>;
9261def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9262  warn_format_conversion_argument_type_mismatch.Text>,
9263  InGroup<FormatPedantic>;
9264def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9265  warn_format_conversion_argument_type_mismatch.Text>,
9266  InGroup<FormatTypeConfusion>, DefaultIgnore;
9267def warn_format_argument_needs_cast : Warning<
9268  "%select{values of type|enum values with underlying type}2 '%0' should not "
9269  "be used as format arguments; add an explicit cast to %1 instead">,
9270  InGroup<Format>;
9271def warn_format_argument_needs_cast_pedantic : Warning<
9272  warn_format_argument_needs_cast.Text>,
9273  InGroup<FormatPedantic>, DefaultIgnore;
9274def warn_printf_positional_arg_exceeds_data_args : Warning <
9275  "data argument position '%0' exceeds the number of data arguments (%1)">,
9276  InGroup<Format>;
9277def warn_format_zero_positional_specifier : Warning<
9278  "position arguments in format strings start counting at 1 (not 0)">,
9279  InGroup<Format>;
9280def warn_format_invalid_positional_specifier : Warning<
9281  "invalid position specified for %select{field width|field precision}0">,
9282  InGroup<Format>;
9283def warn_format_mix_positional_nonpositional_args : Warning<
9284  "cannot mix positional and non-positional arguments in format string">,
9285  InGroup<Format>;
9286def warn_static_array_too_small : Warning<
9287  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9288  " callee requires at least %1">,
9289  InGroup<ArrayBounds>;
9290def note_callee_static_array : Note<
9291  "callee declares array parameter as static here">;
9292def warn_empty_format_string : Warning<
9293  "format string is empty">, InGroup<FormatZeroLength>;
9294def warn_format_string_is_wide_literal : Warning<
9295  "format string should not be a wide string">, InGroup<Format>;
9296def warn_printf_format_string_contains_null_char : Warning<
9297  "format string contains '\\0' within the string body">, InGroup<Format>;
9298def warn_printf_format_string_not_null_terminated : Warning<
9299  "format string is not null-terminated">, InGroup<Format>;
9300def warn_printf_asterisk_missing_arg : Warning<
9301  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9302  InGroup<Format>;
9303def warn_printf_asterisk_wrong_type : Warning<
9304  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9305  InGroup<Format>;
9306def warn_printf_nonsensical_optional_amount: Warning<
9307  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9308  InGroup<Format>;
9309def warn_printf_nonsensical_flag: Warning<
9310  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9311  InGroup<Format>;
9312def warn_format_nonsensical_length: Warning<
9313  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9314  InGroup<Format>;
9315def warn_format_non_standard_positional_arg: Warning<
9316  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9317def warn_format_non_standard: Warning<
9318  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
9319  InGroup<FormatNonStandard>, DefaultIgnore;
9320def warn_format_non_standard_conversion_spec: Warning<
9321  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
9322  InGroup<FormatNonStandard>, DefaultIgnore;
9323def err_invalid_mask_type_size : Error<
9324  "mask type size must be between 1-byte and 8-bytes">;
9325def warn_format_invalid_annotation : Warning<
9326  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
9327  InGroup<Format>;
9328def warn_format_P_no_precision : Warning<
9329  "using '%%P' format specifier without precision">,
9330  InGroup<Format>;
9331def warn_printf_ignored_flag: Warning<
9332  "flag '%0' is ignored when flag '%1' is present">,
9333  InGroup<Format>;
9334def warn_printf_empty_objc_flag: Warning<
9335  "missing object format flag">,
9336  InGroup<Format>;
9337def warn_printf_ObjCflags_without_ObjCConversion: Warning<
9338  "object format flags cannot be used with '%0' conversion specifier">,
9339  InGroup<Format>;
9340def warn_printf_invalid_objc_flag: Warning<
9341    "'%0' is not a valid object format flag">,
9342    InGroup<Format>;
9343def warn_scanf_scanlist_incomplete : Warning<
9344  "no closing ']' for '%%[' in scanf format string">,
9345  InGroup<Format>;
9346def warn_format_bool_as_character : Warning<
9347  "using '%0' format specifier, but argument has boolean value">,
9348  InGroup<Format>;
9349def note_format_string_defined : Note<"format string is defined here">;
9350def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
9351def note_printf_c_str: Note<"did you mean to call the %0 method?">;
9352def note_format_security_fixit: Note<
9353  "treat the string as an argument to avoid this">;
9354
9355def warn_null_arg : Warning<
9356  "null passed to a callee that requires a non-null argument">,
9357  InGroup<NonNull>;
9358def warn_null_ret : Warning<
9359  "null returned from %select{function|method}0 that requires a non-null return value">,
9360  InGroup<NonNull>;
9361
9362def err_lifetimebound_no_object_param : Error<
9363  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
9364  "function has no implicit object parameter">;
9365def err_lifetimebound_ctor_dtor : Error<
9366  "'lifetimebound' attribute cannot be applied to a "
9367  "%select{constructor|destructor}0">;
9368
9369// CHECK: returning address/reference of stack memory
9370def warn_ret_stack_addr_ref : Warning<
9371  "%select{address of|reference to}0 stack memory associated with "
9372  "%select{local variable|parameter}2 %1 returned">,
9373  InGroup<ReturnStackAddress>;
9374def warn_ret_local_temp_addr_ref : Warning<
9375  "returning %select{address of|reference to}0 local temporary object">,
9376  InGroup<ReturnStackAddress>;
9377def warn_ret_addr_label : Warning<
9378  "returning address of label, which is local">,
9379  InGroup<ReturnStackAddress>;
9380def err_ret_local_block : Error<
9381  "returning block that lives on the local stack">;
9382def note_local_var_initializer : Note<
9383  "%select{via initialization of|binding reference}0 variable "
9384  "%select{%2 |}1here">;
9385def note_lambda_capture_initializer : Note<
9386  "%select{implicitly |}2captured%select{| by reference}3"
9387  "%select{%select{ due to use|}2 here|"
9388  " via initialization of lambda capture %0}1">;
9389def note_init_with_default_member_initalizer : Note<
9390  "initializing field %0 with default member initializer">;
9391
9392// Check for initializing a member variable with the address or a reference to
9393// a constructor parameter.
9394def warn_bind_ref_member_to_parameter : Warning<
9395  "binding reference member %0 to stack allocated "
9396  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9397def warn_init_ptr_member_to_parameter_addr : Warning<
9398  "initializing pointer member %0 with the stack address of "
9399  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9400def note_ref_or_ptr_member_declared_here : Note<
9401  "%select{reference|pointer}0 member declared here">;
9402
9403def err_dangling_member : Error<
9404  "%select{reference|backing array for 'std::initializer_list'}2 "
9405  "%select{|subobject of }1member %0 "
9406  "%select{binds to|is}2 a temporary object "
9407  "whose lifetime would be shorter than the lifetime of "
9408  "the constructed object">;
9409def warn_dangling_member : Warning<
9410  "%select{reference|backing array for 'std::initializer_list'}2 "
9411  "%select{|subobject of }1member %0 "
9412  "%select{binds to|is}2 a temporary object "
9413  "whose lifetime is shorter than the lifetime of the constructed object">,
9414  InGroup<DanglingField>;
9415def warn_dangling_lifetime_pointer_member : Warning<
9416  "initializing pointer member %0 to point to a temporary object "
9417  "whose lifetime is shorter than the lifetime of the constructed object">,
9418  InGroup<DanglingGsl>;
9419def note_lifetime_extending_member_declared_here : Note<
9420  "%select{%select{reference|'std::initializer_list'}0 member|"
9421  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
9422  "declared here">;
9423def warn_dangling_variable : Warning<
9424  "%select{temporary %select{whose address is used as value of|"
9425  "%select{|implicitly }2bound to}4 "
9426  "%select{%select{|reference }4member of local variable|"
9427  "local %select{variable|reference}4}1|"
9428  "array backing "
9429  "%select{initializer list subobject of local variable|"
9430  "local initializer list}1}0 "
9431  "%select{%3 |}2will be destroyed at the end of the full-expression">,
9432  InGroup<Dangling>;
9433def warn_new_dangling_reference : Warning<
9434  "temporary bound to reference member of allocated object "
9435  "will be destroyed at the end of the full-expression">,
9436  InGroup<DanglingField>;
9437def warn_dangling_lifetime_pointer : Warning<
9438  "object backing the pointer "
9439  "will be destroyed at the end of the full-expression">,
9440  InGroup<DanglingGsl>;
9441def warn_new_dangling_initializer_list : Warning<
9442  "array backing "
9443  "%select{initializer list subobject of the allocated object|"
9444  "the allocated initializer list}0 "
9445  "will be destroyed at the end of the full-expression">,
9446  InGroup<DanglingInitializerList>;
9447def warn_unsupported_lifetime_extension : Warning<
9448  "sorry, lifetime extension of "
9449  "%select{temporary|backing array of initializer list}0 created "
9450  "by aggregate initialization using default member initializer "
9451  "is not supported; lifetime of %select{temporary|backing array}0 "
9452  "will end at the end of the full-expression">, InGroup<Dangling>;
9453
9454// For non-floating point, expressions of the form x == x or x != x
9455// should result in a warning, since these always evaluate to a constant.
9456// Array comparisons have similar warnings
9457def warn_comparison_always : Warning<
9458  "%select{self-|array }0comparison always evaluates to "
9459  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
9460  InGroup<TautologicalCompare>;
9461def warn_comparison_bitwise_always : Warning<
9462  "bitwise comparison always evaluates to %select{false|true}0">,
9463  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9464def warn_comparison_bitwise_or : Warning<
9465  "bitwise or with non-zero value always evaluates to true">,
9466  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9467def warn_tautological_overlap_comparison : Warning<
9468  "overlapping comparisons always evaluate to %select{false|true}0">,
9469  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
9470def warn_depr_array_comparison : Warning<
9471  "comparison between two arrays is deprecated; "
9472  "to compare array addresses, use unary '+' to decay operands to pointers">,
9473  InGroup<DeprecatedArrayCompare>;
9474
9475def warn_stringcompare : Warning<
9476  "result of comparison against %select{a string literal|@encode}0 is "
9477  "unspecified (use an explicit string comparison function instead)">,
9478  InGroup<StringCompare>;
9479
9480def warn_identity_field_assign : Warning<
9481  "assigning %select{field|instance variable}0 to itself">,
9482  InGroup<SelfAssignmentField>;
9483
9484// Type safety attributes
9485def err_type_tag_for_datatype_not_ice : Error<
9486  "'type_tag_for_datatype' attribute requires the initializer to be "
9487  "an %select{integer|integral}0 constant expression">;
9488def err_type_tag_for_datatype_too_large : Error<
9489  "'type_tag_for_datatype' attribute requires the initializer to be "
9490  "an %select{integer|integral}0 constant expression "
9491  "that can be represented by a 64 bit integer">;
9492def err_tag_index_out_of_range : Error<
9493  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
9494def warn_type_tag_for_datatype_wrong_kind : Warning<
9495  "this type tag was not designed to be used with this function">,
9496  InGroup<TypeSafety>;
9497def warn_type_safety_type_mismatch : Warning<
9498  "argument type %0 doesn't match specified %1 type tag "
9499  "%select{that requires %3|}2">, InGroup<TypeSafety>;
9500def warn_type_safety_null_pointer_required : Warning<
9501  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
9502
9503// Generic selections.
9504def err_assoc_type_incomplete : Error<
9505  "type %0 in generic association incomplete">;
9506def err_assoc_type_nonobject : Error<
9507  "type %0 in generic association not an object type">;
9508def err_assoc_type_variably_modified : Error<
9509  "type %0 in generic association is a variably modified type">;
9510def err_assoc_compatible_types : Error<
9511  "type %0 in generic association compatible with previously specified type %1">;
9512def note_compat_assoc : Note<
9513  "compatible type %0 specified here">;
9514def err_generic_sel_no_match : Error<
9515  "controlling expression type %0 not compatible with any generic association type">;
9516def err_generic_sel_multi_match : Error<
9517  "controlling expression type %0 compatible with %1 generic association types">;
9518
9519
9520// Blocks
9521def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
9522  " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">;
9523def err_block_returning_array_function : Error<
9524  "block cannot return %select{array|function}0 type %1">;
9525
9526// Builtin annotation
9527def err_builtin_annotation_first_arg : Error<
9528  "first argument to __builtin_annotation must be an integer">;
9529def err_builtin_annotation_second_arg : Error<
9530  "second argument to __builtin_annotation must be a non-wide string constant">;
9531def err_msvc_annotation_wide_str : Error<
9532  "arguments to __annotation must be wide string constants">;
9533
9534// CFString checking
9535def err_cfstring_literal_not_string_constant : Error<
9536  "CFString literal is not a string constant">;
9537def warn_cfstring_truncated : Warning<
9538  "input conversion stopped due to an input byte that does not "
9539  "belong to the input codeset UTF-8">,
9540  InGroup<DiagGroup<"CFString-literal">>;
9541
9542// os_log checking
9543// TODO: separate diagnostic for os_trace()
9544def err_os_log_format_not_string_constant : Error<
9545  "os_log() format argument is not a string constant">;
9546def err_os_log_argument_too_big : Error<
9547  "os_log() argument %0 is too big (%1 bytes, max %2)">;
9548def warn_os_log_format_narg : Error<
9549 "os_log() '%%n' format specifier is not allowed">, DefaultError;
9550
9551// Statements.
9552def err_continue_not_in_loop : Error<
9553  "'continue' statement not in loop statement">;
9554def err_break_not_in_loop_or_switch : Error<
9555  "'break' statement not in loop or switch statement">;
9556def warn_loop_ctrl_binds_to_inner : Warning<
9557  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
9558  InGroup<GccCompat>;
9559def warn_break_binds_to_switch : Warning<
9560  "'break' is bound to loop, GCC binds it to switch">,
9561  InGroup<GccCompat>;
9562def err_default_not_in_switch : Error<
9563  "'default' statement not in switch statement">;
9564def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
9565def warn_bool_switch_condition : Warning<
9566  "switch condition has boolean value">, InGroup<SwitchBool>;
9567def warn_case_value_overflow : Warning<
9568  "overflow converting case value to switch condition type (%0 to %1)">,
9569  InGroup<Switch>;
9570def err_duplicate_case : Error<"duplicate case value '%0'">;
9571def err_duplicate_case_differing_expr : Error<
9572  "duplicate case value: '%0' and '%1' both equal '%2'">;
9573def warn_case_empty_range : Warning<"empty case range specified">;
9574def warn_missing_case_for_condition :
9575  Warning<"no case matching constant switch condition '%0'">;
9576
9577def warn_def_missing_case : Warning<"%plural{"
9578  "1:enumeration value %1 not explicitly handled in switch|"
9579  "2:enumeration values %1 and %2 not explicitly handled in switch|"
9580  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
9581  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
9582  InGroup<SwitchEnum>, DefaultIgnore;
9583
9584def warn_missing_case : Warning<"%plural{"
9585  "1:enumeration value %1 not handled in switch|"
9586  "2:enumeration values %1 and %2 not handled in switch|"
9587  "3:enumeration values %1, %2, and %3 not handled in switch|"
9588  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
9589  InGroup<Switch>;
9590
9591def warn_unannotated_fallthrough : Warning<
9592  "unannotated fall-through between switch labels">,
9593  InGroup<ImplicitFallthrough>, DefaultIgnore;
9594def warn_unannotated_fallthrough_per_function : Warning<
9595  "unannotated fall-through between switch labels in partly-annotated "
9596  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
9597def note_insert_fallthrough_fixit : Note<
9598  "insert '%0;' to silence this warning">;
9599def note_insert_break_fixit : Note<
9600  "insert 'break;' to avoid fall-through">;
9601def err_fallthrough_attr_wrong_target : Error<
9602  "%0 attribute is only allowed on empty statements">;
9603def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
9604def err_fallthrough_attr_outside_switch : Error<
9605  "fallthrough annotation is outside switch statement">;
9606def err_fallthrough_attr_invalid_placement : Error<
9607  "fallthrough annotation does not directly precede switch label">;
9608
9609def warn_unreachable_default : Warning<
9610  "default label in switch which covers all enumeration values">,
9611  InGroup<CoveredSwitchDefault>, DefaultIgnore;
9612def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
9613  InGroup<Switch>;
9614def warn_not_in_enum_assignment : Warning<"integer constant not in range "
9615  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
9616def err_typecheck_statement_requires_scalar : Error<
9617  "statement requires expression of scalar type (%0 invalid)">;
9618def err_typecheck_statement_requires_integer : Error<
9619  "statement requires expression of integer type (%0 invalid)">;
9620def err_multiple_default_labels_defined : Error<
9621  "multiple default labels in one switch">;
9622def err_switch_multiple_conversions : Error<
9623  "multiple conversions from switch condition type %0 to an integral or "
9624  "enumeration type">;
9625def note_switch_conversion : Note<
9626  "conversion to %select{integral|enumeration}0 type %1">;
9627def err_switch_explicit_conversion : Error<
9628  "switch condition type %0 requires explicit conversion to %1">;
9629def err_switch_incomplete_class_type : Error<
9630  "switch condition has incomplete class type %0">;
9631
9632def warn_empty_if_body : Warning<
9633  "if statement has empty body">, InGroup<EmptyBody>;
9634def warn_empty_for_body : Warning<
9635  "for loop has empty body">, InGroup<EmptyBody>;
9636def warn_empty_range_based_for_body : Warning<
9637  "range-based for loop has empty body">, InGroup<EmptyBody>;
9638def warn_empty_while_body : Warning<
9639  "while loop has empty body">, InGroup<EmptyBody>;
9640def warn_empty_switch_body : Warning<
9641  "switch statement has empty body">, InGroup<EmptyBody>;
9642def note_empty_body_on_separate_line : Note<
9643  "put the semicolon on a separate line to silence this warning">;
9644
9645def err_va_start_captured_stmt : Error<
9646  "'va_start' cannot be used in a captured statement">;
9647def err_va_start_outside_function : Error<
9648  "'va_start' cannot be used outside a function">;
9649def err_va_start_fixed_function : Error<
9650  "'va_start' used in function with fixed args">;
9651def err_va_start_used_in_wrong_abi_function : Error<
9652  "'va_start' used in %select{System V|Win64}0 ABI function">;
9653def err_ms_va_start_used_in_sysv_function : Error<
9654  "'__builtin_ms_va_start' used in System V ABI function">;
9655def warn_second_arg_of_va_start_not_last_named_param : Warning<
9656  "second argument to 'va_start' is not the last named parameter">,
9657  InGroup<Varargs>;
9658def warn_va_start_type_is_undefined : Warning<
9659  "passing %select{an object that undergoes default argument promotion|"
9660  "an object of reference type|a parameter declared with the 'register' "
9661  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
9662def err_first_argument_to_va_arg_not_of_type_va_list : Error<
9663  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
9664def err_second_parameter_to_va_arg_incomplete: Error<
9665  "second argument to 'va_arg' is of incomplete type %0">;
9666def err_second_parameter_to_va_arg_abstract: Error<
9667  "second argument to 'va_arg' is of abstract type %0">;
9668def warn_second_parameter_to_va_arg_not_pod : Warning<
9669  "second argument to 'va_arg' is of non-POD type %0">,
9670  InGroup<NonPODVarargs>, DefaultError;
9671def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
9672  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
9673  InGroup<NonPODVarargs>, DefaultError;
9674def warn_second_parameter_to_va_arg_never_compatible : Warning<
9675  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
9676  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
9677
9678def warn_return_missing_expr : Warning<
9679  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9680  InGroup<ReturnType>;
9681def ext_return_missing_expr : ExtWarn<
9682  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9683  InGroup<ReturnType>;
9684def ext_return_has_expr : ExtWarn<
9685  "%select{void function|void method|constructor|destructor}1 %0 "
9686  "should not return a value">,
9687  DefaultError, InGroup<ReturnType>;
9688def ext_return_has_void_expr : Extension<
9689  "void %select{function|method|block}1 %0 should not return void expression">;
9690def err_return_init_list : Error<
9691  "%select{void function|void method|constructor|destructor}1 %0 "
9692  "must not return a value">;
9693def err_ctor_dtor_returns_void : Error<
9694  "%select{constructor|destructor}1 %0 must not return void expression">;
9695def warn_noreturn_function_has_return_expr : Warning<
9696  "function %0 declared 'noreturn' should not return">,
9697  InGroup<InvalidNoreturn>;
9698def warn_falloff_noreturn_function : Warning<
9699  "function declared 'noreturn' should not return">,
9700  InGroup<InvalidNoreturn>;
9701def err_noreturn_block_has_return_expr : Error<
9702  "block declared 'noreturn' should not return">;
9703def err_carries_dependency_missing_on_first_decl : Error<
9704  "%select{function|parameter}0 declared '[[carries_dependency]]' "
9705  "after its first declaration">;
9706def note_carries_dependency_missing_first_decl : Note<
9707  "declaration missing '[[carries_dependency]]' attribute is here">;
9708def err_carries_dependency_param_not_function_decl : Error<
9709  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
9710  "declaration or lambda">;
9711def err_block_on_nonlocal : Error<
9712  "__block attribute not allowed, only allowed on local variables">;
9713def err_block_on_vm : Error<
9714  "__block attribute not allowed on declaration with a variably modified type">;
9715def err_sizeless_nonlocal : Error<
9716  "non-local variable with sizeless type %0">;
9717
9718def err_vec_builtin_non_vector : Error<
9719 "first two arguments to %0 must be vectors">;
9720def err_vec_builtin_incompatible_vector : Error<
9721  "first two arguments to %0 must have the same type">;
9722def err_vsx_builtin_nonconstant_argument : Error<
9723  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
9724
9725def err_shufflevector_nonconstant_argument : Error<
9726  "index for __builtin_shufflevector must be a constant integer">;
9727def err_shufflevector_argument_too_large : Error<
9728  "index for __builtin_shufflevector must be less than the total number "
9729  "of vector elements">;
9730
9731def err_convertvector_non_vector : Error<
9732  "first argument to __builtin_convertvector must be a vector">;
9733def err_convertvector_non_vector_type : Error<
9734  "second argument to __builtin_convertvector must be a vector type">;
9735def err_convertvector_incompatible_vector : Error<
9736  "first two arguments to __builtin_convertvector must have the same number of elements">;
9737
9738def err_first_argument_to_cwsc_not_call : Error<
9739  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
9740def err_first_argument_to_cwsc_block_call : Error<
9741  "first argument to __builtin_call_with_static_chain must not be a block call">;
9742def err_first_argument_to_cwsc_builtin_call : Error<
9743  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
9744def err_first_argument_to_cwsc_pdtor_call : Error<
9745  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
9746def err_second_argument_to_cwsc_not_pointer : Error<
9747  "second argument to __builtin_call_with_static_chain must be of pointer type">;
9748
9749def err_vector_incorrect_num_initializers : Error<
9750  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
9751def err_altivec_empty_initializer : Error<"expected initializer">;
9752
9753def err_invalid_neon_type_code : Error<
9754  "incompatible constant for this __builtin_neon function">;
9755def err_argument_invalid_range : Error<
9756  "argument value %0 is outside the valid range [%1, %2]">;
9757def warn_argument_invalid_range : Warning<
9758  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
9759  InGroup<DiagGroup<"argument-outside-range">>;
9760def warn_argument_undefined_behaviour : Warning<
9761  "argument value %0 will result in undefined behaviour">,
9762  InGroup<DiagGroup<"argument-undefined-behaviour">>;
9763def err_argument_not_multiple : Error<
9764  "argument should be a multiple of %0">;
9765def err_argument_not_power_of_2 : Error<
9766  "argument should be a power of 2">;
9767def err_argument_not_shifted_byte : Error<
9768  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
9769def err_argument_not_shifted_byte_or_xxff : Error<
9770  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9771def err_argument_not_contiguous_bit_field : Error<
9772  "argument %0 value should represent a contiguous bit field">;
9773def err_rotation_argument_to_cadd
9774    : Error<"argument should be the value 90 or 270">;
9775def err_rotation_argument_to_cmla
9776    : Error<"argument should be the value 0, 90, 180 or 270">;
9777def warn_neon_vector_initializer_non_portable : Warning<
9778  "vector initializers are not compatible with NEON intrinsics in big endian "
9779  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
9780def note_neon_vector_initializer_non_portable : Note<
9781  "consider using vld1_%0%1() to initialize a vector from memory, or "
9782  "vcreate_%0%1() to initialize from an integer constant">;
9783def note_neon_vector_initializer_non_portable_q : Note<
9784  "consider using vld1q_%0%1() to initialize a vector from memory, or "
9785  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
9786  "constants">;
9787def err_systemz_invalid_tabort_code : Error<
9788  "invalid transaction abort code">;
9789def err_64_bit_builtin_32_bit_tgt : Error<
9790  "this builtin is only available on 64-bit targets">;
9791def err_32_bit_builtin_64_bit_tgt : Error<
9792  "this builtin is only available on 32-bit targets">;
9793def err_builtin_x64_aarch64_only : Error<
9794  "this builtin is only available on x86-64 and aarch64 targets">;
9795def err_mips_builtin_requires_dsp : Error<
9796  "this builtin requires 'dsp' ASE, please use -mdsp">;
9797def err_mips_builtin_requires_dspr2 : Error<
9798  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
9799def err_mips_builtin_requires_msa : Error<
9800  "this builtin requires 'msa' ASE, please use -mmsa">;
9801def err_ppc_builtin_only_on_arch : Error<
9802  "this builtin is only valid on POWER%0 or later CPUs">;
9803def err_ppc_builtin_requires_vsx : Error<
9804  "this builtin requires VSX to be enabled">;
9805def err_ppc_invalid_use_mma_type : Error<
9806  "invalid use of PPC MMA type">;
9807def err_ppc_invalid_test_data_class_type : Error<
9808  "expected a 'float' or 'double' for the first argument">;
9809def err_x86_builtin_invalid_rounding : Error<
9810  "invalid rounding argument">;
9811def err_x86_builtin_invalid_scale : Error<
9812  "scale argument must be 1, 2, 4, or 8">;
9813def err_x86_builtin_tile_arg_duplicate : Error<
9814  "tile arguments must refer to different tiles">;
9815
9816def err_builtin_target_unsupported : Error<
9817  "builtin is not supported on this target">;
9818def err_builtin_longjmp_unsupported : Error<
9819  "__builtin_longjmp is not supported for the current target">;
9820def err_builtin_setjmp_unsupported : Error<
9821  "__builtin_setjmp is not supported for the current target">;
9822
9823def err_builtin_longjmp_invalid_val : Error<
9824  "argument to __builtin_longjmp must be a constant 1">;
9825def err_builtin_requires_language : Error<"'%0' is only available in %1">;
9826
9827def err_constant_integer_arg_type : Error<
9828  "argument to %0 must be a constant integer">;
9829
9830def ext_mixed_decls_code : Extension<
9831  "ISO C90 forbids mixing declarations and code">,
9832  InGroup<DiagGroup<"declaration-after-statement">>;
9833
9834def err_non_local_variable_decl_in_for : Error<
9835  "declaration of non-local variable in 'for' loop">;
9836def err_non_variable_decl_in_for : Error<
9837  "non-variable declaration in 'for' loop">;
9838def err_toomany_element_decls : Error<
9839  "only one element declaration is allowed">;
9840def err_selector_element_not_lvalue : Error<
9841  "selector element is not a valid lvalue">;
9842def err_selector_element_type : Error<
9843  "selector element type %0 is not a valid object">;
9844def err_selector_element_const_type : Error<
9845  "selector element of type %0 cannot be a constant lvalue expression">;
9846def err_collection_expr_type : Error<
9847  "the type %0 is not a pointer to a fast-enumerable object">;
9848def warn_collection_expr_type : Warning<
9849  "collection expression type %0 may not respond to %1">;
9850
9851def err_invalid_conversion_between_ext_vectors : Error<
9852  "invalid conversion between ext-vector type %0 and %1">;
9853
9854def warn_duplicate_attribute_exact : Warning<
9855  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
9856
9857def warn_duplicate_attribute : Warning<
9858  "attribute %0 is already applied with different arguments">,
9859  InGroup<IgnoredAttributes>;
9860
9861def warn_sync_fetch_and_nand_semantics_change : Warning<
9862  "the semantics of this intrinsic changed with GCC "
9863  "version 4.4 - the newer semantics are provided here">,
9864  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
9865
9866// Type
9867def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
9868  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
9869def warn_receiver_forward_class : Warning<
9870  "receiver %0 is a forward class and corresponding @interface may not exist">,
9871  InGroup<ForwardClassReceiver>;
9872def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
9873def ext_missing_declspec : ExtWarn<
9874  "declaration specifier missing, defaulting to 'int'">;
9875def ext_missing_type_specifier : ExtWarn<
9876  "type specifier missing, defaults to 'int'">,
9877  InGroup<ImplicitInt>;
9878def err_decimal_unsupported : Error<
9879  "GNU decimal type extension not supported">;
9880def err_missing_type_specifier : Error<
9881  "C++ requires a type specifier for all declarations">;
9882def err_objc_array_of_interfaces : Error<
9883  "array of interface %0 is invalid (probably should be an array of pointers)">;
9884def ext_c99_array_usage : Extension<
9885  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9886  "feature">, InGroup<C99>;
9887def err_c99_array_usage_cxx : Error<
9888  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9889  "feature, not permitted in C++">;
9890def err_type_unsupported : Error<
9891  "%0 is not supported on this target">;
9892def err_nsconsumed_attribute_mismatch : Error<
9893  "overriding method has mismatched ns_consumed attribute on its"
9894  " parameter">;
9895def err_nsreturns_retained_attribute_mismatch : Error<
9896  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
9897  " attributes">;
9898def err_nserrordomain_invalid_decl : Error<
9899  "domain argument %select{|%1 }0does not refer to global constant">;
9900def err_nserrordomain_wrong_type : Error<
9901  "domain argument %0 does not point to an NSString or CFString constant">;
9902
9903def warn_nsconsumed_attribute_mismatch : Warning<
9904  err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
9905def warn_nsreturns_retained_attribute_mismatch : Warning<
9906  err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
9907
9908def note_getter_unavailable : Note<
9909  "or because setter is declared here, but no getter method %0 is found">;
9910def err_invalid_protocol_qualifiers : Error<
9911  "invalid protocol qualifiers on non-ObjC type">;
9912def warn_ivar_use_hidden : Warning<
9913  "local declaration of %0 hides instance variable">,
9914   InGroup<ShadowIvar>;
9915def warn_direct_initialize_call : Warning<
9916  "explicit call to +initialize results in duplicate call to +initialize">,
9917   InGroup<ExplicitInitializeCall>;
9918def warn_direct_super_initialize_call : Warning<
9919  "explicit call to [super initialize] should only be in implementation "
9920  "of +initialize">,
9921   InGroup<ExplicitInitializeCall>;
9922def err_ivar_use_in_class_method : Error<
9923  "instance variable %0 accessed in class method">;
9924def err_private_ivar_access : Error<"instance variable %0 is private">,
9925  AccessControl;
9926def err_protected_ivar_access : Error<"instance variable %0 is protected">,
9927  AccessControl;
9928def warn_maynot_respond : Warning<"%0 may not respond to %1">;
9929def ext_typecheck_base_super : Warning<
9930  "method parameter type "
9931  "%diff{$ does not match super class method parameter type $|"
9932  "does not match super class method parameter type}0,1">,
9933   InGroup<SuperSubClassMismatch>, DefaultIgnore;
9934def warn_missing_method_return_type : Warning<
9935  "method has no return type specified; defaults to 'id'">,
9936  InGroup<MissingMethodReturnType>, DefaultIgnore;
9937def warn_direct_ivar_access : Warning<"instance variable %0 is being "
9938  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
9939
9940// Spell-checking diagnostics
9941def err_unknown_typename : Error<
9942  "unknown type name %0">;
9943def err_unknown_type_or_class_name_suggest : Error<
9944  "unknown %select{type|class}1 name %0; did you mean %2?">;
9945def err_unknown_typename_suggest : Error<
9946  "unknown type name %0; did you mean %1?">;
9947def err_unknown_nested_typename_suggest : Error<
9948  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
9949def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
9950def err_undeclared_use_suggest : Error<
9951  "use of undeclared %0; did you mean %1?">;
9952def err_undeclared_var_use_suggest : Error<
9953  "use of undeclared identifier %0; did you mean %1?">;
9954def err_no_template : Error<"no template named %0">;
9955def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
9956def err_no_member_template : Error<"no template named %0 in %1">;
9957def err_no_member_template_suggest : Error<
9958  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
9959def err_non_template_in_template_id : Error<
9960  "%0 does not name a template but is followed by template arguments">;
9961def err_non_template_in_template_id_suggest : Error<
9962  "%0 does not name a template but is followed by template arguments; "
9963  "did you mean %1?">;
9964def err_non_template_in_member_template_id_suggest : Error<
9965  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
9966def note_non_template_in_template_id_found : Note<
9967  "non-template declaration found by name lookup">;
9968def err_mem_init_not_member_or_class_suggest : Error<
9969  "initializer %0 does not name a non-static data member or base "
9970  "class; did you mean the %select{base class|member}1 %2?">;
9971def err_field_designator_unknown_suggest : Error<
9972  "field designator %0 does not refer to any field in type %1; did you mean "
9973  "%2?">;
9974def err_typecheck_member_reference_ivar_suggest : Error<
9975  "%0 does not have a member named %1; did you mean %2?">;
9976def err_property_not_found_suggest : Error<
9977  "property %0 not found on object of type %1; did you mean %2?">;
9978def err_class_property_found : Error<
9979  "property %0 is a class property; did you mean to access it with class '%1'?">;
9980def err_ivar_access_using_property_syntax_suggest : Error<
9981  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
9982def warn_property_access_suggest : Warning<
9983"property %0 not found on object of type %1; did you mean to access property %2?">,
9984InGroup<PropertyAccessDotSyntax>;
9985def err_property_found_suggest : Error<
9986  "property %0 found on object of type %1; did you mean to access "
9987  "it with the \".\" operator?">;
9988def err_undef_interface_suggest : Error<
9989  "cannot find interface declaration for %0; did you mean %1?">;
9990def warn_undef_interface_suggest : Warning<
9991  "cannot find interface declaration for %0; did you mean %1?">;
9992def err_undef_superclass_suggest : Error<
9993  "cannot find interface declaration for %0, superclass of %1; did you mean "
9994  "%2?">;
9995def err_undeclared_protocol_suggest : Error<
9996  "cannot find protocol declaration for %0; did you mean %1?">;
9997def note_base_class_specified_here : Note<
9998  "base class %0 specified here">;
9999def err_using_directive_suggest : Error<
10000  "no namespace named %0; did you mean %1?">;
10001def err_using_directive_member_suggest : Error<
10002  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
10003def note_namespace_defined_here : Note<"namespace %0 defined here">;
10004def err_sizeof_pack_no_pack_name_suggest : Error<
10005  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
10006def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
10007
10008def err_uncasted_use_of_unknown_any : Error<
10009  "%0 has unknown type; cast it to its declared type to use it">;
10010def err_uncasted_call_of_unknown_any : Error<
10011  "%0 has unknown return type; cast the call to its declared return type">;
10012def err_uncasted_send_to_unknown_any_method : Error<
10013  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
10014  "message send to the method's return type">;
10015def err_unsupported_unknown_any_decl : Error<
10016  "%0 has unknown type, which is not supported for this kind of declaration">;
10017def err_unsupported_unknown_any_expr : Error<
10018  "unsupported expression with unknown type">;
10019def err_unsupported_unknown_any_call : Error<
10020  "call to unsupported expression with unknown type">;
10021def err_unknown_any_addrof : Error<
10022  "the address of a declaration with unknown type "
10023  "can only be cast to a pointer type">;
10024def err_unknown_any_addrof_call : Error<
10025  "address-of operator cannot be applied to a call to a function with "
10026  "unknown return type">;
10027def err_unknown_any_var_function_type : Error<
10028  "variable %0 with unknown type cannot be given a function type">;
10029def err_unknown_any_function : Error<
10030  "function %0 with unknown type must be given a function type">;
10031
10032def err_filter_expression_integral : Error<
10033  "filter expression has non-integral type %0">;
10034
10035def err_non_asm_stmt_in_naked_function : Error<
10036  "non-ASM statement in naked function is not supported">;
10037def err_asm_naked_this_ref : Error<
10038  "'this' pointer references not allowed in naked functions">;
10039def err_asm_naked_parm_ref : Error<
10040  "parameter references not allowed in naked functions">;
10041
10042// OpenCL warnings and errors.
10043def err_invalid_astype_of_different_size : Error<
10044  "invalid reinterpretation: sizes of %0 and %1 must match">;
10045def err_static_kernel : Error<
10046  "kernel functions cannot be declared static">;
10047def err_method_kernel : Error<
10048  "kernel functions cannot be class members">;
10049def err_template_kernel : Error<
10050  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
10051def err_opencl_ptrptr_kernel_param : Error<
10052  "kernel parameter cannot be declared as a pointer to a pointer">;
10053def err_kernel_arg_address_space : Error<
10054  "pointer arguments to kernel functions must reside in '__global', "
10055  "'__constant' or '__local' address space">;
10056def err_opencl_ext_vector_component_invalid_length : Error<
10057  "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
10058def err_opencl_function_variable : Error<
10059  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
10060def err_opencl_addrspace_scope : Error<
10061  "variables in the %0 address space can only be declared in the outermost "
10062  "scope of a kernel function">;
10063def err_static_function_scope : Error<
10064  "variables in function scope cannot be declared static">;
10065def err_opencl_bitfields : Error<
10066  "bit-fields are not supported in OpenCL">;
10067def err_opencl_vla : Error<
10068  "variable length arrays are not supported in OpenCL">;
10069def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
10070    "scalar operand type has greater rank than the type of the vector "
10071    "element. (%0 and %1)">;
10072def err_bad_kernel_param_type : Error<
10073  "%0 cannot be used as the type of a kernel parameter">;
10074def err_opencl_implicit_function_decl : Error<
10075  "implicit declaration of function %0 is invalid in OpenCL">;
10076def err_record_with_pointers_kernel_param : Error<
10077  "%select{struct|union}0 kernel parameters may not contain pointers">;
10078def note_within_field_of_type : Note<
10079  "within field of type %0 declared here">;
10080def note_illegal_field_declared_here : Note<
10081  "field of illegal %select{type|pointer type}0 %1 declared here">;
10082def err_opencl_type_struct_or_union_field : Error<
10083  "the %0 type cannot be used to declare a structure or union field">;
10084def err_event_t_addr_space_qual : Error<
10085  "the event_t type can only be used with __private address space qualifier">;
10086def err_expected_kernel_void_return_type : Error<
10087  "kernel must have void return type">;
10088def err_sampler_initializer_not_integer : Error<
10089  "sampler_t initialization requires 32-bit integer, not %0">;
10090def warn_sampler_initializer_invalid_bits : Warning<
10091  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
10092def err_sampler_argument_required : Error<
10093  "sampler_t variable required - got %0">;
10094def err_wrong_sampler_addressspace: Error<
10095  "sampler type cannot be used with the __local and __global address space qualifiers">;
10096def err_opencl_nonconst_global_sampler : Error<
10097  "global sampler requires a const or constant address space qualifier">;
10098def err_opencl_cast_non_zero_to_event_t : Error<
10099  "cannot cast non-zero value '%0' to 'event_t'">;
10100def err_opencl_global_invalid_addr_space : Error<
10101  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
10102def err_missing_actual_pipe_type : Error<
10103  "missing actual type specifier for pipe">;
10104def err_reference_pipe_type : Error <
10105  "pipes packet types cannot be of reference type">;
10106def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
10107def err_opencl_kernel_attr :
10108  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
10109def err_opencl_return_value_with_address_space : Error<
10110  "return value cannot be qualified with address space">;
10111def err_opencl_constant_no_init : Error<
10112  "variable in constant address space must be initialized">;
10113def err_opencl_atomic_init: Error<
10114  "atomic variable can be %select{assigned|initialized}0 to a variable only "
10115  "in global address space">;
10116def err_opencl_implicit_vector_conversion : Error<
10117  "implicit conversions between vector types (%0 and %1) are not permitted">;
10118def err_opencl_invalid_type_array : Error<
10119  "array of %0 type is invalid in OpenCL">;
10120def err_opencl_ternary_with_block : Error<
10121  "block type cannot be used as expression in ternary expression in OpenCL">;
10122def err_opencl_pointer_to_type : Error<
10123  "pointer to type %0 is invalid in OpenCL">;
10124def err_opencl_type_can_only_be_used_as_function_parameter : Error <
10125  "type %0 can only be used as a function parameter in OpenCL">;
10126def err_opencl_type_not_found : Error<
10127  "%0 type %1 not found; include the base header with -finclude-default-header">;
10128def warn_opencl_attr_deprecated_ignored : Warning <
10129  "%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>;
10130def err_opencl_variadic_function : Error<
10131  "invalid prototype, variadic arguments are not allowed in OpenCL">;
10132def err_opencl_requires_extension : Error<
10133  "use of %select{type|declaration}0 %1 requires %2 support">;
10134def ext_opencl_double_without_pragma : Extension<
10135  "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
10136  " supported">;
10137def warn_opencl_generic_address_space_arg : Warning<
10138  "passing non-generic address space pointer to %0"
10139  " may cause dynamic conversion affecting performance">,
10140  InGroup<Conversion>, DefaultIgnore;
10141
10142// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
10143def err_opencl_builtin_pipe_first_arg : Error<
10144  "first argument to %0 must be a pipe type">;
10145def err_opencl_builtin_pipe_arg_num : Error<
10146  "invalid number of arguments to function: %0">;
10147def err_opencl_builtin_pipe_invalid_arg : Error<
10148  "invalid argument type to function %0 (expecting %1 having %2)">;
10149def err_opencl_builtin_pipe_invalid_access_modifier : Error<
10150  "invalid pipe access modifier (expecting %0)">;
10151
10152// OpenCL access qualifier
10153def err_opencl_invalid_access_qualifier : Error<
10154  "access qualifier can only be used for pipe and image type">;
10155def err_opencl_invalid_read_write : Error<
10156  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 "
10157  "and without __opencl_c_read_write_images feature}2">;
10158def err_opencl_multiple_access_qualifiers : Error<
10159  "multiple access qualifiers">;
10160def note_opencl_typedef_access_qualifier : Note<
10161  "previously declared '%0' here">;
10162
10163// OpenCL v2.0 s6.12.5 Blocks restrictions
10164def err_opencl_block_storage_type : Error<
10165  "the __block storage type is not permitted">;
10166def err_opencl_invalid_block_declaration : Error<
10167  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
10168def err_opencl_extern_block_declaration : Error<
10169  "invalid block variable declaration - using 'extern' storage class is disallowed">;
10170def err_opencl_block_ref_block : Error<
10171  "cannot refer to a block inside block">;
10172
10173// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
10174def err_opencl_builtin_to_addr_invalid_arg : Error<
10175  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
10176
10177// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
10178def err_opencl_enqueue_kernel_incorrect_args : Error<
10179  "illegal call to enqueue_kernel, incorrect argument types">;
10180def err_opencl_enqueue_kernel_local_size_args : Error<
10181  "mismatch in number of block parameters and local size arguments passed">;
10182def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
10183  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
10184def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
10185  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
10186def err_opencl_enqueue_kernel_blocks_no_args : Error<
10187  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
10188
10189def err_opencl_builtin_expected_type : Error<
10190  "illegal call to %0, expected %1 argument type">;
10191
10192// OpenCL v3.0 s6.3.7 - Vector Components
10193def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
10194  "vector component name '%0' is a feature from OpenCL version 3.0 onwards">,
10195  InGroup<OpenCLUnsupportedRGBA>;
10196
10197def err_openclcxx_placement_new : Error<
10198  "use of placement new requires explicit declaration">;
10199
10200// MIG routine annotations.
10201def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
10202  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
10203  InGroup<IgnoredAttributes>;
10204} // end of sema category
10205
10206let CategoryName = "OpenMP Issue" in {
10207// OpenMP support.
10208def err_omp_expected_var_arg : Error<
10209  "%0 is not a global variable, static local variable or static data member">;
10210def err_omp_expected_var_arg_suggest : Error<
10211  "%0 is not a global variable, static local variable or static data member; "
10212  "did you mean %1">;
10213def err_omp_global_var_arg : Error<
10214  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
10215def err_omp_ref_type_arg : Error<
10216  "arguments of '#pragma omp %0' cannot be of reference type %1">;
10217def err_omp_region_not_file_context : Error<
10218  "directive must be at file or namespace scope">;
10219def err_omp_var_scope : Error<
10220  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
10221def err_omp_var_used : Error<
10222  "'#pragma omp %0' must precede all references to variable %q1">;
10223def err_omp_var_thread_local : Error<
10224  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
10225def err_omp_private_incomplete_type : Error<
10226  "a private variable with incomplete type %0">;
10227def err_omp_firstprivate_incomplete_type : Error<
10228  "a firstprivate variable with incomplete type %0">;
10229def err_omp_lastprivate_incomplete_type : Error<
10230  "a lastprivate variable with incomplete type %0">;
10231def err_omp_reduction_incomplete_type : Error<
10232  "a reduction list item with incomplete type %0">;
10233def err_omp_unexpected_clause_value : Error<
10234  "expected %0 in OpenMP clause '%1'">;
10235def err_omp_expected_var_name_member_expr : Error<
10236  "expected variable name%select{| or data member of current class}0">;
10237def err_omp_expected_var_name_member_expr_or_array_item : Error<
10238  "expected variable name%select{|, data member of current class}0, array element or array section">;
10239def err_omp_expected_addressable_lvalue_or_array_item : Error<
10240  "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">;
10241def err_omp_expected_named_var_member_or_array_expression: Error<
10242  "expected expression containing only member accesses and/or array sections based on named variables">;
10243def err_omp_bit_fields_forbidden_in_clause : Error<
10244  "bit fields cannot be used to specify storage in a '%0' clause">;
10245def err_array_section_does_not_specify_contiguous_storage : Error<
10246  "array section does not specify contiguous storage">;
10247def err_array_section_does_not_specify_length : Error<
10248  "array section does not specify length for outermost dimension">;
10249def err_omp_union_type_not_allowed : Error<
10250  "mapping of union members is not allowed">;
10251def err_omp_expected_access_to_data_field : Error<
10252  "expected access to data field">;
10253def err_omp_multiple_array_items_in_map_clause : Error<
10254  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
10255def err_omp_duplicate_map_type_modifier : Error<
10256  "same map type modifier has been specified more than once">;
10257def err_omp_duplicate_motion_modifier : Error<
10258  "same motion modifier has been specified more than once">;
10259def err_omp_pointer_mapped_along_with_derived_section : Error<
10260  "pointer cannot be mapped along with a section derived from itself">;
10261def err_omp_original_storage_is_shared_and_does_not_contain : Error<
10262  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
10263def err_omp_same_pointer_dereferenced : Error<
10264  "same pointer dereferenced in multiple different ways in map clause expressions">;
10265def note_omp_task_predetermined_firstprivate_here : Note<
10266  "predetermined as a firstprivate in a task construct here">;
10267def err_omp_threadprivate_incomplete_type : Error<
10268  "threadprivate variable with incomplete type %0">;
10269def err_omp_no_dsa_for_variable : Error<
10270  "variable %0 must have explicitly specified data sharing attributes">;
10271def err_omp_defaultmap_no_attr_for_variable : Error<
10272  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
10273def note_omp_default_dsa_none : Note<
10274  "explicit data sharing attribute requested here">;
10275def note_omp_defaultmap_attr_none : Note<
10276  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
10277def err_omp_wrong_dsa : Error<
10278  "%0 variable cannot be %1">;
10279def err_omp_variably_modified_type_not_supported : Error<
10280  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
10281def note_omp_explicit_dsa : Note<
10282  "defined as %0">;
10283def note_omp_predetermined_dsa : Note<
10284  "%select{static data member is predetermined as shared|"
10285  "variable with static storage duration is predetermined as shared|"
10286  "loop iteration variable is predetermined as private|"
10287  "loop iteration variable is predetermined as linear|"
10288  "loop iteration variable is predetermined as lastprivate|"
10289  "constant variable is predetermined as shared|"
10290  "global variable is predetermined as shared|"
10291  "non-shared variable in a task construct is predetermined as firstprivate|"
10292  "variable with automatic storage duration is predetermined as private}0"
10293  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
10294def note_omp_implicit_dsa : Note<
10295  "implicitly determined as %0">;
10296def err_omp_loop_var_dsa : Error<
10297  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
10298def err_omp_not_for : Error<
10299  "%select{statement after '#pragma omp %1' must be a for loop|"
10300  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
10301def note_omp_collapse_ordered_expr : Note<
10302  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
10303def err_omp_negative_expression_in_clause : Error<
10304  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
10305def err_omp_not_integral : Error<
10306  "expression must have integral or unscoped enumeration "
10307  "type, not %0">;
10308def err_omp_threadprivate_in_target : Error<
10309  "threadprivate variables cannot be used in target constructs">;
10310def err_omp_incomplete_type : Error<
10311  "expression has incomplete class type %0">;
10312def err_omp_explicit_conversion : Error<
10313  "expression requires explicit conversion from %0 to %1">;
10314def note_omp_conversion_here : Note<
10315  "conversion to %select{integral|enumeration}0 type %1 declared here">;
10316def err_omp_ambiguous_conversion : Error<
10317  "ambiguous conversion from type %0 to an integral or unscoped "
10318  "enumeration type">;
10319def err_omp_iterator_not_integral_or_pointer : Error<
10320  "expected integral or pointer type as the iterator-type, not %0">;
10321def err_omp_iterator_step_not_integral : Error<
10322  "iterator step expression %0 is not the integral expression">;
10323def err_omp_iterator_step_constant_zero : Error<
10324  "iterator step expression %0 evaluates to 0">;
10325def err_omp_required_access : Error<
10326  "%0 variable must be %1">;
10327def err_omp_const_variable : Error<
10328  "const-qualified variable cannot be %0">;
10329def err_omp_const_not_mutable_variable : Error<
10330  "const-qualified variable without mutable fields cannot be %0">;
10331def err_omp_const_list_item : Error<
10332  "const-qualified list item cannot be %0">;
10333def err_omp_linear_incomplete_type : Error<
10334  "a linear variable with incomplete type %0">;
10335def err_omp_linear_expected_int_or_ptr : Error<
10336  "argument of a linear clause should be of integral or pointer "
10337  "type, not %0">;
10338def warn_omp_linear_step_zero : Warning<
10339  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
10340  InGroup<OpenMPClauses>;
10341def warn_omp_alignment_not_power_of_two : Warning<
10342  "aligned clause will be ignored because the requested alignment is not a power of 2">,
10343  InGroup<OpenMPClauses>;
10344def err_omp_invalid_target_decl : Error<
10345  "%0 used in declare target directive is not a variable or a function name">;
10346def err_omp_declare_target_to_and_link : Error<
10347  "%0 must not appear in both clauses 'to' and 'link'">;
10348def warn_omp_not_in_target_context : Warning<
10349  "declaration is not declared in any declare target region">,
10350  InGroup<OpenMPTarget>;
10351def err_omp_function_in_link_clause : Error<
10352  "function name is not allowed in 'link' clause">;
10353def err_omp_aligned_expected_array_or_ptr : Error<
10354  "argument of aligned clause should be array"
10355  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
10356  ", not %0">;
10357def err_omp_used_in_clause_twice : Error<
10358  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
10359def err_omp_local_var_in_threadprivate_init : Error<
10360  "variable with local storage in initial value of threadprivate variable">;
10361def err_omp_loop_not_canonical_init : Error<
10362  "initialization clause of OpenMP for loop is not in canonical form "
10363  "('var = init' or 'T var = init')">;
10364def ext_omp_loop_not_canonical_init : ExtWarn<
10365  "initialization clause of OpenMP for loop is not in canonical form "
10366  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
10367def err_omp_loop_not_canonical_cond : Error<
10368  "condition of OpenMP for loop must be a relational comparison "
10369  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
10370def err_omp_loop_not_canonical_incr : Error<
10371  "increment clause of OpenMP for loop must perform simple addition "
10372  "or subtraction on loop variable %0">;
10373def err_omp_loop_variable_type : Error<
10374  "variable must be of integer or %select{pointer|random access iterator}0 type">;
10375def err_omp_loop_incr_not_compatible : Error<
10376  "increment expression must cause %0 to %select{decrease|increase}1 "
10377  "on each iteration of OpenMP for loop">;
10378def note_omp_loop_cond_requres_compatible_incr : Note<
10379  "loop step is expected to be %select{negative|positive}0 due to this condition">;
10380def err_omp_loop_diff_cxx : Error<
10381  "could not calculate number of iterations calling 'operator-' with "
10382  "upper and lower loop bounds">;
10383def err_omp_loop_cannot_use_stmt : Error<
10384  "'%0' statement cannot be used in OpenMP for loop">;
10385def err_omp_simd_region_cannot_use_stmt : Error<
10386  "'%0' statement cannot be used in OpenMP simd region">;
10387def warn_omp_loop_64_bit_var : Warning<
10388  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
10389  InGroup<OpenMPLoopForm>;
10390def err_omp_unknown_reduction_identifier : Error<
10391  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
10392  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
10393def err_omp_not_resolved_reduction_identifier : Error<
10394  "unable to resolve declare reduction construct for type %0">;
10395def err_omp_reduction_ref_type_arg : Error<
10396  "argument of OpenMP clause '%0' must reference the same object in all threads">;
10397def err_omp_clause_not_arithmetic_type_arg : Error<
10398  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
10399def err_omp_clause_floating_type_arg : Error<
10400  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
10401def err_omp_once_referenced : Error<
10402  "variable can appear only once in OpenMP '%0' clause">;
10403def err_omp_once_referenced_in_target_update : Error<
10404  "variable can appear only once in OpenMP 'target update' construct">;
10405def note_omp_referenced : Note<
10406  "previously referenced here">;
10407def err_omp_reduction_in_task : Error<
10408  "reduction variables may not be accessed in an explicit task">;
10409def err_omp_reduction_id_not_compatible : Error<
10410  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
10411def err_omp_reduction_identifier_mismatch : Error<
10412  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
10413def note_omp_previous_reduction_identifier : Note<
10414  "previously marked as task_reduction with different reduction operation">;
10415def err_omp_prohibited_region : Error<
10416  "region cannot be%select{| closely}0 nested inside '%1' region"
10417  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
10418  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
10419  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
10420  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
10421  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
10422def err_omp_prohibited_region_simd : Error<
10423  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
10424def err_omp_prohibited_region_atomic : Error<
10425  "OpenMP constructs may not be nested inside an atomic region">;
10426def err_omp_prohibited_region_critical_same_name : Error<
10427  "cannot nest 'critical' regions having the same name %0">;
10428def note_omp_previous_critical_region : Note<
10429  "previous 'critical' region starts here">;
10430def err_omp_several_directives_in_region : Error<
10431  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
10432def note_omp_previous_directive : Note<
10433  "previous '%0' directive used here">;
10434def err_omp_sections_not_compound_stmt : Error<
10435  "the statement for '#pragma omp sections' must be a compound statement">;
10436def err_omp_parallel_sections_not_compound_stmt : Error<
10437  "the statement for '#pragma omp parallel sections' must be a compound statement">;
10438def err_omp_orphaned_section_directive : Error<
10439  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
10440  " must be closely nested to a sections region%select{|, not a %1 region}0">;
10441def err_omp_sections_substmt_not_section : Error<
10442  "statement in 'omp sections' directive must be enclosed into a section region">;
10443def err_omp_parallel_sections_substmt_not_section : Error<
10444  "statement in 'omp parallel sections' directive must be enclosed into a section region">;
10445def err_omp_parallel_reduction_in_task_firstprivate : Error<
10446  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
10447def err_omp_atomic_read_not_expression_statement : Error<
10448  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
10449  " where v and x are both lvalue expressions with scalar type">;
10450def note_omp_atomic_read_write: Note<
10451  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
10452def err_omp_atomic_write_not_expression_statement : Error<
10453  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
10454  " where x is a lvalue expression with scalar type">;
10455def err_omp_atomic_update_not_expression_statement : Error<
10456  "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',"
10457  " where x is an lvalue expression with scalar type">;
10458def err_omp_atomic_not_expression_statement : Error<
10459  "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',"
10460  " where x is an lvalue expression with scalar type">;
10461def note_omp_atomic_update: Note<
10462  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
10463  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
10464  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
10465def err_omp_atomic_capture_not_expression_statement : Error<
10466  "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',"
10467  " where x and v are both lvalue expressions with scalar type">;
10468def err_omp_atomic_capture_not_compound_statement : Error<
10469  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
10470  " '{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;}',"
10471  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
10472  " where x is an lvalue expression with scalar type">;
10473def note_omp_atomic_capture: Note<
10474  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
10475def err_omp_atomic_several_clauses : Error<
10476  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
10477def err_omp_several_mem_order_clauses : Error<
10478  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
10479def err_omp_atomic_incompatible_mem_order_clause : Error<
10480  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
10481def note_omp_previous_mem_order_clause : Note<
10482  "'%0' clause used here">;
10483def err_omp_target_contains_not_only_teams : Error<
10484  "target construct with nested teams region contains statements outside of the teams construct">;
10485def note_omp_nested_teams_construct_here : Note<
10486  "nested teams construct here">;
10487def note_omp_nested_statement_here : Note<
10488  "%select{statement|directive}0 outside teams construct here">;
10489def err_omp_single_copyprivate_with_nowait : Error<
10490  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
10491def note_omp_nowait_clause_here : Note<
10492  "'nowait' clause is here">;
10493def err_omp_single_decl_in_declare_simd_variant : Error<
10494  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
10495def err_omp_function_expected : Error<
10496  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
10497def err_omp_wrong_cancel_region : Error<
10498  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
10499def err_omp_parent_cancel_region_nowait : Error<
10500  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
10501def err_omp_parent_cancel_region_ordered : Error<
10502  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
10503def 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">;
10504def 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">;
10505def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
10506def err_omp_mapper_wrong_type : Error<
10507  "mapper type must be of struct, union or class type">;
10508def err_omp_declare_mapper_wrong_var : Error<
10509  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
10510def err_omp_declare_mapper_redefinition : Error<
10511  "redefinition of user-defined mapper for type %0 with name %1">;
10512def err_omp_invalid_mapper: Error<
10513  "cannot find a valid user-defined mapper for type %0 with name %1">;
10514def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
10515def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
10516def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
10517def err_omp_typecheck_section_value : Error<
10518  "subscripted value is not an array or pointer">;
10519def err_omp_typecheck_section_not_integer : Error<
10520  "array section %select{lower bound|length}0 is not an integer">;
10521def err_omp_typecheck_shaping_not_integer : Error<
10522  "array shaping operation dimension is not an integer">;
10523def err_omp_shaping_dimension_not_positive : Error<
10524  "array shaping dimension is evaluated to a non-positive value %0">;
10525def err_omp_section_function_type : Error<
10526  "section of pointer to function type %0">;
10527def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
10528  InGroup<CharSubscript>, DefaultIgnore;
10529def err_omp_section_incomplete_type : Error<
10530  "section of pointer to incomplete type %0">;
10531def err_omp_section_not_subset_of_array : Error<
10532  "array section must be a subset of the original array">;
10533def err_omp_section_length_negative : Error<
10534  "section length is evaluated to a negative value %0">;
10535def err_omp_section_stride_non_positive : Error<
10536  "section stride is evaluated to a non-positive value %0">;
10537def err_omp_section_length_undefined : Error<
10538  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
10539def err_omp_wrong_linear_modifier : Error<
10540  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
10541def err_omp_wrong_linear_modifier_non_reference : Error<
10542  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
10543def err_omp_wrong_simdlen_safelen_values : Error<
10544  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
10545def err_omp_wrong_if_directive_name_modifier : Error<
10546  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
10547def err_omp_no_more_if_clause : Error<
10548  "no more 'if' clause is allowed">;
10549def err_omp_unnamed_if_clause : Error<
10550  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
10551def note_omp_previous_named_if_clause : Note<
10552  "previous clause with directive name modifier specified here">;
10553def err_omp_ordered_directive_with_param : Error<
10554  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
10555def err_omp_ordered_directive_without_param : Error<
10556  "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
10557def note_omp_ordered_param : Note<
10558  "'ordered' clause%select{| with specified parameter}0">;
10559def err_omp_expected_base_var_name : Error<
10560  "expected variable name as a base of the array %select{subscript|section}0">;
10561def err_omp_map_shared_storage : Error<
10562  "variable already marked as mapped in current construct">;
10563def err_omp_invalid_map_type_for_directive : Error<
10564  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
10565def err_omp_invalid_map_type_modifier_for_directive : Error<
10566  "map type modifier '%0' is not allowed for '#pragma omp %1'">;
10567def err_omp_no_clause_for_directive : Error<
10568  "expected at least one %0 clause for '#pragma omp %1'">;
10569def err_omp_threadprivate_in_clause : Error<
10570  "threadprivate variables are not allowed in '%0' clause">;
10571def err_omp_wrong_ordered_loop_count : Error<
10572  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
10573def note_collapse_loop_count : Note<
10574  "parameter of the 'collapse' clause">;
10575def err_omp_clauses_mutually_exclusive : Error<
10576  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
10577def note_omp_previous_clause : Note<
10578  "'%0' clause is specified here">;
10579def err_omp_hint_clause_no_name : Error<
10580  "the name of the construct must be specified in presence of 'hint' clause">;
10581def err_omp_critical_with_hint : Error<
10582  "constructs with the same name must have a 'hint' clause with the same value">;
10583def note_omp_critical_hint_here : Note<
10584  "%select{|previous }0'hint' clause with value '%1'">;
10585def note_omp_critical_no_hint : Note<
10586  "%select{|previous }0directive with no 'hint' clause specified">;
10587def err_omp_depend_clause_thread_simd : Error<
10588  "'depend' clauses cannot be mixed with '%0' clause">;
10589def err_omp_depend_sink_expected_loop_iteration : Error<
10590  "expected%select{| %1}0 loop iteration variable">;
10591def err_omp_depend_sink_unexpected_expr : Error<
10592  "unexpected expression: number of expressions is larger than the number of associated loops">;
10593def err_omp_depend_sink_expected_plus_minus : Error<
10594  "expected '+' or '-' operation">;
10595def err_omp_depend_sink_source_not_allowed : Error<
10596  "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
10597def err_omp_depend_zero_length_array_section_not_allowed : Error<
10598  "zero-length array section is not allowed in 'depend' clause">;
10599def err_omp_depend_sink_source_with_modifier : Error<
10600  "depend modifier cannot be used with 'sink' or 'source' depend type">;
10601def err_omp_depend_modifier_not_iterator : Error<
10602  "expected iterator specification as depend modifier">;
10603def err_omp_linear_ordered : Error<
10604  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
10605def err_omp_unexpected_schedule_modifier : Error<
10606  "modifier '%0' cannot be used along with modifier '%1'">;
10607def err_omp_schedule_nonmonotonic_static : Error<
10608  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
10609def err_omp_simple_clause_incompatible_with_ordered : Error<
10610  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
10611def err_omp_ordered_simd : Error<
10612  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
10613def err_omp_variable_in_given_clause_and_dsa : Error<
10614  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
10615def err_omp_param_or_this_in_clause : Error<
10616  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
10617def err_omp_expected_uniform_param : Error<
10618  "expected a reference to a parameter specified in a 'uniform' clause">;
10619def err_omp_expected_int_param : Error<
10620  "expected a reference to an integer-typed parameter">;
10621def err_omp_at_least_one_motion_clause_required : Error<
10622  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
10623def err_omp_usedeviceptr_not_a_pointer : Error<
10624  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
10625def err_omp_argument_type_isdeviceptr : Error <
10626  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
10627def warn_omp_nesting_simd : Warning<
10628  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
10629  InGroup<SourceUsesOpenMP>;
10630def err_omp_orphaned_device_directive : Error<
10631  "orphaned 'omp %0' directives are prohibited"
10632  "; perhaps you forget to enclose the directive into a "
10633  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
10634def err_omp_reduction_non_addressable_expression : Error<
10635  "expected addressable reduction item for the task-based directives">;
10636def err_omp_reduction_with_nogroup : Error<
10637  "'reduction' clause cannot be used with 'nogroup' clause">;
10638def err_omp_reduction_vla_unsupported : Error<
10639  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
10640def err_omp_linear_distribute_var_non_loop_iteration : Error<
10641  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
10642def warn_omp_non_trivial_type_mapped : Warning<
10643  "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
10644  InGroup<OpenMPMapping>;
10645def err_omp_requires_clause_redeclaration : Error <
10646  "Only one %0 clause can appear on a requires directive in a single translation unit">;
10647def note_omp_requires_previous_clause : Note <
10648  "%0 clause previously used here">;
10649def err_omp_directive_before_requires : Error <
10650  "'%0' region encountered before requires directive with '%1' clause">;
10651def note_omp_requires_encountered_directive : Note <
10652  "'%0' previously encountered here">;
10653def err_omp_invalid_scope : Error <
10654  "'#pragma omp %0' directive must appear only in file scope">;
10655def note_omp_invalid_length_on_this_ptr_mapping : Note <
10656  "expected length on mapping of 'this' array section expression to be '1'">;
10657def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
10658  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
10659def note_omp_invalid_subscript_on_this_ptr_map : Note <
10660  "expected 'this' subscript expression on map clause to be 'this[0]'">;
10661def err_omp_invalid_map_this_expr : Error <
10662  "invalid 'this' expression on 'map' clause">;
10663def err_omp_implied_type_not_found : Error<
10664  "'%0' type not found; include <omp.h>">;
10665def err_omp_expected_omp_depend_t_lvalue : Error<
10666  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
10667def err_omp_depobj_expected : Error<
10668  "expected depobj expression">;
10669def err_omp_depobj_single_clause_expected : Error<
10670  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
10671def err_omp_scan_single_clause_expected : Error<
10672  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
10673def err_omp_inclusive_exclusive_not_reduction : Error<
10674  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
10675  "of the parent directive">;
10676def err_omp_reduction_not_inclusive_exclusive : Error<
10677  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
10678  " 'exclusive' clause on an inner 'omp scan' directive">;
10679def err_omp_wrong_inscan_reduction : Error<
10680  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
10681  " 'omp parallel for', or 'omp parallel for simd' directive">;
10682def err_omp_inscan_reduction_expected : Error<
10683  "expected 'reduction' clause with the 'inscan' modifier">;
10684def note_omp_previous_inscan_reduction : Note<
10685  "'reduction' clause with 'inscan' modifier is used here">;
10686def err_omp_expected_predefined_allocator : Error<
10687  "expected one of the predefined allocators for the variables with the static "
10688  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
10689  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
10690  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
10691def warn_omp_used_different_allocator : Warning<
10692  "allocate directive specifies %select{default|'%1'}0 allocator while "
10693  "previously used %select{default|'%3'}2">,
10694  InGroup<OpenMPClauses>;
10695def note_omp_previous_allocator : Note<
10696  "previous allocator is specified here">;
10697def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
10698  "inside of the target region; provide an 'allocator' clause or use 'requires'"
10699  " directive with the 'dynamic_allocators' clause">;
10700def err_expected_allocator_expression : Error<"expected an allocator expression "
10701  "inside of the target region; provide an allocator expression or use 'requires'"
10702  " directive with the 'dynamic_allocators' clause">;
10703def warn_omp_allocate_thread_on_task_target_directive : Warning<
10704  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
10705  InGroup<OpenMPClauses>;
10706def err_omp_expected_private_copy_for_allocate : Error<
10707  "the referenced item is not found in any private clause on the same directive">;
10708def err_omp_stmt_depends_on_loop_counter : Error<
10709  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
10710def err_omp_invariant_dependency : Error<
10711  "expected loop invariant expression">;
10712def err_omp_invariant_or_linear_dependency : Error<
10713  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
10714def err_omp_wrong_dependency_iterator_type : Error<
10715  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
10716def err_device_unsupported_type
10717    : Error<"%0 requires %select{|%2 bit size}1 %3 type support, but device "
10718            "'%4' does not support it">;
10719def err_omp_lambda_capture_in_declare_target_not_to : Error<
10720  "variable captured in declare target region must appear in a to clause">;
10721def err_omp_device_type_mismatch : Error<
10722  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
10723def err_omp_wrong_device_function_call : Error<
10724  "function with 'device_type(%0)' is not available on %select{device|host}1">;
10725def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
10726def warn_omp_declare_target_after_first_use : Warning<
10727  "declaration marked as declare target after first use, it may lead to incorrect results">,
10728  InGroup<OpenMPTarget>;
10729def err_omp_declare_variant_incompat_attributes : Error<
10730  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
10731def warn_omp_declare_variant_score_not_constant
10732    : Warning<"score expressions in the OpenMP context selector need to be "
10733              "constant; %0 is not and will be ignored">,
10734      InGroup<SourceUsesOpenMP>;
10735def err_omp_declare_variant_user_condition_not_constant
10736    : Error<"the user condition in the OpenMP context selector needs to be "
10737            "constant; %0 is not">;
10738def warn_omp_declare_variant_after_used : Warning<
10739  "'#pragma omp declare variant' cannot be applied for function after first "
10740  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
10741def warn_omp_declare_variant_after_emitted : Warning<
10742  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
10743  " the original function might be used">, InGroup<SourceUsesOpenMP>;
10744def err_omp_declare_variant_doesnt_support : Error<
10745  "'#pragma omp declare variant' does not "
10746  "support %select{function templates|virtual functions|"
10747  "deduced return types|constructors|destructors|deleted functions|"
10748  "defaulted functions|constexpr functions|consteval function}0">;
10749def err_omp_declare_variant_diff : Error<
10750  "function with '#pragma omp declare variant' has a different %select{calling convention"
10751  "|return type|constexpr specification|inline specification|storage class|"
10752  "linkage}0">;
10753def err_omp_declare_variant_incompat_types : Error<
10754  "variant in '#pragma omp declare variant' with type %0 is incompatible with type %1"
10755  >;
10756def warn_omp_declare_variant_marked_as_declare_variant : Warning<
10757  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
10758  >, InGroup<SourceUsesOpenMP>;
10759def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
10760def err_omp_one_defaultmap_each_category: Error<
10761  "at most one defaultmap clause for each variable-category can appear on the directive">;
10762def err_omp_lastprivate_conditional_non_scalar : Error<
10763  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
10764  >;
10765def err_omp_flush_order_clause_and_list : Error<
10766  "'flush' directive with memory order clause '%0' cannot have the list">;
10767def note_omp_flush_order_clause_here : Note<
10768  "memory order clause '%0' is specified here">;
10769def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
10770  "expected addressable lvalue in '%0' clause">;
10771def err_omp_var_expected : Error<
10772  "expected variable of the '%0' type%select{|, not %2}1">;
10773def warn_unknown_declare_variant_isa_trait
10774    : Warning<"isa trait '%0' is not known to the current target; verify the "
10775              "spelling or consider restricting the context selector with the "
10776              "'arch' selector further">,
10777      InGroup<SourceUsesOpenMP>;
10778def err_omp_non_pointer_type_array_shaping_base : Error<
10779  "expected expression with a pointer to a complete type as a base of an array "
10780  "shaping operation">;
10781def err_omp_reduction_task_not_parallel_or_worksharing : Error<
10782  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
10783  " worksharing constructs">;
10784def err_omp_expected_array_alloctraits : Error<
10785  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
10786def err_omp_predefined_allocator_with_traits : Error<
10787  "predefined allocator cannot have traits specified">;
10788def note_omp_predefined_allocator : Note<
10789  "predefined trait '%0' used here">;
10790def err_omp_nonpredefined_allocator_without_traits : Error<
10791  "non-predefined allocator must have traits specified">;
10792def err_omp_allocator_used_in_clauses : Error<
10793  "allocators used in 'uses_allocators' clause cannot appear in other "
10794  "data-sharing or data-mapping attribute clauses">;
10795def err_omp_allocator_not_in_uses_allocators : Error<
10796  "allocator must be specified in the 'uses_allocators' clause">;
10797def note_omp_protected_structured_block
10798    : Note<"jump bypasses OpenMP structured block">;
10799def note_omp_exits_structured_block
10800    : Note<"jump exits scope of OpenMP structured block">;
10801def err_omp_interop_variable_expected : Error<
10802  "expected%select{| non-const}0 variable of type 'omp_interop_t'">;
10803def err_omp_interop_variable_wrong_type : Error<
10804  "interop variable must be of type 'omp_interop_t'">;
10805def err_omp_interop_prefer_type : Error<
10806  "prefer_list item must be a string literal or constant integral "
10807  "expression">;
10808def err_omp_interop_bad_depend_clause : Error<
10809  "'depend' clause requires the 'targetsync' interop type">;
10810def err_omp_interop_var_multiple_actions : Error<
10811  "interop variable %0 used in multiple action clauses">;
10812def err_omp_dispatch_statement_call
10813    : Error<"statement after '#pragma omp dispatch' must be a direct call"
10814            " to a target function or an assignment to one">;
10815def err_omp_unroll_full_variable_trip_count : Error<
10816  "loop to be fully unrolled must have a constant trip count">;
10817def note_omp_directive_here : Note<"'%0' directive found here">;
10818def err_omp_instantiation_not_supported
10819    : Error<"instantiation of '%0' not supported yet">;
10820} // end of OpenMP category
10821
10822let CategoryName = "Related Result Type Issue" in {
10823// Objective-C related result type compatibility
10824def warn_related_result_type_compatibility_class : Warning<
10825  "method is expected to return an instance of its class type "
10826  "%diff{$, but is declared to return $|"
10827  ", but is declared to return different type}0,1">;
10828def warn_related_result_type_compatibility_protocol : Warning<
10829  "protocol method is expected to return an instance of the implementing "
10830  "class, but is declared to return %0">;
10831def note_related_result_type_family : Note<
10832  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
10833  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
10834  "self}1' method family%select{| and is expected to return an instance of its "
10835  "class type}0">;
10836def note_related_result_type_overridden : Note<
10837  "overridden method returns an instance of its class type">;
10838def note_related_result_type_inferred : Note<
10839  "%select{class|instance}0 method %1 is assumed to return an instance of "
10840  "its receiver type (%2)">;
10841def note_related_result_type_explicit : Note<
10842  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
10843  "%select{| and is expected to return an instance of its class type}0">;
10844def err_invalid_type_for_program_scope_var : Error<
10845  "the %0 type cannot be used to declare a program scope variable">;
10846
10847}
10848
10849let CategoryName = "Modules Issue" in {
10850def err_module_decl_in_module_map_module : Error<
10851  "'module' declaration found while building module from module map">;
10852def err_module_decl_in_header_module : Error<
10853  "'module' declaration found while building header unit">;
10854def err_module_interface_implementation_mismatch : Error<
10855  "missing 'export' specifier in module declaration while "
10856  "building module interface">;
10857def err_current_module_name_mismatch : Error<
10858  "module name '%0' specified on command line does not match name of module">;
10859def err_module_redefinition : Error<
10860  "redefinition of module '%0'">;
10861def note_prev_module_definition : Note<"previously defined here">;
10862def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
10863def err_module_not_defined : Error<
10864  "definition of module '%0' is not available; use -fmodule-file= to specify "
10865  "path to precompiled module interface">;
10866def err_module_redeclaration : Error<
10867  "translation unit contains multiple module declarations">;
10868def note_prev_module_declaration : Note<"previous module declaration is here">;
10869def err_module_declaration_missing : Error<
10870  "missing 'export module' declaration in module interface unit">;
10871def err_module_declaration_missing_after_global_module_introducer : Error<
10872  "missing 'module' declaration at end of global module fragment "
10873  "introduced here">;
10874def err_module_private_specialization : Error<
10875  "%select{template|partial|member}0 specialization cannot be "
10876  "declared __module_private__">;
10877def err_module_private_local : Error<
10878  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
10879  "__module_private__">;
10880def err_module_private_local_class : Error<
10881  "local %select{struct|interface|union|class|enum}0 cannot be declared "
10882  "__module_private__">;
10883def err_module_unimported_use : Error<
10884  "%select{declaration|definition|default argument|"
10885  "explicit specialization|partial specialization}0 of %1 must be imported "
10886  "from module '%2' before it is required">;
10887def err_module_unimported_use_header : Error<
10888  "%select{missing '#include'|missing '#include %3'}2; "
10889  "%select{||default argument of |explicit specialization of |"
10890  "partial specialization of }0%1 must be "
10891  "%select{declared|defined|defined|declared|declared}0 "
10892  "before it is used">;
10893def err_module_unimported_use_multiple : Error<
10894  "%select{declaration|definition|default argument|"
10895  "explicit specialization|partial specialization}0 of %1 must be imported "
10896  "from one of the following modules before it is required:%2">;
10897def note_unreachable_entity : Note<
10898  "%select{declaration|definition|default argument declared|"
10899  "explicit specialization declared|partial specialization declared}0 here "
10900  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
10901def ext_module_import_in_extern_c : ExtWarn<
10902  "import of C++ module '%0' appears within extern \"C\" language linkage "
10903  "specification">, DefaultError,
10904  InGroup<DiagGroup<"module-import-in-extern-c">>;
10905def err_module_import_not_at_top_level_fatal : Error<
10906  "import of module '%0' appears within %1">, DefaultFatal;
10907def ext_module_import_not_at_top_level_noop : ExtWarn<
10908  "redundant #include of module '%0' appears within %1">, DefaultError,
10909  InGroup<DiagGroup<"modules-import-nested-redundant">>;
10910def note_module_import_not_at_top_level : Note<"%0 begins here">;
10911def err_module_self_import : Error<
10912  "import of module '%0' appears within same top-level module '%1'">;
10913def err_module_import_in_implementation : Error<
10914  "@import of module '%0' in implementation of '%1'; use #import">;
10915
10916// C++ Modules
10917def err_module_decl_not_at_start : Error<
10918  "module declaration must occur at the start of the translation unit">;
10919def note_global_module_introducer_missing : Note<
10920  "add 'module;' to the start of the file to introduce a "
10921  "global module fragment">;
10922def err_export_within_anonymous_namespace : Error<
10923  "export declaration appears within anonymous namespace">;
10924def note_anonymous_namespace : Note<"anonymous namespace begins here">;
10925def ext_export_no_name_block : ExtWarn<
10926  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
10927  "to appear in an export block">, InGroup<ExportUnnamed>;
10928def ext_export_no_names : ExtWarn<
10929  "ISO C++20 does not permit a declaration that does not introduce any names "
10930  "to be exported">, InGroup<ExportUnnamed>;
10931def note_export : Note<"export block begins here">;
10932def err_export_no_name : Error<
10933  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
10934def ext_export_using_directive : ExtWarn<
10935  "ISO C++20 does not permit using directive to be exported">,
10936  InGroup<DiagGroup<"export-using-directive">>;
10937def err_export_within_export : Error<
10938  "export declaration appears within another export declaration">;
10939def err_export_internal : Error<
10940  "declaration of %0 with internal linkage cannot be exported">;
10941def err_export_using_internal : Error<
10942  "using declaration referring to %0 with internal linkage cannot be exported">;
10943def err_export_not_in_module_interface : Error<
10944  "export declaration can only be used within a module interface unit"
10945  "%select{ after the module declaration|}0">;
10946def err_export_in_private_module_fragment : Error<
10947  "export declaration cannot be used in a private module fragment">;
10948def note_private_module_fragment : Note<
10949  "private module fragment begins here">;
10950def err_private_module_fragment_not_module : Error<
10951  "private module fragment declaration with no preceding module declaration">;
10952def err_private_module_fragment_redefined : Error<
10953  "private module fragment redefined">;
10954def err_private_module_fragment_not_module_interface : Error<
10955  "private module fragment in module implementation unit">;
10956def note_not_module_interface_add_export : Note<
10957  "add 'export' here if this is intended to be a module interface unit">;
10958
10959def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
10960  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
10961  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
10962def note_equivalent_internal_linkage_decl : Note<
10963  "declared here%select{ in module '%1'|}0">;
10964
10965def note_redefinition_modules_same_file : Note<
10966  "'%0' included multiple times, additional include site in header from module '%1'">;
10967def note_redefinition_include_same_file : Note<
10968  "'%0' included multiple times, additional include site here">;
10969}
10970
10971let CategoryName = "Coroutines Issue" in {
10972def err_return_in_coroutine : Error<
10973  "return statement not allowed in coroutine; did you mean 'co_return'?">;
10974def note_declared_coroutine_here : Note<
10975  "function is a coroutine due to use of '%0' here">;
10976def err_coroutine_objc_method : Error<
10977  "Objective-C methods as coroutines are not yet supported">;
10978def err_coroutine_unevaluated_context : Error<
10979  "'%0' cannot be used in an unevaluated context">;
10980def err_coroutine_within_handler : Error<
10981  "'%0' cannot be used in the handler of a try block">;
10982def err_coroutine_outside_function : Error<
10983  "'%0' cannot be used outside a function">;
10984def err_coroutine_invalid_func_context : Error<
10985  "'%1' cannot be used in %select{a constructor|a destructor"
10986  "|the 'main' function|a constexpr function"
10987  "|a function with a deduced return type|a varargs function"
10988  "|a consteval function}0">;
10989def err_implied_coroutine_type_not_found : Error<
10990  "%0 type was not found; include <experimental/coroutine> before defining "
10991  "a coroutine">;
10992def err_implicit_coroutine_std_nothrow_type_not_found : Error<
10993  "std::nothrow was not found; include <new> before defining a coroutine which "
10994  "uses get_return_object_on_allocation_failure()">;
10995def err_malformed_std_nothrow : Error<
10996  "std::nothrow must be a valid variable declaration">;
10997def err_malformed_std_coroutine_handle : Error<
10998  "std::experimental::coroutine_handle must be a class template">;
10999def err_coroutine_handle_missing_member : Error<
11000  "std::experimental::coroutine_handle missing a member named '%0'">;
11001def err_malformed_std_coroutine_traits : Error<
11002  "'std::experimental::coroutine_traits' must be a class template">;
11003def err_implied_std_coroutine_traits_promise_type_not_found : Error<
11004  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
11005def err_implied_std_coroutine_traits_promise_type_not_class : Error<
11006  "this function cannot be a coroutine: %0 is not a class">;
11007def err_coroutine_promise_type_incomplete : Error<
11008  "this function cannot be a coroutine: %0 is an incomplete type">;
11009def err_coroutine_type_missing_specialization : Error<
11010  "this function cannot be a coroutine: missing definition of "
11011  "specialization %0">;
11012def err_coroutine_promise_incompatible_return_functions : Error<
11013  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
11014def err_coroutine_promise_requires_return_function : Error<
11015  "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
11016def note_coroutine_promise_implicit_await_transform_required_here : Note<
11017  "call to 'await_transform' implicitly required by 'co_await' here">;
11018def note_coroutine_promise_suspend_implicitly_required : Note<
11019  "call to '%select{initial_suspend|final_suspend}0' implicitly "
11020  "required by the %select{initial suspend point|final suspend point}0">;
11021def err_coroutine_promise_unhandled_exception_required : Error<
11022  "%0 is required to declare the member 'unhandled_exception()'">;
11023def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
11024  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
11025  InGroup<CoroutineMissingUnhandledException>;
11026def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
11027  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
11028def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
11029  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
11030def err_coroutine_promise_new_requires_nothrow : Error<
11031  "%0 is required to have a non-throwing noexcept specification when the promise "
11032   "type declares 'get_return_object_on_allocation_failure()'">;
11033def note_coroutine_promise_call_implicitly_required : Note<
11034  "call to %0 implicitly required by coroutine function here">;
11035def err_await_suspend_invalid_return_type : Error<
11036  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
11037>;
11038def note_await_ready_no_bool_conversion : Note<
11039  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
11040>;
11041def warn_coroutine_handle_address_invalid_return_type : Warning <
11042  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">,
11043  InGroup<Coroutine>;
11044def err_coroutine_promise_final_suspend_requires_nothrow : Error<
11045  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
11046>;
11047def note_coroutine_function_declare_noexcept : Note<
11048  "must be declared with 'noexcept'"
11049>;
11050} // end of coroutines issue category
11051
11052let CategoryName = "Documentation Issue" in {
11053def warn_not_a_doxygen_trailing_member_comment : Warning<
11054  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
11055} // end of documentation issue category
11056
11057let CategoryName = "Nullability Issue" in {
11058
11059def warn_mismatched_nullability_attr : Warning<
11060  "nullability specifier %0 conflicts with existing specifier %1">,
11061  InGroup<Nullability>;
11062
11063def warn_nullability_declspec : Warning<
11064  "nullability specifier %0 cannot be applied "
11065  "to non-pointer type %1; did you mean to apply the specifier to the "
11066  "%select{pointer|block pointer|member pointer|function pointer|"
11067  "member function pointer}2?">,
11068  InGroup<NullabilityDeclSpec>,
11069  DefaultError;
11070
11071def note_nullability_here : Note<"%0 specified here">;
11072
11073def err_nullability_nonpointer : Error<
11074  "nullability specifier %0 cannot be applied to non-pointer type %1">;
11075
11076def warn_nullability_lost : Warning<
11077  "implicit conversion from nullable pointer %0 to non-nullable pointer "
11078  "type %1">,
11079  InGroup<NullableToNonNullConversion>, DefaultIgnore;
11080def warn_zero_as_null_pointer_constant : Warning<
11081  "zero as null pointer constant">,
11082  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
11083
11084def err_nullability_cs_multilevel : Error<
11085  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
11086def note_nullability_type_specifier : Note<
11087  "use nullability type specifier %0 to affect the innermost "
11088  "pointer type of %1">;
11089
11090def warn_null_resettable_setter : Warning<
11091  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
11092  InGroup<Nullability>;
11093
11094def warn_nullability_missing : Warning<
11095  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
11096  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
11097  InGroup<NullabilityCompleteness>;
11098def warn_nullability_missing_array : Warning<
11099  "array parameter is missing a nullability type specifier (_Nonnull, "
11100  "_Nullable, or _Null_unspecified)">,
11101  InGroup<NullabilityCompletenessOnArrays>;
11102def note_nullability_fix_it : Note<
11103  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
11104  "%select{pointer|block pointer|member pointer|array parameter}1 "
11105  "%select{should never be null|may be null|should not declare nullability}0">;
11106
11107def warn_nullability_inferred_on_nested_type : Warning<
11108  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
11109  "deprecated">,
11110  InGroup<NullabilityInferredOnNestedType>;
11111
11112def err_objc_type_arg_explicit_nullability : Error<
11113  "type argument %0 cannot explicitly specify nullability">;
11114
11115def err_objc_type_param_bound_explicit_nullability : Error<
11116  "type parameter %0 bound %1 cannot explicitly specify nullability">;
11117
11118}
11119
11120let CategoryName = "Generics Issue" in {
11121
11122def err_objc_type_param_bound_nonobject : Error<
11123  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
11124
11125def err_objc_type_param_bound_missing_pointer : Error<
11126  "missing '*' in type bound %0 for type parameter %1">;
11127def err_objc_type_param_bound_qualified : Error<
11128  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
11129
11130def err_objc_type_param_redecl : Error<
11131  "redeclaration of type parameter %0">;
11132
11133def err_objc_type_param_arity_mismatch : Error<
11134  "%select{forward class declaration|class definition|category|extension}0 has "
11135  "too %select{few|many}1 type parameters (expected %2, have %3)">;
11136
11137def err_objc_type_param_bound_conflict : Error<
11138  "type bound %0 for type parameter %1 conflicts with "
11139  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
11140
11141def err_objc_type_param_variance_conflict : Error<
11142  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
11143  "%select{in|co|contra}2variant type parameter %3">;
11144
11145def note_objc_type_param_here : Note<"type parameter %0 declared here">;
11146
11147def err_objc_type_param_bound_missing : Error<
11148  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
11149
11150def err_objc_parameterized_category_nonclass : Error<
11151  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
11152  "parameters">;
11153
11154def err_objc_parameterized_forward_class : Error<
11155  "forward declaration of non-parameterized class %0 cannot have type "
11156  "parameters">;
11157
11158def err_objc_parameterized_forward_class_first : Error<
11159  "class %0 previously declared with type parameters">;
11160
11161def err_objc_type_arg_missing_star : Error<
11162  "type argument %0 must be a pointer (requires a '*')">;
11163def err_objc_type_arg_qualified : Error<
11164  "type argument %0 cannot be qualified with '%1'">;
11165
11166def err_objc_type_arg_missing : Error<
11167  "no type or protocol named %0">;
11168
11169def err_objc_type_args_and_protocols : Error<
11170  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
11171  "%select{protocol|type}0 (%2)">;
11172
11173def err_objc_type_args_non_class : Error<
11174  "type arguments cannot be applied to non-class type %0">;
11175
11176def err_objc_type_args_non_parameterized_class : Error<
11177  "type arguments cannot be applied to non-parameterized class %0">;
11178
11179def err_objc_type_args_specialized_class : Error<
11180  "type arguments cannot be applied to already-specialized class type %0">;
11181
11182def err_objc_type_args_wrong_arity : Error<
11183  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
11184}
11185
11186def err_objc_type_arg_not_id_compatible : Error<
11187  "type argument %0 is neither an Objective-C object nor a block type">;
11188
11189def err_objc_type_arg_does_not_match_bound : Error<
11190  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
11191
11192def warn_objc_redundant_qualified_class_type : Warning<
11193  "parameterized class %0 already conforms to the protocols listed; did you "
11194  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
11195
11196def warn_block_literal_attributes_on_omitted_return_type : Warning<
11197  "attribute %0 ignored, because it cannot be applied to omitted return type">,
11198  InGroup<IgnoredAttributes>;
11199
11200def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
11201  "'%0' qualifier on omitted return type %1 has no effect">,
11202  InGroup<IgnoredQualifiers>;
11203
11204def warn_shadow_field : Warning<
11205  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
11206  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
11207def note_shadow_field : Note<"declared here">;
11208
11209def err_multiversion_required_in_redecl : Error<
11210  "function declaration is missing %select{'target'|'cpu_specific' or "
11211  "'cpu_dispatch'}0 attribute in a multiversioned function">;
11212def note_multiversioning_caused_here : Note<
11213  "function multiversioning caused by this declaration">;
11214def err_multiversion_after_used : Error<
11215  "function declaration cannot become a multiversioned function after first "
11216  "usage">;
11217def err_bad_multiversion_option : Error<
11218  "function multiversioning doesn't support %select{feature|architecture}0 "
11219  "'%1'">;
11220def err_multiversion_duplicate : Error<
11221  "multiversioned function redeclarations require identical target attributes">;
11222def err_multiversion_noproto : Error<
11223  "multiversioned function must have a prototype">;
11224def err_multiversion_disallowed_other_attr : Error<
11225  "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined"
11226  " with attribute %1">;
11227def err_multiversion_mismatched_attrs
11228    : Error<"attributes on multiversioned functions must all match, attribute "
11229            "%0 %select{is missing|has different arguments}1">;
11230def err_multiversion_diff : Error<
11231  "multiversioned function declaration has a different %select{calling convention"
11232  "|return type|constexpr specification|inline specification|linkage|"
11233  "language linkage}0">;
11234def err_multiversion_doesnt_support : Error<
11235  "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not "
11236  "yet support %select{function templates|virtual functions|"
11237  "deduced return types|constructors|destructors|deleted functions|"
11238  "defaulted functions|constexpr functions|consteval function}1">;
11239def err_multiversion_not_allowed_on_main : Error<
11240  "'main' cannot be a multiversioned function">;
11241def err_multiversion_not_supported : Error<
11242 "function multiversioning is not supported on the current target">;
11243def err_multiversion_types_mixed : Error<
11244  "multiversioning attributes cannot be combined">;
11245def err_cpu_dispatch_mismatch : Error<
11246 "'cpu_dispatch' function redeclared with different CPUs">;
11247def err_cpu_specific_multiple_defs : Error<
11248 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
11249def warn_multiversion_duplicate_entries : Warning<
11250 "CPU list contains duplicate entries; attribute ignored">,
11251  InGroup<FunctionMultiVersioning>;
11252def warn_dispatch_body_ignored : Warning<
11253  "body of cpu_dispatch function will be ignored">,
11254  InGroup<FunctionMultiVersioning>;
11255
11256// three-way comparison operator diagnostics
11257def err_implied_comparison_category_type_not_found : Error<
11258  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
11259  "because type '%0' was not found; include <compare>">;
11260def err_spaceship_argument_narrowing : Error<
11261  "argument to 'operator<=>' "
11262  "%select{cannot be narrowed from type %1 to %2|"
11263  "evaluates to %1, which cannot be narrowed to type %2}0">;
11264def err_std_compare_type_not_supported : Error<
11265  "standard library implementation of %0 is not supported; "
11266   "%select{member '%2' does not have expected form|"
11267   "member '%2' is missing|"
11268   "the type is not trivially copyable|"
11269   "the type does not have the expected form}1">;
11270def note_rewriting_operator_as_spaceship : Note<
11271  "while rewriting comparison as call to 'operator<=>' declared here">;
11272def err_three_way_vector_comparison : Error<
11273  "three-way comparison between vectors is not supported">;
11274
11275// Memory Tagging Extensions (MTE) diagnostics
11276def err_memtag_arg_null_or_pointer : Error<
11277  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
11278def err_memtag_any2arg_pointer : Error<
11279  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
11280def err_memtag_arg_must_be_pointer : Error<
11281  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
11282def err_memtag_arg_must_be_integer : Error<
11283  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
11284
11285def warn_dereference_of_noderef_type : Warning<
11286  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
11287def warn_dereference_of_noderef_type_no_decl : Warning<
11288  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
11289def warn_noderef_on_non_pointer_or_array : Warning<
11290  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
11291def warn_noderef_to_dereferenceable_pointer : Warning<
11292  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
11293
11294def err_builtin_launder_invalid_arg : Error<
11295  "%select{non-pointer|function pointer|void pointer}0 argument to "
11296  "'__builtin_launder' is not allowed">;
11297
11298def err_builtin_matrix_disabled: Error<
11299  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
11300def err_matrix_index_not_integer: Error<
11301  "matrix %select{row|column}0 index is not an integer">;
11302def err_matrix_index_outside_range: Error<
11303  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
11304def err_matrix_incomplete_index: Error<
11305  "single subscript expressions are not allowed for matrix values">;
11306def err_matrix_separate_incomplete_index: Error<
11307  "matrix row and column subscripts cannot be separated by any expression">;
11308def err_matrix_subscript_comma: Error<
11309  "comma expressions are not allowed as indices in matrix subscript expressions">;
11310def err_builtin_matrix_arg: Error<"1st argument must be a matrix">;
11311def err_builtin_matrix_scalar_unsigned_arg: Error<
11312  "%0 argument must be a constant unsigned integer expression">;
11313def err_builtin_matrix_pointer_arg: Error<
11314  "%ordinal0 argument must be a pointer to a valid matrix element type">;
11315def err_builtin_matrix_pointer_arg_mismatch: Error<
11316  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
11317def err_builtin_matrix_store_to_const: Error<
11318  "cannot store matrix to read-only pointer">;
11319def err_builtin_matrix_stride_too_small: Error<
11320  "stride must be greater or equal to the number of rows">;
11321def err_builtin_matrix_invalid_dimension: Error<
11322  "%0 dimension is outside the allowed range [1, %1]">;
11323
11324def warn_mismatched_import : Warning<
11325  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
11326  "previous declaration">,
11327  InGroup<IgnoredAttributes>;
11328def warn_import_on_definition : Warning<
11329  "import %select{module|name}0 cannot be applied to a function with a definition">,
11330  InGroup<IgnoredAttributes>;
11331
11332def err_preserve_field_info_not_field : Error<
11333  "__builtin_preserve_field_info argument %0 not a field access">;
11334def err_preserve_field_info_not_const: Error<
11335  "__builtin_preserve_field_info argument %0 not a constant">;
11336def err_btf_type_id_not_const: Error<
11337  "__builtin_btf_type_id argument %0 not a constant">;
11338def err_preserve_type_info_invalid : Error<
11339  "__builtin_preserve_type_info argument %0 invalid">;
11340def err_preserve_type_info_not_const: Error<
11341  "__builtin_preserve_type_info argument %0 not a constant">;
11342def err_preserve_enum_value_invalid : Error<
11343  "__builtin_preserve_enum_value argument %0 invalid">;
11344def err_preserve_enum_value_not_const: Error<
11345  "__builtin_preserve_enum_value argument %0 not a constant">;
11346
11347def err_bit_cast_non_trivially_copyable : Error<
11348  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
11349def err_bit_cast_type_size_mismatch : Error<
11350  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
11351
11352// SYCL-specific diagnostics
11353def warn_sycl_kernel_num_of_template_params : Warning<
11354  "'sycl_kernel' attribute only applies to a function template with at least"
11355  " two template parameters">, InGroup<IgnoredAttributes>;
11356def warn_sycl_kernel_invalid_template_param_type : Warning<
11357  "template parameter of a function template with the 'sycl_kernel' attribute"
11358  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
11359def warn_sycl_kernel_num_of_function_params : Warning<
11360  "function template with 'sycl_kernel' attribute must have a single parameter">,
11361  InGroup<IgnoredAttributes>;
11362def warn_sycl_kernel_return_type : Warning<
11363  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
11364  InGroup<IgnoredAttributes>;
11365
11366def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must "
11367                                 "have a bit size of at least %select{2|1}0">;
11368def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit "
11369                                 "sizes greater than %1 not supported">;
11370
11371// errors of expect.with.probability
11372def err_probability_not_constant_float : Error<
11373   "probability argument to __builtin_expect_with_probability must be constant "
11374   "floating-point expression">;
11375def err_probability_out_of_range : Error<
11376   "probability argument to __builtin_expect_with_probability is outside the "
11377   "range [0.0, 1.0]">;
11378
11379// TCB warnings
11380def err_tcb_conflicting_attributes : Error<
11381  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
11382def warn_tcb_enforcement_violation : Warning<
11383  "calling %0 is a violation of trusted computing base '%1'">,
11384  InGroup<DiagGroup<"tcb-enforcement">>;
11385
11386// RISC-V builtin required extension warning
11387def err_riscv_builtin_requires_extension : Error<
11388  "builtin requires '%0' extension support to be enabled">;
11389def err_riscv_builtin_invalid_lmul : Error<
11390  "LMUL argument must be in the range [0,3] or [5,7]">;
11391} // end of sema component.
11392