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">;
69
70// Constant expressions
71def err_expr_not_ice : Error<
72  "expression is not an %select{integer|integral}0 constant expression">;
73def ext_expr_not_ice : Extension<
74  "expression is not an %select{integer|integral}0 constant expression; "
75  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
76def err_typecheck_converted_constant_expression : Error<
77  "value of type %0 is not implicitly convertible to %1">;
78def err_typecheck_converted_constant_expression_disallowed : Error<
79  "conversion from %0 to %1 is not allowed in a converted constant expression">;
80def err_typecheck_converted_constant_expression_indirect : Error<
81  "conversion from %0 to %1 in converted constant expression would "
82  "bind reference to a temporary">;
83def err_expr_not_cce : Error<
84  "%select{case value|enumerator value|non-type template argument|"
85  "array size|explicit specifier argument}0 "
86  "is not a constant expression">;
87def ext_cce_narrowing : ExtWarn<
88  "%select{case value|enumerator value|non-type template argument|"
89  "array size|explicit specifier argument}0 "
90  "%select{cannot be narrowed from type %2 to %3|"
91  "evaluates to %2, which cannot be narrowed to type %3}1">,
92  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
93def err_ice_not_integral : Error<
94  "%select{integer|integral}1 constant expression must have "
95  "%select{integer|integral or unscoped enumeration}1 type, not %0">;
96def err_ice_incomplete_type : Error<
97  "integral constant expression has incomplete class type %0">;
98def err_ice_explicit_conversion : Error<
99  "integral constant expression requires explicit conversion from %0 to %1">;
100def note_ice_conversion_here : Note<
101  "conversion to %select{integral|enumeration}0 type %1 declared here">;
102def err_ice_ambiguous_conversion : Error<
103  "ambiguous conversion from type %0 to an integral or unscoped "
104  "enumeration type">;
105def err_ice_too_large : Error<
106  "integer constant expression evaluates to value %0 that cannot be "
107  "represented in a %1-bit %select{signed|unsigned}2 integer type">;
108def err_expr_not_string_literal : Error<"expression is not a string literal">;
109
110// Semantic analysis of constant literals.
111def ext_predef_outside_function : Warning<
112  "predefined identifier is only valid inside function">,
113  InGroup<DiagGroup<"predefined-identifier-outside-function">>;
114def warn_float_overflow : Warning<
115  "magnitude of floating-point constant too large for type %0; maximum is %1">,
116   InGroup<LiteralRange>;
117def warn_float_underflow : Warning<
118  "magnitude of floating-point constant too small for type %0; minimum is %1">,
119  InGroup<LiteralRange>;
120def warn_double_const_requires_fp64 : Warning<
121  "double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, "
122  "casting to single precision">;
123def err_half_const_requires_fp16 : Error<
124  "half precision constant requires cl_khr_fp16">;
125
126// C99 variable-length arrays
127def ext_vla : Extension<"variable length arrays are a C99 feature">,
128  InGroup<VLAExtension>;
129def warn_vla_used : Warning<"variable length array used">,
130  InGroup<VLA>, DefaultIgnore;
131def err_vla_in_sfinae : Error<
132  "variable length array cannot be formed during template argument deduction">;
133def err_array_star_in_function_definition : Error<
134  "variable length array must be bound in function definition">;
135def err_vla_decl_in_file_scope : Error<
136  "variable length array declaration not allowed at file scope">;
137def err_vla_decl_has_static_storage : Error<
138  "variable length array declaration cannot have 'static' storage duration">;
139def err_vla_decl_has_extern_linkage : Error<
140  "variable length array declaration cannot have 'extern' linkage">;
141def ext_vla_folded_to_constant : ExtWarn<
142  "variable length array folded to constant array as an extension">,
143  InGroup<GNUFoldingConstant>;
144def err_vla_unsupported : Error<
145  "variable length arrays are not supported for the current target">;
146def note_vla_unsupported : Note<
147  "variable length arrays are not supported for the current target">;
148
149// C99 variably modified types
150def err_variably_modified_template_arg : Error<
151  "variably modified type %0 cannot be used as a template argument">;
152def err_variably_modified_nontype_template_param : Error<
153  "non-type template parameter of variably modified type %0">;
154def err_variably_modified_new_type : Error<
155  "'new' cannot allocate object of variably modified type %0">;
156
157// C99 Designated Initializers
158def ext_designated_init : Extension<
159  "designated initializers are a C99 feature">, InGroup<C99Designator>;
160def err_array_designator_negative : Error<
161  "array designator value '%0' is negative">;
162def err_array_designator_empty_range : Error<
163  "array designator range [%0, %1] is empty">;
164def err_array_designator_non_array : Error<
165  "array designator cannot initialize non-array type %0">;
166def err_array_designator_too_large : Error<
167  "array designator index (%0) exceeds array bounds (%1)">;
168def err_field_designator_non_aggr : Error<
169  "field designator cannot initialize a "
170  "%select{non-struct, non-union|non-class}0 type %1">;
171def err_field_designator_unknown : Error<
172  "field designator %0 does not refer to any field in type %1">;
173def err_field_designator_nonfield : Error<
174  "field designator %0 does not refer to a non-static data member">;
175def note_field_designator_found : Note<"field designator refers here">;
176def err_designator_for_scalar_or_sizeless_init : Error<
177  "designator in initializer for %select{scalar|indivisible sizeless}0 "
178  "type %1">;
179def warn_initializer_overrides : Warning<
180  "initializer %select{partially |}0overrides prior initialization of "
181  "this subobject">, InGroup<InitializerOverrides>;
182def ext_initializer_overrides : ExtWarn<warn_initializer_overrides.Text>,
183  InGroup<InitializerOverrides>, SFINAEFailure;
184def err_initializer_overrides_destructed : Error<
185  "initializer would partially override prior initialization of object of "
186  "type %1 with non-trivial destruction">;
187def note_previous_initializer : Note<
188  "previous initialization %select{|with side effects }0is here"
189  "%select{| (side effects will not occur at run time)}0">;
190def err_designator_into_flexible_array_member : Error<
191  "designator into flexible array member subobject">;
192def note_flexible_array_member : Note<
193  "initialized flexible array member %0 is here">;
194def ext_flexible_array_init : Extension<
195  "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
196
197// C++20 designated initializers
198def ext_cxx_designated_init : Extension<
199  "designated initializers are a C++20 extension">, InGroup<CXX20Designator>;
200def warn_cxx17_compat_designated_init : Warning<
201  "designated initializers are incompatible with C++ standards before C++20">,
202  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
203def ext_designated_init_mixed : ExtWarn<
204  "mixture of designated and non-designated initializers in the same "
205  "initializer list is a C99 extension">, InGroup<C99Designator>;
206def note_designated_init_mixed : Note<
207  "first non-designated initializer is here">;
208def ext_designated_init_array : ExtWarn<
209  "array designators are a C99 extension">, InGroup<C99Designator>;
210def ext_designated_init_nested : ExtWarn<
211  "nested designators are a C99 extension">, InGroup<C99Designator>;
212def ext_designated_init_reordered : ExtWarn<
213  "ISO C++ requires field designators to be specified in declaration order; "
214  "field %1 will be initialized after field %0">, InGroup<ReorderInitList>,
215  SFINAEFailure;
216def note_previous_field_init : Note<
217  "previous initialization for field %0 is here">;
218def ext_designated_init_brace_elision : ExtWarn<
219  "brace elision for designated initializer is a C99 extension">,
220  InGroup<C99Designator>, SFINAEFailure;
221
222// Declarations.
223def ext_plain_complex : ExtWarn<
224  "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
225def ext_imaginary_constant : Extension<
226  "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
227def ext_integer_complex : Extension<
228  "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
229
230def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
231  "'_Fract' or '_Accum', not '%0'">;
232def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
233def err_invalid_width_spec : Error<
234  "'%select{|short|long|long long}0 %1' is invalid">;
235def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
236
237def ext_auto_type_specifier : ExtWarn<
238  "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
239def warn_auto_storage_class : Warning<
240  "'auto' storage class specifier is redundant and incompatible with C++11">,
241  InGroup<CXX11Compat>, DefaultIgnore;
242
243def warn_deprecated_register : Warning<
244  "'register' storage class specifier is deprecated "
245  "and incompatible with C++17">, InGroup<DeprecatedRegister>;
246def ext_register_storage_class : ExtWarn<
247  "ISO C++17 does not allow 'register' storage class specifier">,
248  DefaultError, InGroup<Register>;
249
250def err_invalid_decl_spec_combination : Error<
251  "cannot combine with previous '%0' declaration specifier">;
252def err_invalid_vector_decl_spec_combination : Error<
253  "cannot combine with previous '%0' declaration specifier. "
254  "'__vector' must be first">;
255def err_invalid_pixel_decl_spec_combination : Error<
256  "'__pixel' must be preceded by '__vector'.  "
257  "'%0' declaration specifier not allowed here">;
258def err_invalid_vector_bool_decl_spec : Error<
259  "cannot use '%0' with '__vector bool'">;
260def err_invalid_vector_long_decl_spec : Error<
261  "cannot use 'long' with '__vector'">;
262def err_invalid_vector_float_decl_spec : Error<
263  "cannot use 'float' with '__vector'">;
264def err_invalid_vector_double_decl_spec : Error <
265  "use of 'double' with '__vector' requires VSX support to be enabled "
266  "(available on POWER7 or later)">;
267def err_invalid_vector_bool_int128_decl_spec : Error <
268  "use of '__int128' with '__vector bool' requires VSX support enabled (on "
269  "POWER10 or later)">;
270def err_invalid_vector_long_long_decl_spec : Error <
271  "use of 'long long' with '__vector bool' requires VSX support (available on "
272  "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
273  "to be enabled">;
274def err_invalid_vector_long_double_decl_spec : Error<
275  "cannot use 'long double' with '__vector'">;
276def warn_vector_long_decl_spec_combination : Warning<
277  "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
278
279def err_redeclaration_different_type : Error<
280  "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
281def err_bad_variable_name : Error<
282  "%0 cannot be the name of a variable or data member">;
283def err_bad_parameter_name : Error<
284  "%0 cannot be the name of a parameter">;
285def err_bad_parameter_name_template_id : Error<
286  "parameter name cannot have template arguments">;
287def ext_parameter_name_omitted_c2x : ExtWarn<
288  "omitting the parameter name in a function definition is a C2x extension">,
289  InGroup<C2x>;
290def err_anyx86_interrupt_attribute : Error<
291  "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
292  "have %select{a 'void' return type|"
293  "only a pointer parameter optionally followed by an integer parameter|"
294  "a pointer as the first parameter|a %2 type as the second parameter}1">;
295def err_anyx86_interrupt_called : Error<
296  "interrupt service routine cannot be called directly">;
297def warn_anyx86_interrupt_regsave : Warning<
298  "interrupt service routine should only call a function"
299  " with attribute 'no_caller_saved_registers'">,
300  InGroup<DiagGroup<"interrupt-service-routine">>;
301def warn_arm_interrupt_calling_convention : Warning<
302   "call to function without interrupt attribute could clobber interruptee's VFP registers">,
303   InGroup<Extra>;
304def warn_interrupt_attribute_invalid : Warning<
305   "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to "
306   "functions that have %select{no parameters|a 'void' return type}1">,
307   InGroup<IgnoredAttributes>;
308def warn_riscv_repeated_interrupt_attribute : Warning<
309  "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
310def note_riscv_repeated_interrupt_attribute : Note<
311  "repeated RISC-V 'interrupt' attribute is here">;
312def warn_unused_parameter : Warning<"unused parameter %0">,
313  InGroup<UnusedParameter>, DefaultIgnore;
314def warn_unused_but_set_parameter : Warning<"parameter %0 set but not used">,
315  InGroup<UnusedButSetParameter>, DefaultIgnore;
316def warn_unused_variable : Warning<"unused variable %0">,
317  InGroup<UnusedVariable>, DefaultIgnore;
318def warn_unused_but_set_variable : Warning<"variable %0 set but not used">,
319  InGroup<UnusedButSetVariable>, DefaultIgnore;
320def warn_unused_local_typedef : Warning<
321  "unused %select{typedef|type alias}0 %1">,
322  InGroup<UnusedLocalTypedef>, DefaultIgnore;
323def warn_unused_property_backing_ivar :
324  Warning<"ivar %0 which backs the property is not "
325  "referenced in this property's accessor">,
326  InGroup<UnusedPropertyIvar>, DefaultIgnore;
327def warn_unused_const_variable : Warning<"unused variable %0">,
328  InGroup<UnusedConstVariable>, DefaultIgnore;
329def warn_unused_exception_param : Warning<"unused exception parameter %0">,
330  InGroup<UnusedExceptionParameter>, DefaultIgnore;
331def warn_decl_in_param_list : Warning<
332  "declaration of %0 will not be visible outside of this function">,
333  InGroup<Visibility>;
334def warn_redefinition_in_param_list : Warning<
335  "redefinition of %0 will not be visible outside of this function">,
336  InGroup<Visibility>;
337def warn_empty_parens_are_function_decl : Warning<
338  "empty parentheses interpreted as a function declaration">,
339  InGroup<VexingParse>;
340def warn_parens_disambiguated_as_function_declaration : Warning<
341  "parentheses were disambiguated as a function declaration">,
342  InGroup<VexingParse>;
343def warn_parens_disambiguated_as_variable_declaration : Warning<
344  "parentheses were disambiguated as redundant parentheses around declaration "
345  "of variable named %0">, InGroup<VexingParse>;
346def warn_redundant_parens_around_declarator : Warning<
347  "redundant parentheses surrounding declarator">,
348  InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
349def note_additional_parens_for_variable_declaration : Note<
350  "add a pair of parentheses to declare a variable">;
351def note_raii_guard_add_name : Note<
352  "add a variable name to declare a %0 initialized with %1">;
353def note_function_style_cast_add_parentheses : Note<
354  "add enclosing parentheses to perform a function-style cast">;
355def note_remove_parens_for_variable_declaration : Note<
356  "remove parentheses to silence this warning">;
357def note_empty_parens_function_call : Note<
358  "change this ',' to a ';' to call %0">;
359def note_empty_parens_default_ctor : Note<
360  "remove parentheses to declare a variable">;
361def note_empty_parens_zero_initialize : Note<
362  "replace parentheses with an initializer to declare a variable">;
363def warn_unused_function : Warning<"unused function %0">,
364  InGroup<UnusedFunction>, DefaultIgnore;
365def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
366  InGroup<UnusedTemplate>, DefaultIgnore;
367def warn_unused_member_function : Warning<"unused member function %0">,
368  InGroup<UnusedMemberFunction>, DefaultIgnore;
369def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
370  InGroup<UsedButMarkedUnused>, DefaultIgnore;
371def warn_unneeded_internal_decl : Warning<
372  "%select{function|variable}0 %1 is not needed and will not be emitted">,
373  InGroup<UnneededInternalDecl>, DefaultIgnore;
374def warn_unneeded_static_internal_decl : Warning<
375  "'static' function %0 declared in header file "
376  "should be declared 'static inline'">,
377  InGroup<UnneededInternalDecl>, DefaultIgnore;
378def warn_unneeded_member_function : Warning<
379  "member function %0 is not needed and will not be emitted">,
380  InGroup<UnneededMemberFunction>, DefaultIgnore;
381def warn_unused_private_field: Warning<"private field %0 is not used">,
382  InGroup<UnusedPrivateField>, DefaultIgnore;
383def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
384  "%select{used|required to be captured for this use}1">,
385  InGroup<UnusedLambdaCapture>, DefaultIgnore;
386
387def warn_reserved_extern_symbol: Warning<
388  "identifier %0 is reserved because %select{"
389  "<ERROR>|" // ReservedIdentifierStatus::NotReserved
390  "it starts with '_' at global scope|"
391  "it starts with '__'|"
392  "it starts with '_' followed by a capital letter|"
393  "it contains '__'}1">,
394  InGroup<ReservedIdentifier>, DefaultIgnore;
395
396def warn_parameter_size: Warning<
397  "%0 is a large (%1 bytes) pass-by-value argument; "
398  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
399def warn_return_value_size: Warning<
400  "return value of %0 is a large (%1 bytes) pass-by-value object; "
401  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
402def warn_return_value_udt: Warning<
403  "%0 has C-linkage specified, but returns user-defined type %1 which is "
404  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
405def warn_return_value_udt_incomplete: Warning<
406  "%0 has C-linkage specified, but returns incomplete type %1 which could be "
407  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
408def warn_implicit_function_decl : Warning<
409  "implicit declaration of function %0">,
410  InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
411def ext_implicit_function_decl : ExtWarn<
412  "implicit declaration of function %0 is invalid in C99">,
413  InGroup<ImplicitFunctionDeclare>;
414def note_function_suggestion : Note<"did you mean %0?">;
415
416def err_ellipsis_first_param : Error<
417  "ISO C requires a named parameter before '...'">;
418def err_declarator_need_ident : Error<"declarator requires an identifier">;
419def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
420def err_language_linkage_spec_not_ascii : Error<
421  "string literal in language linkage specifier cannot have an "
422  "encoding-prefix">;
423def ext_use_out_of_scope_declaration : ExtWarn<
424  "use of out-of-scope declaration of %0%select{| whose type is not "
425  "compatible with that of an implicit declaration}1">,
426  InGroup<DiagGroup<"out-of-scope-function">>;
427def err_inline_non_function : Error<
428  "'inline' can only appear on functions%select{| and non-local variables}0">;
429def err_noreturn_non_function : Error<
430  "'_Noreturn' can only appear on functions">;
431def warn_qual_return_type : Warning<
432  "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
433  InGroup<IgnoredQualifiers>, DefaultIgnore;
434def warn_deprecated_redundant_constexpr_static_def : Warning<
435  "out-of-line definition of constexpr static data member is redundant "
436  "in C++17 and is deprecated">,
437  InGroup<Deprecated>, DefaultIgnore;
438
439def warn_decl_shadow :
440  Warning<"declaration shadows a %select{"
441          "local variable|"
442          "variable in %2|"
443          "static data member of %2|"
444          "field of %2|"
445          "typedef in %2|"
446          "type alias in %2|"
447          "structured binding}1">,
448  InGroup<Shadow>, DefaultIgnore;
449def warn_decl_shadow_uncaptured_local :
450  Warning<warn_decl_shadow.Text>,
451  InGroup<ShadowUncapturedLocal>, DefaultIgnore;
452def warn_ctor_parm_shadows_field:
453  Warning<"constructor parameter %0 shadows the field %1 of %2">,
454  InGroup<ShadowFieldInConstructor>, DefaultIgnore;
455def warn_modifying_shadowing_decl :
456  Warning<"modifying constructor parameter %0 that shadows a "
457          "field of %1">,
458  InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
459
460// C++ decomposition declarations
461def err_decomp_decl_context : Error<
462  "decomposition declaration not permitted in this context">;
463def warn_cxx14_compat_decomp_decl : Warning<
464  "decomposition declarations are incompatible with "
465  "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
466def ext_decomp_decl : ExtWarn<
467  "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
468def ext_decomp_decl_cond : ExtWarn<
469  "ISO C++17 does not permit structured binding declaration in a condition">,
470  InGroup<DiagGroup<"binding-in-condition">>;
471def err_decomp_decl_spec : Error<
472  "decomposition declaration cannot be declared "
473  "%plural{1:'%1'|:with '%1' specifiers}0">;
474def ext_decomp_decl_spec : ExtWarn<
475  "decomposition declaration declared "
476  "%plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension">,
477  InGroup<CXX20>;
478def warn_cxx17_compat_decomp_decl_spec : Warning<
479  "decomposition declaration declared "
480  "%plural{1:'%1'|:with '%1' specifiers}0 "
481  "is incompatible with C++ standards before C++20">,
482  InGroup<CXXPre20Compat>, DefaultIgnore;
483def err_decomp_decl_type : Error<
484  "decomposition declaration cannot be declared with type %0; "
485  "declared type must be 'auto' or reference to 'auto'">;
486def err_decomp_decl_parens : Error<
487  "decomposition declaration cannot be declared with parentheses">;
488def err_decomp_decl_template : Error<
489  "decomposition declaration template not supported">;
490def err_decomp_decl_not_alone : Error<
491  "decomposition declaration must be the only declaration in its group">;
492def err_decomp_decl_requires_init : Error<
493  "decomposition declaration %0 requires an initializer">;
494def err_decomp_decl_wrong_number_bindings : Error<
495  "type %0 decomposes into %3 %plural{1:element|:elements}2, but "
496  "%select{%plural{0:no|:only %1}1|%1}4 "
497  "%plural{1:name was|:names were}1 provided">;
498def err_decomp_decl_unbindable_type : Error<
499  "cannot decompose %select{union|non-class, non-array}1 type %2">;
500def err_decomp_decl_multiple_bases_with_members : Error<
501  "cannot decompose class type %1: "
502  "%select{its base classes %2 and|both it and its base class}0 %3 "
503  "have non-static data members">;
504def err_decomp_decl_ambiguous_base : Error<
505  "cannot decompose members of ambiguous base class %1 of %0:%2">;
506def err_decomp_decl_inaccessible_base : Error<
507  "cannot decompose members of inaccessible base class %1 of %0">,
508  AccessControl;
509def err_decomp_decl_inaccessible_field : Error<
510  "cannot decompose %select{private|protected}0 member %1 of %3">,
511  AccessControl;
512def err_decomp_decl_lambda : Error<
513  "cannot decompose lambda closure type">;
514def err_decomp_decl_anon_union_member : Error<
515  "cannot decompose class type %0 because it has an anonymous "
516  "%select{struct|union}1 member">;
517def err_decomp_decl_std_tuple_element_not_specialized : Error<
518  "cannot decompose this type; 'std::tuple_element<%0>::type' "
519  "does not name a type">;
520def err_decomp_decl_std_tuple_size_not_constant : Error<
521  "cannot decompose this type; 'std::tuple_size<%0>::value' "
522  "is not a valid integral constant expression">;
523def note_in_binding_decl_init : Note<
524  "in implicit initialization of binding declaration %0">;
525
526def err_std_type_trait_not_class_template : Error<
527  "unsupported standard library implementation: "
528  "'std::%0' is not a class template">;
529
530// C++ using declarations
531def err_using_requires_qualname : Error<
532  "using declaration requires a qualified name">;
533def err_using_typename_non_type : Error<
534  "'typename' keyword used on a non-type">;
535def err_using_dependent_value_is_type : Error<
536  "dependent using declaration resolved to type without 'typename'">;
537def err_using_decl_nested_name_specifier_is_not_class : Error<
538  "using declaration in class refers into '%0', which is not a class">;
539def warn_cxx17_compat_using_decl_non_member_enumerator : Warning<
540  "member using declaration naming non-class '%0' enumerator is "
541  "incompatible with C++ standards before C++20">, InGroup<CXXPre20Compat>,
542  DefaultIgnore;
543def err_using_decl_nested_name_specifier_is_current_class : Error<
544  "using declaration refers to its own class">;
545def err_using_decl_nested_name_specifier_is_not_base_class : Error<
546  "using declaration refers into '%0', which is not a base class of %1">;
547def err_using_decl_constructor_not_in_direct_base : Error<
548  "%0 is not a direct base of %1, cannot inherit constructors">;
549def err_using_decl_can_not_refer_to_class_member : Error<
550  "using declaration cannot refer to class member">;
551def warn_cxx17_compat_using_decl_class_member_enumerator : Warning<
552  "member using declaration naming a non-member enumerator is incompatible "
553  "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
554def ext_using_decl_class_member_enumerator : ExtWarn<
555  "member using declaration naming a non-member enumerator is "
556  "a C++20 extension">, InGroup<CXX20>;
557def err_using_enum_is_dependent : Error<
558  "using-enum cannot name a dependent type">;
559def err_ambiguous_inherited_constructor : Error<
560  "constructor of %0 inherited from multiple base class subobjects">;
561def note_ambiguous_inherited_constructor_using : Note<
562  "inherited from base class %0 here">;
563def note_using_decl_class_member_workaround : Note<
564  "use %select{an alias declaration|a typedef declaration|a reference|"
565  "a const variable|a constexpr variable}0 instead">;
566def err_using_decl_can_not_refer_to_namespace : Error<
567  "using declaration cannot refer to a namespace">;
568def warn_cxx17_compat_using_decl_scoped_enumerator: Warning<
569  "using declaration naming a scoped enumerator is incompatible with "
570  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
571def ext_using_decl_scoped_enumerator : ExtWarn<
572  "using declaration naming a scoped enumerator is a C++20 extension">,
573  InGroup<CXX20>;
574def err_using_decl_constructor : Error<
575  "using declaration cannot refer to a constructor">;
576def warn_cxx98_compat_using_decl_constructor : Warning<
577  "inheriting constructors are incompatible with C++98">,
578  InGroup<CXX98Compat>, DefaultIgnore;
579def err_using_decl_destructor : Error<
580  "using declaration cannot refer to a destructor">;
581def err_using_decl_template_id : Error<
582  "using declaration cannot refer to a template specialization">;
583def note_using_decl_target : Note<"target of using declaration">;
584def note_using_decl_conflict : Note<"conflicting declaration">;
585def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
586def err_using_decl_conflict : Error<
587  "target of using declaration conflicts with declaration already in scope">;
588def err_using_decl_conflict_reverse : Error<
589  "declaration conflicts with target of using declaration already in scope">;
590def note_using_decl : Note<"%select{|previous }0using declaration">;
591def err_using_decl_redeclaration_expansion : Error<
592  "using declaration pack expansion at block scope produces multiple values">;
593def err_use_of_empty_using_if_exists : Error<
594  "reference to unresolved using declaration">;
595def note_empty_using_if_exists_here : Note<
596  "using declaration annotated with 'using_if_exists' here">;
597def err_using_if_exists_on_ctor : Error<
598  "'using_if_exists' attribute cannot be applied to an inheriting constructor">;
599def err_using_enum_decl_redeclaration : Error<
600  "redeclaration of using-enum declaration">;
601def note_using_enum_decl : Note<"%select{|previous }0using-enum declaration">;
602
603def warn_access_decl_deprecated : Warning<
604  "access declarations are deprecated; use using declarations instead">,
605  InGroup<Deprecated>;
606def err_access_decl : Error<
607  "ISO C++11 does not allow access declarations; "
608  "use using declarations instead">;
609def warn_deprecated_copy : Warning<
610  "definition of implicit copy %select{constructor|assignment operator}1 "
611  "for %0 is deprecated because it has a user-declared copy "
612  "%select{assignment operator|constructor}1">,
613  InGroup<DeprecatedCopy>, DefaultIgnore;
614def warn_deprecated_copy_with_dtor : Warning<
615  "definition of implicit copy %select{constructor|assignment operator}1 "
616  "for %0 is deprecated because it has a user-declared destructor">,
617  InGroup<DeprecatedCopyWithDtor>, DefaultIgnore;
618def warn_deprecated_copy_with_user_provided_copy: Warning<
619  "definition of implicit copy %select{constructor|assignment operator}1 "
620  "for %0 is deprecated because it has a user-provided copy "
621  "%select{assignment operator|constructor}1">,
622  InGroup<DeprecatedCopyWithUserProvidedCopy>, DefaultIgnore;
623def warn_deprecated_copy_with_user_provided_dtor : Warning<
624  "definition of implicit copy %select{constructor|assignment operator}1 "
625  "for %0 is deprecated because it has a user-provided destructor">,
626  InGroup<DeprecatedCopyWithUserProvidedDtor>, DefaultIgnore;
627def warn_cxx17_compat_exception_spec_in_signature : Warning<
628  "mangled name of %0 will change in C++17 due to non-throwing exception "
629  "specification in function signature">, InGroup<CXX17CompatMangling>;
630
631def warn_global_constructor : Warning<
632  "declaration requires a global constructor">,
633  InGroup<GlobalConstructors>, DefaultIgnore;
634def warn_global_destructor : Warning<
635  "declaration requires a global destructor">,
636   InGroup<GlobalConstructors>, DefaultIgnore;
637def warn_exit_time_destructor : Warning<
638  "declaration requires an exit-time destructor">,
639  InGroup<ExitTimeDestructors>, DefaultIgnore;
640
641def err_invalid_thread : Error<
642  "'%0' is only allowed on variable declarations">;
643def err_thread_non_global : Error<
644  "'%0' variables must have global storage">;
645def err_thread_unsupported : Error<
646  "thread-local storage is not supported for the current target">;
647
648// FIXME: Combine fallout warnings to just one warning.
649def warn_maybe_falloff_nonvoid_function : Warning<
650  "non-void function does not return a value in all control paths">,
651  InGroup<ReturnType>;
652def warn_falloff_nonvoid_function : Warning<
653  "non-void function does not return a value">,
654  InGroup<ReturnType>;
655def err_maybe_falloff_nonvoid_block : Error<
656  "non-void block does not return a value in all control paths">;
657def err_falloff_nonvoid_block : Error<
658  "non-void block does not return a value">;
659def warn_maybe_falloff_nonvoid_coroutine : Warning<
660  "non-void coroutine does not return a value in all control paths">,
661  InGroup<ReturnType>;
662def warn_falloff_nonvoid_coroutine : Warning<
663  "non-void coroutine does not return a value">,
664  InGroup<ReturnType>;
665def warn_suggest_noreturn_function : Warning<
666  "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
667  InGroup<MissingNoreturn>, DefaultIgnore;
668def warn_suggest_noreturn_block : Warning<
669  "block could be declared with attribute 'noreturn'">,
670  InGroup<MissingNoreturn>, DefaultIgnore;
671
672// Unreachable code.
673def warn_unreachable : Warning<
674  "code will never be executed">,
675  InGroup<UnreachableCode>, DefaultIgnore;
676def warn_unreachable_break : Warning<
677  "'break' will never be executed">,
678  InGroup<UnreachableCodeBreak>, DefaultIgnore;
679def warn_unreachable_return : Warning<
680  "'return' will never be executed">,
681  InGroup<UnreachableCodeReturn>, DefaultIgnore;
682def warn_unreachable_loop_increment : Warning<
683  "loop will run at most once (loop increment never executed)">,
684  InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
685def note_unreachable_silence : Note<
686  "silence by adding parentheses to mark code as explicitly dead">;
687
688/// Built-in functions.
689def ext_implicit_lib_function_decl : ExtWarn<
690  "implicitly declaring library function '%0' with type %1">,
691  InGroup<ImplicitFunctionDeclare>;
692def note_include_header_or_declare : Note<
693  "include the header <%0> or explicitly provide a declaration for '%1'">;
694def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
695def warn_implicit_decl_no_jmp_buf
696    : Warning<"declaration of built-in function '%0' requires the declaration"
697    " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.">,
698      InGroup<DiagGroup<"incomplete-setjmp-declaration">>;
699def warn_implicit_decl_requires_sysheader : Warning<
700  "declaration of built-in function '%1' requires inclusion of the header <%0>">,
701  InGroup<BuiltinRequiresHeader>;
702def warn_redecl_library_builtin : Warning<
703  "incompatible redeclaration of library function %0">,
704  InGroup<DiagGroup<"incompatible-library-redeclaration">>;
705def err_builtin_definition : Error<"definition of builtin function %0">;
706def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
707def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
708def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as "
709  "%select{GCP|CDE}1">;
710def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
711def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
712def err_invalid_cpu_specific_dispatch_value : Error<
713"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
714def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
715  InGroup<ImplicitFunctionDeclare>, DefaultError;
716def warn_cstruct_memaccess : Warning<
717  "%select{destination for|source of|first operand of|second operand of}0 this "
718  "%1 call is a pointer to record %2 that is not trivial to "
719  "%select{primitive-default-initialize|primitive-copy}3">,
720  InGroup<NonTrivialMemaccess>;
721def note_nontrivial_field : Note<
722  "field is non-trivial to %select{copy|default-initialize}0">;
723def err_non_trivial_c_union_in_invalid_context : Error<
724  "cannot %select{"
725  "use type %1 for a function/method parameter|"
726  "use type %1 for function/method return|"
727  "default-initialize an object of type %1|"
728  "declare an automatic variable of type %1|"
729  "copy-initialize an object of type %1|"
730  "assign to a variable of type %1|"
731  "construct an automatic compound literal of type %1|"
732  "capture a variable of type %1|"
733  "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion"
734  "}3 "
735  "since it %select{contains|is}2 a union that is non-trivial to "
736  "%select{default-initialize|destruct|copy}0">;
737def note_non_trivial_c_union : Note<
738  "%select{%2 has subobjects that are|%3 has type %2 that is}0 "
739  "non-trivial to %select{default-initialize|destruct|copy}1">;
740def warn_dyn_class_memaccess : Warning<
741  "%select{destination for|source of|first operand of|second operand of}0 this "
742  "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
743  "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
744  InGroup<DynamicClassMemaccess>;
745def note_bad_memaccess_silence : Note<
746  "explicitly cast the pointer to silence this warning">;
747def warn_sizeof_pointer_expr_memaccess : Warning<
748  "'%0' call operates on objects of type %1 while the size is based on a "
749  "different type %2">,
750  InGroup<SizeofPointerMemaccess>;
751def warn_sizeof_pointer_expr_memaccess_note : Note<
752  "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
753  "it by the number of elements)|remove the addressof in the argument to "
754  "'sizeof' (and multiply it by the number of elements)|provide an explicit "
755  "length}0?">;
756def warn_sizeof_pointer_type_memaccess : Warning<
757  "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
758  "%select{destination|source}2; expected %3 or an explicit length">,
759  InGroup<SizeofPointerMemaccess>;
760def warn_strlcpycat_wrong_size : Warning<
761  "size argument in %0 call appears to be size of the source; "
762  "expected the size of the destination">,
763  InGroup<DiagGroup<"strlcpy-strlcat-size">>;
764def note_strlcpycat_wrong_size : Note<
765  "change size argument to be the size of the destination">;
766def warn_memsize_comparison : Warning<
767  "size argument in %0 call is a comparison">,
768  InGroup<DiagGroup<"memsize-comparison">>;
769def note_memsize_comparison_paren : Note<
770  "did you mean to compare the result of %0 instead?">;
771def note_memsize_comparison_cast_silence : Note<
772  "explicitly cast the argument to size_t to silence this warning">;
773def warn_suspicious_sizeof_memset : Warning<
774  "%select{'size' argument to memset is '0'|"
775  "setting buffer to a 'sizeof' expression}0"
776  "; did you mean to transpose the last two arguments?">,
777  InGroup<MemsetTransposedArgs>;
778def note_suspicious_sizeof_memset_silence : Note<
779  "%select{parenthesize the third argument|"
780  "cast the second argument to 'int'}0 to silence">;
781def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
782  InGroup<SuspiciousBzero>;
783def note_suspicious_bzero_size_silence : Note<
784  "parenthesize the second argument to silence">;
785
786def warn_strncat_large_size : Warning<
787  "the value of the size argument in 'strncat' is too large, might lead to a "
788  "buffer overflow">, InGroup<StrncatSize>;
789def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
790  "to be size of the source">, InGroup<StrncatSize>;
791def warn_strncat_wrong_size : Warning<
792  "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
793def note_strncat_wrong_size : Note<
794  "change the argument to be the free space in the destination buffer minus "
795  "the terminating null byte">;
796
797def warn_assume_side_effects : Warning<
798  "the argument to %0 has side effects that will be discarded">,
799  InGroup<DiagGroup<"assume">>;
800def warn_assume_attribute_string_unknown : Warning<
801  "unknown assumption string '%0'; attribute is potentially ignored">,
802  InGroup<UnknownAssumption>;
803def warn_assume_attribute_string_unknown_suggested : Warning<
804  "unknown assumption string '%0' may be misspelled; attribute is potentially "
805  "ignored, did you mean '%1'?">,
806  InGroup<MisspelledAssumption>;
807
808def warn_builtin_chk_overflow : Warning<
809  "'%0' will always overflow; destination buffer has size %1,"
810  " but size argument is %2">,
811  InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
812
813def warn_fortify_source_overflow
814  : Warning<warn_builtin_chk_overflow.Text>, InGroup<FortifySource>;
815def warn_fortify_source_size_mismatch : Warning<
816  "'%0' size argument is too large; destination buffer has size %1,"
817  " but size argument is %2">, InGroup<FortifySource>;
818
819def warn_fortify_source_format_overflow : Warning<
820  "'%0' will always overflow; destination buffer has size %1,"
821  " but format string expands to at least %2">,
822  InGroup<FortifySource>;
823
824
825/// main()
826// static main() is not an error in C, just in C++.
827def warn_static_main : Warning<"'main' should not be declared static">,
828    InGroup<Main>;
829def err_static_main : Error<"'main' is not allowed to be declared static">;
830def err_inline_main : Error<"'main' is not allowed to be declared inline">;
831def ext_variadic_main : ExtWarn<
832  "'main' is not allowed to be declared variadic">, InGroup<Main>;
833def ext_noreturn_main : ExtWarn<
834  "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
835def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
836def err_constexpr_main : Error<
837  "'main' is not allowed to be declared %select{constexpr|consteval}0">;
838def err_deleted_main : Error<"'main' is not allowed to be deleted">;
839def err_mainlike_template_decl : Error<"%0 cannot be a template">;
840def err_main_returns_nonint : Error<"'main' must return 'int'">;
841def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
842    InGroup<MainReturnType>;
843def note_main_change_return_type : Note<"change return type to 'int'">;
844def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
845    "must be 0, 2, or 3">;
846def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
847    InGroup<Main>;
848def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
849    "parameter of 'main' (%select{argument count|argument array|environment|"
850    "platform-specific data}0) must be of type %1">;
851def warn_main_returns_bool_literal : Warning<"bool literal returned from "
852    "'main'">, InGroup<Main>;
853def err_main_global_variable :
854    Error<"main cannot be declared as global variable">;
855def warn_main_redefined : Warning<"variable named 'main' with external linkage "
856    "has undefined behavior">, InGroup<Main>;
857def ext_main_used : Extension<
858  "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
859
860/// parser diagnostics
861def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
862  InGroup<MissingDeclarations>;
863def err_no_declarators : Error<"declaration does not declare anything">;
864def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
865  InGroup<MissingDeclarations>;
866def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
867
868def ext_non_c_like_anon_struct_in_typedef : ExtWarn<
869  "anonymous non-C-compatible type given name for linkage purposes "
870  "by %select{typedef|alias}0 declaration; "
871  "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>;
872def err_non_c_like_anon_struct_in_typedef : Error<
873  "anonymous non-C-compatible type given name for linkage purposes "
874  "by %select{typedef|alias}0 declaration after its linkage was computed; "
875  "add a tag name here to establish linkage prior to definition">;
876def err_typedef_changes_linkage : Error<
877  "unsupported: anonymous type given name for linkage purposes "
878  "by %select{typedef|alias}0 declaration after its linkage was computed; "
879  "add a tag name here to establish linkage prior to definition">;
880def note_non_c_like_anon_struct : Note<
881  "type is not C-compatible due to this "
882  "%select{base class|default member initializer|lambda expression|"
883  "friend declaration|member declaration}0">;
884def note_typedef_for_linkage_here : Note<
885  "type is given name %0 for linkage purposes by this "
886  "%select{typedef|alias}1 declaration">;
887
888def err_statically_allocated_object : Error<
889  "interface type cannot be statically allocated">;
890def err_object_cannot_be_passed_returned_by_value : Error<
891  "interface type %1 cannot be %select{returned|passed}0 by value"
892  "; did you forget * in %1?">;
893def err_parameters_retval_cannot_have_fp16_type : Error<
894  "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
895def err_opencl_half_load_store : Error<
896  "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
897  "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
898def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
899def err_opencl_half_declaration : Error<
900  "declaring variable of type %0 is not allowed">;
901def err_opencl_invalid_param : Error<
902  "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">;
903def err_opencl_invalid_return : Error<
904  "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
905def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
906def warn_pragma_options_align_reset_failed : Warning<
907  "#pragma options align=reset failed: %0">,
908  InGroup<IgnoredPragmas>;
909def err_pragma_options_align_mac68k_target_unsupported : Error<
910  "mac68k alignment pragma is not supported on this target">;
911def warn_pragma_pack_invalid_alignment : Warning<
912  "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
913  InGroup<IgnoredPragmas>;
914def err_pragma_pack_invalid_alignment : Error<
915  warn_pragma_pack_invalid_alignment.Text>;
916def warn_pragma_pack_non_default_at_include : Warning<
917  "non-default #pragma pack value changes the alignment of struct or union "
918  "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
919  DefaultIgnore;
920def warn_pragma_pack_modified_after_include : Warning<
921  "the current #pragma pack alignment value is modified in the included "
922  "file">, InGroup<PragmaPack>;
923def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
924  "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
925def note_pragma_pack_here : Note<
926  "previous '#pragma pack' directive that modifies alignment is here">;
927def note_pragma_pack_pop_instead_reset : Note<
928  "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
929// Follow the Microsoft implementation.
930def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
931def warn_pragma_pack_pop_identifier_and_alignment : Warning<
932  "specifying both a name and alignment to 'pop' is undefined">;
933def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
934  InGroup<IgnoredPragmas>;
935def err_pragma_fc_pp_scope : Error<
936  "'#pragma float_control push/pop' can only appear at file scope or namespace scope">;
937def err_pragma_fc_noprecise_requires_nofenv : Error<
938  "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
939def err_pragma_fc_except_requires_precise : Error<
940  "'#pragma float_control(except, on)' is illegal when precise is disabled">;
941def err_pragma_fc_noprecise_requires_noexcept : Error<
942  "'#pragma float_control(precise, off)' is illegal when except is enabled">;
943def err_pragma_fenv_requires_precise : Error<
944  "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">;
945def warn_cxx_ms_struct :
946  Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
947          "with base classes or virtual functions">,
948  DefaultError, InGroup<IncompatibleMSStruct>;
949def err_pragma_pack_identifer_not_supported : Error<
950  "specifying an identifier within `#pragma pack` is not supported on this target">;
951def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
952def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
953def err_invalid_super_scope : Error<"invalid use of '__super', "
954  "this keyword can only be used inside class or member function scope">;
955def err_super_in_lambda_unsupported : Error<
956  "use of '__super' inside a lambda is unsupported">;
957
958def warn_pragma_unused_undeclared_var : Warning<
959  "undeclared variable %0 used as an argument for '#pragma unused'">,
960  InGroup<IgnoredPragmas>;
961def warn_atl_uuid_deprecated : Warning<
962  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
963  InGroup<DeprecatedDeclarations>;
964def warn_pragma_unused_expected_var_arg : Warning<
965  "only variables can be arguments to '#pragma unused'">,
966  InGroup<IgnoredPragmas>;
967def err_pragma_push_visibility_mismatch : Error<
968  "#pragma visibility push with no matching #pragma visibility pop">;
969def note_surrounding_namespace_ends_here : Note<
970  "surrounding namespace with visibility attribute ends here">;
971def err_pragma_pop_visibility_mismatch : Error<
972  "#pragma visibility pop with no matching #pragma visibility push">;
973def note_surrounding_namespace_starts_here : Note<
974  "surrounding namespace with visibility attribute starts here">;
975def err_pragma_loop_invalid_argument_type : Error<
976  "invalid argument of type %0; expected an integer type">;
977def err_pragma_loop_invalid_argument_value : Error<
978  "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
979def err_pragma_loop_compatibility : Error<
980  "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
981def err_pragma_loop_precedes_nonloop : Error<
982  "expected a for, while, or do-while loop to follow '%0'">;
983
984def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
985  "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
986  "those declarations">;
987def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
988  "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
989def err_pragma_attribute_invalid_matchers : Error<
990  "attribute %0 can't be applied to %1">;
991def err_pragma_attribute_stack_mismatch : Error<
992  "'#pragma clang attribute %select{%1.|}0pop' with no matching"
993  " '#pragma clang attribute %select{%1.|}0push'">;
994def warn_pragma_attribute_unused : Warning<
995  "unused attribute %0 in '#pragma clang attribute push' region">,
996  InGroup<PragmaClangAttribute>;
997def note_pragma_attribute_region_ends_here : Note<
998  "'#pragma clang attribute push' regions ends here">;
999def err_pragma_attribute_no_pop_eof : Error<"unterminated "
1000  "'#pragma clang attribute push' at end of file">;
1001def note_pragma_attribute_applied_decl_here : Note<
1002  "when applied to this declaration">;
1003def err_pragma_attr_attr_no_push : Error<
1004  "'#pragma clang attribute' attribute with no matching "
1005  "'#pragma clang attribute push'">;
1006
1007/// Objective-C parser diagnostics
1008def err_duplicate_class_def : Error<
1009  "duplicate interface definition for class %0">;
1010def err_undef_superclass : Error<
1011  "cannot find interface declaration for %0, superclass of %1">;
1012def err_forward_superclass : Error<
1013  "attempting to use the forward class %0 as superclass of %1">;
1014def err_no_nsconstant_string_class : Error<
1015  "cannot find interface declaration for %0">;
1016def err_recursive_superclass : Error<
1017  "trying to recursively use %0 as superclass of %1">;
1018def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
1019def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
1020def warn_duplicate_protocol_def : Warning<
1021  "duplicate protocol definition of %0 is ignored">,
1022  InGroup<DiagGroup<"duplicate-protocol">>;
1023def err_protocol_has_circular_dependency : Error<
1024  "protocol has circular dependency">;
1025def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
1026def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
1027def err_atprotocol_protocol : Error<
1028  "@protocol is using a forward protocol declaration of %0">;
1029def warn_readonly_property : Warning<
1030  "attribute 'readonly' of property %0 restricts attribute "
1031  "'readwrite' of property inherited from %1">,
1032  InGroup<PropertyAttr>;
1033
1034def warn_property_attribute : Warning<
1035  "'%1' attribute on property %0 does not match the property inherited from %2">,
1036  InGroup<PropertyAttr>;
1037def warn_property_types_are_incompatible : Warning<
1038  "property type %0 is incompatible with type %1 inherited from %2">,
1039  InGroup<DiagGroup<"incompatible-property-type">>;
1040def warn_protocol_property_mismatch : Warning<
1041  "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
1042  "getter %1|with setter %1}0 was selected for synthesis">,
1043  InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
1044def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
1045def err_undef_interface : Error<"cannot find interface declaration for %0">;
1046def err_category_forward_interface : Error<
1047  "cannot define %select{category|class extension}0 for undefined class %1">;
1048def err_class_extension_after_impl : Error<
1049  "cannot declare class extension for %0 after class implementation">;
1050def note_implementation_declared : Note<
1051  "class implementation is declared here">;
1052def note_while_in_implementation : Note<
1053  "detected while default synthesizing properties in class implementation">;
1054def note_class_declared : Note<
1055  "class is declared here">;
1056def note_receiver_class_declared : Note<
1057  "receiver is instance of class declared here">;
1058def note_receiver_expr_here : Note<
1059  "receiver expression is here">;
1060def note_receiver_is_id : Note<
1061  "receiver is treated with 'id' type for purpose of method lookup">;
1062def note_suppressed_class_declare : Note<
1063  "class with specified objc_requires_property_definitions attribute is declared here">;
1064def err_objc_root_class_subclass : Error<
1065  "objc_root_class attribute may only be specified on a root class declaration">;
1066def err_restricted_superclass_mismatch : Error<
1067  "cannot subclass a class that was declared with the "
1068  "'objc_subclassing_restricted' attribute">;
1069def err_class_stub_subclassing_mismatch : Error<
1070  "'objc_class_stub' attribute cannot be specified on a class that does not "
1071  "have the 'objc_subclassing_restricted' attribute">;
1072def err_implementation_of_class_stub : Error<
1073  "cannot declare implementation of a class declared with the "
1074  "'objc_class_stub' attribute">;
1075def warn_objc_root_class_missing : Warning<
1076  "class %0 defined without specifying a base class">,
1077  InGroup<ObjCRootClass>;
1078def err_objc_runtime_visible_category : Error<
1079  "cannot implement a category for class %0 that is only visible via the "
1080  "Objective-C runtime">;
1081def err_objc_runtime_visible_subclass : Error<
1082  "cannot implement subclass %0 of a superclass %1 that is only visible via the "
1083  "Objective-C runtime">;
1084def note_objc_needs_superclass : Note<
1085  "add a super class to fix this problem">;
1086def err_conflicting_super_class : Error<"conflicting super class name %0">;
1087def err_dup_implementation_class : Error<"reimplementation of class %0">;
1088def err_dup_implementation_category : Error<
1089  "reimplementation of category %1 for class %0">;
1090def err_conflicting_ivar_type : Error<
1091  "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
1092def err_duplicate_ivar_declaration : Error<
1093  "instance variable is already declared">;
1094def warn_on_superclass_use : Warning<
1095  "class implementation may not have super class">;
1096def err_conflicting_ivar_bitwidth : Error<
1097  "instance variable %0 has conflicting bit-field width">;
1098def err_conflicting_ivar_name : Error<
1099  "conflicting instance variable names: %0 vs %1">;
1100def err_inconsistent_ivar_count : Error<
1101  "inconsistent number of instance variables specified">;
1102def warn_undef_method_impl : Warning<"method definition for %0 not found">,
1103  InGroup<DiagGroup<"incomplete-implementation">>;
1104def warn_objc_boxing_invalid_utf8_string : Warning<
1105  "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
1106  InGroup<ObjCBoxing>;
1107
1108def err_objc_non_runtime_protocol_in_protocol_expr : Error<
1109  "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">;
1110def err_objc_direct_on_protocol : Error<
1111  "'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
1112  "declared in an Objective-C protocol">;
1113def err_objc_direct_duplicate_decl : Error<
1114  "%select{|direct }0%select{method|property}1 declaration conflicts "
1115  "with previous %select{|direct }2declaration of %select{method|property}1 %3">;
1116def err_objc_direct_impl_decl_mismatch : Error<
1117  "direct method was declared in %select{the primary interface|an extension|a category}0 "
1118  "but is implemented in %select{the primary interface|a category|a different category}1">;
1119def err_objc_direct_missing_on_decl : Error<
1120  "direct method implementation was previously declared not direct">;
1121def err_objc_direct_on_override : Error<
1122  "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">;
1123def err_objc_override_direct_method : Error<
1124  "cannot override a method that is declared direct by a superclass">;
1125def warn_objc_direct_ignored : Warning<
1126  "%0 attribute isn't implemented by this Objective-C runtime">,
1127  InGroup<IgnoredAttributes>;
1128def warn_objc_direct_property_ignored : Warning<
1129  "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
1130  InGroup<IgnoredAttributes>;
1131def err_objc_direct_dynamic_property : Error<
1132  "direct property cannot be @dynamic">;
1133def err_objc_direct_protocol_conformance : Error<
1134  "%select{category %1|class extension}0 cannot conform to protocol %2 because "
1135  "of direct members declared in interface %3">;
1136def note_direct_member_here : Note<"direct member declared here">;
1137
1138def warn_conflicting_overriding_ret_types : Warning<
1139  "conflicting return type in "
1140  "declaration of %0%diff{: $ vs $|}1,2">,
1141  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1142
1143def warn_conflicting_ret_types : Warning<
1144  "conflicting return type in "
1145  "implementation of %0%diff{: $ vs $|}1,2">,
1146  InGroup<MismatchedReturnTypes>;
1147
1148def warn_conflicting_overriding_ret_type_modifiers : Warning<
1149  "conflicting distributed object modifiers on return type "
1150  "in declaration of %0">,
1151  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1152
1153def warn_conflicting_ret_type_modifiers : Warning<
1154  "conflicting distributed object modifiers on return type "
1155  "in implementation of %0">,
1156  InGroup<DistributedObjectModifiers>;
1157
1158def warn_non_covariant_overriding_ret_types : Warning<
1159  "conflicting return type in "
1160  "declaration of %0: %1 vs %2">,
1161  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1162
1163def warn_non_covariant_ret_types : Warning<
1164  "conflicting return type in "
1165  "implementation of %0: %1 vs %2">,
1166  InGroup<MethodSignatures>, DefaultIgnore;
1167
1168def warn_conflicting_overriding_param_types : Warning<
1169  "conflicting parameter types in "
1170  "declaration of %0%diff{: $ vs $|}1,2">,
1171  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1172
1173def warn_conflicting_param_types : Warning<
1174  "conflicting parameter types in "
1175  "implementation of %0%diff{: $ vs $|}1,2">,
1176  InGroup<MismatchedParameterTypes>;
1177
1178def warn_conflicting_param_modifiers : Warning<
1179  "conflicting distributed object modifiers on parameter type "
1180  "in implementation of %0">,
1181  InGroup<DistributedObjectModifiers>;
1182
1183def warn_conflicting_overriding_param_modifiers : Warning<
1184  "conflicting distributed object modifiers on parameter type "
1185  "in declaration of %0">,
1186  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1187
1188def warn_non_contravariant_overriding_param_types : Warning<
1189  "conflicting parameter types in "
1190  "declaration of %0: %1 vs %2">,
1191  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1192
1193def warn_non_contravariant_param_types : Warning<
1194  "conflicting parameter types in "
1195  "implementation of %0: %1 vs %2">,
1196  InGroup<MethodSignatures>, DefaultIgnore;
1197
1198def warn_conflicting_overriding_variadic :Warning<
1199  "conflicting variadic declaration of method and its "
1200  "implementation">,
1201  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1202
1203def warn_conflicting_variadic :Warning<
1204  "conflicting variadic declaration of method and its "
1205  "implementation">;
1206
1207def warn_category_method_impl_match:Warning<
1208  "category is implementing a method which will also be implemented"
1209  " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1210
1211def warn_implements_nscopying : Warning<
1212"default assign attribute on property %0 which implements "
1213"NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1214
1215def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1216  InGroup<ObjCMultipleMethodNames>;
1217def warn_strict_multiple_method_decl : Warning<
1218  "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1219def warn_accessor_property_type_mismatch : Warning<
1220  "type of property %0 does not match type of accessor %1">;
1221def note_conv_function_declared_at : Note<"type conversion function declared here">;
1222def note_method_declared_at : Note<"method %0 declared here">;
1223def note_direct_method_declared_at : Note<"direct method %0 declared here">;
1224def note_property_attribute : Note<"property %0 is declared "
1225  "%select{deprecated|unavailable|partial}1 here">;
1226def err_setter_type_void : Error<"type of setter must be void">;
1227def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1228def warn_duplicate_method_decl :
1229  Warning<"multiple declarations of method %0 found and ignored">,
1230  InGroup<MethodDuplicate>, DefaultIgnore;
1231def warn_objc_cdirective_format_string :
1232  Warning<"using %0 directive in %select{NSString|CFString}1 "
1233          "which is being passed as a formatting argument to the formatting "
1234          "%select{method|CFfunction}2">,
1235  InGroup<ObjCCStringFormat>, DefaultIgnore;
1236def err_objc_var_decl_inclass :
1237    Error<"cannot declare variable inside @interface or @protocol">;
1238def err_missing_method_context : Error<
1239  "missing context for method declaration">;
1240def err_objc_property_attr_mutually_exclusive : Error<
1241  "property attributes '%0' and '%1' are mutually exclusive">;
1242def err_objc_property_requires_object : Error<
1243  "property with '%0' attribute must be of object type">;
1244def warn_objc_property_assign_on_object : Warning<
1245  "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1246  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1247def warn_objc_property_no_assignment_attribute : Warning<
1248  "no 'assign', 'retain', or 'copy' attribute is specified - "
1249  "'assign' is assumed">,
1250  InGroup<ObjCPropertyNoAttribute>;
1251def warn_objc_isa_use : Warning<
1252  "direct access to Objective-C's isa is deprecated in favor of "
1253  "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1254def warn_objc_isa_assign : Warning<
1255  "assignment to Objective-C's isa is deprecated in favor of "
1256  "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1257def warn_objc_pointer_masking : Warning<
1258  "bitmasking for introspection of Objective-C object pointers is strongly "
1259  "discouraged">,
1260  InGroup<ObjCPointerIntrospect>;
1261def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1262  InGroup<ObjCPointerIntrospectPerformSelector>;
1263def warn_objc_property_default_assign_on_object : Warning<
1264  "default property attribute 'assign' not appropriate for object">,
1265  InGroup<ObjCPropertyNoAttribute>;
1266def warn_property_attr_mismatch : Warning<
1267  "property attribute in class extension does not match the primary class">,
1268  InGroup<PropertyAttr>;
1269def warn_property_implicitly_mismatched : Warning <
1270  "primary property declaration is implicitly strong while redeclaration "
1271  "in class extension is weak">,
1272  InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1273def warn_objc_property_copy_missing_on_block : Warning<
1274    "'copy' attribute must be specified for the block property "
1275    "when -fobjc-gc-only is specified">;
1276def warn_objc_property_retain_of_block : Warning<
1277    "retain'ed block property does not copy the block "
1278    "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1279def warn_objc_readonly_property_has_setter : Warning<
1280    "setter cannot be specified for a readonly property">,
1281    InGroup<ObjCReadonlyPropertyHasSetter>;
1282def warn_atomic_property_rule : Warning<
1283  "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1284  "with a user defined %select{getter|setter}2">,
1285  InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1286def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1287  "synthesized, or both be user defined,or the property must be nonatomic">;
1288def err_atomic_property_nontrivial_assign_op : Error<
1289  "atomic property of reference type %0 cannot have non-trivial assignment"
1290  " operator">;
1291def warn_cocoa_naming_owned_rule : Warning<
1292  "property follows Cocoa naming"
1293  " convention for returning 'owned' objects">,
1294  InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1295def err_cocoa_naming_owned_rule : Error<
1296  "property follows Cocoa naming"
1297  " convention for returning 'owned' objects">;
1298def note_cocoa_naming_declare_family : Note<
1299  "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1300  "object">;
1301def warn_auto_synthesizing_protocol_property :Warning<
1302  "auto property synthesis will not synthesize property %0"
1303  " declared in protocol %1">,
1304  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1305def note_add_synthesize_directive : Note<
1306  "add a '@synthesize' directive">;
1307def warn_no_autosynthesis_shared_ivar_property : Warning <
1308  "auto property synthesis will not synthesize property "
1309  "%0 because it cannot share an ivar with another synthesized property">,
1310  InGroup<ObjCNoPropertyAutoSynthesis>;
1311def warn_no_autosynthesis_property : Warning<
1312  "auto property synthesis will not synthesize property "
1313  "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1314  "via another property">,
1315  InGroup<ObjCNoPropertyAutoSynthesis>;
1316def warn_autosynthesis_property_in_superclass : Warning<
1317  "auto property synthesis will not synthesize property "
1318  "%0; it will be implemented by its superclass, use @dynamic to "
1319  "acknowledge intention">,
1320  InGroup<ObjCNoPropertyAutoSynthesis>;
1321def warn_autosynthesis_property_ivar_match :Warning<
1322  "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1323  "%2, not existing instance variable %3">,
1324  InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1325def warn_missing_explicit_synthesis : Warning <
1326  "auto property synthesis is synthesizing property not explicitly synthesized">,
1327  InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1328def warn_property_getter_owning_mismatch : Warning<
1329  "property declared as returning non-retained objects"
1330  "; getter returning retained objects">;
1331def warn_property_redecl_getter_mismatch : Warning<
1332  "getter name mismatch between property redeclaration (%1) and its original "
1333  "declaration (%0)">, InGroup<PropertyAttr>;
1334def err_property_setter_ambiguous_use : Error<
1335  "synthesized properties %0 and %1 both claim setter %2 -"
1336  " use of this setter will cause unexpected behavior">;
1337def warn_default_atomic_custom_getter_setter : Warning<
1338  "atomic by default property %0 has a user defined %select{getter|setter}1 "
1339  "(property should be marked 'atomic' if this is intended)">,
1340  InGroup<CustomAtomic>, DefaultIgnore;
1341def err_use_continuation_class : Error<
1342  "illegal redeclaration of property in class extension %0"
1343  " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1344def err_type_mismatch_continuation_class : Error<
1345  "type of property %0 in class extension does not match "
1346  "property type in primary class">;
1347def err_use_continuation_class_redeclaration_readwrite : Error<
1348  "illegal redeclaration of 'readwrite' property in class extension %0"
1349  " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1350  "'readonly' public property?)">;
1351def err_continuation_class : Error<"class extension has no primary class">;
1352def err_property_type : Error<"property cannot have array or function type %0">;
1353def err_missing_property_context : Error<
1354  "missing context for property implementation declaration">;
1355def err_bad_property_decl : Error<
1356  "property implementation must have its declaration in interface %0 or one of "
1357  "its extensions">;
1358def err_category_property : Error<
1359  "property declared in category %0 cannot be implemented in "
1360  "class implementation">;
1361def note_property_declare : Note<
1362  "property declared here">;
1363def note_protocol_property_declare : Note<
1364  "it could also be property "
1365  "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1366  "%1|with setter %1}0 declared here">;
1367def note_property_synthesize : Note<
1368  "property synthesized here">;
1369def err_synthesize_category_decl : Error<
1370  "@synthesize not allowed in a category's implementation">;
1371def err_synthesize_on_class_property : Error<
1372  "@synthesize not allowed on a class property %0">;
1373def err_missing_property_interface : Error<
1374  "property implementation in a category with no category declaration">;
1375def err_bad_category_property_decl : Error<
1376  "property implementation must have its declaration in the category %0">;
1377def err_bad_property_context : Error<
1378  "property implementation must be in a class or category implementation">;
1379def err_missing_property_ivar_decl : Error<
1380  "synthesized property %0 must either be named the same as a compatible"
1381  " instance variable or must explicitly name an instance variable">;
1382def err_arc_perform_selector_retains : Error<
1383  "performSelector names a selector which retains the object">;
1384def warn_arc_perform_selector_leaks : Warning<
1385  "performSelector may cause a leak because its selector is unknown">,
1386  InGroup<DiagGroup<"arc-performSelector-leaks">>;
1387def warn_dealloc_in_category : Warning<
1388"-dealloc is being overridden in a category">,
1389InGroup<DeallocInCategory>;
1390def err_gc_weak_property_strong_type : Error<
1391  "weak attribute declared on a __strong type property in GC mode">;
1392def warn_arc_repeated_use_of_weak : Warning <
1393  "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1394  "accessed multiple times in this %select{function|method|block|lambda}2 "
1395  "but may be unpredictably set to nil; assign to a strong variable to keep "
1396  "the object alive">,
1397  InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1398def warn_implicitly_retains_self : Warning <
1399  "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1400  "this is intended behavior">,
1401  InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1402def warn_arc_possible_repeated_use_of_weak : Warning <
1403  "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1404  "be accessed multiple times in this %select{function|method|block|lambda}2 "
1405  "and may be unpredictably set to nil; assign to a strong variable to keep "
1406  "the object alive">,
1407  InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1408def note_arc_weak_also_accessed_here : Note<
1409  "also accessed here">;
1410def err_incomplete_synthesized_property : Error<
1411  "cannot synthesize property %0 with incomplete type %1">;
1412
1413def err_property_ivar_type : Error<
1414  "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1415def err_property_accessor_type : Error<
1416  "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1417def err_ivar_in_superclass_use : Error<
1418  "property %0 attempting to use instance variable %1 declared in super class %2">;
1419def err_weak_property : Error<
1420  "existing instance variable %1 for __weak property %0 must be __weak">;
1421def err_strong_property : Error<
1422  "existing instance variable %1 for strong property %0 may not be __weak">;
1423def err_dynamic_property_ivar_decl : Error<
1424  "dynamic property cannot have instance variable specification">;
1425def err_duplicate_ivar_use : Error<
1426  "synthesized properties %0 and %1 both claim instance variable %2">;
1427def err_property_implemented : Error<"property %0 is already implemented">;
1428def warn_objc_missing_super_call : Warning<
1429  "method possibly missing a [super %0] call">,
1430  InGroup<ObjCMissingSuperCalls>;
1431def err_dealloc_bad_result_type : Error<
1432  "dealloc return type must be correctly specified as 'void' under ARC, "
1433  "instead of %0">;
1434def warn_undeclared_selector : Warning<
1435  "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1436def warn_undeclared_selector_with_typo : Warning<
1437  "undeclared selector %0; did you mean %1?">,
1438  InGroup<UndeclaredSelector>, DefaultIgnore;
1439def warn_implicit_atomic_property : Warning<
1440  "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1441def note_auto_readonly_iboutlet_fixup_suggest : Note<
1442  "property should be changed to be readwrite">;
1443def warn_auto_readonly_iboutlet_property : Warning<
1444  "readonly IBOutlet property %0 when auto-synthesized may "
1445  "not work correctly with 'nib' loader">,
1446  InGroup<DiagGroup<"readonly-iboutlet-property">>;
1447def warn_auto_implicit_atomic_property : Warning<
1448  "property is assumed atomic when auto-synthesizing the property">,
1449  InGroup<ImplicitAtomic>, DefaultIgnore;
1450def warn_unimplemented_selector:  Warning<
1451  "no method with selector %0 is implemented in this translation unit">,
1452  InGroup<Selector>, DefaultIgnore;
1453def warn_unimplemented_protocol_method : Warning<
1454  "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1455def warn_multiple_selectors: Warning<
1456  "several methods with selector %0 of mismatched types are found "
1457  "for the @selector expression">,
1458  InGroup<SelectorTypeMismatch>, DefaultIgnore;
1459def err_direct_selector_expression : Error<
1460  "@selector expression formed with direct selector %0">;
1461def warn_potentially_direct_selector_expression : Warning<
1462  "@selector expression formed with potentially direct selector %0">,
1463  InGroup<ObjCPotentiallyDirectSelector>;
1464def warn_strict_potentially_direct_selector_expression : Warning<
1465  warn_potentially_direct_selector_expression.Text>,
1466  InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore;
1467
1468def err_objc_kindof_nonobject : Error<
1469  "'__kindof' specifier cannot be applied to non-object type %0">;
1470def err_objc_kindof_wrong_position : Error<
1471  "'__kindof' type specifier must precede the declarator">;
1472
1473def err_objc_method_unsupported_param_ret_type : Error<
1474  "%0 %select{parameter|return}1 type is unsupported; "
1475  "support for vector types for this target is introduced in %2">;
1476
1477def warn_messaging_unqualified_id : Warning<
1478  "messaging unqualified id">, DefaultIgnore,
1479  InGroup<DiagGroup<"objc-messaging-id">>;
1480def err_messaging_unqualified_id_with_direct_method : Error<
1481  "messaging unqualified id with a method that is possibly direct">;
1482def err_messaging_super_with_direct_method : Error<
1483  "messaging super with a direct method">;
1484def err_messaging_class_with_direct_method : Error<
1485  "messaging a Class with a method that is possibly direct">;
1486
1487// C++ declarations
1488def err_static_assert_expression_is_not_constant : Error<
1489  "static_assert expression is not an integral constant expression">;
1490def err_constexpr_if_condition_expression_is_not_constant : Error<
1491  "constexpr if condition is not a constant expression">;
1492def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1493def err_static_assert_requirement_failed : Error<
1494  "static_assert failed due to requirement '%0'%select{ %2|}1">;
1495
1496def ext_inline_variable : ExtWarn<
1497  "inline variables are a C++17 extension">, InGroup<CXX17>;
1498def warn_cxx14_compat_inline_variable : Warning<
1499  "inline variables are incompatible with C++ standards before C++17">,
1500  DefaultIgnore, InGroup<CXXPre17Compat>;
1501
1502def warn_inline_namespace_reopened_noninline : Warning<
1503  "inline namespace reopened as a non-inline namespace">,
1504  InGroup<InlineNamespaceReopenedNoninline>;
1505def err_inline_namespace_mismatch : Error<
1506  "non-inline namespace cannot be reopened as inline">;
1507
1508def err_unexpected_friend : Error<
1509  "friends can only be classes or functions">;
1510def ext_enum_friend : ExtWarn<
1511  "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1512def warn_cxx98_compat_enum_friend : Warning<
1513  "befriending enumeration type %0 is incompatible with C++98">,
1514  InGroup<CXX98Compat>, DefaultIgnore;
1515def ext_nonclass_type_friend : ExtWarn<
1516  "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1517def warn_cxx98_compat_nonclass_type_friend : Warning<
1518  "non-class friend type %0 is incompatible with C++98">,
1519  InGroup<CXX98Compat>, DefaultIgnore;
1520def err_friend_is_member : Error<
1521  "friends cannot be members of the declaring class">;
1522def warn_cxx98_compat_friend_is_member : Warning<
1523  "friend declaration naming a member of the declaring class is incompatible "
1524  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1525def ext_unelaborated_friend_type : ExtWarn<
1526  "unelaborated friend declaration is a C++11 extension; specify "
1527  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1528  InGroup<CXX11>;
1529def warn_cxx98_compat_unelaborated_friend_type : Warning<
1530  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1531  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1532def err_qualified_friend_no_match : Error<
1533  "friend declaration of %0 does not match any declaration in %1">;
1534def err_introducing_special_friend : Error<
1535  "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1536  " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1537  "as a friend">;
1538def err_tagless_friend_type_template : Error<
1539  "friend type templates must use an elaborated type">;
1540def err_no_matching_local_friend : Error<
1541  "no matching function found in local scope">;
1542def err_no_matching_local_friend_suggest : Error<
1543  "no matching function %0 found in local scope; did you mean %3?">;
1544def err_partial_specialization_friend : Error<
1545  "partial specialization cannot be declared as a friend">;
1546def err_qualified_friend_def : Error<
1547  "friend function definition cannot be qualified with '%0'">;
1548def err_friend_def_in_local_class : Error<
1549  "friend function cannot be defined in a local class">;
1550def err_friend_not_first_in_declaration : Error<
1551  "'friend' must appear first in a non-function declaration">;
1552def err_using_decl_friend : Error<
1553  "cannot befriend target of using declaration">;
1554def warn_template_qualified_friend_unsupported : Warning<
1555  "dependent nested name specifier '%0' for friend class declaration is "
1556  "not supported; turning off access control for %1">,
1557  InGroup<UnsupportedFriend>;
1558def warn_template_qualified_friend_ignored : Warning<
1559  "dependent nested name specifier '%0' for friend template declaration is "
1560  "not supported; ignoring this friend declaration">,
1561  InGroup<UnsupportedFriend>;
1562def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1563  "unqualified friend declaration referring to type outside of the nearest "
1564  "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1565  InGroup<MicrosoftUnqualifiedFriend>;
1566def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1567
1568def err_invalid_base_in_interface : Error<
1569  "interface type cannot inherit from "
1570  "%select{struct|non-public interface|class}0 %1">;
1571
1572def err_abstract_type_in_decl : Error<
1573  "%select{return|parameter|variable|field|instance variable|"
1574  "synthesized instance variable}0 type %1 is an abstract class">;
1575def err_allocation_of_abstract_type : Error<
1576  "allocating an object of abstract class type %0">;
1577def err_throw_abstract_type : Error<
1578  "cannot throw an object of abstract type %0">;
1579def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1580def err_capture_of_abstract_type : Error<
1581  "by-copy capture of value of abstract type %0">;
1582def err_capture_of_incomplete_or_sizeless_type : Error<
1583  "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">;
1584def err_capture_default_non_local : Error<
1585  "non-local lambda expression cannot have a capture-default">;
1586
1587def err_multiple_final_overriders : Error<
1588  "virtual function %q0 has more than one final overrider in %1">;
1589def note_final_overrider : Note<"final overrider of %q0 in %1">;
1590
1591def err_type_defined_in_type_specifier : Error<
1592  "%0 cannot be defined in a type specifier">;
1593def err_type_defined_in_result_type : Error<
1594  "%0 cannot be defined in the result type of a function">;
1595def err_type_defined_in_param_type : Error<
1596  "%0 cannot be defined in a parameter type">;
1597def err_type_defined_in_alias_template : Error<
1598  "%0 cannot be defined in a type alias template">;
1599def err_type_defined_in_condition : Error<
1600  "%0 cannot be defined in a condition">;
1601def err_type_defined_in_enum : Error<
1602  "%0 cannot be defined in an enumeration">;
1603
1604def note_pure_virtual_function : Note<
1605  "unimplemented pure virtual method %0 in %1">;
1606
1607def note_pure_qualified_call_kext : Note<
1608  "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1609
1610def err_deleted_decl_not_first : Error<
1611  "deleted definition must be first declaration">;
1612
1613def err_deleted_override : Error<
1614  "deleted function %0 cannot override a non-deleted function">;
1615def err_non_deleted_override : Error<
1616  "non-deleted function %0 cannot override a deleted function">;
1617def err_consteval_override : Error<
1618  "consteval function %0 cannot override a non-consteval function">;
1619def err_non_consteval_override : Error<
1620  "non-consteval function %0 cannot override a consteval function">;
1621
1622def warn_weak_vtable : Warning<
1623  "%0 has no out-of-line virtual method definitions; its vtable will be "
1624  "emitted in every translation unit">,
1625  InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1626def warn_weak_template_vtable : Warning<
1627  "explicit template instantiation %0 will emit a vtable in every "
1628  "translation unit">,
1629  InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1630
1631def ext_using_undefined_std : ExtWarn<
1632  "using directive refers to implicitly-defined namespace 'std'">;
1633
1634// C++ exception specifications
1635def err_exception_spec_in_typedef : Error<
1636  "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1637def err_distant_exception_spec : Error<
1638  "exception specifications are not allowed beyond a single level "
1639  "of indirection">;
1640def err_incomplete_in_exception_spec : Error<
1641  "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1642  "in exception specification">;
1643def err_sizeless_in_exception_spec : Error<
1644  "%select{|reference to }0sizeless type %1 is not allowed "
1645  "in exception specification">;
1646def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1647  InGroup<MicrosoftExceptionSpec>;
1648def err_rref_in_exception_spec : Error<
1649  "rvalue reference type %0 is not allowed in exception specification">;
1650def err_mismatched_exception_spec : Error<
1651  "exception specification in declaration does not match previous declaration">;
1652def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1653  InGroup<MicrosoftExceptionSpec>;
1654def err_override_exception_spec : Error<
1655  "exception specification of overriding function is more lax than "
1656  "base version">;
1657def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1658  InGroup<MicrosoftExceptionSpec>;
1659def err_incompatible_exception_specs : Error<
1660  "target exception specification is not superset of source">;
1661def warn_incompatible_exception_specs : Warning<
1662  err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1663def err_deep_exception_specs_differ : Error<
1664  "exception specifications of %select{return|argument}0 types differ">;
1665def warn_deep_exception_specs_differ : Warning<
1666  err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1667def err_missing_exception_specification : Error<
1668  "%0 is missing exception specification '%1'">;
1669def ext_missing_exception_specification : ExtWarn<
1670  err_missing_exception_specification.Text>,
1671  InGroup<DiagGroup<"missing-exception-spec">>;
1672def ext_ms_missing_exception_specification : ExtWarn<
1673  err_missing_exception_specification.Text>,
1674  InGroup<MicrosoftExceptionSpec>;
1675def err_noexcept_needs_constant_expression : Error<
1676  "argument to noexcept specifier must be a constant expression">;
1677def err_exception_spec_not_parsed : Error<
1678  "exception specification is not available until end of class definition">;
1679def err_exception_spec_cycle : Error<
1680  "exception specification of %0 uses itself">;
1681def err_exception_spec_incomplete_type : Error<
1682  "exception specification needed for member of incomplete class %0">;
1683def warn_wasm_dynamic_exception_spec_ignored : ExtWarn<
1684  "dynamic exception specifications with types are currently ignored in wasm">,
1685  InGroup<WebAssemblyExceptionSpec>;
1686
1687// C++ access checking
1688def err_class_redeclared_with_different_access : Error<
1689  "%0 redeclared with '%1' access">;
1690def err_access : Error<
1691  "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1692def ext_ms_using_declaration_inaccessible : ExtWarn<
1693  "using declaration referring to inaccessible member '%0' (which refers "
1694  "to accessible member '%1') is a Microsoft compatibility extension">,
1695    AccessControl, InGroup<MicrosoftUsingDecl>;
1696def err_access_ctor : Error<
1697  "calling a %select{private|protected}0 constructor of class %2">,
1698  AccessControl;
1699def ext_rvalue_to_reference_access_ctor : Extension<
1700  "C++98 requires an accessible copy constructor for class %2 when binding "
1701  "a reference to a temporary; was %select{private|protected}0">,
1702  AccessControl, InGroup<BindToTemporaryCopy>;
1703def err_access_base_ctor : Error<
1704  // The ERRORs represent other special members that aren't constructors, in
1705  // hopes that someone will bother noticing and reporting if they appear
1706  "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1707  "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1708  "|*ERROR*|}2constructor">, AccessControl;
1709def err_access_field_ctor : Error<
1710  // The ERRORs represent other special members that aren't constructors, in
1711  // hopes that someone will bother noticing and reporting if they appear
1712  "field of type %0 has %select{private|protected}2 "
1713  "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1714  AccessControl;
1715def err_access_friend_function : Error<
1716  "friend function %1 is a %select{private|protected}0 member of %3">,
1717  AccessControl;
1718
1719def err_access_dtor : Error<
1720  "calling a %select{private|protected}1 destructor of class %0">,
1721  AccessControl;
1722def err_access_dtor_base :
1723    Error<"base class %0 has %select{private|protected}1 destructor">,
1724    AccessControl;
1725def err_access_dtor_vbase :
1726    Error<"inherited virtual base class %1 has "
1727    "%select{private|protected}2 destructor">,
1728    AccessControl;
1729def err_access_dtor_temp :
1730    Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1731    AccessControl;
1732def err_access_dtor_exception :
1733    Error<"exception object of type %0 has %select{private|protected}1 "
1734          "destructor">, AccessControl;
1735def err_access_dtor_field :
1736    Error<"field of type %1 has %select{private|protected}2 destructor">,
1737    AccessControl;
1738def err_access_dtor_var :
1739    Error<"variable of type %1 has %select{private|protected}2 destructor">,
1740    AccessControl;
1741def err_access_dtor_ivar :
1742    Error<"instance variable of type %0 has %select{private|protected}1 "
1743          "destructor">,
1744    AccessControl;
1745def note_previous_access_declaration : Note<
1746  "previously declared '%1' here">;
1747def note_access_natural : Note<
1748  "%select{|implicitly }1declared %select{private|protected}0 here">;
1749def note_access_constrained_by_path : Note<
1750  "constrained by %select{|implicitly }1%select{private|protected}0"
1751  " inheritance here">;
1752def note_access_protected_restricted_noobject : Note<
1753  "must name member using the type of the current context %0">;
1754def note_access_protected_restricted_ctordtor : Note<
1755  "protected %select{constructor|destructor}0 can only be used to "
1756  "%select{construct|destroy}0 a base class subobject">;
1757def note_access_protected_restricted_object : Note<
1758  "can only access this member on an object of type %0">;
1759def warn_cxx98_compat_sfinae_access_control : Warning<
1760  "substitution failure due to access control is incompatible with C++98">,
1761  InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1762
1763// C++ name lookup
1764def err_incomplete_nested_name_spec : Error<
1765  "incomplete type %0 named in nested name specifier">;
1766def err_incomplete_enum : Error<
1767  "enumeration %0 is incomplete">;
1768def err_dependent_nested_name_spec : Error<
1769  "nested name specifier for a declaration cannot depend on a template "
1770  "parameter">;
1771def err_nested_name_member_ref_lookup_ambiguous : Error<
1772  "lookup of %0 in member access expression is ambiguous">;
1773def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1774  "lookup of %0 in member access expression is ambiguous; using member of %1">,
1775  InGroup<AmbigMemberTemplate>;
1776def note_ambig_member_ref_object_type : Note<
1777  "lookup in the object type %0 refers here">;
1778def note_ambig_member_ref_scope : Note<
1779  "lookup from the current scope refers here">;
1780def err_qualified_member_nonclass : Error<
1781  "qualified member access refers to a member in %0">;
1782def err_incomplete_member_access : Error<
1783  "member access into incomplete type %0">;
1784def err_incomplete_type : Error<
1785  "incomplete type %0 where a complete type is required">;
1786def warn_cxx98_compat_enum_nested_name_spec : Warning<
1787  "enumeration type in nested name specifier is incompatible with C++98">,
1788  InGroup<CXX98Compat>, DefaultIgnore;
1789def err_nested_name_spec_is_not_class : Error<
1790  "%0 cannot appear before '::' because it is not a class"
1791  "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1792def ext_nested_name_spec_is_enum : ExtWarn<
1793  "use of enumeration in a nested name specifier is a C++11 extension">,
1794  InGroup<CXX11>;
1795def err_out_of_line_qualified_id_type_names_constructor : Error<
1796  "qualified reference to %0 is a constructor name rather than a "
1797  "%select{template name|type}1 in this context">;
1798def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1799  "ISO C++ specifies that "
1800  "qualified reference to %0 is a constructor name rather than a "
1801  "%select{template name|type}1 in this context, despite preceding "
1802  "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1803  InGroup<DiagGroup<"injected-class-name">>;
1804
1805// C++ class members
1806def err_storageclass_invalid_for_member : Error<
1807  "storage class specified for a member declaration">;
1808def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1809def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1810def ext_mutable_reference : ExtWarn<
1811  "'mutable' on a reference type is a Microsoft extension">,
1812  InGroup<MicrosoftMutableReference>;
1813def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1814def err_mutable_nonmember : Error<
1815  "'mutable' can only be applied to member variables">;
1816def err_virtual_in_union : Error<
1817  "unions cannot have virtual functions">;
1818def err_virtual_non_function : Error<
1819  "'virtual' can only appear on non-static member functions">;
1820def err_virtual_out_of_class : Error<
1821  "'virtual' can only be specified inside the class definition">;
1822def err_virtual_member_function_template : Error<
1823  "'virtual' cannot be specified on member function templates">;
1824def err_static_overrides_virtual : Error<
1825  "'static' member function %0 overrides a virtual function in a base class">;
1826def err_explicit_non_function : Error<
1827  "'explicit' can only appear on non-static member functions">;
1828def err_explicit_out_of_class : Error<
1829  "'explicit' can only be specified inside the class definition">;
1830def err_explicit_non_ctor_or_conv_function : Error<
1831  "'explicit' can only be applied to a constructor or conversion function">;
1832def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1833def err_static_out_of_line : Error<
1834  "'static' can only be specified inside the class definition">;
1835def ext_static_out_of_line : ExtWarn<
1836  err_static_out_of_line.Text>,
1837  InGroup<MicrosoftTemplate>;
1838def err_storage_class_for_static_member : Error<
1839  "static data member definition cannot specify a storage class">;
1840def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1841def err_not_integral_type_bitfield : Error<
1842  "bit-field %0 has non-integral type %1">;
1843def err_not_integral_type_anon_bitfield : Error<
1844  "anonymous bit-field has non-integral type %0">;
1845def err_anon_bitfield_qualifiers : Error<
1846  "anonymous bit-field cannot have qualifiers">;
1847def err_member_function_initialization : Error<
1848  "initializer on function does not look like a pure-specifier">;
1849def err_non_virtual_pure : Error<
1850  "%0 is not virtual and cannot be declared pure">;
1851def ext_pure_function_definition : ExtWarn<
1852  "function definition with pure-specifier is a Microsoft extension">,
1853  InGroup<MicrosoftPureDefinition>;
1854def err_qualified_member_of_unrelated : Error<
1855  "%q0 is not a member of class %1">;
1856
1857def err_member_function_call_bad_cvr : Error<
1858  "'this' argument to member function %0 has type %1, but function is not marked "
1859  "%select{const|restrict|const or restrict|volatile|const or volatile|"
1860  "volatile or restrict|const, volatile, or restrict}2">;
1861def err_member_function_call_bad_ref : Error<
1862  "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1863  "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1864def err_member_function_call_bad_type : Error<
1865  "cannot initialize object parameter of type %0 with an expression "
1866  "of type %1">;
1867
1868def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1869  "call to pure virtual member function %0 has undefined behavior; "
1870  "overrides of %0 in subclasses are not available in the "
1871  "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
1872
1873def select_special_member_kind : TextSubstitution<
1874  "%select{default constructor|copy constructor|move constructor|"
1875  "copy assignment operator|move assignment operator|destructor}0">;
1876
1877def note_member_declared_at : Note<"member is declared here">;
1878def note_ivar_decl : Note<"instance variable is declared here">;
1879def note_bitfield_decl : Note<"bit-field is declared here">;
1880def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1881def note_member_synthesized_at : Note<
1882  "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 "
1883  "first required here">;
1884def note_comparison_synthesized_at : Note<
1885  "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 "
1886  "first required here">;
1887def err_missing_default_ctor : Error<
1888  "%select{constructor for %1 must explicitly initialize the|"
1889  "implicit default constructor for %1 must explicitly initialize the|"
1890  "cannot use constructor inherited from base class %4;}0 "
1891  "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1892  "does not have a default constructor">;
1893def note_due_to_dllexported_class : Note<
1894  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1895
1896def err_illegal_union_or_anon_struct_member : Error<
1897  "%select{anonymous struct|union}0 member %1 has a non-trivial "
1898  "%sub{select_special_member_kind}2">;
1899
1900def warn_frame_address : Warning<
1901  "calling '%0' with a nonzero argument is unsafe">,
1902  InGroup<FrameAddress>, DefaultIgnore;
1903
1904def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1905  "%select{anonymous struct|union}0 member %1 with a non-trivial "
1906  "%sub{select_special_member_kind}2 is incompatible with C++98">,
1907  InGroup<CXX98Compat>, DefaultIgnore;
1908
1909def note_nontrivial_virtual_dtor : Note<
1910  "destructor for %0 is not trivial because it is virtual">;
1911def note_nontrivial_has_virtual : Note<
1912  "because type %0 has a virtual %select{member function|base class}1">;
1913def note_nontrivial_no_def_ctor : Note<
1914  "because %select{base class of |field of |}0type %1 has no "
1915  "default constructor">;
1916def note_user_declared_ctor : Note<
1917  "implicit default constructor suppressed by user-declared constructor">;
1918def note_nontrivial_no_copy : Note<
1919  "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1920  "assignment operator|<<ERROR>>}2 can be used to "
1921  "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1922  "%select{base class|field|an object}0 of type %3">;
1923def note_nontrivial_user_provided : Note<
1924  "because %select{base class of |field of |}0type %1 has a user-provided "
1925  "%sub{select_special_member_kind}2">;
1926def note_nontrivial_default_member_init : Note<
1927  "because field %0 has an initializer">;
1928def note_nontrivial_param_type : Note<
1929  "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1930def note_nontrivial_default_arg : Note<"because it has a default argument">;
1931def note_nontrivial_variadic : Note<"because it is a variadic function">;
1932def note_nontrivial_subobject : Note<
1933  "because the function selected to %select{construct|copy|move|copy|move|"
1934  "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1935def note_nontrivial_objc_ownership : Note<
1936  "because type %0 has a member with %select{no|no|__strong|__weak|"
1937  "__autoreleasing}1 ownership">;
1938
1939/// Selector for a TagTypeKind value.
1940def select_tag_type_kind : TextSubstitution<
1941  "%select{struct|interface|union|class|enum}0">;
1942
1943def err_static_data_member_not_allowed_in_anon_struct : Error<
1944  "static data member %0 not allowed in anonymous "
1945  "%sub{select_tag_type_kind}1">;
1946def ext_static_data_member_in_union : ExtWarn<
1947  "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1948def warn_cxx98_compat_static_data_member_in_union : Warning<
1949  "static data member %0 in union is incompatible with C++98">,
1950  InGroup<CXX98Compat>, DefaultIgnore;
1951def ext_union_member_of_reference_type : ExtWarn<
1952  "union member %0 has reference type %1, which is a Microsoft extension">,
1953  InGroup<MicrosoftUnionMemberReference>;
1954def err_union_member_of_reference_type : Error<
1955  "union member %0 has reference type %1">;
1956def ext_anonymous_struct_union_qualified : Extension<
1957  "anonymous %select{struct|union}0 cannot be '%1'">;
1958def err_different_return_type_for_overriding_virtual_function : Error<
1959  "virtual function %0 has a different return type "
1960  "%diff{($) than the function it overrides (which has return type $)|"
1961  "than the function it overrides}1,2">;
1962def note_overridden_virtual_function : Note<
1963  "overridden virtual function is here">;
1964def err_conflicting_overriding_cc_attributes : Error<
1965  "virtual function %0 has different calling convention attributes "
1966  "%diff{($) than the function it overrides (which has calling convention $)|"
1967  "than the function it overrides}1,2">;
1968def warn_overriding_method_missing_noescape : Warning<
1969  "parameter of overriding method should be annotated with "
1970  "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1971def note_overridden_marked_noescape : Note<
1972  "parameter of overridden method is annotated with __attribute__((noescape))">;
1973def note_cat_conform_to_noescape_prot : Note<
1974  "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
1975
1976def err_covariant_return_inaccessible_base : Error<
1977  "invalid covariant return for virtual function: %1 is a "
1978  "%select{private|protected}2 base class of %0">, AccessControl;
1979def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1980  "return type of virtual function %3 is not covariant with the return type of "
1981  "the function it overrides (ambiguous conversion from derived class "
1982  "%0 to base class %1:%2)">;
1983def err_covariant_return_not_derived : Error<
1984  "return type of virtual function %0 is not covariant with the return type of "
1985  "the function it overrides (%1 is not derived from %2)">;
1986def err_covariant_return_incomplete : Error<
1987  "return type of virtual function %0 is not covariant with the return type of "
1988  "the function it overrides (%1 is incomplete)">;
1989def err_covariant_return_type_different_qualifications : Error<
1990  "return type of virtual function %0 is not covariant with the return type of "
1991  "the function it overrides (%1 has different qualifiers than %2)">;
1992def err_covariant_return_type_class_type_more_qualified : Error<
1993  "return type of virtual function %0 is not covariant with the return type of "
1994  "the function it overrides (class type %1 is more qualified than class "
1995  "type %2">;
1996
1997// C++ implicit special member functions
1998def note_in_declaration_of_implicit_special_member : Note<
1999  "while declaring the implicit %sub{select_special_member_kind}1"
2000  " for %0">;
2001
2002// C++ constructors
2003def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
2004def err_invalid_qualified_constructor : Error<
2005  "'%0' qualifier is not allowed on a constructor">;
2006def err_ref_qualifier_constructor : Error<
2007  "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
2008
2009def err_constructor_return_type : Error<
2010  "constructor cannot have a return type">;
2011def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
2012def err_constructor_byvalue_arg : Error<
2013  "copy constructor must pass its first argument by reference">;
2014def warn_no_constructor_for_refconst : Warning<
2015  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
2016  "constructor to initialize its non-modifiable members">;
2017def note_refconst_member_not_initialized : Note<
2018  "%select{const|reference}0 member %1 will never be initialized">;
2019def ext_ms_explicit_constructor_call : ExtWarn<
2020  "explicit constructor calls are a Microsoft extension">,
2021  InGroup<MicrosoftExplicitConstructorCall>;
2022
2023// C++ destructors
2024def err_destructor_not_member : Error<
2025  "destructor must be a non-static member function">;
2026def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
2027def err_invalid_qualified_destructor : Error<
2028  "'%0' qualifier is not allowed on a destructor">;
2029def err_ref_qualifier_destructor : Error<
2030  "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
2031def err_destructor_return_type : Error<"destructor cannot have a return type">;
2032def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
2033def err_destructor_with_params : Error<"destructor cannot have any parameters">;
2034def err_destructor_variadic : Error<"destructor cannot be variadic">;
2035def ext_destructor_typedef_name : ExtWarn<
2036  "destructor cannot be declared using a %select{typedef|type alias}1 %0 "
2037  "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>;
2038def err_undeclared_destructor_name : Error<
2039  "undeclared identifier %0 in destructor name">;
2040def err_destructor_name : Error<
2041  "expected the class name after '~' to name the enclosing class">;
2042def err_destructor_name_nontype : Error<
2043  "identifier %0 after '~' in destructor name does not name a type">;
2044def err_destructor_expr_mismatch : Error<
2045  "identifier %0 in object destruction expression does not name the type "
2046  "%1 of the object being destroyed">;
2047def err_destructor_expr_nontype : Error<
2048  "identifier %0 in object destruction expression does not name a type">;
2049def err_destructor_expr_type_mismatch : Error<
2050  "destructor type %0 in object destruction expression does not match the "
2051  "type %1 of the object being destroyed">;
2052def note_destructor_type_here : Note<
2053  "type %0 found by destructor name lookup">;
2054def note_destructor_nontype_here : Note<
2055  "non-type declaration found by destructor name lookup">;
2056def ext_dtor_named_in_wrong_scope : Extension<
2057  "ISO C++ requires the name after '::~' to be found in the same scope as "
2058  "the name before '::~'">, InGroup<DtorName>;
2059def ext_qualified_dtor_named_in_lexical_scope : ExtWarn<
2060  "qualified destructor name only found in lexical scope; omit the qualifier "
2061  "to find this type name by unqualified lookup">, InGroup<DtorName>;
2062def ext_dtor_name_ambiguous : Extension<
2063  "ISO C++ considers this destructor name lookup to be ambiguous">,
2064  InGroup<DtorName>;
2065
2066def err_destroy_attr_on_non_static_var : Error<
2067  "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
2068  " variable with static or thread storage duration">;
2069
2070def err_destructor_template : Error<
2071  "destructor cannot be declared as a template">;
2072
2073// C++ initialization
2074def err_init_conversion_failed : Error<
2075  "cannot initialize %select{a variable|a parameter|template parameter|"
2076  "return object|statement expression result|an "
2077  "exception object|a member subobject|an array element|a new value|a value|a "
2078  "base class|a constructor delegation|a vector element|a block element|a "
2079  "block element|a complex element|a lambda capture|a compound literal "
2080  "initializer|a related result|a parameter of CF audited function}0 "
2081  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2082  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2083  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2084  "|: different number of parameters (%5 vs %6)"
2085  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2086  "|: different return type%diff{ ($ vs $)|}5,6"
2087  "|: different qualifiers (%5 vs %6)"
2088  "|: different exception specifications}4">;
2089def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2090  "declared here; conversion would be valid if it was derived from %1">;
2091
2092def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2093  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2094def err_lvalue_reference_bind_to_initlist : Error<
2095  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2096  "initializer list temporary">;
2097def err_lvalue_reference_bind_to_temporary : Error<
2098  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2099  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2100def err_lvalue_reference_bind_to_unrelated : Error<
2101  "%select{non-const|volatile}0 lvalue reference "
2102  "%diff{to type $ cannot bind to a value of unrelated type $|"
2103  "cannot bind to a value of unrelated type}1,2">;
2104def err_reference_bind_drops_quals : Error<
2105  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2106  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2107  "not permitted due to incompatible qualifiers}2">;
2108def err_reference_bind_failed : Error<
2109  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2110  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2111  "incompatible type}0,3">;
2112def err_reference_bind_temporary_addrspace : Error<
2113  "reference of type %0 cannot bind to a temporary object because of "
2114  "address space mismatch">;
2115def err_reference_bind_init_list : Error<
2116  "reference to type %0 cannot bind to an initializer list">;
2117def err_init_list_bad_dest_type : Error<
2118  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2119  "list">;
2120def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2121  "aggregate initialization of type %0 with user-declared constructors "
2122  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2123
2124def err_reference_bind_to_bitfield : Error<
2125  "%select{non-const|volatile}0 reference cannot bind to "
2126  "bit-field%select{| %1}2">;
2127def err_reference_bind_to_vector_element : Error<
2128  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2129def err_reference_bind_to_matrix_element : Error<
2130  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2131def err_reference_var_requires_init : Error<
2132  "declaration of reference variable %0 requires an initializer">;
2133def err_reference_without_init : Error<
2134  "reference to type %0 requires an initializer">;
2135def note_value_initialization_here : Note<
2136  "in value-initialization of type %0 here">;
2137def err_reference_has_multiple_inits : Error<
2138  "reference cannot be initialized with multiple values">;
2139def err_init_non_aggr_init_list : Error<
2140  "initialization of non-aggregate type %0 with an initializer list">;
2141def err_init_reference_member_uninitialized : Error<
2142  "reference member of type %0 uninitialized">;
2143def note_uninit_reference_member : Note<
2144  "uninitialized reference member is here">;
2145def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2146  InGroup<Uninitialized>;
2147def warn_base_class_is_uninit : Warning<
2148  "base class %0 is uninitialized when used here to access %q1">,
2149  InGroup<Uninitialized>;
2150def warn_reference_field_is_uninit : Warning<
2151  "reference %0 is not yet bound to a value when used here">,
2152  InGroup<Uninitialized>;
2153def note_uninit_in_this_constructor : Note<
2154  "during field initialization in %select{this|the implicit default}0 "
2155  "constructor">;
2156def warn_static_self_reference_in_init : Warning<
2157  "static variable %0 is suspiciously used within its own initialization">,
2158  InGroup<UninitializedStaticSelfInit>;
2159def warn_uninit_self_reference_in_init : Warning<
2160  "variable %0 is uninitialized when used within its own initialization">,
2161  InGroup<Uninitialized>;
2162def warn_uninit_self_reference_in_reference_init : Warning<
2163  "reference %0 is not yet bound to a value when used within its own"
2164  " initialization">,
2165  InGroup<Uninitialized>;
2166def warn_uninit_var : Warning<
2167  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2168  InGroup<Uninitialized>, DefaultIgnore;
2169def warn_sometimes_uninit_var : Warning<
2170  "variable %0 is %select{used|captured}1 uninitialized whenever "
2171  "%select{'%3' condition is %select{true|false}4|"
2172  "'%3' loop %select{is entered|exits because its condition is false}4|"
2173  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2174  "switch %3 is taken|"
2175  "its declaration is reached|"
2176  "%3 is called}2">,
2177  InGroup<UninitializedSometimes>, DefaultIgnore;
2178def warn_maybe_uninit_var : Warning<
2179  "variable %0 may be uninitialized when "
2180  "%select{used here|captured by block}1">,
2181  InGroup<UninitializedMaybe>, DefaultIgnore;
2182def note_var_declared_here : Note<"variable %0 is declared here">;
2183def note_uninit_var_use : Note<
2184  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2185def warn_uninit_byref_blockvar_captured_by_block : Warning<
2186  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2187  "block">, InGroup<Uninitialized>, DefaultIgnore;
2188def note_block_var_fixit_add_initialization : Note<
2189  "did you mean to use __block %0?">;
2190def note_in_omitted_aggregate_initializer : Note<
2191  "in implicit initialization of %select{"
2192  "array element %1 with omitted initializer|"
2193  "field %1 with omitted initializer|"
2194  "trailing array elements in runtime-sized array new}0">;
2195def note_in_reference_temporary_list_initializer : Note<
2196  "in initialization of temporary of type %0 created to "
2197  "list-initialize this reference">;
2198def note_var_fixit_add_initialization : Note<
2199  "initialize the variable %0 to silence this warning">;
2200def note_uninit_fixit_remove_cond : Note<
2201  "remove the %select{'%1' if its condition|condition if it}0 "
2202  "is always %select{false|true}2">;
2203def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2204def err_list_init_in_parens : Error<
2205  "cannot initialize %select{non-class|reference}0 type %1 with a "
2206  "parenthesized initializer list">;
2207
2208def warn_uninit_const_reference : Warning<
2209  "variable %0 is uninitialized when passed as a const reference argument "
2210  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2211
2212def warn_unsequenced_mod_mod : Warning<
2213  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2214def warn_unsequenced_mod_use : Warning<
2215  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2216
2217def select_initialized_entity_kind : TextSubstitution<
2218  "%select{copying variable|copying parameter|initializing template parameter|"
2219  "returning object|initializing statement expression result|"
2220  "throwing object|copying member subobject|copying array element|"
2221  "allocating object|copying temporary|initializing base subobject|"
2222  "initializing vector element|capturing value}0">;
2223
2224def err_temp_copy_no_viable : Error<
2225  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2226def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2227  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2228  "C++98 requires a copy constructor when binding a reference to a temporary">,
2229  InGroup<BindToTemporaryCopy>;
2230def err_temp_copy_ambiguous : Error<
2231  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2232  "of type %1">;
2233def err_temp_copy_deleted : Error<
2234  "%sub{select_initialized_entity_kind}0 of type %1 "
2235  "invokes deleted constructor">;
2236def err_temp_copy_incomplete : Error<
2237  "copying a temporary object of incomplete type %0">;
2238def warn_cxx98_compat_temp_copy : Warning<
2239  "%sub{select_initialized_entity_kind}1 "
2240  "of type %2 when binding a reference to a temporary would %select{invoke "
2241  "an inaccessible constructor|find no viable constructor|find ambiguous "
2242  "constructors|invoke a deleted constructor}0 in C++98">,
2243  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2244def err_selected_explicit_constructor : Error<
2245  "chosen constructor is explicit in copy-initialization">;
2246def note_explicit_ctor_deduction_guide_here : Note<
2247  "explicit %select{constructor|deduction guide}0 declared here">;
2248
2249// C++11 decltype
2250def err_decltype_in_declarator : Error<
2251    "'decltype' cannot be used to name a declaration">;
2252
2253// C++11 auto
2254def warn_cxx98_compat_auto_type_specifier : Warning<
2255  "'auto' type specifier is incompatible with C++98">,
2256  InGroup<CXX98Compat>, DefaultIgnore;
2257def err_auto_variable_cannot_appear_in_own_initializer : Error<
2258  "variable %0 declared with deduced type %1 "
2259  "cannot appear in its own initializer">;
2260def err_binding_cannot_appear_in_own_initializer : Error<
2261  "binding %0 cannot appear in the initializer of its own "
2262  "decomposition declaration">;
2263def err_illegal_decl_array_of_auto : Error<
2264  "'%0' declared as array of %1">;
2265def err_new_array_of_auto : Error<
2266  "cannot allocate array of 'auto'">;
2267def err_auto_not_allowed : Error<
2268  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2269  "use of "
2270  "%select{class template|function template|variable template|alias template|"
2271  "template template parameter|concept|template}2 %3 requires template "
2272  "arguments; argument deduction}0 not allowed "
2273  "%select{in function prototype"
2274  "|in non-static struct member|in struct member"
2275  "|in non-static union member|in union member"
2276  "|in non-static class member|in interface member"
2277  "|in exception declaration|in template parameter until C++17|in block literal"
2278  "|in template argument|in typedef|in type alias|in function return type"
2279  "|in conversion function type|here|in lambda parameter"
2280  "|in type allocated by 'new'|in K&R-style function parameter"
2281  "|in template parameter|in friend declaration|in function prototype that is "
2282  "not a function declaration|in requires expression parameter}1">;
2283def err_dependent_deduced_tst : Error<
2284  "typename specifier refers to "
2285  "%select{class template|function template|variable template|alias template|"
2286  "template template parameter|template}0 member in %1; "
2287  "argument deduction not allowed here">;
2288def err_deduced_tst : Error<
2289  "typename specifier refers to "
2290  "%select{class template|function template|variable template|alias template|"
2291  "template template parameter|template}0; argument deduction not allowed "
2292  "here">;
2293def err_auto_not_allowed_var_inst : Error<
2294  "'auto' variable template instantiation is not allowed">;
2295def err_auto_var_requires_init : Error<
2296  "declaration of variable %0 with deduced type %1 requires an initializer">;
2297def err_auto_new_requires_ctor_arg : Error<
2298  "new expression for type %0 requires a constructor argument">;
2299def ext_auto_new_list_init : Extension<
2300  "ISO C++ standards before C++17 do not allow new expression for "
2301  "type %0 to use list-initialization">, InGroup<CXX17>;
2302def err_auto_var_init_no_expression : Error<
2303  "initializer for variable %0 with type %1 is empty">;
2304def err_auto_var_init_multiple_expressions : Error<
2305  "initializer for variable %0 with type %1 contains multiple expressions">;
2306def err_auto_var_init_paren_braces : Error<
2307  "cannot deduce type for variable %1 with type %2 from "
2308  "%select{parenthesized|nested}0 initializer list">;
2309def err_auto_new_ctor_multiple_expressions : Error<
2310  "new expression for type %0 contains multiple constructor arguments">;
2311def err_auto_missing_trailing_return : Error<
2312  "'auto' return without trailing return type; deduced return types are a "
2313  "C++14 extension">;
2314def err_deduced_return_type : Error<
2315  "deduced return types are a C++14 extension">;
2316def err_trailing_return_without_auto : Error<
2317  "function with trailing return type must specify return type 'auto', not %0">;
2318def err_trailing_return_in_parens : Error<
2319  "trailing return type may not be nested within parentheses">;
2320def err_auto_var_deduction_failure : Error<
2321  "variable %0 with type %1 has incompatible initializer of type %2">;
2322def err_auto_var_deduction_failure_from_init_list : Error<
2323  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2324def err_auto_new_deduction_failure : Error<
2325  "new expression for type %0 has incompatible constructor argument of type %1">;
2326def err_auto_inconsistent_deduction : Error<
2327  "deduced conflicting types %diff{($ vs $) |}0,1"
2328  "for initializer list element type">;
2329def err_auto_different_deductions : Error<
2330  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2331  "deduced as %1 in declaration of %2 and "
2332  "deduced as %3 in declaration of %4">;
2333def err_auto_non_deduced_not_alone : Error<
2334  "%select{function with deduced return type|"
2335  "declaration with trailing return type}0 "
2336  "must be the only declaration in its group">;
2337def err_implied_std_initializer_list_not_found : Error<
2338  "cannot deduce type of initializer list because std::initializer_list was "
2339  "not found; include <initializer_list>">;
2340def err_malformed_std_initializer_list : Error<
2341  "std::initializer_list must be a class template with a single type parameter">;
2342def err_auto_init_list_from_c : Error<
2343  "cannot use __auto_type with initializer list in C">;
2344def err_auto_bitfield : Error<
2345  "cannot pass bit-field as __auto_type initializer in C">;
2346
2347// C++1y decltype(auto) type
2348def err_decltype_auto_invalid : Error<
2349  "'decltype(auto)' not allowed here">;
2350def err_decltype_auto_cannot_be_combined : Error<
2351  "'decltype(auto)' cannot be combined with other type specifiers">;
2352def err_decltype_auto_function_declarator_not_declaration : Error<
2353  "'decltype(auto)' can only be used as a return type "
2354  "in a function declaration">;
2355def err_decltype_auto_compound_type : Error<
2356  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2357def err_decltype_auto_initializer_list : Error<
2358  "cannot deduce 'decltype(auto)' from initializer list">;
2359
2360// C++17 deduced class template specialization types
2361def err_deduced_class_template_compound_type : Error<
2362  "cannot %select{form pointer to|form reference to|form array of|"
2363  "form function returning|use parentheses when declaring variable with}0 "
2364  "deduced class template specialization type">;
2365def err_deduced_non_class_template_specialization_type : Error<
2366  "%select{<error>|function template|variable template|alias template|"
2367  "template template parameter|concept|template}0 %1 requires template "
2368  "arguments; argument deduction only allowed for class templates">;
2369def err_deduced_class_template_ctor_ambiguous : Error<
2370  "ambiguous deduction for template arguments of %0">;
2371def err_deduced_class_template_ctor_no_viable : Error<
2372  "no viable constructor or deduction guide for deduction of "
2373  "template arguments of %0">;
2374def err_deduced_class_template_incomplete : Error<
2375  "template %0 has no definition and no %select{|viable }1deduction guides "
2376  "for deduction of template arguments">;
2377def err_deduced_class_template_deleted : Error<
2378  "class template argument deduction for %0 selected a deleted constructor">;
2379def err_deduced_class_template_explicit : Error<
2380  "class template argument deduction for %0 selected an explicit "
2381  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2382def err_deduction_guide_no_trailing_return_type : Error<
2383  "deduction guide declaration without trailing return type">;
2384def err_deduction_guide_bad_trailing_return_type : Error<
2385  "deduced type %1 of deduction guide is not %select{|written as }2"
2386  "a specialization of template %0">;
2387def err_deduction_guide_with_complex_decl : Error<
2388  "cannot specify any part of a return type in the "
2389  "declaration of a deduction guide">;
2390def err_deduction_guide_invalid_specifier : Error<
2391  "deduction guide cannot be declared '%0'">;
2392def err_deduction_guide_name_not_class_template : Error<
2393  "cannot specify deduction guide for "
2394  "%select{<error>|function template|variable template|alias template|"
2395  "template template parameter|concept|dependent template name}0 %1">;
2396def err_deduction_guide_wrong_scope : Error<
2397  "deduction guide must be declared in the same scope as template %q0">;
2398def err_deduction_guide_defines_function : Error<
2399  "deduction guide cannot have a function definition">;
2400def err_deduction_guide_redeclared : Error<
2401  "redeclaration of deduction guide">;
2402def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2403  "%select{explicitly instantiated|explicitly specialized}0">;
2404def err_deduction_guide_template_not_deducible : Error<
2405  "deduction guide template contains "
2406  "%select{a template parameter|template parameters}0 that cannot be "
2407  "deduced">;
2408def err_deduction_guide_wrong_access : Error<
2409  "deduction guide has different access from the corresponding "
2410  "member template">;
2411def note_deduction_guide_template_access : Note<
2412  "member template declared %0 here">;
2413def note_deduction_guide_access : Note<
2414  "deduction guide declared %0 by intervening access specifier">;
2415def warn_cxx14_compat_class_template_argument_deduction : Warning<
2416  "class template argument deduction is incompatible with C++ standards "
2417  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2418  InGroup<CXXPre17Compat>, DefaultIgnore;
2419def warn_ctad_maybe_unsupported : Warning<
2420  "%0 may not intend to support class template argument deduction">,
2421  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2422def note_suppress_ctad_maybe_unsupported : Note<
2423  "add a deduction guide to suppress this warning">;
2424
2425
2426// C++14 deduced return types
2427def err_auto_fn_deduction_failure : Error<
2428  "cannot deduce return type %0 from returned value of type %1">;
2429def err_auto_fn_different_deductions : Error<
2430  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2431  "deduced as %2 in earlier return statement">;
2432def err_auto_fn_used_before_defined : Error<
2433  "function %0 with deduced return type cannot be used before it is defined">;
2434def err_auto_fn_no_return_but_not_auto : Error<
2435  "cannot deduce return type %0 for function with no return statements">;
2436def err_auto_fn_return_void_but_not_auto : Error<
2437  "cannot deduce return type %0 from omitted return expression">;
2438def err_auto_fn_return_init_list : Error<
2439  "cannot deduce return type from initializer list">;
2440def err_auto_fn_virtual : Error<
2441  "function with deduced return type cannot be virtual">;
2442def warn_cxx11_compat_deduced_return_type : Warning<
2443  "return type deduction is incompatible with C++ standards before C++14">,
2444  InGroup<CXXPre14Compat>, DefaultIgnore;
2445
2446// C++11 override control
2447def override_keyword_only_allowed_on_virtual_member_functions : Error<
2448  "only virtual member functions can be marked '%0'">;
2449def override_keyword_hides_virtual_member_function : Error<
2450  "non-virtual member function marked '%0' hides virtual member "
2451  "%select{function|functions}1">;
2452def err_function_marked_override_not_overriding : Error<
2453  "%0 marked 'override' but does not override any member functions">;
2454def warn_destructor_marked_not_override_overriding : TextSubstitution <
2455  "%0 overrides a destructor but is not marked 'override'">;
2456def warn_function_marked_not_override_overriding : TextSubstitution <
2457  "%0 overrides a member function but is not marked 'override'">;
2458def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2459  "%sub{warn_destructor_marked_not_override_overriding}0">,
2460  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2461def warn_inconsistent_function_marked_not_override_overriding : Warning <
2462  "%sub{warn_function_marked_not_override_overriding}0">,
2463  InGroup<CXX11WarnInconsistentOverrideMethod>;
2464def warn_suggest_destructor_marked_not_override_overriding : Warning <
2465  "%sub{warn_destructor_marked_not_override_overriding}0">,
2466  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2467def warn_suggest_function_marked_not_override_overriding : Warning <
2468  "%sub{warn_function_marked_not_override_overriding}0">,
2469  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2470def err_class_marked_final_used_as_base : Error<
2471  "base %0 is marked '%select{final|sealed}1'">;
2472def warn_abstract_final_class : Warning<
2473  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2474def warn_final_dtor_non_final_class : Warning<
2475  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2476  InGroup<FinalDtorNonFinalClass>;
2477def note_final_dtor_non_final_class_silence : Note<
2478  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2479
2480// C++11 attributes
2481def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2482
2483// C++11 final
2484def err_final_function_overridden : Error<
2485  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2486
2487// C++11 scoped enumerations
2488def err_enum_invalid_underlying : Error<
2489  "non-integral type %0 is an invalid underlying type">;
2490def err_enumerator_too_large : Error<
2491  "enumerator value is not representable in the underlying type %0">;
2492def ext_enumerator_too_large : Extension<
2493  "enumerator value is not representable in the underlying type %0">,
2494  InGroup<MicrosoftEnumValue>;
2495def err_enumerator_wrapped : Error<
2496  "enumerator value %0 is not representable in the underlying type %1">;
2497def err_enum_redeclare_type_mismatch : Error<
2498  "enumeration redeclared with different underlying type %0 (was %1)">;
2499def err_enum_redeclare_fixed_mismatch : Error<
2500  "enumeration previously declared with %select{non|}0fixed underlying type">;
2501def err_enum_redeclare_scoped_mismatch : Error<
2502  "enumeration previously declared as %select{un|}0scoped">;
2503def err_only_enums_have_underlying_types : Error<
2504  "only enumeration types have underlying types">;
2505def err_underlying_type_of_incomplete_enum : Error<
2506  "cannot determine underlying type of incomplete enumeration type %0">;
2507
2508// C++11 delegating constructors
2509def err_delegating_ctor : Error<
2510  "delegating constructors are permitted only in C++11">;
2511def warn_cxx98_compat_delegating_ctor : Warning<
2512  "delegating constructors are incompatible with C++98">,
2513  InGroup<CXX98Compat>, DefaultIgnore;
2514def err_delegating_initializer_alone : Error<
2515  "an initializer for a delegating constructor must appear alone">;
2516def warn_delegating_ctor_cycle : Warning<
2517  "constructor for %0 creates a delegation cycle">, DefaultError,
2518  InGroup<DelegatingCtorCycles>;
2519def note_it_delegates_to : Note<"it delegates to">;
2520def note_which_delegates_to : Note<"which delegates to">;
2521
2522// C++11 range-based for loop
2523def err_for_range_decl_must_be_var : Error<
2524  "for range declaration must declare a variable">;
2525def err_for_range_storage_class : Error<
2526  "loop variable %0 may not be declared %select{'extern'|'static'|"
2527  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2528def err_type_defined_in_for_range : Error<
2529  "types may not be defined in a for range declaration">;
2530def err_for_range_deduction_failure : Error<
2531  "cannot use type %0 as a range">;
2532def err_for_range_incomplete_type : Error<
2533  "cannot use incomplete type %0 as a range">;
2534def err_for_range_iter_deduction_failure : Error<
2535  "cannot use type %0 as an iterator">;
2536def ext_for_range_begin_end_types_differ : ExtWarn<
2537  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2538  InGroup<CXX17>;
2539def warn_for_range_begin_end_types_differ : Warning<
2540  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2541  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2542def note_in_for_range: Note<
2543  "when looking up '%select{begin|end}0' function for range expression "
2544  "of type %1">;
2545def err_for_range_invalid: Error<
2546  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2547  "function available">;
2548def note_for_range_member_begin_end_ignored : Note<
2549  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2550def err_range_on_array_parameter : Error<
2551  "cannot build range expression with array function parameter %0 since "
2552  "parameter with array type %1 is treated as pointer type %2">;
2553def err_for_range_dereference : Error<
2554  "invalid range expression of type %0; did you mean to dereference it "
2555  "with '*'?">;
2556def note_for_range_invalid_iterator : Note <
2557  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2558def note_for_range_begin_end : Note<
2559  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2560def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2561  "loop variable %0 "
2562  "%diff{of type $ binds to a temporary constructed from type $"
2563  "|binds to a temporary constructed from a different type}1,2">,
2564  InGroup<RangeLoopConstruct>, DefaultIgnore;
2565def note_use_type_or_non_reference : Note<
2566  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2567def warn_for_range_ref_binds_ret_temp : Warning<
2568  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2569  InGroup<RangeLoopBindReference>, DefaultIgnore;
2570def note_use_non_reference_type : Note<"use non-reference type %0">;
2571def warn_for_range_copy : Warning<
2572  "loop variable %0 creates a copy from type %1">,
2573  InGroup<RangeLoopConstruct>, DefaultIgnore;
2574def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2575def err_objc_for_range_init_stmt : Error<
2576  "initialization statement is not supported when iterating over Objective-C "
2577  "collection">;
2578
2579// C++11 constexpr
2580def warn_cxx98_compat_constexpr : Warning<
2581  "'constexpr' specifier is incompatible with C++98">,
2582  InGroup<CXX98Compat>, DefaultIgnore;
2583// FIXME: Maybe this should also go in -Wc++14-compat?
2584def warn_cxx14_compat_constexpr_not_const : Warning<
2585  "'constexpr' non-static member function will not be implicitly 'const' "
2586  "in C++14; add 'const' to avoid a change in behavior">,
2587  InGroup<DiagGroup<"constexpr-not-const">>;
2588def err_invalid_consteval_take_address : Error<
2589  "cannot take address of consteval function %0 outside"
2590  " of an immediate invocation">;
2591def err_invalid_consteval_call : Error<
2592  "call to consteval function %q0 is not a constant expression">;
2593def err_invalid_consteval_decl_kind : Error<
2594  "%0 cannot be declared consteval">;
2595def err_invalid_constexpr : Error<
2596  "%select{function parameter|typedef}0 "
2597  "cannot be %sub{select_constexpr_spec_kind}1">;
2598def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2599  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2600def err_constexpr_tag : Error<
2601  "%select{class|struct|interface|union|enum}0 "
2602  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2603def err_constexpr_dtor : Error<
2604  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2605def err_constexpr_dtor_subobject : Error<
2606  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2607  "%select{data member %2|base class %3}1 does not have a "
2608  "constexpr destructor">;
2609def note_constexpr_dtor_subobject : Note<
2610  "%select{data member %1|base class %2}0 declared here">;
2611def err_constexpr_wrong_decl_kind : Error<
2612  "%sub{select_constexpr_spec_kind}0 can only be used "
2613  "in %select{|variable and function|function|variable}0 declarations">;
2614def err_invalid_constexpr_var_decl : Error<
2615  "constexpr variable declaration must be a definition">;
2616def err_constexpr_static_mem_var_requires_init : Error<
2617  "declaration of constexpr static data member %0 requires an initializer">;
2618def err_constexpr_var_non_literal : Error<
2619  "constexpr variable cannot have non-literal type %0">;
2620def err_constexpr_var_requires_const_init : Error<
2621  "constexpr variable %0 must be initialized by a constant expression">;
2622def err_constexpr_var_requires_const_destruction : Error<
2623  "constexpr variable %0 must have constant destruction">;
2624def err_constexpr_redecl_mismatch : Error<
2625  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2626  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2627def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2628def warn_cxx17_compat_constexpr_virtual : Warning<
2629  "virtual constexpr functions are incompatible with "
2630  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2631def err_constexpr_virtual_base : Error<
2632  "constexpr %select{member function|constructor}0 not allowed in "
2633  "%select{struct|interface|class}1 with virtual base "
2634  "%plural{1:class|:classes}2">;
2635def note_non_literal_incomplete : Note<
2636  "incomplete type %0 is not a literal type">;
2637def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2638  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2639def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2640def err_constexpr_non_literal_return : Error<
2641  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2642def err_constexpr_non_literal_param : Error<
2643  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2644  "not a literal type">;
2645def err_constexpr_body_invalid_stmt : Error<
2646  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2647def ext_constexpr_body_invalid_stmt : ExtWarn<
2648  "use of this statement in a constexpr %select{function|constructor}0 "
2649  "is a C++14 extension">, InGroup<CXX14>;
2650def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2651  "use of this statement in a constexpr %select{function|constructor}0 "
2652  "is incompatible with C++ standards before C++14">,
2653  InGroup<CXXPre14Compat>, DefaultIgnore;
2654def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2655  "use of this statement in a constexpr %select{function|constructor}0 "
2656  "is a C++20 extension">, InGroup<CXX20>;
2657def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2658  "use of this statement in a constexpr %select{function|constructor}0 "
2659  "is incompatible with C++ standards before C++20">,
2660  InGroup<CXXPre20Compat>, DefaultIgnore;
2661def ext_constexpr_type_definition : ExtWarn<
2662  "type definition in a constexpr %select{function|constructor}0 "
2663  "is a C++14 extension">, InGroup<CXX14>;
2664def warn_cxx11_compat_constexpr_type_definition : Warning<
2665  "type definition in a constexpr %select{function|constructor}0 "
2666  "is incompatible with C++ standards before C++14">,
2667  InGroup<CXXPre14Compat>, DefaultIgnore;
2668def err_constexpr_vla : Error<
2669  "variably-modified type %0 cannot be used in a constexpr "
2670  "%select{function|constructor}1">;
2671def ext_constexpr_local_var : ExtWarn<
2672  "variable declaration in a constexpr %select{function|constructor}0 "
2673  "is a C++14 extension">, InGroup<CXX14>;
2674def warn_cxx11_compat_constexpr_local_var : Warning<
2675  "variable declaration in a constexpr %select{function|constructor}0 "
2676  "is incompatible with C++ standards before C++14">,
2677  InGroup<CXXPre14Compat>, DefaultIgnore;
2678def err_constexpr_local_var_static : Error<
2679  "%select{static|thread_local}1 variable not permitted in a constexpr "
2680  "%select{function|constructor}0">;
2681def err_constexpr_local_var_non_literal_type : Error<
2682  "variable of non-literal type %1 cannot be defined in a constexpr "
2683  "%select{function|constructor}0">;
2684def ext_constexpr_local_var_no_init : ExtWarn<
2685  "uninitialized variable in a constexpr %select{function|constructor}0 "
2686  "is a C++20 extension">, InGroup<CXX20>;
2687def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2688  "uninitialized variable in a constexpr %select{function|constructor}0 "
2689  "is incompatible with C++ standards before C++20">,
2690  InGroup<CXXPre20Compat>, DefaultIgnore;
2691def ext_constexpr_function_never_constant_expr : ExtWarn<
2692  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2693  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2694def err_attr_cond_never_constant_expr : Error<
2695  "%0 attribute expression never produces a constant expression">;
2696def err_diagnose_if_invalid_diagnostic_type : Error<
2697  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2698  "instead">;
2699def err_constexpr_body_no_return : Error<
2700  "no return statement in %select{constexpr|consteval}0 function">;
2701def err_constexpr_return_missing_expr : Error<
2702  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2703def warn_cxx11_compat_constexpr_body_no_return : Warning<
2704  "constexpr function with no return statements is incompatible with C++ "
2705  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2706def ext_constexpr_body_multiple_return : ExtWarn<
2707  "multiple return statements in constexpr function is a C++14 extension">,
2708  InGroup<CXX14>;
2709def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2710  "multiple return statements in constexpr function "
2711  "is incompatible with C++ standards before C++14">,
2712  InGroup<CXXPre14Compat>, DefaultIgnore;
2713def note_constexpr_body_previous_return : Note<
2714  "previous return statement is here">;
2715
2716// C++20 function try blocks in constexpr
2717def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2718  "function try block in constexpr %select{function|constructor}0 is "
2719  "a C++20 extension">, InGroup<CXX20>;
2720def warn_cxx17_compat_constexpr_function_try_block : Warning<
2721  "function try block in constexpr %select{function|constructor}0 is "
2722  "incompatible with C++ standards before C++20">,
2723  InGroup<CXXPre20Compat>, DefaultIgnore;
2724
2725def ext_constexpr_union_ctor_no_init : ExtWarn<
2726  "constexpr union constructor that does not initialize any member "
2727  "is a C++20 extension">, InGroup<CXX20>;
2728def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2729  "constexpr union constructor that does not initialize any member "
2730  "is incompatible with C++ standards before C++20">,
2731  InGroup<CXXPre20Compat>, DefaultIgnore;
2732def ext_constexpr_ctor_missing_init : ExtWarn<
2733  "constexpr constructor that does not initialize all members "
2734  "is a C++20 extension">, InGroup<CXX20>;
2735def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2736  "constexpr constructor that does not initialize all members "
2737  "is incompatible with C++ standards before C++20">,
2738  InGroup<CXXPre20Compat>, DefaultIgnore;
2739def note_constexpr_ctor_missing_init : Note<
2740  "member not initialized by constructor">;
2741def note_non_literal_no_constexpr_ctors : Note<
2742  "%0 is not literal because it is not an aggregate and has no constexpr "
2743  "constructors other than copy or move constructors">;
2744def note_non_literal_base_class : Note<
2745  "%0 is not literal because it has base class %1 of non-literal type">;
2746def note_non_literal_field : Note<
2747  "%0 is not literal because it has data member %1 of "
2748  "%select{non-literal|volatile}3 type %2">;
2749def note_non_literal_user_provided_dtor : Note<
2750  "%0 is not literal because it has a user-provided destructor">;
2751def note_non_literal_nontrivial_dtor : Note<
2752  "%0 is not literal because it has a non-trivial destructor">;
2753def note_non_literal_non_constexpr_dtor : Note<
2754  "%0 is not literal because its destructor is not constexpr">;
2755def note_non_literal_lambda : Note<
2756  "lambda closure types are non-literal types before C++17">;
2757def warn_private_extern : Warning<
2758  "use of __private_extern__ on a declaration may not produce external symbol "
2759  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2760def note_private_extern : Note<
2761  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2762
2763// C++ Concepts
2764def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2765  "concept declarations may only appear in global or namespace scope">;
2766def err_concept_no_parameters : Error<
2767  "concept template parameter list must have at least one parameter; explicit "
2768  "specialization of concepts is not allowed">;
2769def err_concept_extra_headers : Error<
2770  "extraneous template parameter list in concept definition">;
2771def err_concept_no_associated_constraints : Error<
2772  "concept cannot have associated constraints">;
2773def err_non_constant_constraint_expression : Error<
2774  "substitution into constraint expression resulted in a non-constant "
2775  "expression">;
2776def err_non_bool_atomic_constraint : Error<
2777  "atomic constraint must be of type 'bool' (found %0)">;
2778def err_template_arg_list_constraints_not_satisfied : Error<
2779  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
2780  "template template parameter|template}0 %1%2">;
2781def note_substituted_constraint_expr_is_ill_formed : Note<
2782  "because substituted constraint expression is ill-formed%0">;
2783def note_atomic_constraint_evaluated_to_false : Note<
2784  "%select{and|because}0 '%1' evaluated to false">;
2785def note_concept_specialization_constraint_evaluated_to_false : Note<
2786  "%select{and|because}0 '%1' evaluated to false">;
2787def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
2788  "%select{and|because}0 %1 does not satisfy %2">;
2789def note_atomic_constraint_evaluated_to_false_elaborated : Note<
2790  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
2791def err_constrained_virtual_method : Error<
2792  "virtual function cannot have a requires clause">;
2793def err_trailing_requires_clause_on_deduction_guide : Error<
2794  "deduction guide cannot have a requires clause">;
2795def err_reference_to_function_with_unsatisfied_constraints : Error<
2796  "invalid reference to function %0: constraints not satisfied">;
2797def err_requires_expr_local_parameter_default_argument : Error<
2798  "default arguments not allowed for parameters of a requires expression">;
2799def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
2800  "constraint variable %0 cannot be used in an evaluated context">;
2801def note_expr_requirement_expr_substitution_error : Note<
2802  "%select{and|because}0 '%1' would be invalid: %2">;
2803def note_expr_requirement_expr_unknown_substitution_error : Note<
2804  "%select{and|because}0 '%1' would be invalid">;
2805def note_expr_requirement_noexcept_not_met : Note<
2806  "%select{and|because}0 '%1' may throw an exception">;
2807def note_expr_requirement_type_requirement_substitution_error : Note<
2808  "%select{and|because}0 '%1' would be invalid: %2">;
2809def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
2810  "%select{and|because}0 '%1' would be invalid">;
2811def note_expr_requirement_constraints_not_satisfied : Note<
2812  "%select{and|because}0 type constraint '%1' was not satisfied:">;
2813def note_expr_requirement_constraints_not_satisfied_simple : Note<
2814  "%select{and|because}0 %1 does not satisfy %2:">;
2815def note_type_requirement_substitution_error : Note<
2816  "%select{and|because}0 '%1' would be invalid: %2">;
2817def note_type_requirement_unknown_substitution_error : Note<
2818  "%select{and|because}0 '%1' would be invalid">;
2819def note_nested_requirement_substitution_error : Note<
2820  "%select{and|because}0 '%1' would be invalid: %2">;
2821def note_nested_requirement_unknown_substitution_error : Note<
2822  "%select{and|because}0 '%1' would be invalid">;
2823def note_ambiguous_atomic_constraints : Note<
2824  "similar constraint expressions not considered equivalent; constraint "
2825  "expressions cannot be considered equivalent unless they originate from the "
2826  "same concept">;
2827def note_ambiguous_atomic_constraints_similar_expression : Note<
2828  "similar constraint expression here">;
2829def err_unsupported_placeholder_constraint : Error<
2830  "constrained placeholder types other than simple 'auto' on non-type template "
2831  "parameters not supported yet">;
2832
2833def err_template_different_requires_clause : Error<
2834  "requires clause differs in template redeclaration">;
2835def err_template_different_type_constraint : Error<
2836  "type constraint differs in template redeclaration">;
2837def err_template_template_parameter_not_at_least_as_constrained : Error<
2838  "template template argument %0 is more constrained than template template "
2839  "parameter %1">;
2840
2841def err_type_constraint_non_type_concept : Error<
2842  "concept named in type constraint is not a type concept">;
2843def err_type_constraint_missing_arguments : Error<
2844  "%0 requires more than 1 template argument; provide the remaining arguments "
2845  "explicitly to use it here">;
2846def err_placeholder_constraints_not_satisfied : Error<
2847  "deduced type %0 does not satisfy %1">;
2848
2849// C++11 char16_t/char32_t
2850def warn_cxx98_compat_unicode_type : Warning<
2851  "'%0' type specifier is incompatible with C++98">,
2852  InGroup<CXX98Compat>, DefaultIgnore;
2853def warn_cxx17_compat_unicode_type : Warning<
2854  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2855  InGroup<CXXPre20Compat>, DefaultIgnore;
2856
2857// __make_integer_seq
2858def err_integer_sequence_negative_length : Error<
2859  "integer sequences must have non-negative sequence length">;
2860def err_integer_sequence_integral_element_type : Error<
2861  "integer sequences must have integral element type">;
2862
2863// __type_pack_element
2864def err_type_pack_element_out_of_bounds : Error<
2865  "a parameter pack may not be accessed at an out of bounds index">;
2866
2867// Objective-C++
2868def err_objc_decls_may_only_appear_in_global_scope : Error<
2869  "Objective-C declarations may only appear in global scope">;
2870def warn_auto_var_is_id : Warning<
2871  "'auto' deduced as 'id' in declaration of %0">,
2872  InGroup<DiagGroup<"auto-var-id">>;
2873
2874// Attributes
2875def warn_nomerge_attribute_ignored_in_stmt: Warning<
2876  "%0 attribute is ignored because there exists no call expression inside the "
2877  "statement">,
2878  InGroup<IgnoredAttributes>;
2879
2880def err_musttail_needs_trivial_args : Error<
2881  "tail call requires that the return value, all parameters, and any "
2882  "temporaries created by the expression are trivially destructible">;
2883def err_musttail_needs_call : Error<
2884  "%0 attribute requires that the return value is the result of a function call"
2885  >;
2886def err_musttail_needs_prototype : Error<
2887  "%0 attribute requires that both caller and callee functions have a "
2888  "prototype">;
2889def note_musttail_fix_non_prototype : Note<
2890  "add 'void' to the parameter list to turn an old-style K&R function "
2891  "declaration into a prototype">;
2892def err_musttail_structors_forbidden : Error<"cannot perform a tail call "
2893  "%select{from|to}0 a %select{constructor|destructor}1">;
2894def note_musttail_structors_forbidden : Note<"target "
2895  "%select{constructor|destructor}0 is declared here">;
2896def err_musttail_forbidden_from_this_context : Error<
2897  "%0 attribute cannot be used from "
2898  "%select{a block|an Objective-C function|this context}1">;
2899def err_musttail_member_mismatch : Error<
2900  "%select{non-member|static member|non-static member}0 "
2901  "function cannot perform a tail call to "
2902  "%select{non-member|static member|non-static member|pointer-to-member}1 "
2903  "function%select{| %3}2">;
2904def note_musttail_callee_defined_here : Note<"%0 declared here">;
2905def note_tail_call_required : Note<"tail call required by %0 attribute here">;
2906def err_musttail_mismatch : Error<
2907  "cannot perform a tail call to function%select{| %1}0 because its signature "
2908  "is incompatible with the calling function">;
2909def note_musttail_mismatch : Note<
2910    "target function "
2911    "%select{is a member of different class%diff{ (expected $ but has $)|}1,2"
2912    "|has different number of parameters (expected %1 but has %2)"
2913    "|has type mismatch at %ordinal3 parameter"
2914    "%diff{ (expected $ but has $)|}1,2"
2915    "|has different return type%diff{ ($ expected but has $)|}1,2}0">;
2916def err_musttail_callconv_mismatch : Error<
2917  "cannot perform a tail call to function%select{| %1}0 because it uses an "
2918  "incompatible calling convention">;
2919def note_musttail_callconv_mismatch : Note<
2920  "target function has calling convention %1 (expected %0)">;
2921def err_musttail_scope : Error<
2922  "cannot perform a tail call from this return statement">;
2923def err_musttail_no_variadic : Error<
2924  "%0 attribute may not be used with variadic functions">;
2925
2926def err_nsobject_attribute : Error<
2927  "'NSObject' attribute is for pointer types only">;
2928def err_attributes_are_not_compatible : Error<
2929  "%0 and %1 attributes are not compatible">;
2930def err_attribute_invalid_argument : Error<
2931  "%select{a reference type|an array type|a non-vector or "
2932  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
2933def err_attribute_wrong_number_arguments : Error<
2934  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2935  ":requires exactly %1 arguments}1">;
2936def err_attribute_too_many_arguments : Error<
2937  "%0 attribute takes no more than %1 argument%s1">;
2938def err_attribute_too_few_arguments : Error<
2939  "%0 attribute takes at least %1 argument%s1">;
2940def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2941def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
2942def err_attribute_bad_neon_vector_size : Error<
2943  "Neon vector size must be 64 or 128 bits">;
2944def err_attribute_invalid_sve_type : Error<
2945  "%0 attribute applied to non-SVE type %1">;
2946def err_attribute_bad_sve_vector_size : Error<
2947  "invalid SVE vector size '%0', must match value set by "
2948  "'-msve-vector-bits' ('%1')">;
2949def err_attribute_arm_feature_sve_bits_unsupported : Error<
2950  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
2951  "value of 128, 256, 512, 1024 or 2048.">;
2952def err_attribute_requires_positive_integer : Error<
2953  "%0 attribute requires a %select{positive|non-negative}1 "
2954  "integral compile time constant expression">;
2955def err_attribute_requires_opencl_version : Error<
2956  "%0 attribute requires OpenCL version %1%select{| or above}2">;
2957def err_invalid_branch_protection_spec : Error<
2958  "invalid or misplaced branch protection specification '%0'">;
2959def warn_unsupported_target_attribute
2960    : Warning<"%select{unsupported|duplicate|unknown}0%select{| architecture|"
2961              " tune CPU}1 '%2' in the 'target' attribute string; 'target' "
2962              "attribute ignored">,
2963      InGroup<IgnoredAttributes>;
2964def err_attribute_unsupported
2965    : Error<"%0 attribute is not supported on targets missing %1;"
2966            " specify an appropriate -march= or -mcpu=">;
2967// The err_*_attribute_argument_not_int are separate because they're used by
2968// VerifyIntegerConstantExpression.
2969def err_aligned_attribute_argument_not_int : Error<
2970  "'aligned' attribute requires integer constant">;
2971def err_align_value_attribute_argument_not_int : Error<
2972  "'align_value' attribute requires integer constant">;
2973def err_alignas_attribute_wrong_decl_type : Error<
2974  "%0 attribute cannot be applied to a %select{function parameter|"
2975  "variable with 'register' storage class|'catch' variable|bit-field}1">;
2976def err_alignas_missing_on_definition : Error<
2977  "%0 must be specified on definition if it is specified on any declaration">;
2978def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2979def err_alignas_mismatch : Error<
2980  "redeclaration has different alignment requirement (%1 vs %0)">;
2981def err_alignas_underaligned : Error<
2982  "requested alignment is less than minimum alignment of %1 for type %0">;
2983def err_attribute_sizeless_type : Error<
2984  "%0 attribute cannot be applied to sizeless type %1">;
2985def err_attribute_argument_n_type : Error<
2986  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2987  "constant|a string|an identifier|a constant expression}2">;
2988def err_attribute_argument_type : Error<
2989  "%0 attribute requires %select{int or bool|an integer "
2990  "constant|a string|an identifier}1">;
2991def err_attribute_argument_out_of_range : Error<
2992  "%0 attribute requires integer constant between %1 and %2 inclusive">;
2993def err_init_priority_object_attr : Error<
2994  "can only use 'init_priority' attribute on file-scope definitions "
2995  "of objects of class type">;
2996def err_attribute_argument_out_of_bounds : Error<
2997  "%0 attribute parameter %1 is out of bounds">;
2998def err_attribute_only_once_per_parameter : Error<
2999  "%0 attribute can only be applied once per parameter">;
3000def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
3001def note_previous_uuid : Note<"previous uuid specified here">;
3002def warn_attribute_pointers_only : Warning<
3003  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
3004  InGroup<IgnoredAttributes>;
3005def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
3006def err_attribute_integers_only : Error<
3007  "%0 attribute argument may only refer to a function parameter of integer "
3008  "type">;
3009def warn_attribute_return_pointers_only : Warning<
3010  "%0 attribute only applies to return values that are pointers">,
3011  InGroup<IgnoredAttributes>;
3012def warn_attribute_return_pointers_refs_only : Warning<
3013  "%0 attribute only applies to return values that are pointers or references">,
3014  InGroup<IgnoredAttributes>;
3015def warn_attribute_pointer_or_reference_only : Warning<
3016  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
3017  InGroup<IgnoredAttributes>;
3018def err_attribute_no_member_pointers : Error<
3019  "%0 attribute cannot be used with pointers to members">;
3020def err_attribute_invalid_implicit_this_argument : Error<
3021  "%0 attribute is invalid for the implicit this argument">;
3022def err_ownership_type : Error<
3023  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
3024def err_ownership_returns_index_mismatch : Error<
3025  "'ownership_returns' attribute index does not match; here it is %0">;
3026def note_ownership_returns_index_mismatch : Note<
3027  "declared with index %0 here">;
3028def err_format_strftime_third_parameter : Error<
3029  "strftime format attribute requires 3rd parameter to be 0">;
3030def err_format_attribute_requires_variadic : Error<
3031  "format attribute requires variadic function">;
3032def err_format_attribute_not : Error<"format argument not %0">;
3033def err_format_attribute_result_not : Error<"function does not return %0">;
3034def err_format_attribute_implicit_this_format_string : Error<
3035  "format attribute cannot specify the implicit this argument as the format "
3036  "string">;
3037def err_callback_attribute_no_callee : Error<
3038  "'callback' attribute specifies no callback callee">;
3039def err_callback_attribute_invalid_callee : Error<
3040  "'callback' attribute specifies invalid callback callee">;
3041def err_callback_attribute_multiple : Error<
3042  "multiple 'callback' attributes specified">;
3043def err_callback_attribute_argument_unknown : Error<
3044  "'callback' attribute argument %0 is not a known function parameter">;
3045def err_callback_callee_no_function_type : Error<
3046  "'callback' attribute callee does not have function type">;
3047def err_callback_callee_is_variadic : Error<
3048  "'callback' attribute callee may not be variadic">;
3049def err_callback_implicit_this_not_available : Error<
3050  "'callback' argument at position %0 references unavailable implicit 'this'">;
3051def err_init_method_bad_return_type : Error<
3052  "init methods must return an object pointer type, not %0">;
3053def err_attribute_invalid_size : Error<
3054  "vector size not an integral multiple of component size">;
3055def err_attribute_zero_size : Error<"zero %0 size">;
3056def err_attribute_size_too_large : Error<"%0 size too large">;
3057def err_typecheck_sve_ambiguous : Error<
3058  "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">;
3059def err_typecheck_sve_gnu_ambiguous : Error<
3060  "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">;
3061def err_typecheck_vector_not_convertable_implict_truncation : Error<
3062   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
3063   " %2 as implicit conversion would cause truncation">;
3064def err_typecheck_vector_not_convertable : Error<
3065  "cannot convert between vector values of different size (%0 and %1)">;
3066def err_typecheck_vector_not_convertable_non_scalar : Error<
3067  "cannot convert between vector and non-scalar values (%0 and %1)">;
3068def err_typecheck_vector_lengths_not_equal : Error<
3069  "vector operands do not have the same number of elements (%0 and %1)">;
3070def warn_typecheck_vector_element_sizes_not_equal : Warning<
3071  "vector operands do not have the same elements sizes (%0 and %1)">,
3072  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
3073def err_ext_vector_component_exceeds_length : Error<
3074  "vector component access exceeds type %0">;
3075def err_ext_vector_component_name_illegal : Error<
3076  "illegal vector component name '%0'">;
3077def err_attribute_address_space_negative : Error<
3078  "address space is negative">;
3079def err_attribute_address_space_too_high : Error<
3080  "address space is larger than the maximum supported (%0)">;
3081def err_attribute_address_multiple_qualifiers : Error<
3082  "multiple address spaces specified for type">;
3083def warn_attribute_address_multiple_identical_qualifiers : Warning<
3084  "multiple identical address spaces specified for type">,
3085  InGroup<DuplicateDeclSpecifier>;
3086def err_attribute_not_clinkage : Error<
3087  "function type with %0 attribute must have C linkage">;
3088def err_function_decl_cmse_ns_call : Error<
3089  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
3090def err_attribute_address_function_type : Error<
3091  "function type may not be qualified with an address space">;
3092def err_as_qualified_auto_decl : Error<
3093  "automatic variable qualified with an%select{| invalid}0 address space">;
3094def err_arg_with_address_space : Error<
3095  "parameter may not be qualified with an address space">;
3096def err_field_with_address_space : Error<
3097  "field may not be qualified with an address space">;
3098def err_compound_literal_with_address_space : Error<
3099  "compound literal in function scope may not be qualified with an address space">;
3100def err_address_space_mismatch_templ_inst : Error<
3101  "conflicting address space qualifiers are provided between types %0 and %1">;
3102def err_attr_objc_ownership_redundant : Error<
3103  "the type %0 is already explicitly ownership-qualified">;
3104def err_invalid_nsnumber_type : Error<
3105  "%0 is not a valid literal type for NSNumber">;
3106def err_objc_illegal_boxed_expression_type : Error<
3107  "illegal type %0 used in a boxed expression">;
3108def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3109  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3110def err_objc_incomplete_boxed_expression_type : Error<
3111  "incomplete type %0 used in a boxed expression">;
3112def err_undeclared_objc_literal_class : Error<
3113  "definition of class %0 must be available to use Objective-C "
3114  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3115  "string literals}1">;
3116def err_undeclared_boxing_method : Error<
3117  "declaration of %0 is missing in %1 class">;
3118def err_objc_literal_method_sig : Error<
3119  "literal construction method %0 has incompatible signature">;
3120def note_objc_literal_method_param : Note<
3121  "%select{first|second|third}0 parameter has unexpected type %1 "
3122  "(should be %2)">;
3123def note_objc_literal_method_return : Note<
3124  "method returns unexpected type %0 (should be an object type)">;
3125def err_invalid_collection_element : Error<
3126  "collection element of type %0 is not an Objective-C object">;
3127def err_box_literal_collection : Error<
3128  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3129  "in a collection">;
3130def warn_objc_literal_comparison : Warning<
3131  "direct comparison of %select{an array literal|a dictionary literal|"
3132  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3133  InGroup<ObjCLiteralComparison>;
3134def err_missing_atsign_prefix : Error<
3135  "%select{string|numeric}0 literal must be prefixed by '@'">;
3136def warn_objc_string_literal_comparison : Warning<
3137  "direct comparison of a string literal has undefined behavior">,
3138  InGroup<ObjCStringComparison>;
3139def warn_concatenated_literal_array_init : Warning<
3140  "suspicious concatenation of string literals in an array initialization; "
3141  "did you mean to separate the elements with a comma?">,
3142  InGroup<StringConcatation>, DefaultIgnore;
3143def warn_concatenated_nsarray_literal : Warning<
3144  "concatenated NSString literal for an NSArray expression - "
3145  "possibly missing a comma">,
3146  InGroup<ObjCStringConcatenation>;
3147def note_objc_literal_comparison_isequal : Note<
3148  "use 'isEqual:' instead">;
3149def warn_objc_collection_literal_element : Warning<
3150  "object of type %0 is not compatible with "
3151  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3152  InGroup<ObjCLiteralConversion>;
3153def warn_nsdictionary_duplicate_key : Warning<
3154  "duplicate key in dictionary literal">,
3155  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3156def note_nsdictionary_duplicate_key_here : Note<
3157  "previous equal key is here">;
3158def err_swift_param_attr_not_swiftcall : Error<
3159  "'%0' parameter can only be used with swiftcall%select{ or swiftasynccall|}1 "
3160  "calling convention%select{|s}1">;
3161def err_swift_indirect_result_not_first : Error<
3162  "'swift_indirect_result' parameters must be first parameters of function">;
3163def err_swift_error_result_not_after_swift_context : Error<
3164  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3165def err_swift_abi_parameter_wrong_type : Error<
3166  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3167  "type here is %2">;
3168
3169def err_attribute_argument_invalid : Error<
3170  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3171  "min must not be greater than max}1">;
3172def err_attribute_argument_is_zero : Error<
3173  "%0 attribute must be greater than 0">;
3174def warn_attribute_argument_n_negative : Warning<
3175  "%0 attribute parameter %1 is negative and will be ignored">,
3176  InGroup<CudaCompat>;
3177def err_property_function_in_objc_container : Error<
3178  "use of Objective-C property in function nested in Objective-C "
3179  "container not supported, move function outside its container">;
3180
3181let CategoryName = "Cocoa API Issue" in {
3182def warn_objc_redundant_literal_use : Warning<
3183  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3184}
3185
3186def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3187  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3188
3189def err_aix_attr_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
3190
3191def err_tls_var_aligned_over_maximum : Error<
3192  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3193  "alignment (%2) for a thread-local variable on this target">;
3194
3195def err_only_annotate_after_access_spec : Error<
3196  "access specifier can only have annotation attributes">;
3197
3198def err_attribute_section_invalid_for_target : Error<
3199  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3200def err_pragma_section_invalid_for_target : Error<
3201  "argument to #pragma section is not valid for this target: %0">;
3202def warn_attribute_section_drectve : Warning<
3203  "#pragma %0(\".drectve\") has undefined behavior, "
3204  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3205def warn_mismatched_section : Warning<
3206  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3207def warn_attribute_section_on_redeclaration : Warning<
3208  "section attribute is specified on redeclared variable">, InGroup<Section>;
3209def err_mismatched_code_seg_base : Error<
3210  "derived class must specify the same code segment as its base classes">;
3211def err_mismatched_code_seg_override : Error<
3212  "overriding virtual function must specify the same code segment as its overridden function">;
3213def err_conflicting_codeseg_attribute : Error<
3214  "conflicting code segment specifiers">;
3215def warn_duplicate_codeseg_attribute : Warning<
3216  "duplicate code segment specifiers">, InGroup<Section>;
3217
3218def err_anonymous_property: Error<
3219  "anonymous property is not supported">;
3220def err_property_is_variably_modified : Error<
3221  "property %0 has a variably modified type">;
3222def err_no_accessor_for_property : Error<
3223  "no %select{getter|setter}0 defined for property %1">;
3224def err_cannot_find_suitable_accessor : Error<
3225  "cannot find suitable %select{getter|setter}0 for property %1">;
3226
3227def warn_alloca : Warning<
3228  "use of function %0 is discouraged; there is no way to check for failure but "
3229  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3230  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3231
3232def warn_alloca_align_alignof : Warning<
3233  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3234  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3235
3236def err_alignment_too_small : Error<
3237  "requested alignment must be %0 or greater">;
3238def err_alignment_too_big : Error<
3239  "requested alignment must be %0 or smaller">;
3240def err_alignment_not_power_of_two : Error<
3241  "requested alignment is not a power of 2">;
3242def warn_alignment_not_power_of_two : Warning<
3243  err_alignment_not_power_of_two.Text>,
3244  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3245def err_alignment_dependent_typedef_name : Error<
3246  "requested alignment is dependent but declaration is not dependent">;
3247
3248def warn_alignment_builtin_useless : Warning<
3249  "%select{aligning a value|the result of checking whether a value is aligned}0"
3250  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3251def err_attribute_aligned_too_great : Error<
3252  "requested alignment must be %0 bytes or smaller">;
3253def warn_assume_aligned_too_great
3254    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3255              "alignment assumed">,
3256      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3257def warn_not_xl_compatible
3258    : Warning<"requesting an alignment of 16 bytes or greater for struct"
3259              " members is not binary compatible with AIX XL 16.1 and older">,
3260      InGroup<AIXCompat>;
3261def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3262  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3263  InGroup<MicrosoftInconsistentDllImport>;
3264def warn_redeclaration_without_import_attribute : Warning<
3265  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3266  InGroup<MicrosoftInconsistentDllImport>;
3267def warn_dllimport_dropped_from_inline_function : Warning<
3268  "%q0 redeclared inline; %1 attribute ignored">,
3269  InGroup<IgnoredAttributes>;
3270def warn_attribute_ignored : Warning<"%0 attribute ignored">,
3271  InGroup<IgnoredAttributes>;
3272def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3273  " exception specification; attribute ignored">,
3274  InGroup<IgnoredAttributes>;
3275def warn_attribute_ignored_on_non_definition :
3276  Warning<"%0 attribute ignored on a non-definition declaration">,
3277  InGroup<IgnoredAttributes>;
3278def warn_attribute_ignored_on_inline :
3279  Warning<"%0 attribute ignored on inline function">,
3280  InGroup<IgnoredAttributes>;
3281def warn_nocf_check_attribute_ignored :
3282  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3283  InGroup<IgnoredAttributes>;
3284def warn_attribute_after_definition_ignored : Warning<
3285  "attribute %0 after definition is ignored">,
3286   InGroup<IgnoredAttributes>;
3287def warn_attributes_likelihood_ifstmt_conflict
3288    : Warning<"conflicting attributes %0 are ignored">,
3289      InGroup<IgnoredAttributes>;
3290def warn_cxx11_gnu_attribute_on_type : Warning<
3291  "attribute %0 ignored, because it cannot be applied to a type">,
3292  InGroup<IgnoredAttributes>;
3293def warn_unhandled_ms_attribute_ignored : Warning<
3294  "__declspec attribute %0 is not supported">,
3295  InGroup<IgnoredAttributes>;
3296def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3297  "attribute %0 has no effect when annotating an infinite loop">,
3298   InGroup<IgnoredAttributes>;
3299def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3300  "annotating the infinite loop here">;
3301def warn_attribute_has_no_effect_on_if_constexpr : Warning<
3302  "attribute %0 has no effect when annotating an 'if constexpr' statement">,
3303   InGroup<IgnoredAttributes>;
3304def note_attribute_has_no_effect_on_if_constexpr_here : Note<
3305  "annotating the 'if constexpr' statement here">;
3306def err_decl_attribute_invalid_on_stmt : Error<
3307  "%0 attribute cannot be applied to a statement">;
3308def err_stmt_attribute_invalid_on_decl : Error<
3309  "%0 attribute cannot be applied to a declaration">;
3310def warn_declspec_attribute_ignored : Warning<
3311  "attribute %0 is ignored, place it after "
3312  "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
3313  "type declaration">, InGroup<IgnoredAttributes>;
3314def warn_attribute_precede_definition : Warning<
3315  "attribute declaration must precede definition">,
3316  InGroup<IgnoredAttributes>;
3317def warn_attribute_void_function_method : Warning<
3318  "attribute %0 cannot be applied to "
3319  "%select{functions|Objective-C method}1 without return value">,
3320  InGroup<IgnoredAttributes>;
3321def warn_attribute_weak_on_field : Warning<
3322  "__weak attribute cannot be specified on a field declaration">,
3323  InGroup<IgnoredAttributes>;
3324def warn_gc_attribute_weak_on_local : Warning<
3325  "Objective-C GC does not allow weak variables on the stack">,
3326  InGroup<IgnoredAttributes>;
3327def warn_nsobject_attribute : Warning<
3328  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3329  InGroup<NSobjectAttribute>;
3330def warn_independentclass_attribute : Warning<
3331  "'objc_independent_class' attribute may be put on a typedef only; "
3332  "attribute is ignored">,
3333  InGroup<IndependentClassAttribute>;
3334def warn_ptr_independentclass_attribute : Warning<
3335  "'objc_independent_class' attribute may be put on Objective-C object "
3336  "pointer type only; attribute is ignored">,
3337  InGroup<IndependentClassAttribute>;
3338def warn_attribute_weak_on_local : Warning<
3339  "__weak attribute cannot be specified on an automatic variable when ARC "
3340  "is not enabled">,
3341  InGroup<IgnoredAttributes>;
3342def warn_weak_identifier_undeclared : Warning<
3343  "weak identifier %0 never declared">;
3344def warn_attribute_cmse_entry_static : Warning<
3345  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3346  InGroup<IgnoredAttributes>;
3347def warn_cmse_nonsecure_union : Warning<
3348  "passing union across security boundary via %select{parameter %1|return value}0 "
3349  "may leak information">,
3350  InGroup<DiagGroup<"cmse-union-leak">>;
3351def err_attribute_weak_static : Error<
3352  "weak declaration cannot have internal linkage">;
3353def err_attribute_selectany_non_extern_data : Error<
3354  "'selectany' can only be applied to data items with external linkage">;
3355def err_declspec_thread_on_thread_variable : Error<
3356  "'__declspec(thread)' applied to variable that already has a "
3357  "thread-local storage specifier">;
3358def err_attribute_dll_not_extern : Error<
3359  "%q0 must have external linkage when declared %q1">;
3360def err_attribute_dll_thread_local : Error<
3361  "%q0 cannot be thread local when declared %q1">;
3362def err_attribute_dll_lambda : Error<
3363  "lambda cannot be declared %0">;
3364def warn_attribute_invalid_on_definition : Warning<
3365  "'%0' attribute cannot be specified on a definition">,
3366  InGroup<IgnoredAttributes>;
3367def err_attribute_dll_redeclaration : Error<
3368  "redeclaration of %q0 cannot add %q1 attribute">;
3369def warn_attribute_dll_redeclaration : Warning<
3370  "redeclaration of %q0 should not add %q1 attribute">,
3371  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3372def err_attribute_dllimport_function_definition : Error<
3373  "dllimport cannot be applied to non-inline function definition">;
3374def err_attribute_dll_deleted : Error<
3375  "attribute %q0 cannot be applied to a deleted function">;
3376def err_attribute_dllimport_data_definition : Error<
3377  "definition of dllimport data">;
3378def err_attribute_dllimport_static_field_definition : Error<
3379  "definition of dllimport static field not allowed">;
3380def warn_attribute_dllimport_static_field_definition : Warning<
3381  "definition of dllimport static field">,
3382  InGroup<DiagGroup<"dllimport-static-field-def">>;
3383def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3384  "explicit instantiation declaration should not be 'dllexport'">,
3385  InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
3386def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3387  "'dllexport' attribute ignored on explicit instantiation definition">,
3388  InGroup<IgnoredAttributes>;
3389def warn_invalid_initializer_from_system_header : Warning<
3390  "invalid constructor from class in system header, should not be explicit">,
3391  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3392def note_used_in_initialization_here : Note<"used in initialization here">;
3393def err_attribute_dll_member_of_dll_class : Error<
3394  "attribute %q0 cannot be applied to member of %q1 class">;
3395def warn_attribute_dll_instantiated_base_class : Warning<
3396  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3397  "base class template without dll attribute is not supported">,
3398  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3399def err_attribute_dll_ambiguous_default_ctor : Error<
3400  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3401def err_attribute_weakref_not_static : Error<
3402  "weakref declaration must have internal linkage">;
3403def err_attribute_weakref_not_global_context : Error<
3404  "weakref declaration of %0 must be in a global context">;
3405def err_attribute_weakref_without_alias : Error<
3406  "weakref declaration of %0 must also have an alias attribute">;
3407def err_alias_not_supported_on_darwin : Error <
3408  "aliases are not supported on darwin">;
3409def warn_attribute_wrong_decl_type_str : Warning<
3410  "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
3411def err_attribute_wrong_decl_type_str : Error<
3412  warn_attribute_wrong_decl_type_str.Text>;
3413def warn_attribute_wrong_decl_type : Warning<
3414  "%0 attribute only applies to %select{"
3415  "functions"
3416  "|unions"
3417  "|variables and functions"
3418  "|functions and methods"
3419  "|functions, methods and blocks"
3420  "|functions, methods, and parameters"
3421  "|variables"
3422  "|variables and fields"
3423  "|variables, data members and tag types"
3424  "|types and namespaces"
3425  "|variables, functions and classes"
3426  "|kernel functions"
3427  "|non-K&R-style functions}1">,
3428  InGroup<IgnoredAttributes>;
3429def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
3430def warn_type_attribute_wrong_type : Warning<
3431  "'%0' only applies to %select{function|pointer|"
3432  "Objective-C object or block pointer}1 types; type here is %2">,
3433  InGroup<IgnoredAttributes>;
3434def warn_incomplete_encoded_type : Warning<
3435  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3436  InGroup<DiagGroup<"encode-type">>;
3437def warn_gnu_inline_attribute_requires_inline : Warning<
3438  "'gnu_inline' attribute requires function to be marked 'inline',"
3439  " attribute ignored">,
3440  InGroup<IgnoredAttributes>;
3441def warn_gnu_inline_cplusplus_without_extern : Warning<
3442  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3443  " available, this changed in Clang 10">,
3444  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3445def err_attribute_vecreturn_only_vector_member : Error<
3446  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3447def err_attribute_vecreturn_only_pod_record : Error<
3448  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3449def err_cconv_change : Error<
3450  "function declared '%0' here was previously declared "
3451  "%select{'%2'|without calling convention}1">;
3452def warn_cconv_unsupported : Warning<
3453  "%0 calling convention is not supported %select{"
3454  // Use CallingConventionIgnoredReason Enum to specify these.
3455  "for this target"
3456  "|on variadic function"
3457  "|on constructor/destructor"
3458  "|on builtin function"
3459  "}1">,
3460  InGroup<IgnoredAttributes>;
3461def error_cconv_unsupported : Error<warn_cconv_unsupported.Text>;
3462def err_cconv_knr : Error<
3463  "function with no prototype cannot use the %0 calling convention">;
3464def warn_cconv_knr : Warning<
3465  err_cconv_knr.Text>,
3466  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3467def err_cconv_varargs : Error<
3468  "variadic function cannot use %0 calling convention">;
3469def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3470  "attribute was previously declared "
3471  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3472def err_function_attribute_mismatch : Error<
3473  "function declared with %0 attribute "
3474  "was previously declared without the %0 attribute">;
3475def err_objc_precise_lifetime_bad_type : Error<
3476  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3477def warn_objc_precise_lifetime_meaningless : Error<
3478  "objc_precise_lifetime is not meaningful for "
3479  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3480def err_invalid_pcs : Error<"invalid PCS type">;
3481def warn_attribute_not_on_decl : Warning<
3482  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3483def err_base_specifier_attribute : Error<
3484  "%0 attribute cannot be applied to a base specifier">;
3485def err_invalid_attribute_on_virtual_function : Error<
3486  "%0 attribute cannot be applied to virtual functions">;
3487def warn_declspec_allocator_nonpointer : Warning<
3488  "ignoring __declspec(allocator) because the function return type %0 is not "
3489  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3490def err_cconv_incomplete_param_type : Error<
3491  "parameter %0 must have a complete type to use function %1 with the %2 "
3492  "calling convention">;
3493def err_attribute_output_parameter : Error<
3494  "attribute only applies to output parameters">;
3495
3496def ext_cannot_use_trivial_abi : ExtWarn<
3497  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3498def note_cannot_use_trivial_abi_reason : Note<
3499  "'trivial_abi' is disallowed on %0 because %select{"
3500  "its copy constructors and move constructors are all deleted|"
3501  "it is polymorphic|"
3502  "it has a base of a non-trivial class type|it has a virtual base|"
3503  "it has a __weak field|it has a field of a non-trivial class type}1">;
3504
3505// Availability attribute
3506def warn_availability_unknown_platform : Warning<
3507  "unknown platform %0 in availability macro">, InGroup<Availability>;
3508def warn_availability_version_ordering : Warning<
3509  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3510  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3511  "attribute ignored">, InGroup<Availability>;
3512def warn_mismatched_availability: Warning<
3513  "availability does not match previous declaration">, InGroup<Availability>;
3514def warn_mismatched_availability_override : Warning<
3515  "%select{|overriding }4method %select{introduced after|"
3516  "deprecated before|obsoleted before}0 "
3517  "%select{the protocol method it implements|overridden method}4 "
3518  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3519def warn_mismatched_availability_override_unavail : Warning<
3520  "%select{|overriding }1method cannot be unavailable on %0 when "
3521  "%select{the protocol method it implements|its overridden method}1 is "
3522  "available">,
3523  InGroup<Availability>;
3524def warn_availability_on_static_initializer : Warning<
3525  "ignoring availability attribute %select{on '+load' method|"
3526  "with constructor attribute|with destructor attribute}0">,
3527  InGroup<Availability>;
3528def note_overridden_method : Note<
3529  "overridden method is here">;
3530def warn_availability_swift_unavailable_deprecated_only : Warning<
3531  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3532  InGroup<Availability>;
3533def note_protocol_method : Note<
3534  "protocol method is here">;
3535
3536def warn_unguarded_availability :
3537  Warning<"%0 is only available on %1 %2 or newer">,
3538  InGroup<UnguardedAvailability>, DefaultIgnore;
3539def warn_unguarded_availability_new :
3540  Warning<warn_unguarded_availability.Text>,
3541  InGroup<UnguardedAvailabilityNew>;
3542def note_decl_unguarded_availability_silence : Note<
3543  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3544def note_unguarded_available_silence : Note<
3545  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3546  " this warning">;
3547def warn_at_available_unchecked_use : Warning<
3548  "%select{@available|__builtin_available}0 does not guard availability here; "
3549  "use if (%select{@available|__builtin_available}0) instead">,
3550  InGroup<DiagGroup<"unsupported-availability-guard">>;
3551
3552def warn_missing_sdksettings_for_availability_checking : Warning<
3553  "%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
3554  InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
3555
3556// Thread Safety Attributes
3557def warn_thread_attribute_ignored : Warning<
3558  "ignoring %0 attribute because its argument is invalid">,
3559  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3560def warn_thread_attribute_not_on_non_static_member : Warning<
3561  "%0 attribute without capability arguments can only be applied to non-static "
3562  "methods of a class">,
3563  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3564def warn_thread_attribute_not_on_capability_member : Warning<
3565  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3566  "annotated with 'capability' or 'scoped_lockable' attribute">,
3567  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3568def warn_thread_attribute_argument_not_lockable : Warning<
3569  "%0 attribute requires arguments whose type is annotated "
3570  "with 'capability' attribute; type here is %1">,
3571  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3572def warn_thread_attribute_decl_not_lockable : Warning<
3573  "%0 attribute can only be applied in a context annotated "
3574  "with 'capability' attribute">,
3575  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3576def warn_thread_attribute_decl_not_pointer : Warning<
3577  "%0 only applies to pointer types; type here is %1">,
3578  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3579def err_attribute_argument_out_of_bounds_extra_info : Error<
3580  "%0 attribute parameter %1 is out of bounds: "
3581  "%plural{0:no parameters to index into|"
3582  "1:can only be 1, since there is one parameter|"
3583  ":must be between 1 and %2}2">;
3584
3585// Thread Safety Analysis
3586def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3587  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3588def warn_unlock_kind_mismatch : Warning<
3589  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3590  "%select{shared|exclusive}3 access">,
3591  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3592def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3593  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3594def warn_no_unlock : Warning<
3595  "%0 '%1' is still held at the end of function">,
3596  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3597def warn_expecting_locked : Warning<
3598  "expecting %0 '%1' to be held at the end of function">,
3599  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3600// FIXME: improve the error message about locks not in scope
3601def warn_lock_some_predecessors : Warning<
3602  "%0 '%1' is not held on every path through here">,
3603  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3604def warn_expecting_lock_held_on_loop : Warning<
3605  "expecting %0 '%1' to be held at start of each loop">,
3606  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3607def note_locked_here : Note<"%0 acquired here">;
3608def note_unlocked_here : Note<"%0 released here">;
3609def warn_lock_exclusive_and_shared : Warning<
3610  "%0 '%1' is acquired exclusively and shared in the same scope">,
3611  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3612def note_lock_exclusive_and_shared : Note<
3613  "the other acquisition of %0 '%1' is here">;
3614def warn_variable_requires_any_lock : Warning<
3615  "%select{reading|writing}1 variable %0 requires holding "
3616  "%select{any mutex|any mutex exclusively}1">,
3617  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3618def warn_var_deref_requires_any_lock : Warning<
3619  "%select{reading|writing}1 the value pointed to by %0 requires holding "
3620  "%select{any mutex|any mutex exclusively}1">,
3621  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3622def warn_fun_excludes_mutex : Warning<
3623  "cannot call function '%1' while %0 '%2' is held">,
3624  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3625def warn_cannot_resolve_lock : Warning<
3626  "cannot resolve lock expression">,
3627  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3628def warn_acquired_before : Warning<
3629  "%0 '%1' must be acquired before '%2'">,
3630  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3631def warn_acquired_before_after_cycle : Warning<
3632  "Cycle in acquired_before/after dependencies, starting with '%0'">,
3633  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3634
3635
3636// Thread safety warnings negative capabilities
3637def warn_acquire_requires_negative_cap : Warning<
3638  "acquiring %0 '%1' requires negative capability '%2'">,
3639  InGroup<ThreadSafetyNegative>, DefaultIgnore;
3640def warn_fun_requires_negative_cap : Warning<
3641  "calling function %0 requires negative capability '%1'">,
3642  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3643
3644// Thread safety warnings on pass by reference
3645def warn_guarded_pass_by_reference : Warning<
3646  "passing variable %1 by reference requires holding %0 "
3647  "%select{'%2'|'%2' exclusively}3">,
3648  InGroup<ThreadSafetyReference>, DefaultIgnore;
3649def warn_pt_guarded_pass_by_reference : Warning<
3650  "passing the value that %1 points to by reference requires holding %0 "
3651  "%select{'%2'|'%2' exclusively}3">,
3652  InGroup<ThreadSafetyReference>, DefaultIgnore;
3653
3654// Imprecise thread safety warnings
3655def warn_variable_requires_lock : Warning<
3656  "%select{reading|writing}3 variable %1 requires holding %0 "
3657  "%select{'%2'|'%2' exclusively}3">,
3658  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3659def warn_var_deref_requires_lock : Warning<
3660  "%select{reading|writing}3 the value pointed to by %1 requires "
3661  "holding %0 %select{'%2'|'%2' exclusively}3">,
3662  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3663def warn_fun_requires_lock : Warning<
3664  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3665  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3666
3667// Precise thread safety warnings
3668def warn_variable_requires_lock_precise :
3669  Warning<warn_variable_requires_lock.Text>,
3670  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3671def warn_var_deref_requires_lock_precise :
3672  Warning<warn_var_deref_requires_lock.Text>,
3673  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3674def warn_fun_requires_lock_precise :
3675  Warning<warn_fun_requires_lock.Text>,
3676  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3677def note_found_mutex_near_match : Note<"found near match '%0'">;
3678
3679// Verbose thread safety warnings
3680def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
3681  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3682def note_thread_warning_in_fun : Note<"thread warning in function %0">;
3683def note_guarded_by_declared_here : Note<"guarded_by declared here">;
3684
3685// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3686def warn_thread_safety_beta : Warning<"thread safety beta warning">,
3687  InGroup<ThreadSafetyBeta>, DefaultIgnore;
3688
3689// Consumed warnings
3690def warn_use_in_invalid_state : Warning<
3691  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3692  "state">, InGroup<Consumed>, DefaultIgnore;
3693def warn_use_of_temp_in_invalid_state : Warning<
3694  "invalid invocation of method '%0' on a temporary object while it is in the "
3695  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3696def warn_attr_on_unconsumable_class : Warning<
3697  "consumed analysis attribute is attached to member of class %0 which isn't "
3698  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3699def warn_return_typestate_for_unconsumable_type : Warning<
3700  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3701  DefaultIgnore;
3702def warn_return_typestate_mismatch : Warning<
3703  "return value not in expected state; expected '%0', observed '%1'">,
3704  InGroup<Consumed>, DefaultIgnore;
3705def warn_loop_state_mismatch : Warning<
3706  "state of variable '%0' must match at the entry and exit of loop">,
3707  InGroup<Consumed>, DefaultIgnore;
3708def warn_param_return_typestate_mismatch : Warning<
3709  "parameter '%0' not in expected state when the function returns: expected "
3710  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3711def warn_param_typestate_mismatch : Warning<
3712  "argument not in expected state; expected '%0', observed '%1'">,
3713  InGroup<Consumed>, DefaultIgnore;
3714
3715// no_sanitize attribute
3716def warn_unknown_sanitizer_ignored : Warning<
3717  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3718
3719def warn_impcast_vector_scalar : Warning<
3720  "implicit conversion turns vector to scalar: %0 to %1">,
3721  InGroup<Conversion>, DefaultIgnore;
3722def warn_impcast_complex_scalar : Warning<
3723  "implicit conversion discards imaginary component: %0 to %1">,
3724  InGroup<Conversion>, DefaultIgnore;
3725def err_impcast_complex_scalar : Error<
3726  "implicit conversion from %0 to %1 is not permitted in C++">;
3727def warn_impcast_float_precision : Warning<
3728  "implicit conversion loses floating-point precision: %0 to %1">,
3729  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3730def warn_impcast_float_result_precision : Warning<
3731  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3732  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3733def warn_impcast_double_promotion : Warning<
3734  "implicit conversion increases floating-point precision: %0 to %1">,
3735  InGroup<DoublePromotion>, DefaultIgnore;
3736def warn_impcast_integer_sign : Warning<
3737  "implicit conversion changes signedness: %0 to %1">,
3738  InGroup<SignConversion>, DefaultIgnore;
3739def warn_impcast_integer_sign_conditional : Warning<
3740  "operand of ? changes signedness: %0 to %1">,
3741  InGroup<SignConversion>, DefaultIgnore;
3742def warn_impcast_integer_precision : Warning<
3743  "implicit conversion loses integer precision: %0 to %1">,
3744  InGroup<ImplicitIntConversion>, DefaultIgnore;
3745def warn_impcast_high_order_zero_bits : Warning<
3746  "higher order bits are zeroes after implicit conversion">,
3747  InGroup<ImplicitIntConversion>, DefaultIgnore;
3748def warn_impcast_nonnegative_result : Warning<
3749  "the resulting value is always non-negative after implicit conversion">,
3750  InGroup<SignConversion>, DefaultIgnore;
3751def warn_impcast_integer_64_32 : Warning<
3752  "implicit conversion loses integer precision: %0 to %1">,
3753  InGroup<Shorten64To32>, DefaultIgnore;
3754def warn_impcast_integer_precision_constant : Warning<
3755  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3756  InGroup<ConstantConversion>;
3757def warn_impcast_bitfield_precision_constant : Warning<
3758  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3759  InGroup<BitFieldConstantConversion>;
3760def warn_impcast_constant_value_to_objc_bool : Warning<
3761  "implicit conversion from constant value %0 to 'BOOL'; "
3762  "the only well defined values for 'BOOL' are YES and NO">,
3763  InGroup<ObjCBoolConstantConversion>;
3764
3765def warn_impcast_fixed_point_range : Warning<
3766  "implicit conversion from %0 cannot fit within the range of values for %1">,
3767  InGroup<ImplicitFixedPointConversion>;
3768
3769def warn_impcast_literal_float_to_integer : Warning<
3770  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3771  InGroup<LiteralConversion>;
3772def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3773  "implicit conversion of out of range value from %0 to %1 is undefined">,
3774  InGroup<LiteralConversion>;
3775def warn_impcast_float_integer : Warning<
3776  "implicit conversion turns floating-point number into integer: %0 to %1">,
3777  InGroup<FloatConversion>, DefaultIgnore;
3778def warn_impcast_float_to_objc_signed_char_bool : Warning<
3779  "implicit conversion from floating-point type %0 to 'BOOL'">,
3780  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
3781def warn_impcast_int_to_objc_signed_char_bool : Warning<
3782  "implicit conversion from integral type %0 to 'BOOL'">,
3783  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
3784
3785// Implicit int -> float conversion precision loss warnings.
3786def warn_impcast_integer_float_precision : Warning<
3787  "implicit conversion from %0 to %1 may lose precision">,
3788  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
3789def warn_impcast_integer_float_precision_constant : Warning<
3790  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3791  InGroup<ImplicitConstIntFloatConversion>;
3792
3793def warn_impcast_float_to_integer : Warning<
3794  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3795  InGroup<FloatOverflowConversion>, DefaultIgnore;
3796def warn_impcast_float_to_integer_out_of_range : Warning<
3797  "implicit conversion of out of range value from %0 to %1 is undefined">,
3798  InGroup<FloatOverflowConversion>, DefaultIgnore;
3799def warn_impcast_float_to_integer_zero : Warning<
3800  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3801  InGroup<FloatZeroConversion>, DefaultIgnore;
3802
3803def warn_impcast_string_literal_to_bool : Warning<
3804  "implicit conversion turns string literal into bool: %0 to %1">,
3805  InGroup<StringConversion>, DefaultIgnore;
3806def warn_impcast_different_enum_types : Warning<
3807  "implicit conversion from enumeration type %0 to different enumeration type "
3808  "%1">, InGroup<EnumConversion>;
3809def warn_impcast_bool_to_null_pointer : Warning<
3810    "initialization of pointer of type %0 to null from a constant boolean "
3811    "expression">, InGroup<BoolConversion>;
3812def warn_non_literal_null_pointer : Warning<
3813    "expression which evaluates to zero treated as a null pointer constant of "
3814    "type %0">, InGroup<NonLiteralNullConversion>;
3815def warn_pointer_compare : Warning<
3816    "comparing a pointer to a null character constant; did you mean "
3817    "to compare to %select{NULL|(void *)0}0?">,
3818    InGroup<DiagGroup<"pointer-compare">>;
3819def warn_impcast_null_pointer_to_integer : Warning<
3820    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3821    InGroup<NullConversion>;
3822def warn_impcast_floating_point_to_bool : Warning<
3823    "implicit conversion turns floating-point number into bool: %0 to %1">,
3824    InGroup<ImplicitConversionFloatingPointToBool>;
3825def ext_ms_impcast_fn_obj : ExtWarn<
3826  "implicit conversion between pointer-to-function and pointer-to-object is a "
3827  "Microsoft extension">, InGroup<MicrosoftCast>;
3828
3829def warn_impcast_pointer_to_bool : Warning<
3830    "address of%select{| function| array}0 '%1' will always evaluate to "
3831    "'true'">,
3832    InGroup<PointerBoolConversion>;
3833def warn_cast_nonnull_to_bool : Warning<
3834    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3835    "'true' on first encounter">,
3836    InGroup<PointerBoolConversion>;
3837def warn_this_bool_conversion : Warning<
3838  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3839  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3840def warn_address_of_reference_bool_conversion : Warning<
3841  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3842  "code; pointer may be assumed to always convert to true">,
3843  InGroup<UndefinedBoolConversion>;
3844
3845def warn_xor_used_as_pow : Warning<
3846  "result of '%0' is %1; did you mean exponentiation?">,
3847  InGroup<XorUsedAsPow>;
3848def warn_xor_used_as_pow_base_extra : Warning<
3849  "result of '%0' is %1; did you mean '%2' (%3)?">,
3850  InGroup<XorUsedAsPow>;
3851def warn_xor_used_as_pow_base : Warning<
3852  "result of '%0' is %1; did you mean '%2'?">,
3853  InGroup<XorUsedAsPow>;
3854def note_xor_used_as_pow_silence : Note<
3855  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
3856
3857def warn_null_pointer_compare : Warning<
3858    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3859    "equal to a null pointer is always %select{true|false}2">,
3860    InGroup<TautologicalPointerCompare>;
3861def warn_nonnull_expr_compare : Warning<
3862    "comparison of nonnull %select{function call|parameter}0 '%1' "
3863    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3864    "encounter">,
3865    InGroup<TautologicalPointerCompare>;
3866def warn_this_null_compare : Warning<
3867  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3868  "assumed to always evaluate to %select{true|false}0">,
3869  InGroup<TautologicalUndefinedCompare>;
3870def warn_address_of_reference_null_compare : Warning<
3871  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3872  "code; comparison may be assumed to always evaluate to "
3873  "%select{true|false}0">,
3874  InGroup<TautologicalUndefinedCompare>;
3875def note_reference_is_return_value : Note<"%0 returns a reference">;
3876
3877def note_pointer_declared_here : Note<
3878  "pointer %0 declared here">;
3879def warn_division_sizeof_ptr : Warning<
3880  "'%0' will return the size of the pointer, not the array itself">,
3881  InGroup<DiagGroup<"sizeof-pointer-div">>;
3882def warn_division_sizeof_array : Warning<
3883  "expression does not compute the number of elements in this array; element "
3884  "type is %0, not %1">,
3885  InGroup<DiagGroup<"sizeof-array-div">>;
3886
3887def note_function_warning_silence : Note<
3888    "prefix with the address-of operator to silence this warning">;
3889def note_function_to_function_call : Note<
3890    "suffix with parentheses to turn this into a function call">;
3891def warn_impcast_objective_c_literal_to_bool : Warning<
3892    "implicit boolean conversion of Objective-C object literal always "
3893    "evaluates to true">,
3894    InGroup<ObjCLiteralConversion>;
3895
3896def warn_cast_align : Warning<
3897  "cast from %0 to %1 increases required alignment from %2 to %3">,
3898  InGroup<CastAlign>, DefaultIgnore;
3899def warn_old_style_cast : Warning<
3900  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3901
3902// Separate between casts to void* and non-void* pointers.
3903// Some APIs use (abuse) void* for something like a user context,
3904// and often that value is an integer even if it isn't a pointer itself.
3905// Having a separate warning flag allows users to control the warning
3906// for their workflow.
3907def warn_int_to_pointer_cast : Warning<
3908  "cast to %1 from smaller integer type %0">,
3909  InGroup<IntToPointerCast>;
3910def warn_int_to_void_pointer_cast : Warning<
3911  "cast to %1 from smaller integer type %0">,
3912  InGroup<IntToVoidPointerCast>;
3913def warn_pointer_to_int_cast : Warning<
3914  "cast to smaller integer type %1 from %0">,
3915  InGroup<PointerToIntCast>;
3916def warn_pointer_to_enum_cast : Warning<
3917  warn_pointer_to_int_cast.Text>,
3918  InGroup<PointerToEnumCast>;
3919def warn_void_pointer_to_int_cast : Warning<
3920  "cast to smaller integer type %1 from %0">,
3921  InGroup<VoidPointerToIntCast>;
3922def warn_void_pointer_to_enum_cast : Warning<
3923  warn_void_pointer_to_int_cast.Text>,
3924  InGroup<VoidPointerToEnumCast>;
3925
3926def warn_attribute_ignored_for_field_of_type : Warning<
3927  "%0 attribute ignored for field of type %1">,
3928  InGroup<IgnoredAttributes>;
3929def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3930  "enums in the Microsoft ABI are signed integers by default; consider giving "
3931  "the enum %0 an unsigned underlying type to make this code portable">,
3932  InGroup<SignedEnumBitfield>, DefaultIgnore;
3933def warn_attribute_packed_for_bitfield : Warning<
3934  "'packed' attribute was ignored on bit-fields with single-byte alignment "
3935  "in older versions of GCC and Clang">,
3936  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3937def warn_transparent_union_attribute_field_size_align : Warning<
3938  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3939  "%select{alignment|size}0 of the first field in transparent union; "
3940  "transparent_union attribute ignored">,
3941  InGroup<IgnoredAttributes>;
3942def note_transparent_union_first_field_size_align : Note<
3943  "%select{alignment|size}0 of first field is %1 bits">;
3944def warn_transparent_union_attribute_not_definition : Warning<
3945  "transparent_union attribute can only be applied to a union definition; "
3946  "attribute ignored">,
3947  InGroup<IgnoredAttributes>;
3948def warn_transparent_union_attribute_floating : Warning<
3949  "first field of a transparent union cannot have %select{floating point|"
3950  "vector}0 type %1; transparent_union attribute ignored">,
3951  InGroup<IgnoredAttributes>;
3952def warn_transparent_union_attribute_zero_fields : Warning<
3953  "transparent union definition must contain at least one field; "
3954  "transparent_union attribute ignored">,
3955  InGroup<IgnoredAttributes>;
3956def warn_attribute_type_not_supported : Warning<
3957  "%0 attribute argument not supported: %1">,
3958  InGroup<IgnoredAttributes>;
3959def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3960  InGroup<IgnoredAttributes>;
3961def warn_attribute_protected_visibility :
3962  Warning<"target does not support 'protected' visibility; using 'default'">,
3963  InGroup<DiagGroup<"unsupported-visibility">>;
3964def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3965def note_previous_attribute : Note<"previous attribute is here">;
3966def note_conflicting_attribute : Note<"conflicting attribute is here">;
3967def note_attribute : Note<"attribute is here">;
3968def err_mismatched_ms_inheritance : Error<
3969  "inheritance model does not match %select{definition|previous declaration}0">;
3970def warn_ignored_ms_inheritance : Warning<
3971  "inheritance model ignored on %select{primary template|partial specialization}0">,
3972  InGroup<IgnoredAttributes>;
3973def note_previous_ms_inheritance : Note<
3974  "previous inheritance model specified here">;
3975def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3976def err_mode_not_primitive : Error<
3977  "mode attribute only supported for integer and floating-point types">;
3978def err_mode_wrong_type : Error<
3979  "type of machine mode does not match type of base type">;
3980def warn_vector_mode_deprecated : Warning<
3981  "specifying vector types with the 'mode' attribute is deprecated; "
3982  "use the 'vector_size' attribute instead">,
3983  InGroup<DeprecatedAttributes>;
3984def err_complex_mode_vector_type : Error<
3985  "type of machine mode does not support base vector types">;
3986def err_enum_mode_vector_type : Error<
3987  "mode %0 is not supported for enumeration types">;
3988def warn_attribute_nonnull_no_pointers : Warning<
3989  "'nonnull' attribute applied to function with no pointer arguments">,
3990  InGroup<IgnoredAttributes>;
3991def warn_attribute_nonnull_parm_no_args : Warning<
3992  "'nonnull' attribute when used on parameters takes no arguments">,
3993  InGroup<IgnoredAttributes>;
3994def note_declared_nonnull : Note<
3995  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3996def warn_attribute_sentinel_named_arguments : Warning<
3997  "'sentinel' attribute requires named arguments">,
3998  InGroup<IgnoredAttributes>;
3999def warn_attribute_sentinel_not_variadic : Warning<
4000  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
4001  InGroup<IgnoredAttributes>;
4002def warn_deprecated_ignored_on_using : Warning<
4003  "%0 currently has no effect on a using declaration">,
4004  InGroup<IgnoredAttributes>;
4005def err_attribute_sentinel_less_than_zero : Error<
4006  "'sentinel' parameter 1 less than zero">;
4007def err_attribute_sentinel_not_zero_or_one : Error<
4008  "'sentinel' parameter 2 not 0 or 1">;
4009def warn_cleanup_ext : Warning<
4010  "GCC does not allow the 'cleanup' attribute argument to be anything other "
4011  "than a simple identifier">,
4012  InGroup<GccCompat>;
4013def err_attribute_cleanup_arg_not_function : Error<
4014  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
4015def err_attribute_cleanup_func_must_take_one_arg : Error<
4016  "'cleanup' function %0 must take 1 parameter">;
4017def err_attribute_cleanup_func_arg_incompatible_type : Error<
4018  "'cleanup' function %0 parameter has "
4019  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
4020def err_attribute_regparm_wrong_platform : Error<
4021  "'regparm' is not valid on this platform">;
4022def err_attribute_regparm_invalid_number : Error<
4023  "'regparm' parameter must be between 0 and %0 inclusive">;
4024def err_attribute_not_supported_in_lang : Error<
4025  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
4026def err_attribute_not_supported_on_arch
4027    : Error<"%0 attribute is not supported on '%1'">;
4028def warn_gcc_ignores_type_attr : Warning<
4029  "GCC does not allow the %0 attribute to be written on a type">,
4030  InGroup<GccCompat>;
4031
4032// Clang-Specific Attributes
4033def warn_attribute_iboutlet : Warning<
4034  "%0 attribute can only be applied to instance variables or properties">,
4035  InGroup<IgnoredAttributes>;
4036def err_iboutletcollection_type : Error<
4037  "invalid type %0 as argument of iboutletcollection attribute">;
4038def err_iboutletcollection_builtintype : Error<
4039  "type argument of iboutletcollection attribute cannot be a builtin type">;
4040def warn_iboutlet_object_type : Warning<
4041  "%select{instance variable|property}2 with %0 attribute must "
4042  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
4043def warn_iboutletcollection_property_assign : Warning<
4044  "IBOutletCollection properties should be copy/strong and not assign">,
4045  InGroup<ObjCInvalidIBOutletProperty>;
4046
4047def err_attribute_overloadable_mismatch : Error<
4048  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
4049def note_attribute_overloadable_prev_overload : Note<
4050  "previous %select{unmarked |}0overload of function is here">;
4051def err_attribute_overloadable_no_prototype : Error<
4052  "'overloadable' function %0 must have a prototype">;
4053def err_attribute_overloadable_multiple_unmarked_overloads : Error<
4054  "at most one overload for a given name may lack the 'overloadable' "
4055  "attribute">;
4056def warn_attribute_no_builtin_invalid_builtin_name : Warning<
4057  "'%0' is not a valid builtin name for %1">,
4058  InGroup<DiagGroup<"invalid-no-builtin-names">>;
4059def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
4060  "empty %0 cannot be composed with named ones">;
4061def err_attribute_no_builtin_on_non_definition : Error<
4062  "%0 attribute is permitted on definitions only">;
4063def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
4064  "%0 attribute has no effect on defaulted or deleted functions">;
4065def warn_ns_attribute_wrong_return_type : Warning<
4066  "%0 attribute only applies to %select{functions|methods|properties}1 that "
4067  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
4068  InGroup<IgnoredAttributes>;
4069def err_ns_attribute_wrong_parameter_type : Error<
4070  "%0 attribute only applies to "
4071  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
4072def warn_ns_attribute_wrong_parameter_type : Warning<
4073  "%0 attribute only applies to "
4074  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
4075  InGroup<IgnoredAttributes>;
4076def warn_objc_requires_super_protocol : Warning<
4077  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
4078  InGroup<DiagGroup<"requires-super-attribute">>;
4079def note_protocol_decl : Note<
4080  "protocol is declared here">;
4081def note_protocol_decl_undefined : Note<
4082  "protocol %0 has no definition">;
4083def err_attribute_preferred_name_arg_invalid : Error<
4084  "argument %0 to 'preferred_name' attribute is not a typedef for "
4085  "a specialization of %1">;
4086def err_attribute_builtin_alias : Error<
4087  "%0 attribute can only be applied to a ARM or RISC-V builtin">;
4088
4089// called-once attribute diagnostics.
4090def err_called_once_attribute_wrong_type : Error<
4091  "'called_once' attribute only applies to function-like parameters">;
4092
4093def warn_completion_handler_never_called : Warning<
4094  "%select{|captured }1completion handler is never called">,
4095  InGroup<CompletionHandler>, DefaultIgnore;
4096def warn_called_once_never_called : Warning<
4097  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
4098  InGroup<CalledOnceParameter>;
4099
4100def warn_completion_handler_never_called_when : Warning<
4101  "completion handler is never %select{used|called}1 when "
4102  "%select{taking true branch|taking false branch|"
4103  "handling this case|none of the cases applies|"
4104  "entering the loop|skipping the loop|taking one of the branches}2">,
4105  InGroup<CompletionHandler>, DefaultIgnore;
4106def warn_called_once_never_called_when : Warning<
4107  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
4108  "%select{taking true branch|taking false branch|"
4109  "handling this case|none of the cases applies|"
4110  "entering the loop|skipping the loop|taking one of the branches}2">,
4111  InGroup<CalledOnceParameter>;
4112
4113def warn_completion_handler_called_twice : Warning<
4114  "completion handler is called twice">,
4115  InGroup<CompletionHandler>, DefaultIgnore;
4116def warn_called_once_gets_called_twice : Warning<
4117  "%0 parameter marked 'called_once' is called twice">,
4118  InGroup<CalledOnceParameter>;
4119def note_called_once_gets_called_twice : Note<
4120  "previous call is here%select{; set to nil to indicate "
4121  "it cannot be called afterwards|}0">;
4122
4123// objc_designated_initializer attribute diagnostics.
4124def warn_objc_designated_init_missing_super_call : Warning<
4125  "designated initializer missing a 'super' call to a designated initializer of the super class">,
4126  InGroup<ObjCDesignatedInit>;
4127def note_objc_designated_init_marked_here : Note<
4128  "method marked as designated initializer of the class here">;
4129def warn_objc_designated_init_non_super_designated_init_call : Warning<
4130  "designated initializer should only invoke a designated initializer on 'super'">,
4131  InGroup<ObjCDesignatedInit>;
4132def warn_objc_designated_init_non_designated_init_call : Warning<
4133  "designated initializer invoked a non-designated initializer">,
4134  InGroup<ObjCDesignatedInit>;
4135def warn_objc_secondary_init_super_init_call : Warning<
4136  "convenience initializer should not invoke an initializer on 'super'">,
4137  InGroup<ObjCDesignatedInit>;
4138def warn_objc_secondary_init_missing_init_call : Warning<
4139  "convenience initializer missing a 'self' call to another initializer">,
4140  InGroup<ObjCDesignatedInit>;
4141def warn_objc_implementation_missing_designated_init_override : Warning<
4142  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4143  InGroup<ObjCDesignatedInit>;
4144def err_designated_init_attr_non_init : Error<
4145  "'objc_designated_initializer' attribute only applies to init methods "
4146  "of interface or class extension declarations">;
4147
4148// objc_bridge attribute diagnostics.
4149def err_objc_attr_not_id : Error<
4150  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4151def err_objc_attr_typedef_not_id : Error<
4152  "parameter of %0 attribute must be 'id' when used on a typedef">;
4153def err_objc_attr_typedef_not_void_pointer : Error<
4154  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4155def err_objc_cf_bridged_not_interface : Error<
4156  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4157def err_objc_ns_bridged_invalid_cfobject : Error<
4158  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
4159def warn_objc_invalid_bridge : Warning<
4160  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4161def warn_objc_invalid_bridge_to_cf : Warning<
4162  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4163
4164// objc_bridge_related attribute diagnostics.
4165def err_objc_bridged_related_invalid_class : Error<
4166  "could not find Objective-C class %0 to convert %1 to %2">;
4167def err_objc_bridged_related_invalid_class_name : Error<
4168  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4169def err_objc_bridged_related_known_method : Error<
4170 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4171 "method for this conversion">;
4172
4173def err_objc_attr_protocol_requires_definition : Error<
4174  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4175
4176// Swift attributes.
4177def warn_attr_swift_name_function
4178  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4179    InGroup<SwiftNameAttribute>;
4180def warn_attr_swift_name_invalid_identifier
4181  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4182    InGroup<SwiftNameAttribute>;
4183def warn_attr_swift_name_decl_kind
4184  : Warning<"%0 attribute cannot be applied to this declaration">,
4185    InGroup<SwiftNameAttribute>;
4186def warn_attr_swift_name_subscript_invalid_parameter
4187  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4188        "have at least one parameter|"
4189        "have a 'self:' parameter}1">,
4190    InGroup<SwiftNameAttribute>;
4191def warn_attr_swift_name_missing_parameters
4192  : Warning<"%0 attribute is missing parameter label clause">,
4193    InGroup<SwiftNameAttribute>;
4194def warn_attr_swift_name_setter_parameters
4195  : Warning<"%0 attribute for setter must have one parameter for new value">,
4196    InGroup<SwiftNameAttribute>;
4197def warn_attr_swift_name_multiple_selfs
4198  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4199    InGroup<SwiftNameAttribute>;
4200def warn_attr_swift_name_getter_parameters
4201  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4202    InGroup<SwiftNameAttribute>;
4203def warn_attr_swift_name_subscript_setter_no_newValue
4204  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4205    InGroup<SwiftNameAttribute>;
4206def warn_attr_swift_name_subscript_setter_multiple_newValues
4207  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4208    InGroup<SwiftNameAttribute>;
4209def warn_attr_swift_name_subscript_getter_newValue
4210  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4211    InGroup<SwiftNameAttribute>;
4212def warn_attr_swift_name_num_params
4213  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4214            "the %1 attribute (expected %2; got %3)">,
4215    InGroup<SwiftNameAttribute>;
4216def warn_attr_swift_name_decl_missing_params
4217  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4218            "with no parameters">,
4219    InGroup<SwiftNameAttribute>;
4220
4221def err_attr_swift_error_no_error_parameter : Error<
4222  "%0 attribute can only be applied to a %select{function|method}1 with an "
4223  "error parameter">;
4224def err_attr_swift_error_return_type : Error<
4225  "%0 attribute with '%1' convention can only be applied to a "
4226  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4227
4228def err_swift_async_no_access : Error<
4229  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4230  "'not_swift_private'">;
4231def err_swift_async_bad_block_type : Error<
4232  "'swift_async' completion handler parameter must have block type returning"
4233  " 'void', type here is %0">;
4234
4235def err_swift_async_error_without_swift_async : Error<
4236  "%0 attribute must be applied to a %select{function|method}1 annotated "
4237  "with non-'none' attribute 'swift_async'">;
4238def err_swift_async_error_no_error_parameter : Error<
4239  "%0 attribute with 'nonnull_error' convention can only be applied to a "
4240  "%select{function|method}1 with a completion handler with an error "
4241  "parameter">;
4242def err_swift_async_error_non_integral : Error<
4243  "%0 attribute with '%1' convention must have an integral-typed parameter "
4244  "in completion handler at index %2, type here is %3">;
4245
4246def warn_ignored_objc_externally_retained : Warning<
4247  "'objc_externally_retained' can only be applied to local variables "
4248  "%select{of retainable type|with strong ownership}0">,
4249  InGroup<IgnoredAttributes>;
4250
4251// Function Parameter Semantic Analysis.
4252def err_param_with_void_type : Error<"argument may not have 'void' type">;
4253def err_void_only_param : Error<
4254  "'void' must be the first and only parameter if specified">;
4255def err_void_param_qualified : Error<
4256  "'void' as parameter must not have type qualifiers">;
4257def err_ident_list_in_fn_declaration : Error<
4258  "a parameter list without types is only allowed in a function definition">;
4259def ext_param_not_declared : Extension<
4260  "parameter %0 was not declared, defaulting to type 'int'">;
4261def err_param_default_argument : Error<
4262  "C does not support default arguments">;
4263def err_param_default_argument_redefinition : Error<
4264  "redefinition of default argument">;
4265def ext_param_default_argument_redefinition : ExtWarn<
4266  err_param_default_argument_redefinition.Text>,
4267  InGroup<MicrosoftDefaultArgRedefinition>;
4268def err_param_default_argument_missing : Error<
4269  "missing default argument on parameter">;
4270def err_param_default_argument_missing_name : Error<
4271  "missing default argument on parameter %0">;
4272def err_param_default_argument_references_param : Error<
4273  "default argument references parameter %0">;
4274def err_param_default_argument_references_local : Error<
4275  "default argument references local variable %0 of enclosing function">;
4276def err_param_default_argument_references_this : Error<
4277  "default argument references 'this'">;
4278def err_param_default_argument_nonfunc : Error<
4279  "default arguments can only be specified for parameters in a function "
4280  "declaration">;
4281def err_param_default_argument_template_redecl : Error<
4282  "default arguments cannot be added to a function template that has already "
4283  "been declared">;
4284def err_param_default_argument_member_template_redecl : Error<
4285  "default arguments cannot be added to an out-of-line definition of a member "
4286  "of a %select{class template|class template partial specialization|nested "
4287  "class in a template}0">;
4288def err_param_default_argument_on_parameter_pack : Error<
4289  "parameter pack cannot have a default argument">;
4290def err_uninitialized_member_for_assign : Error<
4291  "cannot define the implicit copy assignment operator for %0, because "
4292  "non-static %select{reference|const}1 member %2 cannot use copy "
4293  "assignment operator">;
4294def err_uninitialized_member_in_ctor : Error<
4295  "%select{constructor for %1|"
4296  "implicit default constructor for %1|"
4297  "cannot use constructor inherited from %1:}0 must explicitly "
4298  "initialize the %select{reference|const}2 member %3">;
4299def err_default_arg_makes_ctor_special : Error<
4300  "addition of default argument on redeclaration makes this constructor a "
4301  "%select{default|copy|move}0 constructor">;
4302
4303def err_use_of_default_argument_to_function_declared_later : Error<
4304  "use of default argument to function %0 that is declared later in class %1">;
4305def note_default_argument_declared_here : Note<
4306  "default argument declared here">;
4307def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4308def note_recursive_default_argument_used_here : Note<
4309  "default argument used here">;
4310
4311def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4312  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4313  "parameter type $|promoted type of K&R function parameter is not compatible "
4314  "with parameter type}0,1 declared in a previous prototype">,
4315  InGroup<KNRPromotedParameter>;
4316
4317
4318// C++ Overloading Semantic Analysis.
4319def err_ovl_diff_return_type : Error<
4320  "functions that differ only in their return type cannot be overloaded">;
4321def err_ovl_static_nonstatic_member : Error<
4322  "static and non-static member functions with the same parameter types "
4323  "cannot be overloaded">;
4324
4325let Deferrable = 1 in {
4326
4327def err_ovl_no_viable_function_in_call : Error<
4328  "no matching function for call to %0">;
4329def err_ovl_no_viable_member_function_in_call : Error<
4330  "no matching member function for call to %0">;
4331def err_ovl_ambiguous_call : Error<
4332  "call to %0 is ambiguous">;
4333def err_ovl_deleted_call : Error<"call to deleted function %0">;
4334def err_ovl_ambiguous_member_call : Error<
4335  "call to member function %0 is ambiguous">;
4336def err_ovl_deleted_member_call : Error<
4337  "call to deleted member function %0">;
4338def note_ovl_too_many_candidates : Note<
4339    "remaining %0 candidate%s0 omitted; "
4340    "pass -fshow-overloads=all to show them">;
4341
4342def select_ovl_candidate_kind : TextSubstitution<
4343  "%select{function|function|function (with reversed parameter order)|"
4344    "constructor|"
4345    "constructor (the implicit default constructor)|"
4346    "constructor (the implicit copy constructor)|"
4347    "constructor (the implicit move constructor)|"
4348    "function (the implicit copy assignment operator)|"
4349    "function (the implicit move assignment operator)|"
4350    "function (the implicit 'operator==' for this 'operator<=>)'|"
4351    "inherited constructor}0%select{| template| %2}1">;
4352
4353def note_ovl_candidate : Note<
4354    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4355    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4356    "| has different number of parameters (expected %5 but has %6)"
4357    "| has type mismatch at %ordinal5 parameter"
4358    "%diff{ (expected $ but has $)|}6,7"
4359    "| has different return type%diff{ ($ expected but has $)|}5,6"
4360    "| has different qualifiers (expected %5 but found %6)"
4361    "| has different exception specification}4">;
4362
4363def note_ovl_candidate_explicit : Note<
4364    "explicit %select{constructor|conversion function|deduction guide}0 "
4365    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4366def note_ovl_candidate_inherited_constructor : Note<
4367    "constructor from base class %0 inherited here">;
4368def note_ovl_candidate_inherited_constructor_slice : Note<
4369    "candidate %select{constructor|template}0 ignored: "
4370    "inherited constructor cannot be used to %select{copy|move}1 object">;
4371def note_ovl_candidate_illegal_constructor : Note<
4372    "candidate %select{constructor|template}0 ignored: "
4373    "instantiation %select{takes|would take}0 its own class type by value">;
4374def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4375    "candidate constructor ignored: cannot be used to construct an object "
4376    "in address space %0">;
4377def note_ovl_candidate_bad_deduction : Note<
4378    "candidate template ignored: failed template argument deduction">;
4379def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4380    "couldn't infer template argument %0">;
4381def note_ovl_candidate_incomplete_deduction_pack : Note<
4382    "candidate template ignored: "
4383    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4384    "expanded parameter in deduced argument pack %2">;
4385def note_ovl_candidate_inconsistent_deduction : Note<
4386    "candidate template ignored: deduced %select{conflicting types|"
4387    "conflicting values|conflicting templates|packs of different lengths}0 "
4388    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4389def note_ovl_candidate_inconsistent_deduction_types : Note<
4390    "candidate template ignored: deduced values %diff{"
4391    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4392    "%1 and %3 of conflicting types for parameter %0}2,4">;
4393def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4394    "candidate template ignored: invalid explicitly-specified argument "
4395    "for template parameter %0">;
4396def note_ovl_candidate_unsatisfied_constraints : Note<
4397    "candidate template ignored: constraints not satisfied%0">;
4398def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4399    "candidate template ignored: invalid explicitly-specified argument "
4400    "for %ordinal0 template parameter">;
4401def note_ovl_candidate_instantiation_depth : Note<
4402    "candidate template ignored: substitution exceeded maximum template "
4403    "instantiation depth">;
4404def note_ovl_candidate_underqualified : Note<
4405    "candidate template ignored: cannot deduce a type for %0 that would "
4406    "make %2 equal %1">;
4407def note_ovl_candidate_substitution_failure : Note<
4408    "candidate template ignored: substitution failure%0%1">;
4409def note_ovl_candidate_disabled_by_enable_if : Note<
4410    "candidate template ignored: disabled by %0%1">;
4411def note_ovl_candidate_disabled_by_requirement : Note<
4412    "candidate template ignored: requirement '%0' was not satisfied%1">;
4413def note_ovl_candidate_has_pass_object_size_params: Note<
4414    "candidate address cannot be taken because parameter %0 has "
4415    "pass_object_size attribute">;
4416def err_diagnose_if_succeeded : Error<"%0">;
4417def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4418    ShowInSystemHeader;
4419def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4420    "candidate disabled: %0">;
4421def err_addrof_function_disabled_by_enable_if_attr : Error<
4422    "cannot take address of function %0 because it has one or more "
4423    "non-tautological enable_if conditions">;
4424def err_addrof_function_constraints_not_satisfied : Error<
4425    "cannot take address of function %0 because its constraints are not "
4426    "satisfied">;
4427def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4428    "candidate function made ineligible by enable_if">;
4429def note_ovl_candidate_deduced_mismatch : Note<
4430    "candidate template ignored: deduced type "
4431    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4432    "adjusted type $ of %select{|element of }4argument"
4433    "|of %select{|element of }4%ordinal0 parameter does not match "
4434    "adjusted type of %select{|element of }4argument}1,2%3">;
4435def note_ovl_candidate_non_deduced_mismatch : Note<
4436    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4437// This note is needed because the above note would sometimes print two
4438// different types with the same name.  Remove this note when the above note
4439// can handle that case properly.
4440def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4441    "candidate template ignored: could not match %q0 against %q1">;
4442
4443// Note that we don't treat templates differently for this diagnostic.
4444def note_ovl_candidate_arity : Note<"candidate "
4445    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4446    "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
4447    "%plural{1:was|:were}5 provided">;
4448
4449def note_ovl_candidate_arity_one : Note<"candidate "
4450    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4451    "%select{requires at least|allows at most single|requires single}3 "
4452    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4453
4454def note_ovl_candidate_deleted : Note<
4455    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4456    "%select{explicitly made unavailable|explicitly deleted|"
4457    "implicitly deleted}3">;
4458
4459// Giving the index of the bad argument really clutters this message, and
4460// it's relatively unimportant because 1) it's generally obvious which
4461// argument(s) are of the given object type and 2) the fix is usually
4462// to complete the type, which doesn't involve changes to the call line
4463// anyway.  If people complain, we can change it.
4464def note_ovl_candidate_bad_conv_incomplete : Note<
4465    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4466    "cannot convert argument of incomplete type "
4467    "%diff{$ to $|to parameter type}3,4 for "
4468    "%select{%ordinal6 argument|object argument}5"
4469    "%select{|; dereference the argument with *|"
4470    "; take the address of the argument with &|"
4471    "; remove *|"
4472    "; remove &}7">;
4473def note_ovl_candidate_bad_list_argument : Note<
4474    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4475    "cannot convert initializer list argument to %4">;
4476def note_ovl_candidate_bad_overload : Note<
4477    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4478    "no overload of %4 matching %3 for %ordinal5 argument">;
4479def note_ovl_candidate_bad_conv : Note<
4480    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4481    "no known conversion "
4482    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4483    "%select{%ordinal6 argument|object argument}5"
4484    "%select{|; dereference the argument with *|"
4485    "; take the address of the argument with &|"
4486    "; remove *|"
4487    "; remove &}7">;
4488def note_ovl_candidate_bad_arc_conv : Note<
4489    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4490    "cannot implicitly convert argument "
4491    "%diff{of type $ to $|type to parameter type}3,4 for "
4492    "%select{%ordinal6 argument|object argument}5 under ARC">;
4493def note_ovl_candidate_bad_value_category : Note<
4494    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4495    "expects an %select{lvalue|rvalue}5 for "
4496    "%select{%ordinal4 argument|object argument}3">;
4497def note_ovl_candidate_bad_addrspace : Note<
4498    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4499    "cannot %select{pass pointer to|bind reference in}5 %3 "
4500    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4501    "argument">;
4502def note_ovl_candidate_bad_addrspace_this : Note<
4503    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4504    "'this' object is in %3, but method expects object in %4">;
4505def note_ovl_candidate_bad_gc : Note<
4506    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4507    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4508    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4509def note_ovl_candidate_bad_ownership : Note<
4510    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4511    "%select{%ordinal7|'this'}6 argument (%3) has "
4512    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4513    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4514    "__autoreleasing}5 ownership">;
4515def note_ovl_candidate_bad_cvr_this : Note<
4516    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4517    "'this' argument has type %3, but method is not marked "
4518    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4519    "volatile or restrict|const, volatile, or restrict}4">;
4520def note_ovl_candidate_bad_cvr : Note<
4521    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4522    "%ordinal5 argument (%3) would lose "
4523    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4524    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4525    "%select{||s||s|s|s}4">;
4526def note_ovl_candidate_bad_unaligned : Note<
4527    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4528    "%ordinal5 argument (%3) would lose __unaligned qualifier">;
4529def note_ovl_candidate_bad_base_to_derived_conv : Note<
4530    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4531    "cannot %select{convert from|convert from|bind}3 "
4532    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4533    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4534    "%ordinal6 argument">;
4535def note_ovl_candidate_bad_target : Note<
4536    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4537    "call to "
4538    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4539    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4540def note_ovl_candidate_constraints_not_satisfied : Note<
4541    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4542    "not satisfied">;
4543def note_implicit_member_target_infer_collision : Note<
4544    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4545    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4546    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4547
4548def note_ambiguous_type_conversion: Note<
4549    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4550def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4551def err_ovl_no_viable_function_in_init : Error<
4552  "no matching constructor for initialization of %0">;
4553def err_ovl_no_conversion_in_cast : Error<
4554  "cannot convert %1 to %2 without a conversion operator">;
4555def err_ovl_no_viable_conversion_in_cast : Error<
4556  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4557  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4558def err_ovl_ambiguous_conversion_in_cast : Error<
4559  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4560  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4561def err_ovl_deleted_conversion_in_cast : Error<
4562  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4563  "functional-style cast|}0 from %1 to %2 uses deleted function">;
4564def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4565def err_ref_init_ambiguous : Error<
4566  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4567def err_ovl_deleted_init : Error<
4568  "call to deleted constructor of %0">;
4569def err_ovl_deleted_special_init : Error<
4570  "call to implicitly-deleted %select{default constructor|copy constructor|"
4571  "move constructor|copy assignment operator|move assignment operator|"
4572  "destructor|function}0 of %1">;
4573def err_ovl_ambiguous_oper_unary : Error<
4574  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4575def err_ovl_ambiguous_oper_binary : Error<
4576  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4577def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4578  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4579  "and %2) to be ambiguous despite there being a unique best viable function"
4580  "%select{ with non-reversed arguments|}3">,
4581  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4582def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4583  "ambiguity is between a regular call to this operator and a call with the "
4584  "argument order reversed">;
4585def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4586  "candidate function with non-reversed arguments">;
4587def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
4588  "ambiguous candidate function with reversed arguments">;
4589def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
4590def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
4591def err_ovl_deleted_oper : Error<
4592  "overload resolution selected deleted operator '%0'">;
4593def err_ovl_deleted_special_oper : Error<
4594  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
4595  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
4596  "implicitly deleted">;
4597def err_ovl_deleted_comparison : Error<
4598  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
4599def err_ovl_rewrite_equalequal_not_bool : Error<
4600  "return type %0 of selected 'operator==' function for rewritten "
4601  "'%1' comparison is not 'bool'">;
4602def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
4603  "ISO C++20 requires return type of selected 'operator==' function for "
4604  "rewritten '%1' comparison to be 'bool', not %0">,
4605  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
4606def err_ovl_no_viable_subscript :
4607    Error<"no viable overloaded operator[] for type %0">;
4608def err_ovl_no_oper :
4609    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
4610def err_ovl_unresolvable : Error<
4611  "reference to %select{overloaded|multiversioned}1 function could not be "
4612  "resolved; did you mean to call it%select{| with no arguments}0?">;
4613def err_bound_member_function : Error<
4614  "reference to non-static member function must be called"
4615  "%select{|; did you mean to call it with no arguments?}0">;
4616def note_possible_target_of_call : Note<"possible target for call">;
4617
4618def err_ovl_no_viable_object_call : Error<
4619  "no matching function for call to object of type %0">;
4620def err_ovl_ambiguous_object_call : Error<
4621  "call to object of type %0 is ambiguous">;
4622def err_ovl_deleted_object_call : Error<
4623  "call to deleted function call operator in type %0">;
4624def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
4625def err_member_call_without_object : Error<
4626  "call to non-static member function without an object argument">;
4627
4628// C++ Address of Overloaded Function
4629def err_addr_ovl_no_viable : Error<
4630  "address of overloaded function %0 does not match required type %1">;
4631def err_addr_ovl_ambiguous : Error<
4632  "address of overloaded function %0 is ambiguous">;
4633def err_addr_ovl_not_func_ptrref : Error<
4634  "address of overloaded function %0 cannot be converted to type %1">;
4635def err_addr_ovl_no_qualifier : Error<
4636  "cannot form member pointer of type %0 without '&' and class name">;
4637
4638} // let Deferrable
4639
4640// C++11 Literal Operators
4641def err_ovl_no_viable_literal_operator : Error<
4642  "no matching literal operator for call to %0"
4643  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
4644  "%select{| or 'const char *'}4"
4645  "%select{|, and no matching literal operator template}5">;
4646
4647// C++ Template Declarations
4648def err_template_param_shadow : Error<
4649  "declaration of %0 shadows template parameter">;
4650def ext_template_param_shadow : ExtWarn<
4651  err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>;
4652def note_template_param_here : Note<"template parameter is declared here">;
4653def warn_template_export_unsupported : Warning<
4654  "exported templates are unsupported">;
4655def err_template_outside_namespace_or_class_scope : Error<
4656  "templates can only be declared in namespace or class scope">;
4657def err_template_inside_local_class : Error<
4658  "templates cannot be declared inside of a local class">;
4659def err_template_linkage : Error<"templates must have C++ linkage">;
4660def err_template_typedef : Error<"a typedef cannot be a template">;
4661def err_template_unnamed_class : Error<
4662  "cannot declare a class template with no name">;
4663def err_template_param_list_different_arity : Error<
4664  "%select{too few|too many}0 template parameters in template "
4665  "%select{|template parameter }1redeclaration">;
4666def note_template_param_list_different_arity : Note<
4667  "%select{too few|too many}0 template parameters in template template "
4668  "argument">;
4669def note_template_prev_declaration : Note<
4670  "previous template %select{declaration|template parameter}0 is here">;
4671def err_template_param_different_kind : Error<
4672  "template parameter has a different kind in template "
4673  "%select{|template parameter }0redeclaration">;
4674def note_template_param_different_kind : Note<
4675  "template parameter has a different kind in template argument">;
4676
4677def err_invalid_decl_specifier_in_nontype_parm : Error<
4678  "invalid declaration specifier in template non-type parameter">;
4679
4680def err_template_nontype_parm_different_type : Error<
4681  "template non-type parameter has a different type %0 in template "
4682  "%select{|template parameter }1redeclaration">;
4683
4684def note_template_nontype_parm_different_type : Note<
4685  "template non-type parameter has a different type %0 in template argument">;
4686def note_template_nontype_parm_prev_declaration : Note<
4687  "previous non-type template parameter with type %0 is here">;
4688def err_template_nontype_parm_bad_type : Error<
4689  "a non-type template parameter cannot have type %0">;
4690def err_template_nontype_parm_bad_structural_type : Error<
4691  "a non-type template parameter cannot have type %0 before C++20">;
4692def err_template_nontype_parm_incomplete : Error<
4693  "non-type template parameter has incomplete type %0">;
4694def err_template_nontype_parm_not_literal : Error<
4695  "non-type template parameter has non-literal type %0">;
4696def err_template_nontype_parm_rvalue_ref : Error<
4697  "non-type template parameter has rvalue reference type %0">;
4698def err_template_nontype_parm_not_structural : Error<
4699  "type %0 of non-type template parameter is not a structural type">;
4700def note_not_structural_non_public : Note<
4701  "%0 is not a structural type because it has a "
4702  "%select{non-static data member|base class}1 that is not public">;
4703def note_not_structural_mutable_field : Note<
4704  "%0 is not a structural type because it has a mutable "
4705  "non-static data member">;
4706def note_not_structural_rvalue_ref_field : Note<
4707  "%0 is not a structural type because it has a non-static data member "
4708  "of rvalue reference type">;
4709def note_not_structural_subobject : Note<
4710  "%0 is not a structural type because it has a "
4711  "%select{non-static data member|base class}1 of non-structural type %2">;
4712def warn_cxx17_compat_template_nontype_parm_type : Warning<
4713  "non-type template parameter of type %0 is incompatible with "
4714  "C++ standards before C++20">,
4715  DefaultIgnore, InGroup<CXXPre20Compat>;
4716def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
4717  "non-type template parameters declared with %0 are incompatible with C++ "
4718  "standards before C++17">,
4719  DefaultIgnore, InGroup<CXXPre17Compat>;
4720def err_template_param_default_arg_redefinition : Error<
4721  "template parameter redefines default argument">;
4722def note_template_param_prev_default_arg : Note<
4723  "previous default template argument defined here">;
4724def err_template_param_default_arg_missing : Error<
4725  "template parameter missing a default argument">;
4726def ext_template_parameter_default_in_function_template : ExtWarn<
4727  "default template arguments for a function template are a C++11 extension">,
4728  InGroup<CXX11>;
4729def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
4730  "default template arguments for a function template are incompatible with C++98">,
4731  InGroup<CXX98Compat>, DefaultIgnore;
4732def err_template_parameter_default_template_member : Error<
4733  "cannot add a default template argument to the definition of a member of a "
4734  "class template">;
4735def err_template_parameter_default_friend_template : Error<
4736  "default template argument not permitted on a friend template">;
4737def err_template_template_parm_no_parms : Error<
4738  "template template parameter must have its own template parameters">;
4739
4740def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4741  InGroup<CXX14>;
4742def warn_cxx11_compat_variable_template : Warning<
4743  "variable templates are incompatible with C++ standards before C++14">,
4744  InGroup<CXXPre14Compat>, DefaultIgnore;
4745def err_template_variable_noparams : Error<
4746  "extraneous 'template<>' in declaration of variable %0">;
4747def err_template_member : Error<"member %0 declared as a template">;
4748def err_template_member_noparams : Error<
4749  "extraneous 'template<>' in declaration of member %0">;
4750def err_template_tag_noparams : Error<
4751  "extraneous 'template<>' in declaration of %0 %1">;
4752
4753def warn_cxx17_compat_adl_only_template_id : Warning<
4754  "use of function template name with no prior function template "
4755  "declaration in function call with explicit template arguments "
4756  "is incompatible with C++ standards before C++20">,
4757  InGroup<CXXPre20Compat>, DefaultIgnore;
4758def ext_adl_only_template_id : ExtWarn<
4759  "use of function template name with no prior declaration in function call "
4760  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
4761
4762// C++ Template Argument Lists
4763def err_template_missing_args : Error<
4764  "use of "
4765  "%select{class template|function template|variable template|alias template|"
4766  "template template parameter|concept|template}0 %1 requires template "
4767  "arguments">;
4768def err_template_arg_list_different_arity : Error<
4769  "%select{too few|too many}0 template arguments for "
4770  "%select{class template|function template|variable template|alias template|"
4771  "template template parameter|concept|template}1 %2">;
4772def note_template_decl_here : Note<"template is declared here">;
4773def err_template_arg_must_be_type : Error<
4774  "template argument for template type parameter must be a type">;
4775def err_template_arg_must_be_type_suggest : Error<
4776  "template argument for template type parameter must be a type; "
4777  "did you forget 'typename'?">;
4778def ext_ms_template_type_arg_missing_typename : ExtWarn<
4779  "template argument for template type parameter must be a type; "
4780  "omitted 'typename' is a Microsoft extension">,
4781  InGroup<MicrosoftTemplate>;
4782def err_template_arg_must_be_expr : Error<
4783  "template argument for non-type template parameter must be an expression">;
4784def err_template_arg_nontype_ambig : Error<
4785  "template argument for non-type template parameter is treated as function type %0">;
4786def err_template_arg_must_be_template : Error<
4787  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4788def ext_template_arg_local_type : ExtWarn<
4789  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4790def ext_template_arg_unnamed_type : ExtWarn<
4791  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4792def warn_cxx98_compat_template_arg_local_type : Warning<
4793  "local type %0 as template argument is incompatible with C++98">,
4794  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4795def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4796  "unnamed type as template argument is incompatible with C++98">,
4797  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4798def note_template_unnamed_type_here : Note<
4799  "unnamed type used in template argument was declared here">;
4800def err_template_arg_overload_type : Error<
4801  "template argument is the type of an unresolved overloaded function">;
4802def err_template_arg_not_valid_template : Error<
4803  "template argument does not refer to a class or alias template, or template "
4804  "template parameter">;
4805def note_template_arg_refers_here_func : Note<
4806  "template argument refers to function template %0, here">;
4807def err_template_arg_template_params_mismatch : Error<
4808  "template template argument has different template parameters than its "
4809  "corresponding template template parameter">;
4810def err_template_arg_not_integral_or_enumeral : Error<
4811  "non-type template argument of type %0 must have an integral or enumeration"
4812  " type">;
4813def err_template_arg_not_ice : Error<
4814  "non-type template argument of type %0 is not an integral constant "
4815  "expression">;
4816def err_template_arg_not_address_constant : Error<
4817  "non-type template argument of type %0 is not a constant expression">;
4818def warn_cxx98_compat_template_arg_null : Warning<
4819  "use of null pointer as non-type template argument is incompatible with "
4820  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4821def err_template_arg_untyped_null_constant : Error<
4822  "null non-type template argument must be cast to template parameter type %0">;
4823def err_template_arg_wrongtype_null_constant : Error<
4824  "null non-type template argument of type %0 does not match template parameter "
4825  "of type %1">;
4826def err_non_type_template_parm_type_deduction_failure : Error<
4827  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4828def err_deduced_non_type_template_arg_type_mismatch : Error<
4829  "deduced non-type template argument does not have the same type as the "
4830  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4831def err_non_type_template_arg_subobject : Error<
4832  "non-type template argument refers to subobject '%0'">;
4833def err_non_type_template_arg_addr_label_diff : Error<
4834  "template argument / label address difference / what did you expect?">;
4835def err_non_type_template_arg_unsupported : Error<
4836  "sorry, non-type template argument of type %0 is not yet supported">;
4837def err_template_arg_not_convertible : Error<
4838  "non-type template argument of type %0 cannot be converted to a value "
4839  "of type %1">;
4840def warn_template_arg_negative : Warning<
4841  "non-type template argument with value '%0' converted to '%1' for unsigned "
4842  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4843def warn_template_arg_too_large : Warning<
4844  "non-type template argument value '%0' truncated to '%1' for "
4845  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4846def err_template_arg_no_ref_bind : Error<
4847  "non-type template parameter of reference type "
4848  "%diff{$ cannot bind to template argument of type $"
4849  "|cannot bind to template of incompatible argument type}0,1">;
4850def err_template_arg_ref_bind_ignores_quals : Error<
4851  "reference binding of non-type template parameter "
4852  "%diff{of type $ to template argument of type $|to template argument}0,1 "
4853  "ignores qualifiers">;
4854def err_template_arg_not_decl_ref : Error<
4855  "non-type template argument does not refer to any declaration">;
4856def err_template_arg_not_address_of : Error<
4857  "non-type template argument for template parameter of pointer type %0 must "
4858  "have its address taken">;
4859def err_template_arg_address_of_non_pointer : Error<
4860  "address taken in non-type template argument for template parameter of "
4861  "reference type %0">;
4862def err_template_arg_reference_var : Error<
4863  "non-type template argument of reference type %0 is not an object">;
4864def err_template_arg_field : Error<
4865  "non-type template argument refers to non-static data member %0">;
4866def err_template_arg_method : Error<
4867  "non-type template argument refers to non-static member function %0">;
4868def err_template_arg_object_no_linkage : Error<
4869  "non-type template argument refers to %select{function|object}0 %1 that "
4870  "does not have linkage">;
4871def warn_cxx98_compat_template_arg_object_internal : Warning<
4872  "non-type template argument referring to %select{function|object}0 %1 with "
4873  "internal linkage is incompatible with C++98">,
4874  InGroup<CXX98Compat>, DefaultIgnore;
4875def ext_template_arg_object_internal : ExtWarn<
4876  "non-type template argument referring to %select{function|object}0 %1 with "
4877  "internal linkage is a C++11 extension">, InGroup<CXX11>;
4878def err_template_arg_thread_local : Error<
4879  "non-type template argument refers to thread-local object">;
4880def note_template_arg_internal_object : Note<
4881  "non-type template argument refers to %select{function|object}0 here">;
4882def note_template_arg_refers_here : Note<
4883  "non-type template argument refers here">;
4884def err_template_arg_not_object_or_func : Error<
4885  "non-type template argument does not refer to an object or function">;
4886def err_template_arg_not_pointer_to_member_form : Error<
4887  "non-type template argument is not a pointer to member constant">;
4888def err_template_arg_member_ptr_base_derived_not_supported : Error<
4889  "sorry, non-type template argument of pointer-to-member type %1 that refers "
4890  "to member %q0 of a different class is not supported yet">;
4891def ext_template_arg_extra_parens : ExtWarn<
4892  "address non-type template argument cannot be surrounded by parentheses">;
4893def warn_cxx98_compat_template_arg_extra_parens : Warning<
4894  "redundant parentheses surrounding address non-type template argument are "
4895  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4896def err_pointer_to_member_type : Error<
4897  "invalid use of pointer to member type after %select{.*|->*}0">;
4898def err_pointer_to_member_call_drops_quals : Error<
4899  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4900def err_pointer_to_member_oper_value_classify: Error<
4901  "pointer-to-member function type %0 can only be called on an "
4902  "%select{rvalue|lvalue}1">;
4903def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4904  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
4905  InGroup<CXX20>, SFINAEFailure;
4906def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4907  "invoking a pointer to a 'const &' member function on an rvalue is "
4908  "incompatible with C++ standards before C++20">,
4909  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
4910def ext_ms_deref_template_argument: ExtWarn<
4911  "non-type template argument containing a dereference operation is a "
4912  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4913def ext_ms_delayed_template_argument: ExtWarn<
4914  "using the undeclared type %0 as a default template argument is a "
4915  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4916def err_template_arg_deduced_incomplete_pack : Error<
4917  "deduced incomplete pack %0 for template parameter %1">;
4918
4919// C++ template specialization
4920def err_template_spec_unknown_kind : Error<
4921  "can only provide an explicit specialization for a class template, function "
4922  "template, variable template, or a member function, static data member, "
4923  "%select{or member class|member class, or member enumeration}0 of a "
4924  "class template">;
4925def note_specialized_entity : Note<
4926  "explicitly specialized declaration is here">;
4927def note_explicit_specialization_declared_here : Note<
4928  "explicit specialization declared here">;
4929def err_template_spec_decl_function_scope : Error<
4930  "explicit specialization of %0 in function scope">;
4931def err_template_spec_decl_friend : Error<
4932  "cannot declare an explicit specialization in a friend">;
4933def err_template_spec_redecl_out_of_scope : Error<
4934  "%select{class template|class template partial|variable template|"
4935  "variable template partial|function template|member "
4936  "function|static data member|member class|member enumeration}0 "
4937  "specialization of %1 not in %select{a namespace enclosing %2|"
4938  "class %2 or an enclosing namespace}3">;
4939def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4940  "%select{class template|class template partial|variable template|"
4941  "variable template partial|function template|member "
4942  "function|static data member|member class|member enumeration}0 "
4943  "specialization of %1 not in %select{a namespace enclosing %2|"
4944  "class %2 or an enclosing namespace}3 "
4945  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4946def err_template_spec_redecl_global_scope : Error<
4947  "%select{class template|class template partial|variable template|"
4948  "variable template partial|function template|member "
4949  "function|static data member|member class|member enumeration}0 "
4950  "specialization of %1 must occur at global scope">;
4951def err_spec_member_not_instantiated : Error<
4952  "specialization of member %q0 does not specialize an instantiated member">;
4953def note_specialized_decl : Note<"attempt to specialize declaration here">;
4954def err_specialization_after_instantiation : Error<
4955  "explicit specialization of %0 after instantiation">;
4956def note_instantiation_required_here : Note<
4957  "%select{implicit|explicit}0 instantiation first required here">;
4958def err_template_spec_friend : Error<
4959  "template specialization declaration cannot be a friend">;
4960def err_template_spec_default_arg : Error<
4961  "default argument not permitted on an explicit "
4962  "%select{instantiation|specialization}0 of function %1">;
4963def err_not_class_template_specialization : Error<
4964  "cannot specialize a %select{dependent template|template template "
4965  "parameter}0">;
4966def ext_explicit_specialization_storage_class : ExtWarn<
4967  "explicit specialization cannot have a storage class">;
4968def err_explicit_specialization_inconsistent_storage_class : Error<
4969  "explicit specialization has extraneous, inconsistent storage class "
4970  "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4971def err_dependent_function_template_spec_no_match : Error<
4972  "no candidate function template was found for dependent"
4973  " friend function template specialization">;
4974def note_dependent_function_template_spec_discard_reason : Note<
4975  "candidate ignored: %select{not a function template"
4976  "|not a member of the enclosing namespace;"
4977  " did you mean to explicitly qualify the specialization?}0">;
4978
4979// C++ class template specializations and out-of-line definitions
4980def err_template_spec_needs_header : Error<
4981  "template specialization requires 'template<>'">;
4982def err_template_spec_needs_template_parameters : Error<
4983  "template specialization or definition requires a template parameter list "
4984  "corresponding to the nested type %0">;
4985def err_template_param_list_matches_nontemplate : Error<
4986  "template parameter list matching the non-templated nested type %0 should "
4987  "be empty ('template<>')">;
4988def err_alias_template_extra_headers : Error<
4989  "extraneous template parameter list in alias template declaration">;
4990def err_template_spec_extra_headers : Error<
4991  "extraneous template parameter list in template specialization or "
4992  "out-of-line template definition">;
4993def warn_template_spec_extra_headers : Warning<
4994  "extraneous template parameter list in template specialization">;
4995def note_explicit_template_spec_does_not_need_header : Note<
4996  "'template<>' header not required for explicitly-specialized class %0 "
4997  "declared here">;
4998def err_template_qualified_declarator_no_match : Error<
4999  "nested name specifier '%0' for declaration does not refer into a class, "
5000  "class template or class template partial specialization">;
5001def err_specialize_member_of_template : Error<
5002  "cannot specialize %select{|(with 'template<>') }0a member of an "
5003  "unspecialized template">;
5004
5005// C++ Class Template Partial Specialization
5006def err_default_arg_in_partial_spec : Error<
5007    "default template argument in a class template partial specialization">;
5008def err_dependent_non_type_arg_in_partial_spec : Error<
5009    "type of specialized non-type template argument depends on a template "
5010    "parameter of the partial specialization">;
5011def note_dependent_non_type_default_arg_in_partial_spec : Note<
5012    "template parameter is used in default argument declared here">;
5013def err_dependent_typed_non_type_arg_in_partial_spec : Error<
5014    "non-type template argument specializes a template parameter with "
5015    "dependent type %0">;
5016def err_partial_spec_args_match_primary_template : Error<
5017    "%select{class|variable}0 template partial specialization does not "
5018    "specialize any template argument; to %select{declare|define}1 the "
5019    "primary template, remove the template argument list">;
5020def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
5021    "%select{class|variable}0 template partial specialization is not "
5022    "more specialized than the primary template">, DefaultError,
5023    InGroup<DiagGroup<"invalid-partial-specialization">>;
5024def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
5025def ext_partial_specs_not_deducible : ExtWarn<
5026    "%select{class|variable}0 template partial specialization contains "
5027    "%select{a template parameter|template parameters}1 that cannot be "
5028    "deduced; this partial specialization will never be used">,
5029    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
5030def note_non_deducible_parameter : Note<
5031    "non-deducible template parameter %0">;
5032def err_partial_spec_ordering_ambiguous : Error<
5033    "ambiguous partial specializations of %0">;
5034def note_partial_spec_match : Note<"partial specialization matches %0">;
5035def err_partial_spec_redeclared : Error<
5036  "class template partial specialization %0 cannot be redeclared">;
5037def note_partial_specialization_declared_here : Note<
5038  "explicit specialization declared here">;
5039def note_prev_partial_spec_here : Note<
5040  "previous declaration of class template partial specialization %0 is here">;
5041def err_partial_spec_fully_specialized : Error<
5042  "partial specialization of %0 does not use any of its template parameters">;
5043
5044// C++ Variable Template Partial Specialization
5045def err_var_partial_spec_redeclared : Error<
5046  "variable template partial specialization %0 cannot be redefined">;
5047def note_var_prev_partial_spec_here : Note<
5048  "previous declaration of variable template partial specialization is here">;
5049def err_var_spec_no_template : Error<
5050  "no variable template matches%select{| partial}0 specialization">;
5051def err_var_spec_no_template_but_method : Error<
5052  "no variable template matches specialization; "
5053  "did you mean to use %0 as function template instead?">;
5054
5055// C++ Function template specializations
5056def err_function_template_spec_no_match : Error<
5057    "no function template matches function template specialization %0">;
5058def err_function_template_spec_ambiguous : Error<
5059    "function template specialization %0 ambiguously refers to more than one "
5060    "function template; explicitly specify%select{| additional}1 template "
5061    "arguments to identify a particular function template">;
5062def note_function_template_spec_matched : Note<
5063    "function template %q0 matches specialization %1">;
5064def err_function_template_partial_spec : Error<
5065    "function template partial specialization is not allowed">;
5066
5067// C++ Template Instantiation
5068def err_template_recursion_depth_exceeded : Error<
5069  "recursive template instantiation exceeded maximum depth of %0">,
5070  DefaultFatal, NoSFINAE;
5071def note_template_recursion_depth : Note<
5072  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
5073
5074def err_template_instantiate_within_definition : Error<
5075  "%select{implicit|explicit}0 instantiation of template %1 within its"
5076  " own definition">;
5077def err_template_instantiate_undefined : Error<
5078  "%select{implicit|explicit}0 instantiation of undefined template %1">;
5079def err_implicit_instantiate_member_undefined : Error<
5080  "implicit instantiation of undefined member %0">;
5081def note_template_class_instantiation_was_here : Note<
5082  "class template %0 was instantiated here">;
5083def note_template_class_explicit_specialization_was_here : Note<
5084  "class template %0 was explicitly specialized here">;
5085def note_template_class_instantiation_here : Note<
5086  "in instantiation of template class %q0 requested here">;
5087def note_template_member_class_here : Note<
5088  "in instantiation of member class %q0 requested here">;
5089def note_template_member_function_here : Note<
5090  "in instantiation of member function %q0 requested here">;
5091def note_function_template_spec_here : Note<
5092  "in instantiation of function template specialization %q0 requested here">;
5093def note_template_static_data_member_def_here : Note<
5094  "in instantiation of static data member %q0 requested here">;
5095def note_template_variable_def_here : Note<
5096  "in instantiation of variable template specialization %q0 requested here">;
5097def note_template_enum_def_here : Note<
5098  "in instantiation of enumeration %q0 requested here">;
5099def note_template_nsdmi_here : Note<
5100  "in instantiation of default member initializer %q0 requested here">;
5101def note_template_type_alias_instantiation_here : Note<
5102  "in instantiation of template type alias %0 requested here">;
5103def note_template_exception_spec_instantiation_here : Note<
5104  "in instantiation of exception specification for %0 requested here">;
5105def note_template_requirement_instantiation_here : Note<
5106  "in instantiation of requirement here">;
5107def warn_var_template_missing : Warning<"instantiation of variable %q0 "
5108  "required here, but no definition is available">,
5109  InGroup<UndefinedVarTemplate>;
5110def warn_func_template_missing : Warning<"instantiation of function %q0 "
5111  "required here, but no definition is available">,
5112  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
5113def note_forward_template_decl : Note<
5114  "forward declaration of template entity is here">;
5115def note_inst_declaration_hint : Note<"add an explicit instantiation "
5116  "declaration to suppress this warning if %q0 is explicitly instantiated in "
5117  "another translation unit">;
5118def note_evaluating_exception_spec_here : Note<
5119  "in evaluation of exception specification for %q0 needed here">;
5120
5121def note_default_arg_instantiation_here : Note<
5122  "in instantiation of default argument for '%0' required here">;
5123def note_default_function_arg_instantiation_here : Note<
5124  "in instantiation of default function argument expression "
5125  "for '%0' required here">;
5126def note_explicit_template_arg_substitution_here : Note<
5127  "while substituting explicitly-specified template arguments into function "
5128  "template %0 %1">;
5129def note_function_template_deduction_instantiation_here : Note<
5130  "while substituting deduced template arguments into function template %0 "
5131  "%1">;
5132def note_deduced_template_arg_substitution_here : Note<
5133  "during template argument deduction for %select{class|variable}0 template "
5134  "%select{partial specialization |}1%2 %3">;
5135def note_prior_template_arg_substitution : Note<
5136  "while substituting prior template arguments into %select{non-type|template}0"
5137  " template parameter%1 %2">;
5138def note_template_default_arg_checking : Note<
5139  "while checking a default template argument used here">;
5140def note_concept_specialization_here : Note<
5141  "while checking the satisfaction of concept '%0' requested here">;
5142def note_nested_requirement_here : Note<
5143  "while checking the satisfaction of nested requirement requested here">;
5144def note_checking_constraints_for_template_id_here : Note<
5145  "while checking constraint satisfaction for template '%0' required here">;
5146def note_checking_constraints_for_var_spec_id_here : Note<
5147  "while checking constraint satisfaction for variable template "
5148  "partial specialization '%0' required here">;
5149def note_checking_constraints_for_class_spec_id_here : Note<
5150  "while checking constraint satisfaction for class template partial "
5151  "specialization '%0' required here">;
5152def note_checking_constraints_for_function_here : Note<
5153  "while checking constraint satisfaction for function '%0' required here">;
5154def note_constraint_substitution_here : Note<
5155  "while substituting template arguments into constraint expression here">;
5156def note_constraint_normalization_here : Note<
5157  "while calculating associated constraint of template '%0' here">;
5158def note_parameter_mapping_substitution_here : Note<
5159  "while substituting into concept arguments here; substitution failures not "
5160  "allowed in concept arguments">;
5161def note_instantiation_contexts_suppressed : Note<
5162  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5163  "see all)">;
5164
5165def err_field_instantiates_to_function : Error<
5166  "data member instantiated with function type %0">;
5167def err_variable_instantiates_to_function : Error<
5168  "%select{variable|static data member}0 instantiated with function type %1">;
5169def err_nested_name_spec_non_tag : Error<
5170  "type %0 cannot be used prior to '::' because it has no members">;
5171
5172def err_using_pack_expansion_empty : Error<
5173  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5174
5175// C++ Explicit Instantiation
5176def err_explicit_instantiation_duplicate : Error<
5177    "duplicate explicit instantiation of %0">;
5178def ext_explicit_instantiation_duplicate : ExtWarn<
5179    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5180    InGroup<MicrosoftTemplate>;
5181def note_previous_explicit_instantiation : Note<
5182    "previous explicit instantiation is here">;
5183def warn_explicit_instantiation_after_specialization : Warning<
5184  "explicit instantiation of %0 that occurs after an explicit "
5185  "specialization has no effect">,
5186  InGroup<DiagGroup<"instantiation-after-specialization">>;
5187def note_previous_template_specialization : Note<
5188    "previous template specialization is here">;
5189def err_explicit_instantiation_nontemplate_type : Error<
5190    "explicit instantiation of non-templated type %0">;
5191def note_nontemplate_decl_here : Note<
5192    "non-templated declaration is here">;
5193def err_explicit_instantiation_in_class : Error<
5194  "explicit instantiation of %0 in class scope">;
5195def err_explicit_instantiation_out_of_scope : Error<
5196  "explicit instantiation of %0 not in a namespace enclosing %1">;
5197def err_explicit_instantiation_must_be_global : Error<
5198  "explicit instantiation of %0 must occur at global scope">;
5199def warn_explicit_instantiation_out_of_scope_0x : Warning<
5200  "explicit instantiation of %0 not in a namespace enclosing %1">,
5201  InGroup<CXX11Compat>, DefaultIgnore;
5202def warn_explicit_instantiation_must_be_global_0x : Warning<
5203  "explicit instantiation of %0 must occur at global scope">,
5204  InGroup<CXX11Compat>, DefaultIgnore;
5205
5206def err_explicit_instantiation_requires_name : Error<
5207  "explicit instantiation declaration requires a name">;
5208def err_explicit_instantiation_of_typedef : Error<
5209  "explicit instantiation of typedef %0">;
5210def err_explicit_instantiation_storage_class : Error<
5211  "explicit instantiation cannot have a storage class">;
5212def err_explicit_instantiation_internal_linkage : Error<
5213  "explicit instantiation declaration of %0 with internal linkage">;
5214def err_explicit_instantiation_not_known : Error<
5215  "explicit instantiation of %0 does not refer to a function template, "
5216  "variable template, member function, member class, or static data member">;
5217def note_explicit_instantiation_here : Note<
5218  "explicit instantiation refers here">;
5219def err_explicit_instantiation_data_member_not_instantiated : Error<
5220  "explicit instantiation refers to static data member %q0 that is not an "
5221  "instantiation">;
5222def err_explicit_instantiation_member_function_not_instantiated : Error<
5223  "explicit instantiation refers to member function %q0 that is not an "
5224  "instantiation">;
5225def err_explicit_instantiation_ambiguous : Error<
5226  "partial ordering for explicit instantiation of %0 is ambiguous">;
5227def note_explicit_instantiation_candidate : Note<
5228  "explicit instantiation candidate function %q0 template here %1">;
5229def err_explicit_instantiation_inline : Error<
5230  "explicit instantiation cannot be 'inline'">;
5231def warn_explicit_instantiation_inline_0x : Warning<
5232  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5233  DefaultIgnore;
5234def err_explicit_instantiation_constexpr : Error<
5235  "explicit instantiation cannot be 'constexpr'">;
5236def ext_explicit_instantiation_without_qualified_id : Extension<
5237  "qualifier in explicit instantiation of %q0 requires a template-id "
5238  "(a typedef is not permitted)">;
5239def err_explicit_instantiation_without_template_id : Error<
5240  "explicit instantiation of %q0 must specify a template argument list">;
5241def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5242  "explicit instantiation of %q0 must occur in namespace %1">;
5243def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5244  "explicit instantiation of %q0 must occur in namespace %1">,
5245  InGroup<CXX11Compat>, DefaultIgnore;
5246def err_explicit_instantiation_undefined_member : Error<
5247  "explicit instantiation of undefined %select{member class|member function|"
5248  "static data member}0 %1 of class template %2">;
5249def err_explicit_instantiation_undefined_func_template : Error<
5250  "explicit instantiation of undefined function template %0">;
5251def err_explicit_instantiation_undefined_var_template : Error<
5252  "explicit instantiation of undefined variable template %q0">;
5253def err_explicit_instantiation_declaration_after_definition : Error<
5254  "explicit instantiation declaration (with 'extern') follows explicit "
5255  "instantiation definition (without 'extern')">;
5256def note_explicit_instantiation_definition_here : Note<
5257  "explicit instantiation definition is here">;
5258def err_invalid_var_template_spec_type : Error<"type %2 "
5259  "of %select{explicit instantiation|explicit specialization|"
5260  "partial specialization|redeclaration}0 of %1 does not match"
5261  " expected type %3">;
5262def err_mismatched_exception_spec_explicit_instantiation : Error<
5263  "exception specification in explicit instantiation does not match "
5264  "instantiated one">;
5265def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5266  err_mismatched_exception_spec_explicit_instantiation.Text>,
5267  InGroup<MicrosoftExceptionSpec>;
5268def err_explicit_instantiation_dependent : Error<
5269  "explicit instantiation has dependent template arguments">;
5270
5271// C++ typename-specifiers
5272def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5273def err_typename_nested_not_found_enable_if : Error<
5274  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5275  "this declaration">;
5276def err_typename_nested_not_found_requirement : Error<
5277  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5278  "declaration">;
5279def err_typename_nested_not_type : Error<
5280    "typename specifier refers to non-type member %0 in %1">;
5281def err_typename_not_type : Error<
5282    "typename specifier refers to non-type %0">;
5283def note_typename_member_refers_here : Note<
5284    "referenced member %0 is declared here">;
5285def note_typename_refers_here : Note<
5286    "referenced %0 is declared here">;
5287def err_typename_missing : Error<
5288  "missing 'typename' prior to dependent type name '%0%1'">;
5289def err_typename_missing_template : Error<
5290  "missing 'typename' prior to dependent type template name '%0%1'">;
5291def ext_typename_missing : ExtWarn<
5292  "missing 'typename' prior to dependent type name '%0%1'">,
5293  InGroup<DiagGroup<"typename-missing">>;
5294def ext_typename_outside_of_template : ExtWarn<
5295  "'typename' occurs outside of a template">, InGroup<CXX11>;
5296def warn_cxx98_compat_typename_outside_of_template : Warning<
5297  "use of 'typename' outside of a template is incompatible with C++98">,
5298  InGroup<CXX98Compat>, DefaultIgnore;
5299def err_typename_refers_to_using_value_decl : Error<
5300  "typename specifier refers to a dependent using declaration for a value "
5301  "%0 in %1">;
5302def note_using_value_decl_missing_typename : Note<
5303  "add 'typename' to treat this using declaration as a type">;
5304
5305def err_template_kw_refers_to_non_template : Error<
5306  "%0%select{| following the 'template' keyword}1 "
5307  "does not refer to a template">;
5308def note_template_kw_refers_to_non_template : Note<
5309  "declared as a non-template here">;
5310def err_template_kw_refers_to_dependent_non_template : Error<
5311  "%0%select{| following the 'template' keyword}1 "
5312  "cannot refer to a dependent template">;
5313def err_template_kw_refers_to_class_template : Error<
5314  "'%0%1' instantiated to a class template, not a function template">;
5315def note_referenced_class_template : Note<
5316  "class template declared here">;
5317def err_template_kw_missing : Error<
5318  "missing 'template' keyword prior to dependent template name '%0%1'">;
5319def ext_template_outside_of_template : ExtWarn<
5320  "'template' keyword outside of a template">, InGroup<CXX11>;
5321def warn_cxx98_compat_template_outside_of_template : Warning<
5322  "use of 'template' keyword outside of a template is incompatible with C++98">,
5323  InGroup<CXX98Compat>, DefaultIgnore;
5324
5325def err_non_type_template_in_nested_name_specifier : Error<
5326  "qualified name refers into a specialization of %select{function|variable}0 "
5327  "template %1">;
5328def err_template_id_not_a_type : Error<
5329  "template name refers to non-type template %0">;
5330def note_template_declared_here : Note<
5331  "%select{function template|class template|variable template"
5332  "|type alias template|template template parameter}0 "
5333  "%1 declared here">;
5334def err_template_expansion_into_fixed_list : Error<
5335  "pack expansion used as argument for non-pack parameter of %select{alias "
5336  "template|concept}0">;
5337def note_parameter_type : Note<
5338  "parameter of type %0 is declared here">;
5339
5340// C++11 Variadic Templates
5341def err_template_param_pack_default_arg : Error<
5342  "template parameter pack cannot have a default argument">;
5343def err_template_param_pack_must_be_last_template_parameter : Error<
5344  "template parameter pack must be the last template parameter">;
5345
5346def err_template_parameter_pack_non_pack : Error<
5347  "%select{template type|non-type template|template template}0 parameter"
5348  "%select{| pack}1 conflicts with previous %select{template type|"
5349  "non-type template|template template}0 parameter%select{ pack|}1">;
5350def note_template_parameter_pack_non_pack : Note<
5351  "%select{template type|non-type template|template template}0 parameter"
5352  "%select{| pack}1 does not match %select{template type|non-type template"
5353  "|template template}0 parameter%select{ pack|}1 in template argument">;
5354def note_template_parameter_pack_here : Note<
5355  "previous %select{template type|non-type template|template template}0 "
5356  "parameter%select{| pack}1 declared here">;
5357
5358def err_unexpanded_parameter_pack : Error<
5359  "%select{expression|base type|declaration type|data member type|bit-field "
5360  "size|static assertion|fixed underlying type|enumerator value|"
5361  "using declaration|friend declaration|qualifier|initializer|default argument|"
5362  "non-type template parameter type|exception type|partial specialization|"
5363  "__if_exists name|__if_not_exists name|lambda|block|type constraint|"
5364  "requirement|requires clause}0 "
5365  "contains%plural{0: an|:}1 unexpanded parameter pack"
5366  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5367
5368def err_pack_expansion_without_parameter_packs : Error<
5369  "pack expansion does not contain any unexpanded parameter packs">;
5370def err_pack_expansion_length_conflict : Error<
5371  "pack expansion contains parameter packs %0 and %1 that have different "
5372  "lengths (%2 vs. %3)">;
5373def err_pack_expansion_length_conflict_multilevel : Error<
5374  "pack expansion contains parameter pack %0 that has a different "
5375  "length (%1 vs. %2) from outer parameter packs">;
5376def err_pack_expansion_length_conflict_partial : Error<
5377  "pack expansion contains parameter pack %0 that has a different "
5378  "length (at least %1 vs. %2) from outer parameter packs">;
5379def err_pack_expansion_member_init : Error<
5380  "pack expansion for initialization of member %0">;
5381
5382def err_function_parameter_pack_without_parameter_packs : Error<
5383  "type %0 of function parameter pack does not contain any unexpanded "
5384  "parameter packs">;
5385def err_ellipsis_in_declarator_not_parameter : Error<
5386  "only function and template parameters can be parameter packs">;
5387
5388def err_sizeof_pack_no_pack_name : Error<
5389  "%0 does not refer to the name of a parameter pack">;
5390
5391def err_fold_expression_packs_both_sides : Error<
5392  "binary fold expression has unexpanded parameter packs in both operands">;
5393def err_fold_expression_empty : Error<
5394  "unary fold expression has empty expansion for operator '%0' "
5395  "with no fallback value">;
5396def err_fold_expression_bad_operand : Error<
5397  "expression not permitted as operand of fold expression">;
5398def err_fold_expression_limit_exceeded: Error<
5399  "instantiating fold expression with %0 arguments exceeded expression nesting "
5400  "limit of %1">, DefaultFatal, NoSFINAE;
5401
5402def err_unexpected_typedef : Error<
5403  "unexpected type name %0: expected expression">;
5404def err_unexpected_namespace : Error<
5405  "unexpected namespace name %0: expected expression">;
5406def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5407def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5408  "use of undeclared identifier %0; "
5409  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5410  InGroup<MicrosoftTemplate>;
5411def err_found_in_dependent_base : Error<
5412  "explicit qualification required to use member %0 from dependent base class">;
5413def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5414  "found via unqualified lookup into dependent bases of class templates is a "
5415  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5416def err_found_later_in_class : Error<"member %0 used before its declaration">;
5417def ext_found_later_in_class : ExtWarn<
5418  "use of member %0 before its declaration is a Microsoft extension">,
5419  InGroup<MicrosoftTemplate>;
5420def note_dependent_member_use : Note<
5421  "must qualify identifier to find this declaration in dependent base class">;
5422def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5423    "visible in the template definition nor found by argument-dependent lookup">;
5424def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5425    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5426def err_undeclared_use : Error<"use of undeclared %0">;
5427def warn_deprecated : Warning<"%0 is deprecated">,
5428    InGroup<DeprecatedDeclarations>;
5429def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5430def warn_property_method_deprecated :
5431    Warning<"property access is using %0 method which is deprecated">,
5432    InGroup<DeprecatedDeclarations>;
5433def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5434    InGroup<DeprecatedDeclarations>;
5435def warn_deprecated_anonymous_namespace : Warning<
5436  "'deprecated' attribute on anonymous namespace ignored">,
5437  InGroup<IgnoredAttributes>;
5438def warn_deprecated_fwdclass_message : Warning<
5439    "%0 may be deprecated because the receiver type is unknown">,
5440    InGroup<DeprecatedDeclarations>;
5441def warn_deprecated_def : Warning<
5442  "implementing deprecated %select{method|class|category}0">,
5443  InGroup<DeprecatedImplementations>, DefaultIgnore;
5444def warn_unavailable_def : Warning<
5445  "implementing unavailable method">,
5446  InGroup<DeprecatedImplementations>, DefaultIgnore;
5447def err_unavailable : Error<"%0 is unavailable">;
5448def err_property_method_unavailable :
5449    Error<"property access is using %0 method which is unavailable">;
5450def err_unavailable_message : Error<"%0 is unavailable: %1">;
5451def warn_unavailable_fwdclass_message : Warning<
5452    "%0 may be unavailable because the receiver type is unknown">,
5453    InGroup<UnavailableDeclarations>;
5454def note_availability_specified_here : Note<
5455  "%0 has been explicitly marked "
5456  "%select{unavailable|deleted|deprecated}1 here">;
5457def note_partial_availability_specified_here : Note<
5458  "%0 has been marked as being introduced in %1 %2 here, "
5459  "but the deployment target is %1 %3">;
5460def note_implicitly_deleted : Note<
5461  "explicitly defaulted function was implicitly deleted here">;
5462def warn_not_enough_argument : Warning<
5463  "not enough variable arguments in %0 declaration to fit a sentinel">,
5464  InGroup<Sentinel>;
5465def warn_missing_sentinel : Warning <
5466  "missing sentinel in %select{function call|method dispatch|block call}0">,
5467  InGroup<Sentinel>;
5468def note_sentinel_here : Note<
5469  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5470def warn_missing_prototype : Warning<
5471  "no previous prototype for function %0">,
5472  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5473def note_declaration_not_a_prototype : Note<
5474  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5475  "to make it %select{a prototype for a zero-parameter function|one}0">;
5476def warn_strict_prototypes : Warning<
5477  "this %select{function declaration is not|block declaration is not|"
5478  "old-style function definition is not preceded by}0 a prototype">,
5479  InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
5480def warn_missing_variable_declarations : Warning<
5481  "no previous extern declaration for non-static variable %0">,
5482  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5483def note_static_for_internal_linkage : Note<
5484  "declare 'static' if the %select{variable|function}0 is not intended to be "
5485  "used outside of this translation unit">;
5486def err_static_data_member_reinitialization :
5487  Error<"static data member %0 already has an initializer">;
5488def err_redefinition : Error<"redefinition of %0">;
5489def err_alias_after_tentative :
5490  Error<"alias definition of %0 after tentative definition">;
5491def err_alias_is_definition :
5492  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5493def err_definition_of_implicitly_declared_member : Error<
5494  "definition of implicitly declared %select{default constructor|copy "
5495  "constructor|move constructor|copy assignment operator|move assignment "
5496  "operator|destructor|function}1">;
5497def err_definition_of_explicitly_defaulted_member : Error<
5498  "definition of explicitly defaulted %select{default constructor|copy "
5499  "constructor|move constructor|copy assignment operator|move assignment "
5500  "operator|destructor|function}0">;
5501def err_redefinition_extern_inline : Error<
5502  "redefinition of a 'extern inline' function %0 is not supported in "
5503  "%select{C99 mode|C++}1">;
5504def warn_attr_abi_tag_namespace : Warning<
5505  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5506  InGroup<IgnoredAttributes>;
5507def err_abi_tag_on_redeclaration : Error<
5508  "cannot add 'abi_tag' attribute in a redeclaration">;
5509def err_new_abi_tag_on_redeclaration : Error<
5510  "'abi_tag' %0 missing in original declaration">;
5511def note_use_ifdef_guards : Note<
5512  "unguarded header; consider using #ifdef guards or #pragma once">;
5513
5514def note_deleted_dtor_no_operator_delete : Note<
5515  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5516def note_deleted_special_member_class_subobject : Note<
5517  "%select{default constructor of|copy constructor of|move constructor of|"
5518  "copy assignment operator of|move assignment operator of|destructor of|"
5519  "constructor inherited by}0 "
5520  "%1 is implicitly deleted because "
5521  "%select{base class %3|%select{||||variant }4field %3}2 "
5522  "%select{has "
5523  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
5524  "%select{%select{default constructor|copy constructor|move constructor|copy "
5525  "assignment operator|move assignment operator|destructor|"
5526  "%select{default|corresponding|default|default|default}4 constructor}0|"
5527  "destructor}5"
5528  "%select{||s||}4"
5529  "|is an ObjC pointer}6">;
5530def note_deleted_default_ctor_uninit_field : Note<
5531  "%select{default constructor of|constructor inherited by}0 "
5532  "%1 is implicitly deleted because field %2 of "
5533  "%select{reference|const-qualified}4 type %3 would not be initialized">;
5534def note_deleted_default_ctor_all_const : Note<
5535  "%select{default constructor of|constructor inherited by}0 "
5536  "%1 is implicitly deleted because all "
5537  "%select{data members|data members of an anonymous union member}2"
5538  " are const-qualified">;
5539def note_deleted_copy_ctor_rvalue_reference : Note<
5540  "copy constructor of %0 is implicitly deleted because field %1 is of "
5541  "rvalue reference type %2">;
5542def note_deleted_copy_user_declared_move : Note<
5543  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
5544  " %1 has a user-declared move %select{constructor|assignment operator}2">;
5545def note_deleted_assign_field : Note<
5546  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
5547  "because field %2 is of %select{reference|const-qualified}4 type %3">;
5548
5549// These should be errors.
5550def warn_undefined_internal : Warning<
5551  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
5552  InGroup<DiagGroup<"undefined-internal">>;
5553def err_undefined_internal_type : Error<
5554  "%select{function|variable}0 %q1 is used but not defined in this "
5555  "translation unit, and cannot be defined in any other translation unit "
5556  "because its type does not have linkage">;
5557def ext_undefined_internal_type : Extension<
5558  "ISO C++ requires a definition in this translation unit for "
5559  "%select{function|variable}0 %q1 because its type does not have linkage">,
5560  InGroup<DiagGroup<"undefined-internal-type">>;
5561def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
5562  InGroup<DiagGroup<"undefined-inline">>;
5563def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
5564def note_used_here : Note<"used here">;
5565
5566def err_internal_linkage_redeclaration : Error<
5567  "'internal_linkage' attribute does not appear on the first declaration of %0">;
5568def warn_internal_linkage_local_storage : Warning<
5569  "'internal_linkage' attribute on a non-static local variable is ignored">,
5570  InGroup<IgnoredAttributes>;
5571
5572def ext_internal_in_extern_inline : ExtWarn<
5573  "static %select{function|variable}0 %1 is used in an inline function with "
5574  "external linkage">, InGroup<StaticInInline>;
5575def ext_internal_in_extern_inline_quiet : Extension<
5576  "static %select{function|variable}0 %1 is used in an inline function with "
5577  "external linkage">, InGroup<StaticInInline>;
5578def warn_static_local_in_extern_inline : Warning<
5579  "non-constant static local variable in inline function may be different "
5580  "in different files">, InGroup<StaticLocalInInline>;
5581def note_convert_inline_to_static : Note<
5582  "use 'static' to give inline function %0 internal linkage">;
5583
5584def ext_redefinition_of_typedef : ExtWarn<
5585  "redefinition of typedef %0 is a C11 feature">,
5586  InGroup<DiagGroup<"typedef-redefinition"> >;
5587def err_redefinition_variably_modified_typedef : Error<
5588  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
5589
5590def err_inline_decl_follows_def : Error<
5591  "inline declaration of %0 follows non-inline definition">;
5592def err_inline_declaration_block_scope : Error<
5593  "inline declaration of %0 not allowed in block scope">;
5594def err_static_non_static : Error<
5595  "static declaration of %0 follows non-static declaration">;
5596def err_different_language_linkage : Error<
5597  "declaration of %0 has a different language linkage">;
5598def ext_retained_language_linkage : Extension<
5599  "friend function %0 retaining previous language linkage is an extension">,
5600  InGroup<DiagGroup<"retained-language-linkage">>;
5601def err_extern_c_global_conflict : Error<
5602  "declaration of %1 %select{with C language linkage|in global scope}0 "
5603  "conflicts with declaration %select{in global scope|with C language linkage}0">;
5604def note_extern_c_global_conflict : Note<
5605  "declared %select{in global scope|with C language linkage}0 here">;
5606def note_extern_c_begins_here : Note<
5607  "extern \"C\" language linkage specification begins here">;
5608def warn_weak_import : Warning <
5609  "an already-declared variable is made a weak_import declaration %0">;
5610def ext_static_non_static : Extension<
5611  "redeclaring non-static %0 as static is a Microsoft extension">,
5612  InGroup<MicrosoftRedeclareStatic>;
5613def err_non_static_static : Error<
5614  "non-static declaration of %0 follows static declaration">;
5615def err_extern_non_extern : Error<
5616  "extern declaration of %0 follows non-extern declaration">;
5617def err_non_extern_extern : Error<
5618  "non-extern declaration of %0 follows extern declaration">;
5619def err_non_thread_thread : Error<
5620  "non-thread-local declaration of %0 follows thread-local declaration">;
5621def err_thread_non_thread : Error<
5622  "thread-local declaration of %0 follows non-thread-local declaration">;
5623def err_thread_thread_different_kind : Error<
5624  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
5625  "follows declaration with %select{dynamic|static}1 initialization">;
5626def err_mismatched_owning_module : Error<
5627  "declaration of %0 in %select{the global module|module %2}1 follows "
5628  "declaration in %select{the global module|module %4}3">;
5629def err_redefinition_different_type : Error<
5630  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
5631def err_redefinition_different_kind : Error<
5632  "redefinition of %0 as different kind of symbol">;
5633def err_redefinition_different_namespace_alias : Error<
5634  "redefinition of %0 as an alias for a different namespace">;
5635def note_previous_namespace_alias : Note<
5636  "previously defined as an alias for %0">;
5637def warn_forward_class_redefinition : Warning<
5638  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
5639  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
5640def err_redefinition_different_typedef : Error<
5641  "%select{typedef|type alias|type alias template}0 "
5642  "redefinition with different types%diff{ ($ vs $)|}1,2">;
5643def err_tag_reference_non_tag : Error<
5644  "%select{non-struct type|non-class type|non-union type|non-enum "
5645  "type|typedef|type alias|template|type alias template|template "
5646  "template argument}1 %0 cannot be referenced with a "
5647  "%select{struct|interface|union|class|enum}2 specifier">;
5648def err_tag_reference_conflict : Error<
5649  "implicit declaration introduced by elaborated type conflicts with a "
5650  "%select{non-struct type|non-class type|non-union type|non-enum "
5651  "type|typedef|type alias|template|type alias template|template "
5652  "template argument}0 of the same name">;
5653def err_dependent_tag_decl : Error<
5654  "%select{declaration|definition}0 of "
5655  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
5656def err_tag_definition_of_typedef : Error<
5657  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
5658def err_conflicting_types : Error<"conflicting types for %0">;
5659def err_different_pass_object_size_params : Error<
5660  "conflicting pass_object_size attributes on parameters">;
5661def err_late_asm_label_name : Error<
5662  "cannot apply asm label to %select{variable|function}0 after its first use">;
5663def err_different_asm_label : Error<"conflicting asm label">;
5664def err_nested_redefinition : Error<"nested redefinition of %0">;
5665def err_use_with_wrong_tag : Error<
5666  "use of %0 with tag type that does not match previous declaration">;
5667def warn_struct_class_tag_mismatch : Warning<
5668  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
5669  "declared as a %select{struct|interface|class}3%select{| template}1; "
5670  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5671  InGroup<MismatchedTags>, DefaultIgnore;
5672def warn_struct_class_previous_tag_mismatch : Warning<
5673  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
5674  "here but previously declared as "
5675  "%select{a struct|an interface|a class}3%select{| template}1; "
5676  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5677  InGroup<MismatchedTags>, DefaultIgnore;
5678def note_struct_class_suggestion : Note<
5679  "did you mean %select{struct|interface|class}0 here?">;
5680def ext_forward_ref_enum : Extension<
5681  "ISO C forbids forward references to 'enum' types">;
5682def err_forward_ref_enum : Error<
5683  "ISO C++ forbids forward references to 'enum' types">;
5684def ext_ms_forward_ref_enum : ExtWarn<
5685  "forward references to 'enum' types are a Microsoft extension">,
5686  InGroup<MicrosoftEnumForwardReference>;
5687def ext_forward_ref_enum_def : Extension<
5688  "redeclaration of already-defined enum %0 is a GNU extension">,
5689  InGroup<GNURedeclaredEnum>;
5690
5691def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
5692def err_duplicate_member : Error<"duplicate member %0">;
5693def err_misplaced_ivar : Error<
5694  "instance variables may not be placed in %select{categories|class extension}0">;
5695def warn_ivars_in_interface : Warning<
5696  "declaration of instance variables in the interface is deprecated">,
5697  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
5698def ext_enum_value_not_int : Extension<
5699  "ISO C restricts enumerator values to range of 'int' (%0 is too "
5700  "%select{small|large}1)">;
5701def ext_enum_too_large : ExtWarn<
5702  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
5703def ext_enumerator_increment_too_large : ExtWarn<
5704  "incremented enumerator value %0 is not representable in the "
5705  "largest integer type">, InGroup<EnumTooLarge>;
5706def warn_flag_enum_constant_out_of_range : Warning<
5707  "enumeration value %0 is out of range of flags in enumeration type %1">,
5708  InGroup<FlagEnum>;
5709
5710def err_vm_decl_in_file_scope : Error<
5711  "variably modified type declaration not allowed at file scope">;
5712def err_vm_decl_has_extern_linkage : Error<
5713  "variably modified type declaration cannot have 'extern' linkage">;
5714def err_typecheck_field_variable_size : Error<
5715  "fields must have a constant size: 'variable length array in structure' "
5716  "extension will never be supported">;
5717def err_vm_func_decl : Error<
5718  "function declaration cannot have variably modified type">;
5719def err_array_too_large : Error<
5720  "array is too large (%0 elements)">;
5721
5722def err_typecheck_negative_array_size : Error<"array size is negative">;
5723def warn_typecheck_function_qualifiers_ignored : Warning<
5724  "'%0' qualifier on function type %1 has no effect">,
5725  InGroup<IgnoredQualifiers>;
5726def warn_typecheck_function_qualifiers_unspecified : Warning<
5727  "'%0' qualifier on function type %1 has unspecified behavior">;
5728def warn_typecheck_reference_qualifiers : Warning<
5729  "'%0' qualifier on reference type %1 has no effect">,
5730  InGroup<IgnoredQualifiers>;
5731def err_typecheck_invalid_restrict_not_pointer : Error<
5732  "restrict requires a pointer or reference (%0 is invalid)">;
5733def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
5734  "restrict requires a pointer or reference">;
5735def err_typecheck_invalid_restrict_invalid_pointee : Error<
5736  "pointer to function type %0 may not be 'restrict' qualified">;
5737def ext_typecheck_zero_array_size : Extension<
5738  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
5739def err_typecheck_zero_array_size : Error<
5740  "zero-length arrays are not permitted in C++">;
5741def err_array_size_non_int : Error<"size of array has non-integer type %0">;
5742def err_init_element_not_constant : Error<
5743  "initializer element is not a compile-time constant">;
5744def ext_aggregate_init_not_constant : Extension<
5745  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
5746def err_local_cant_init : Error<
5747  "'__local' variable cannot have an initializer">;
5748def err_loader_uninitialized_cant_init
5749    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
5750            "initializer">;
5751def err_loader_uninitialized_trivial_ctor
5752    : Error<"variable with 'loader_uninitialized' attribute must have a "
5753            "trivial default constructor">;
5754def err_loader_uninitialized_redeclaration
5755    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
5756def err_loader_uninitialized_extern_decl
5757    : Error<"variable %0 cannot be declared both 'extern' and with the "
5758            "'loader_uninitialized' attribute">;
5759def err_block_extern_cant_init : Error<
5760  "'extern' variable cannot have an initializer">;
5761def warn_extern_init : Warning<"'extern' variable has an initializer">,
5762  InGroup<DiagGroup<"extern-initializer">>;
5763def err_variable_object_no_init : Error<
5764  "variable-sized object may not be initialized">;
5765def err_excess_initializers : Error<
5766  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
5767def ext_excess_initializers : ExtWarn<
5768  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
5769  InGroup<ExcessInitializers>;
5770def err_excess_initializers_for_sizeless_type : Error<
5771  "excess elements in initializer for indivisible sizeless type %0">;
5772def ext_excess_initializers_for_sizeless_type : ExtWarn<
5773  "excess elements in initializer for indivisible sizeless type %0">,
5774  InGroup<ExcessInitializers>;
5775def err_excess_initializers_in_char_array_initializer : Error<
5776  "excess elements in char array initializer">;
5777def ext_excess_initializers_in_char_array_initializer : ExtWarn<
5778  "excess elements in char array initializer">,
5779  InGroup<ExcessInitializers>;
5780def err_initializer_string_for_char_array_too_long : Error<
5781  "initializer-string for char array is too long">;
5782def ext_initializer_string_for_char_array_too_long : ExtWarn<
5783  "initializer-string for char array is too long">,
5784  InGroup<ExcessInitializers>;
5785def warn_missing_field_initializers : Warning<
5786  "missing field %0 initializer">,
5787  InGroup<MissingFieldInitializers>, DefaultIgnore;
5788def warn_braces_around_init : Warning<
5789  "braces around %select{scalar |}0initializer">,
5790  InGroup<DiagGroup<"braced-scalar-init">>;
5791def ext_many_braces_around_init : ExtWarn<
5792  "too many braces around %select{scalar |}0initializer">,
5793  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5794def ext_complex_component_init : Extension<
5795  "complex initialization specifying real and imaginary components "
5796  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5797def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5798def err_empty_sizeless_initializer : Error<
5799  "initializer for sizeless type %0 cannot be empty">;
5800def warn_cxx98_compat_empty_scalar_initializer : Warning<
5801  "scalar initialized from empty initializer list is incompatible with C++98">,
5802  InGroup<CXX98Compat>, DefaultIgnore;
5803def warn_cxx98_compat_empty_sizeless_initializer : Warning<
5804  "initializing %0 from an empty initializer list is incompatible with C++98">,
5805  InGroup<CXX98Compat>, DefaultIgnore;
5806def warn_cxx98_compat_reference_list_init : Warning<
5807  "reference initialized from initializer list is incompatible with C++98">,
5808  InGroup<CXX98Compat>, DefaultIgnore;
5809def warn_cxx98_compat_initializer_list_init : Warning<
5810  "initialization of initializer_list object is incompatible with C++98">,
5811  InGroup<CXX98Compat>, DefaultIgnore;
5812def warn_cxx98_compat_ctor_list_init : Warning<
5813  "constructor call from initializer list is incompatible with C++98">,
5814  InGroup<CXX98Compat>, DefaultIgnore;
5815def err_illegal_initializer : Error<
5816  "illegal initializer (only variables can be initialized)">;
5817def err_illegal_initializer_type : Error<"illegal initializer type %0">;
5818def ext_init_list_type_narrowing : ExtWarn<
5819  "type %0 cannot be narrowed to %1 in initializer list">,
5820  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5821def ext_init_list_variable_narrowing : ExtWarn<
5822  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5823  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5824def ext_init_list_constant_narrowing : ExtWarn<
5825  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
5826  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5827def warn_init_list_type_narrowing : Warning<
5828  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
5829  InGroup<CXX11Narrowing>, DefaultIgnore;
5830def warn_init_list_variable_narrowing : Warning<
5831  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5832  "initializer list in C++11">,
5833  InGroup<CXX11Narrowing>, DefaultIgnore;
5834def warn_init_list_constant_narrowing : Warning<
5835  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
5836  "C++11">,
5837  InGroup<CXX11Narrowing>, DefaultIgnore;
5838def note_init_list_narrowing_silence : Note<
5839  "insert an explicit cast to silence this issue">;
5840def err_init_objc_class : Error<
5841  "cannot initialize Objective-C class type %0">;
5842def err_implicit_empty_initializer : Error<
5843  "initializer for aggregate with no elements requires explicit braces">;
5844def err_bitfield_has_negative_width : Error<
5845  "bit-field %0 has negative width (%1)">;
5846def err_anon_bitfield_has_negative_width : Error<
5847  "anonymous bit-field has negative width (%0)">;
5848def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
5849def err_bitfield_width_exceeds_type_width : Error<
5850  "width of%select{ anonymous|}0 bit-field%select{| %1}0 (%2 bits) exceeds the "
5851  "%select{width|size}3 of its type (%4 bit%s4)">;
5852def err_incorrect_number_of_vector_initializers : Error<
5853  "number of elements must be either one or match the size of the vector">;
5854
5855// Used by C++ which allows bit-fields that are wider than the type.
5856def warn_bitfield_width_exceeds_type_width: Warning<
5857  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
5858  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
5859def err_bitfield_too_wide : Error<
5860  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
5861def warn_bitfield_too_small_for_enum : Warning<
5862  "bit-field %0 is not wide enough to store all enumerators of %1">,
5863  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5864def note_widen_bitfield : Note<
5865  "widen this field to %0 bits to store all values of %1">;
5866def warn_unsigned_bitfield_assigned_signed_enum : Warning<
5867  "assigning value of signed enum type %1 to unsigned bit-field %0; "
5868  "negative enumerators of enum %1 will be converted to positive values">,
5869  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5870def warn_signed_bitfield_enum_conversion : Warning<
5871  "signed bit-field %0 needs an extra bit to represent the largest positive "
5872  "enumerators of %1">,
5873  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5874def note_change_bitfield_sign : Note<
5875  "consider making the bitfield type %select{unsigned|signed}0">;
5876
5877def warn_missing_braces : Warning<
5878  "suggest braces around initialization of subobject">,
5879  InGroup<MissingBraces>, DefaultIgnore;
5880
5881def err_redefinition_of_label : Error<"redefinition of label %0">;
5882def err_undeclared_label_use : Error<"use of undeclared label %0">;
5883def err_goto_ms_asm_label : Error<
5884  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5885def note_goto_ms_asm_label : Note<
5886  "inline assembly label %0 declared here">;
5887def warn_unused_label : Warning<"unused label %0">,
5888  InGroup<UnusedLabel>, DefaultIgnore;
5889
5890def err_continue_from_cond_var_init : Error<
5891  "cannot jump from this continue statement to the loop increment; "
5892  "jump bypasses initialization of loop condition variable">;
5893def err_goto_into_protected_scope : Error<
5894  "cannot jump from this goto statement to its label">;
5895def ext_goto_into_protected_scope : ExtWarn<
5896  "jump from this goto statement to its label is a Microsoft extension">,
5897  InGroup<MicrosoftGoto>;
5898def warn_cxx98_compat_goto_into_protected_scope : Warning<
5899  "jump from this goto statement to its label is incompatible with C++98">,
5900  InGroup<CXX98Compat>, DefaultIgnore;
5901def err_switch_into_protected_scope : Error<
5902  "cannot jump from switch statement to this case label">;
5903def warn_cxx98_compat_switch_into_protected_scope : Warning<
5904  "jump from switch statement to this case label is incompatible with C++98">,
5905  InGroup<CXX98Compat>, DefaultIgnore;
5906def err_indirect_goto_without_addrlabel : Error<
5907  "indirect goto in function with no address-of-label expressions">;
5908def err_indirect_goto_in_protected_scope : Error<
5909  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
5910def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5911  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
5912  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5913def note_indirect_goto_target : Note<
5914  "possible target of %select{indirect|asm}0 goto statement">;
5915def note_protected_by_variable_init : Note<
5916  "jump bypasses variable initialization">;
5917def note_protected_by_variable_nontriv_destructor : Note<
5918  "jump bypasses variable with a non-trivial destructor">;
5919def note_protected_by_variable_non_pod : Note<
5920  "jump bypasses initialization of non-POD variable">;
5921def note_protected_by_cleanup : Note<
5922  "jump bypasses initialization of variable with __attribute__((cleanup))">;
5923def note_protected_by_vla_typedef : Note<
5924  "jump bypasses initialization of VLA typedef">;
5925def note_protected_by_vla_type_alias : Note<
5926  "jump bypasses initialization of VLA type alias">;
5927def note_protected_by_constexpr_if : Note<
5928  "jump enters controlled statement of constexpr if">;
5929def note_protected_by_if_available : Note<
5930  "jump enters controlled statement of if available">;
5931def note_protected_by_vla : Note<
5932  "jump bypasses initialization of variable length array">;
5933def note_protected_by_objc_fast_enumeration : Note<
5934  "jump enters Objective-C fast enumeration loop">;
5935def note_protected_by_objc_try : Note<
5936  "jump bypasses initialization of @try block">;
5937def note_protected_by_objc_catch : Note<
5938  "jump bypasses initialization of @catch block">;
5939def note_protected_by_objc_finally : Note<
5940  "jump bypasses initialization of @finally block">;
5941def note_protected_by_objc_synchronized : Note<
5942  "jump bypasses initialization of @synchronized block">;
5943def note_protected_by_objc_autoreleasepool : Note<
5944  "jump bypasses auto release push of @autoreleasepool block">;
5945def note_protected_by_cxx_try : Note<
5946  "jump bypasses initialization of try block">;
5947def note_protected_by_cxx_catch : Note<
5948  "jump bypasses initialization of catch block">;
5949def note_protected_by_seh_try : Note<
5950  "jump bypasses initialization of __try block">;
5951def note_protected_by_seh_except : Note<
5952  "jump bypasses initialization of __except block">;
5953def note_protected_by_seh_finally : Note<
5954  "jump bypasses initialization of __finally block">;
5955def note_protected_by___block : Note<
5956  "jump bypasses setup of __block variable">;
5957def note_protected_by_objc_strong_init : Note<
5958  "jump bypasses initialization of __strong variable">;
5959def note_protected_by_objc_weak_init : Note<
5960  "jump bypasses initialization of __weak variable">;
5961def note_protected_by_non_trivial_c_struct_init : Note<
5962  "jump bypasses initialization of variable of non-trivial C struct type">;
5963def note_enters_block_captures_cxx_obj : Note<
5964  "jump enters lifetime of block which captures a destructible C++ object">;
5965def note_enters_block_captures_strong : Note<
5966  "jump enters lifetime of block which strongly captures a variable">;
5967def note_enters_block_captures_weak : Note<
5968  "jump enters lifetime of block which weakly captures a variable">;
5969def note_enters_block_captures_non_trivial_c_struct : Note<
5970  "jump enters lifetime of block which captures a C struct that is non-trivial "
5971  "to destroy">;
5972def note_enters_compound_literal_scope : Note<
5973  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
5974
5975def note_exits_cleanup : Note<
5976  "jump exits scope of variable with __attribute__((cleanup))">;
5977def note_exits_dtor : Note<
5978  "jump exits scope of variable with non-trivial destructor">;
5979def note_exits_temporary_dtor : Note<
5980  "jump exits scope of lifetime-extended temporary with non-trivial "
5981  "destructor">;
5982def note_exits___block : Note<
5983  "jump exits scope of __block variable">;
5984def note_exits_objc_try : Note<
5985  "jump exits @try block">;
5986def note_exits_objc_catch : Note<
5987  "jump exits @catch block">;
5988def note_exits_objc_finally : Note<
5989  "jump exits @finally block">;
5990def note_exits_objc_synchronized : Note<
5991  "jump exits @synchronized block">;
5992def note_exits_cxx_try : Note<
5993  "jump exits try block">;
5994def note_exits_cxx_catch : Note<
5995  "jump exits catch block">;
5996def note_exits_seh_try : Note<
5997  "jump exits __try block">;
5998def note_exits_seh_except : Note<
5999  "jump exits __except block">;
6000def note_exits_seh_finally : Note<
6001  "jump exits __finally block">;
6002def note_exits_objc_autoreleasepool : Note<
6003  "jump exits autoreleasepool block">;
6004def note_exits_objc_strong : Note<
6005  "jump exits scope of __strong variable">;
6006def note_exits_objc_weak : Note<
6007  "jump exits scope of __weak variable">;
6008def note_exits_block_captures_cxx_obj : Note<
6009  "jump exits lifetime of block which captures a destructible C++ object">;
6010def note_exits_block_captures_strong : Note<
6011  "jump exits lifetime of block which strongly captures a variable">;
6012def note_exits_block_captures_weak : Note<
6013  "jump exits lifetime of block which weakly captures a variable">;
6014def note_exits_block_captures_non_trivial_c_struct : Note<
6015  "jump exits lifetime of block which captures a C struct that is non-trivial "
6016  "to destroy">;
6017def note_exits_compound_literal_scope : Note<
6018  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
6019
6020def err_func_returning_qualified_void : ExtWarn<
6021  "function cannot return qualified void type %0">,
6022  InGroup<DiagGroup<"qualified-void-return-type">>;
6023def err_func_returning_array_function : Error<
6024  "function cannot return %select{array|function}0 type %1">;
6025def err_field_declared_as_function : Error<"field %0 declared as a function">;
6026def err_field_incomplete_or_sizeless : Error<
6027  "field has %select{incomplete|sizeless}0 type %1">;
6028def ext_variable_sized_type_in_struct : ExtWarn<
6029  "field %0 with variable sized type %1 not at the end of a struct or class is"
6030  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
6031
6032def ext_c99_flexible_array_member : Extension<
6033  "flexible array members are a C99 feature">, InGroup<C99>;
6034def err_flexible_array_virtual_base : Error<
6035  "flexible array member %0 not allowed in "
6036  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
6037def err_flexible_array_empty_aggregate : Error<
6038  "flexible array member %0 not allowed in otherwise empty "
6039  "%select{struct|interface|union|class|enum}1">;
6040def err_flexible_array_has_nontrivial_dtor : Error<
6041  "flexible array member %0 of type %1 with non-trivial destruction">;
6042def ext_flexible_array_in_struct : Extension<
6043  "%0 may not be nested in a struct due to flexible array member">,
6044  InGroup<FlexibleArrayExtensions>;
6045def ext_flexible_array_in_array : Extension<
6046  "%0 may not be used as an array element due to flexible array member">,
6047  InGroup<FlexibleArrayExtensions>;
6048def err_flexible_array_init : Error<
6049  "initialization of flexible array member is not allowed">;
6050def ext_flexible_array_empty_aggregate_ms : Extension<
6051  "flexible array member %0 in otherwise empty "
6052  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
6053  InGroup<MicrosoftFlexibleArray>;
6054def err_flexible_array_union : Error<
6055  "flexible array member %0 in a union is not allowed">;
6056def ext_flexible_array_union_ms : Extension<
6057  "flexible array member %0 in a union is a Microsoft extension">,
6058  InGroup<MicrosoftFlexibleArray>;
6059def ext_flexible_array_empty_aggregate_gnu : Extension<
6060  "flexible array member %0 in otherwise empty "
6061  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
6062  InGroup<GNUEmptyStruct>;
6063def ext_flexible_array_union_gnu : Extension<
6064  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
6065
6066def err_flexible_array_not_at_end : Error<
6067  "flexible array member %0 with type %1 is not at the end of"
6068  " %select{struct|interface|union|class|enum}2">;
6069def err_objc_variable_sized_type_not_at_end : Error<
6070  "field %0 with variable sized type %1 is not at the end of class">;
6071def note_next_field_declaration : Note<
6072  "next field declaration is here">;
6073def note_next_ivar_declaration : Note<
6074  "next %select{instance variable declaration|synthesized instance variable}0"
6075  " is here">;
6076def err_synthesize_variable_sized_ivar : Error<
6077  "synthesized property with variable size type %0"
6078  " requires an existing instance variable">;
6079def err_flexible_array_arc_retainable : Error<
6080  "ARC forbids flexible array members with retainable object type">;
6081def warn_variable_sized_ivar_visibility : Warning<
6082  "field %0 with variable sized type %1 is not visible to subclasses and"
6083  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
6084def warn_superclass_variable_sized_type_not_at_end : Warning<
6085  "field %0 can overwrite instance variable %1 with variable sized type %2"
6086  " in superclass %3">, InGroup<ObjCFlexibleArray>;
6087
6088let CategoryName = "ARC Semantic Issue" in {
6089
6090// ARC-mode diagnostics.
6091
6092let CategoryName = "ARC Weak References" in {
6093
6094def err_arc_weak_no_runtime : Error<
6095  "cannot create __weak reference because the current deployment target "
6096  "does not support weak references">;
6097def err_arc_weak_disabled : Error<
6098  "cannot create __weak reference in file using manual reference counting">;
6099def err_synthesizing_arc_weak_property_disabled : Error<
6100  "cannot synthesize weak property in file using manual reference counting">;
6101def err_synthesizing_arc_weak_property_no_runtime : Error<
6102  "cannot synthesize weak property because the current deployment target "
6103  "does not support weak references">;
6104def err_arc_unsupported_weak_class : Error<
6105  "class is incompatible with __weak references">;
6106def err_arc_weak_unavailable_assign : Error<
6107  "assignment of a weak-unavailable object to a __weak object">;
6108def err_arc_weak_unavailable_property : Error<
6109  "synthesizing __weak instance variable of type %0, which does not "
6110  "support weak references">;
6111def note_implemented_by_class : Note<
6112  "when implemented by class %0">;
6113def err_arc_convesion_of_weak_unavailable : Error<
6114  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
6115  " a __weak object of type %2">;
6116
6117} // end "ARC Weak References" category
6118
6119let CategoryName = "ARC Restrictions" in {
6120
6121def err_unavailable_in_arc : Error<
6122  "%0 is unavailable in ARC">;
6123def note_arc_forbidden_type : Note<
6124  "declaration uses type that is ill-formed in ARC">;
6125def note_performs_forbidden_arc_conversion : Note<
6126  "inline function performs a conversion which is forbidden in ARC">;
6127def note_arc_init_returns_unrelated : Note<
6128  "init method must return a type related to its receiver type">;
6129def note_arc_weak_disabled : Note<
6130  "declaration uses __weak, but ARC is disabled">;
6131def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
6132  "the current deployment target does not support">;
6133def note_arc_field_with_ownership : Note<
6134  "field has non-trivial ownership qualification">;
6135
6136def err_arc_illegal_explicit_message : Error<
6137  "ARC forbids explicit message send of %0">;
6138def err_arc_unused_init_message : Error<
6139  "the result of a delegate init call must be immediately returned "
6140  "or assigned to 'self'">;
6141def err_arc_mismatched_cast : Error<
6142  "%select{implicit conversion|cast}0 of "
6143  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6144  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6145  " to %3 is disallowed with ARC">;
6146def err_arc_nolifetime_behavior : Error<
6147  "explicit ownership qualifier on cast result has no effect">;
6148def err_arc_objc_property_default_assign_on_object : Error<
6149  "ARC forbids synthesizing a property of an Objective-C object "
6150  "with unspecified ownership or storage attribute">;
6151def err_arc_illegal_selector : Error<
6152  "ARC forbids use of %0 in a @selector">;
6153def err_arc_illegal_method_def : Error<
6154  "ARC forbids %select{implementation|synthesis}0 of %1">;
6155def warn_arc_strong_pointer_objc_pointer : Warning<
6156  "method parameter of type %0 with no explicit ownership">,
6157  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6158
6159} // end "ARC Restrictions" category
6160
6161def err_arc_lost_method_convention : Error<
6162  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6163  "method, but its implementation doesn't match because %select{"
6164  "its result type is not an object pointer|"
6165  "its result type is unrelated to its receiver type}1">;
6166def note_arc_lost_method_convention : Note<"declaration in interface">;
6167def err_arc_gained_method_convention : Error<
6168  "method implementation does not match its declaration">;
6169def note_arc_gained_method_convention : Note<
6170  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6171  "family because %select{its result type is not an object pointer|"
6172  "its result type is unrelated to its receiver type}1">;
6173def err_typecheck_arc_assign_self : Error<
6174  "cannot assign to 'self' outside of a method in the init family">;
6175def err_typecheck_arc_assign_self_class_method : Error<
6176  "cannot assign to 'self' in a class method">;
6177def err_typecheck_arr_assign_enumeration : Error<
6178  "fast enumeration variables cannot be modified in ARC by default; "
6179  "declare the variable __strong to allow this">;
6180def err_typecheck_arc_assign_externally_retained : Error<
6181  "variable declared with 'objc_externally_retained' "
6182  "cannot be modified in ARC">;
6183def warn_arc_retained_assign : Warning<
6184  "assigning retained object to %select{weak|unsafe_unretained}0 "
6185  "%select{property|variable}1"
6186  "; object will be released after assignment">,
6187  InGroup<ARCUnsafeRetainedAssign>;
6188def warn_arc_retained_property_assign : Warning<
6189  "assigning retained object to unsafe property"
6190  "; object will be released after assignment">,
6191  InGroup<ARCUnsafeRetainedAssign>;
6192def warn_arc_literal_assign : Warning<
6193  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6194  " to a weak %select{property|variable}1"
6195  "; object will be released after assignment">,
6196  InGroup<ARCUnsafeRetainedAssign>;
6197def err_arc_new_array_without_ownership : Error<
6198  "'new' cannot allocate an array of %0 with no explicit ownership">;
6199def err_arc_autoreleasing_var : Error<
6200  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6201  "__autoreleasing ownership">;
6202def err_arc_autoreleasing_capture : Error<
6203  "cannot capture __autoreleasing variable in a "
6204  "%select{block|lambda by copy}0">;
6205def err_arc_thread_ownership : Error<
6206  "thread-local variable has non-trivial ownership: type is %0">;
6207def err_arc_indirect_no_ownership : Error<
6208  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6209def err_arc_array_param_no_ownership : Error<
6210  "must explicitly describe intended ownership of an object array parameter">;
6211def err_arc_pseudo_dtor_inconstant_quals : Error<
6212  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6213  "type %1">;
6214def err_arc_init_method_unrelated_result_type : Error<
6215  "init methods must return a type related to the receiver type">;
6216def err_arc_nonlocal_writeback : Error<
6217  "passing address of %select{non-local|non-scalar}0 object to "
6218  "__autoreleasing parameter for write-back">;
6219def err_arc_method_not_found : Error<
6220  "no known %select{instance|class}1 method for selector %0">;
6221def err_arc_receiver_forward_class : Error<
6222  "receiver %0 for class message is a forward declaration">;
6223def err_arc_may_not_respond : Error<
6224  "no visible @interface for %0 declares the selector %1">;
6225def err_arc_receiver_forward_instance : Error<
6226  "receiver type %0 for instance message is a forward declaration">;
6227def warn_receiver_forward_instance : Warning<
6228  "receiver type %0 for instance message is a forward declaration">,
6229  InGroup<ForwardClassReceiver>, DefaultIgnore;
6230def err_arc_collection_forward : Error<
6231  "collection expression type %0 is a forward declaration">;
6232def err_arc_multiple_method_decl : Error<
6233  "multiple methods named %0 found with mismatched result, "
6234  "parameter type or attributes">;
6235def warn_arc_lifetime_result_type : Warning<
6236  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6237  "lifetime qualifier on return type is ignored">,
6238  InGroup<IgnoredQualifiers>;
6239
6240let CategoryName = "ARC Retain Cycle" in {
6241
6242def warn_arc_retain_cycle : Warning<
6243  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6244  InGroup<ARCRetainCycles>;
6245def note_arc_retain_cycle_owner : Note<
6246  "block will be retained by %select{the captured object|an object strongly "
6247  "retained by the captured object}0">;
6248
6249} // end "ARC Retain Cycle" category
6250
6251def warn_arc_object_memaccess : Warning<
6252  "%select{destination for|source of}0 this %1 call is a pointer to "
6253  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6254
6255let CategoryName = "ARC and @properties" in {
6256
6257def err_arc_strong_property_ownership : Error<
6258  "existing instance variable %1 for strong property %0 may not be "
6259  "%select{|__unsafe_unretained||__weak}2">;
6260def err_arc_assign_property_ownership : Error<
6261  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6262  "attribute must be __unsafe_unretained">;
6263def err_arc_inconsistent_property_ownership : Error<
6264  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6265  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6266
6267} // end "ARC and @properties" category
6268
6269def warn_block_capture_autoreleasing : Warning<
6270  "block captures an autoreleasing out-parameter, which may result in "
6271  "use-after-free bugs">,
6272  InGroup<BlockCaptureAutoReleasing>;
6273def note_declare_parameter_strong : Note<
6274  "declare the parameter __strong or capture a __block __strong variable to "
6275  "keep values alive across autorelease pools">;
6276
6277def err_arc_atomic_ownership : Error<
6278  "cannot perform atomic operation on a pointer to type %0: type has "
6279  "non-trivial ownership">;
6280
6281let CategoryName = "ARC Casting Rules" in {
6282
6283def err_arc_bridge_cast_incompatible : Error<
6284  "incompatible types casting %0 to %1 with a %select{__bridge|"
6285  "__bridge_transfer|__bridge_retained}2 cast">;
6286def err_arc_bridge_cast_wrong_kind : Error<
6287  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6288  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6289  "__bridge_transfer|__bridge_retained}4">;
6290def err_arc_cast_requires_bridge : Error<
6291  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6292  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6293  "requires a bridged cast">;
6294def note_arc_bridge : Note<
6295  "use __bridge to convert directly (no change in ownership)">;
6296def note_arc_cstyle_bridge : Note<
6297  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6298def note_arc_bridge_transfer : Note<
6299  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6300  "ownership of a +1 %0 into ARC">;
6301def note_arc_cstyle_bridge_transfer : Note<
6302  "use __bridge_transfer with C-style cast to transfer "
6303  "ownership of a +1 %0 into ARC">;
6304def note_arc_bridge_retained : Note<
6305  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6306  "ARC object available as a +1 %0">;
6307def note_arc_cstyle_bridge_retained : Note<
6308  "use __bridge_retained with C-style cast to make an "
6309  "ARC object available as a +1 %0">;
6310
6311} // ARC Casting category
6312
6313} // ARC category name
6314
6315def err_flexible_array_init_needs_braces : Error<
6316  "flexible array requires brace-enclosed initializer">;
6317def err_illegal_decl_array_of_functions : Error<
6318  "'%0' declared as array of functions of type %1">;
6319def err_array_incomplete_or_sizeless_type : Error<
6320  "array has %select{incomplete|sizeless}0 element type %1">;
6321def err_illegal_message_expr_incomplete_type : Error<
6322  "Objective-C message has incomplete result type %0">;
6323def err_illegal_decl_array_of_references : Error<
6324  "'%0' declared as array of references of type %1">;
6325def err_decl_negative_array_size : Error<
6326  "'%0' declared as an array with a negative size">;
6327def err_array_static_outside_prototype : Error<
6328  "%0 used in array declarator outside of function prototype">;
6329def err_array_static_not_outermost : Error<
6330  "%0 used in non-outermost array type derivation">;
6331def err_array_star_outside_prototype : Error<
6332  "star modifier used outside of function prototype">;
6333def err_illegal_decl_pointer_to_reference : Error<
6334  "'%0' declared as a pointer to a reference of type %1">;
6335def err_illegal_decl_mempointer_to_reference : Error<
6336  "'%0' declared as a member pointer to a reference of type %1">;
6337def err_illegal_decl_mempointer_to_void : Error<
6338  "'%0' declared as a member pointer to void">;
6339def err_illegal_decl_mempointer_in_nonclass : Error<
6340  "'%0' does not point into a class">;
6341def err_mempointer_in_nonclass_type : Error<
6342  "member pointer refers into non-class type %0">;
6343def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6344def err_nonfunction_block_type : Error<
6345  "block pointer to non-function type is invalid">;
6346def err_return_block_has_expr : Error<"void block should not return a value">;
6347def err_block_return_missing_expr : Error<
6348  "non-void block should return a value">;
6349def err_func_def_incomplete_result : Error<
6350  "incomplete result type %0 in function definition">;
6351def err_atomic_specifier_bad_type
6352    : Error<"_Atomic cannot be applied to "
6353            "%select{incomplete |array |function |reference |atomic |qualified "
6354            "|sizeless ||integer }0type "
6355            "%1 %select{|||||||which is not trivially copyable|}0">;
6356
6357// Expressions.
6358def ext_sizeof_alignof_function_type : Extension<
6359  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6360def ext_sizeof_alignof_void_type : Extension<
6361  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6362def err_opencl_sizeof_alignof_type : Error<
6363  "invalid application of '%0' to a void type">;
6364def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6365  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6366def err_sizeof_alignof_function_type : Error<
6367  "invalid application of '%0' to a function type">;
6368def err_openmp_default_simd_align_expr : Error<
6369  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6370def err_sizeof_alignof_typeof_bitfield : Error<
6371  "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
6372def err_alignof_member_of_incomplete_type : Error<
6373  "invalid application of 'alignof' to a field of a class still being defined">;
6374def err_vecstep_non_scalar_vector_type : Error<
6375  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6376def err_offsetof_incomplete_type : Error<
6377  "offsetof of incomplete type %0">;
6378def err_offsetof_record_type : Error<
6379  "offsetof requires struct, union, or class type, %0 invalid">;
6380def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6381def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6382  InGroup<InvalidOffsetof>;
6383def ext_offsetof_non_standardlayout_type : ExtWarn<
6384  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6385def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6386def err_offsetof_field_of_virtual_base : Error<
6387  "invalid application of 'offsetof' to a field of a virtual base">;
6388def warn_sub_ptr_zero_size_types : Warning<
6389  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6390  InGroup<PointerArith>;
6391def warn_pointer_arith_null_ptr : Warning<
6392  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6393  InGroup<NullPointerArithmetic>, DefaultIgnore;
6394def warn_gnu_null_ptr_arith : Warning<
6395  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6396  InGroup<NullPointerArithmetic>, DefaultIgnore;
6397def warn_pointer_sub_null_ptr : Warning<
6398  "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
6399  InGroup<NullPointerSubtraction>, DefaultIgnore;
6400def err_kernel_invalidates_sycl_unique_stable_name
6401    : Error<"kernel instantiation changes the result of an evaluated "
6402            "'__builtin_sycl_unique_stable_name'">;
6403def note_sycl_unique_stable_name_evaluated_here
6404    : Note<"'__builtin_sycl_unique_stable_name' evaluated here">;
6405
6406def warn_floatingpoint_eq : Warning<
6407  "comparing floating point with == or != is unsafe">,
6408  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6409
6410def warn_remainder_division_by_zero : Warning<
6411  "%select{remainder|division}0 by zero is undefined">,
6412  InGroup<DivZero>;
6413def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6414  InGroup<DiagGroup<"shift-negative-value">>;
6415def warn_shift_negative : Warning<"shift count is negative">,
6416  InGroup<DiagGroup<"shift-count-negative">>;
6417def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6418  InGroup<DiagGroup<"shift-count-overflow">>;
6419def warn_shift_result_gt_typewidth : Warning<
6420  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6421  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6422def warn_shift_result_sets_sign_bit : Warning<
6423  "signed shift result (%0) sets the sign bit of the shift expression's "
6424  "type (%1) and becomes negative">,
6425  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6426
6427def warn_precedence_bitwise_rel : Warning<
6428  "%0 has lower precedence than %1; %1 will be evaluated first">,
6429  InGroup<Parentheses>;
6430def note_precedence_bitwise_first : Note<
6431  "place parentheses around the %0 expression to evaluate it first">;
6432def note_precedence_silence : Note<
6433  "place parentheses around the '%0' expression to silence this warning">;
6434
6435def warn_precedence_conditional : Warning<
6436  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6437  InGroup<Parentheses>;
6438def warn_precedence_bitwise_conditional : Warning<
6439  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6440  InGroup<BitwiseConditionalParentheses>;
6441def note_precedence_conditional_first : Note<
6442  "place parentheses around the '?:' expression to evaluate it first">;
6443
6444def warn_enum_constant_in_bool_context : Warning<
6445  "converting the enum constant to a boolean">,
6446  InGroup<IntInBoolContext>, DefaultIgnore;
6447def warn_left_shift_in_bool_context : Warning<
6448  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6449  InGroup<IntInBoolContext>, DefaultIgnore;
6450def warn_logical_instead_of_bitwise : Warning<
6451  "use of logical '%0' with constant operand">,
6452  InGroup<DiagGroup<"constant-logical-operand">>;
6453def note_logical_instead_of_bitwise_change_operator : Note<
6454  "use '%0' for a bitwise operation">;
6455def note_logical_instead_of_bitwise_remove_constant : Note<
6456  "remove constant to silence this warning">;
6457
6458def warn_bitwise_op_in_bitwise_op : Warning<
6459  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
6460
6461def warn_logical_and_in_logical_or : Warning<
6462  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
6463
6464def warn_overloaded_shift_in_comparison :Warning<
6465  "overloaded operator %select{>>|<<}0 has higher precedence than "
6466  "comparison operator">,
6467  InGroup<OverloadedShiftOpParentheses>;
6468def note_evaluate_comparison_first :Note<
6469  "place parentheses around comparison expression to evaluate it first">;
6470
6471def note_concatenated_string_literal_silence :Note<
6472  "place parentheses around the string literal to silence warning">;
6473
6474def warn_addition_in_bitshift : Warning<
6475  "operator '%0' has lower precedence than '%1'; "
6476  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
6477
6478def warn_self_assignment_builtin : Warning<
6479  "explicitly assigning value of variable of type %0 to itself">,
6480  InGroup<SelfAssignment>, DefaultIgnore;
6481def warn_self_assignment_overloaded : Warning<
6482  "explicitly assigning value of variable of type %0 to itself">,
6483  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
6484def warn_self_move : Warning<
6485  "explicitly moving variable of type %0 to itself">,
6486  InGroup<SelfMove>, DefaultIgnore;
6487
6488def warn_redundant_move_on_return : Warning<
6489  "redundant move in return statement">,
6490  InGroup<RedundantMove>, DefaultIgnore;
6491def warn_pessimizing_move_on_return : Warning<
6492  "moving a local object in a return statement prevents copy elision">,
6493  InGroup<PessimizingMove>, DefaultIgnore;
6494def warn_pessimizing_move_on_initialization : Warning<
6495  "moving a temporary object prevents copy elision">,
6496  InGroup<PessimizingMove>, DefaultIgnore;
6497def note_remove_move : Note<"remove std::move call here">;
6498
6499def warn_string_plus_int : Warning<
6500  "adding %0 to a string does not append to the string">,
6501  InGroup<StringPlusInt>;
6502def warn_string_plus_char : Warning<
6503  "adding %0 to a string pointer does not append to the string">,
6504  InGroup<StringPlusChar>;
6505def note_string_plus_scalar_silence : Note<
6506  "use array indexing to silence this warning">;
6507
6508def warn_sizeof_array_param : Warning<
6509  "sizeof on array function parameter will return size of %0 instead of %1">,
6510  InGroup<SizeofArrayArgument>;
6511
6512def warn_sizeof_array_decay : Warning<
6513  "sizeof on pointer operation will return size of %0 instead of %1">,
6514  InGroup<SizeofArrayDecay>;
6515
6516def err_sizeof_nonfragile_interface : Error<
6517  "application of '%select{alignof|sizeof}1' to interface %0 is "
6518  "not supported on this architecture and platform">;
6519def err_atdef_nonfragile_interface : Error<
6520  "use of @defs is not supported on this architecture and platform">;
6521def err_subscript_nonfragile_interface : Error<
6522  "subscript requires size of interface %0, which is not constant for "
6523  "this architecture and platform">;
6524
6525def err_arithmetic_nonfragile_interface : Error<
6526  "arithmetic on pointer to interface %0, which is not a constant size for "
6527  "this architecture and platform">;
6528
6529def warn_deprecated_comma_subscript : Warning<
6530  "top-level comma expression in array subscript is deprecated">,
6531  InGroup<DeprecatedCommaSubscript>;
6532
6533def ext_subscript_non_lvalue : Extension<
6534  "ISO C90 does not allow subscripting non-lvalue array">;
6535def err_typecheck_subscript_value : Error<
6536  "subscripted value is not an array, pointer, or vector">;
6537def err_typecheck_subscript_not_integer : Error<
6538  "array subscript is not an integer">;
6539def err_subscript_function_type : Error<
6540  "subscript of pointer to function type %0">;
6541def err_subscript_incomplete_or_sizeless_type : Error<
6542  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
6543def err_dereference_incomplete_type : Error<
6544  "dereference of pointer to incomplete type %0">;
6545def ext_gnu_subscript_void_type : Extension<
6546  "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
6547def err_typecheck_member_reference_struct_union : Error<
6548  "member reference base type %0 is not a structure or union">;
6549def err_typecheck_member_reference_ivar : Error<
6550  "%0 does not have a member named %1">;
6551def err_arc_weak_ivar_access : Error<
6552  "dereferencing a __weak pointer is not allowed due to possible "
6553  "null value caused by race condition, assign it to strong variable first">;
6554def err_typecheck_member_reference_arrow : Error<
6555  "member reference type %0 is not a pointer">;
6556def err_typecheck_member_reference_suggestion : Error<
6557  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
6558def note_typecheck_member_reference_suggestion : Note<
6559  "did you mean to use '.' instead?">;
6560def note_member_reference_arrow_from_operator_arrow : Note<
6561  "'->' applied to return value of the operator->() declared here">;
6562def err_typecheck_member_reference_type : Error<
6563  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
6564def err_typecheck_member_reference_unknown : Error<
6565  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
6566def err_member_reference_needs_call : Error<
6567  "base of member reference is a function; perhaps you meant to call "
6568  "it%select{| with no arguments}0?">;
6569def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
6570  InGroup<CharSubscript>, DefaultIgnore;
6571
6572def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
6573def err_no_member : Error<"no member named %0 in %1">;
6574def err_no_member_overloaded_arrow : Error<
6575  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
6576
6577def err_member_not_yet_instantiated : Error<
6578  "no member %0 in %1; it has not yet been instantiated">;
6579def note_non_instantiated_member_here : Note<
6580  "not-yet-instantiated member is declared here">;
6581
6582def err_enumerator_does_not_exist : Error<
6583  "enumerator %0 does not exist in instantiation of %1">;
6584def note_enum_specialized_here : Note<
6585  "enum %0 was explicitly specialized here">;
6586
6587def err_specialization_not_primary_template : Error<
6588  "cannot reference member of primary template because deduced class "
6589  "template specialization %0 is %select{instantiated from a partial|"
6590  "an explicit}1 specialization">;
6591
6592def err_member_redeclared : Error<"class member cannot be redeclared">;
6593def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
6594  InGroup<RedeclaredClassMember>;
6595def err_member_redeclared_in_instantiation : Error<
6596  "multiple overloads of %0 instantiate to the same signature %1">;
6597def err_member_name_of_class : Error<"member %0 has the same name as its class">;
6598def err_member_def_undefined_record : Error<
6599  "out-of-line definition of %0 from class %1 without definition">;
6600def err_member_decl_does_not_match : Error<
6601  "out-of-line %select{declaration|definition}2 of %0 "
6602  "does not match any declaration in %1">;
6603def err_friend_decl_with_def_arg_must_be_def : Error<
6604  "friend declaration specifying a default argument must be a definition">;
6605def err_friend_decl_with_def_arg_redeclared : Error<
6606  "friend declaration specifying a default argument must be the only declaration">;
6607def err_friend_decl_does_not_match : Error<
6608  "friend declaration of %0 does not match any declaration in %1">;
6609def err_member_decl_does_not_match_suggest : Error<
6610  "out-of-line %select{declaration|definition}2 of %0 "
6611  "does not match any declaration in %1; did you mean %3?">;
6612def err_member_def_does_not_match_ret_type : Error<
6613  "return type of out-of-line definition of %q0 differs from "
6614  "that in the declaration">;
6615def err_nonstatic_member_out_of_line : Error<
6616  "non-static data member defined out-of-line">;
6617def err_qualified_typedef_declarator : Error<
6618  "typedef declarator cannot be qualified">;
6619def err_qualified_param_declarator : Error<
6620  "parameter declarator cannot be qualified">;
6621def ext_out_of_line_declaration : ExtWarn<
6622  "out-of-line declaration of a member must be a definition">,
6623  InGroup<OutOfLineDeclaration>, DefaultError;
6624def err_member_extra_qualification : Error<
6625  "extra qualification on member %0">;
6626def warn_member_extra_qualification : Warning<
6627  err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
6628def warn_namespace_member_extra_qualification : Warning<
6629  "extra qualification on member %0">,
6630  InGroup<DiagGroup<"extra-qualification">>;
6631def err_member_qualification : Error<
6632  "non-friend class member %0 cannot have a qualified name">;
6633def note_member_def_close_match : Note<"member declaration nearly matches">;
6634def note_member_def_close_const_match : Note<
6635  "member declaration does not match because "
6636  "it %select{is|is not}0 const qualified">;
6637def note_member_def_close_param_match : Note<
6638  "type of %ordinal0 parameter of member declaration does not match definition"
6639  "%diff{ ($ vs $)|}1,2">;
6640def note_local_decl_close_match : Note<"local declaration nearly matches">;
6641def note_local_decl_close_param_match : Note<
6642  "type of %ordinal0 parameter of local declaration does not match definition"
6643  "%diff{ ($ vs $)|}1,2">;
6644def err_typecheck_ivar_variable_size : Error<
6645  "instance variables must have a constant size">;
6646def err_ivar_reference_type : Error<
6647  "instance variables cannot be of reference type">;
6648def err_typecheck_illegal_increment_decrement : Error<
6649  "cannot %select{decrement|increment}1 value of type %0">;
6650def err_typecheck_expect_int : Error<
6651  "used type %0 where integer is required">;
6652def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
6653  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
6654def err_typecheck_pointer_arith_function_type : Error<
6655  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
6656  "function type%select{|s}2 %1%select{| and %3}2">;
6657def err_typecheck_pointer_arith_void_type : Error<
6658  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
6659def err_typecheck_decl_incomplete_type : Error<
6660  "variable has incomplete type %0">;
6661def ext_typecheck_decl_incomplete_type : ExtWarn<
6662  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
6663  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
6664def err_tentative_def_incomplete_type : Error<
6665  "tentative definition has type %0 that is never completed">;
6666def warn_tentative_incomplete_array : Warning<
6667  "tentative array definition assumed to have one element">;
6668def err_typecheck_incomplete_array_needs_initializer : Error<
6669  "definition of variable with array type needs an explicit size "
6670  "or an initializer">;
6671def err_array_init_not_init_list : Error<
6672  "array initializer must be an initializer "
6673  "list%select{| or string literal| or wide string literal}0">;
6674def err_array_init_narrow_string_into_wchar : Error<
6675  "initializing wide char array with non-wide string literal">;
6676def err_array_init_wide_string_into_char : Error<
6677  "initializing char array with wide string literal">;
6678def err_array_init_incompat_wide_string_into_wchar : Error<
6679  "initializing wide char array with incompatible wide string literal">;
6680def err_array_init_plain_string_into_char8_t : Error<
6681  "initializing 'char8_t' array with plain string literal">;
6682def note_array_init_plain_string_into_char8_t : Note<
6683  "add 'u8' prefix to form a 'char8_t' string literal">;
6684def err_array_init_utf8_string_into_char : Error<
6685  "%select{|ISO C++20 does not permit }0initialization of char array with "
6686  "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">;
6687def warn_cxx20_compat_utf8_string : Warning<
6688  "type of UTF-8 string literal will change from array of const char to "
6689  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
6690def note_cxx20_compat_utf8_string_remove_u8 : Note<
6691  "remove 'u8' prefix to avoid a change of behavior; "
6692  "Clang encodes unprefixed narrow string literals as UTF-8">;
6693def err_array_init_different_type : Error<
6694  "cannot initialize array %diff{of type $ with array of type $|"
6695  "with different type of array}0,1">;
6696def err_array_init_non_constant_array : Error<
6697  "cannot initialize array %diff{of type $ with non-constant array of type $|"
6698  "with different type of array}0,1">;
6699def ext_array_init_copy : Extension<
6700  "initialization of an array "
6701  "%diff{of type $ from a compound literal of type $|"
6702  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
6703// This is intentionally not disabled by -Wno-gnu.
6704def ext_array_init_parens : ExtWarn<
6705  "parenthesized initialization of a member array is a GNU extension">,
6706  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
6707def warn_deprecated_string_literal_conversion : Warning<
6708  "conversion from string literal to %0 is deprecated">,
6709  InGroup<CXX11CompatDeprecatedWritableStr>;
6710def ext_deprecated_string_literal_conversion : ExtWarn<
6711  "ISO C++11 does not allow conversion from string literal to %0">,
6712  InGroup<WritableStrings>, SFINAEFailure;
6713def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
6714def err_typecheck_sclass_fscope : Error<
6715  "illegal storage class on file-scoped variable">;
6716def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
6717  InGroup<MissingDeclarations>;
6718def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
6719  "of a type">, InGroup<MissingDeclarations>;
6720def err_standalone_class_nested_name_specifier : Error<
6721  "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
6722  "have a nested name specifier">;
6723def err_typecheck_sclass_func : Error<"illegal storage class on function">;
6724def err_static_block_func : Error<
6725  "function declared in block scope cannot have 'static' storage class">;
6726def err_typecheck_address_of : Error<"address of %select{bit-field"
6727  "|vector element|property expression|register variable|matrix element}0 requested">;
6728def ext_typecheck_addrof_void : Extension<
6729  "ISO C forbids taking the address of an expression of type 'void'">;
6730def err_unqualified_pointer_member_function : Error<
6731  "must explicitly qualify name of member function when taking its address">;
6732def err_invalid_form_pointer_member_function : Error<
6733  "cannot create a non-constant pointer to member function">;
6734def err_address_of_function_with_pass_object_size_params: Error<
6735  "cannot take address of function %0 because parameter %1 has "
6736  "pass_object_size attribute">;
6737def err_parens_pointer_member_function : Error<
6738  "cannot parenthesize the name of a method when forming a member pointer">;
6739def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
6740  "extra '&' taking address of overloaded function">;
6741def err_typecheck_invalid_lvalue_addrof : Error<
6742  "cannot take the address of an rvalue of type %0">;
6743def ext_typecheck_addrof_temporary : ExtWarn<
6744  "taking the address of a temporary object of type %0">,
6745  InGroup<AddressOfTemporary>, DefaultError;
6746def err_typecheck_addrof_temporary : Error<
6747  "taking the address of a temporary object of type %0">;
6748def err_typecheck_addrof_dtor : Error<
6749  "taking the address of a destructor">;
6750def err_typecheck_unary_expr : Error<
6751  "invalid argument type %0 to unary expression">;
6752def err_typecheck_indirection_requires_pointer : Error<
6753  "indirection requires pointer operand (%0 invalid)">;
6754def ext_typecheck_indirection_through_void_pointer : ExtWarn<
6755  "ISO C++ does not allow indirection on operand of type %0">,
6756  InGroup<DiagGroup<"void-ptr-dereference">>;
6757def warn_indirection_through_null : Warning<
6758  "indirection of non-volatile null pointer will be deleted, not trap">,
6759  InGroup<NullDereference>;
6760def warn_binding_null_to_reference : Warning<
6761  "binding dereferenced null pointer to reference has undefined behavior">,
6762  InGroup<NullDereference>;
6763def note_indirection_through_null : Note<
6764  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
6765def warn_pointer_indirection_from_incompatible_type : Warning<
6766  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
6767  "behavior">,
6768  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6769def warn_taking_address_of_packed_member : Warning<
6770  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
6771  InGroup<DiagGroup<"address-of-packed-member">>;
6772def warn_param_mismatched_alignment : Warning<
6773  "passing %0-byte aligned argument to %1-byte aligned parameter %2 of %3 may result in an unaligned pointer access">,
6774  InGroup<DiagGroup<"align-mismatch">>;
6775
6776def err_objc_object_assignment : Error<
6777  "cannot assign to class object (%0 invalid)">;
6778def err_typecheck_invalid_operands : Error<
6779  "invalid operands to binary expression (%0 and %1)">, Deferrable;
6780def note_typecheck_invalid_operands_converted : Note<
6781  "%select{first|second}0 operand was implicitly converted to type %1">;
6782def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
6783  "logical expression with vector %select{type %1 and non-vector type %2|types"
6784  " %1 and %2}0 is only supported in C++">;
6785def err_typecheck_sub_ptr_compatible : Error<
6786  "%diff{$ and $ are not pointers to compatible types|"
6787  "pointers to incompatible types}0,1">;
6788def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
6789  "ordered comparison between pointer and integer (%0 and %1)">;
6790def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
6791  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
6792def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
6793  "ordered comparison between pointer and zero (%0 and %1)">;
6794def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
6795  "three-way comparison between pointer and zero">;
6796def ext_typecheck_compare_complete_incomplete_pointers : Extension<
6797  "pointer comparisons before C11 "
6798  "need to be between two complete or two incomplete types; "
6799  "%0 is %select{|in}2complete and "
6800  "%1 is %select{|in}3complete">,
6801  InGroup<C11>;
6802def warn_typecheck_ordered_comparison_of_function_pointers : Warning<
6803  "ordered comparison of function pointers (%0 and %1)">,
6804  InGroup<OrderedCompareFunctionPointers>;
6805def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
6806  "ordered comparison of function pointers (%0 and %1)">,
6807  InGroup<OrderedCompareFunctionPointers>;
6808def err_typecheck_ordered_comparison_of_function_pointers : Error<
6809  "ordered comparison of function pointers (%0 and %1)">;
6810def ext_typecheck_comparison_of_fptr_to_void : Extension<
6811  "equality comparison between function pointer and void pointer (%0 and %1)">;
6812def err_typecheck_comparison_of_fptr_to_void : Error<
6813  "equality comparison between function pointer and void pointer (%0 and %1)">;
6814def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
6815  "comparison between pointer and integer (%0 and %1)">,
6816  InGroup<DiagGroup<"pointer-integer-compare">>;
6817def err_typecheck_comparison_of_pointer_integer : Error<
6818  "comparison between pointer and integer (%0 and %1)">;
6819def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
6820  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
6821  InGroup<CompareDistinctPointerType>;
6822def ext_typecheck_cond_incompatible_operands : ExtWarn<
6823  "incompatible operand types (%0 and %1)">;
6824def err_cond_voidptr_arc : Error <
6825  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
6826  "in ARC mode">;
6827def err_typecheck_comparison_of_distinct_pointers : Error<
6828  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
6829def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
6830  "%select{comparison between %diff{ ($ and $)|}0,1"
6831  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
6832  "|conditional operator with the second and third operands of type "
6833  "%diff{ ($ and $)|}0,1}2"
6834  " which are pointers to non-overlapping address spaces">;
6835
6836def select_arith_conv_kind : TextSubstitution<
6837  "%select{arithmetic between|bitwise operation between|comparison of|"
6838  "conditional expression between|compound assignment of}0">;
6839def warn_arith_conv_enum_float : Warning<
6840  "%sub{select_arith_conv_kind}0 "
6841  "%select{floating-point|enumeration}1 type %2 "
6842  "%plural{2:with|4:from|:and}0 "
6843  "%select{enumeration|floating-point}1 type %3">,
6844  InGroup<EnumFloatConversion>, DefaultIgnore;
6845def warn_arith_conv_enum_float_cxx20 : Warning<
6846  "%sub{select_arith_conv_kind}0 "
6847  "%select{floating-point|enumeration}1 type %2 "
6848  "%plural{2:with|4:from|:and}0 "
6849  "%select{enumeration|floating-point}1 type %3 is deprecated">,
6850  InGroup<DeprecatedEnumFloatConversion>;
6851def warn_arith_conv_mixed_enum_types : Warning<
6852  "%sub{select_arith_conv_kind}0 "
6853  "different enumeration types%diff{ ($ and $)|}1,2">,
6854  InGroup<EnumEnumConversion>, DefaultIgnore;
6855def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
6856  "%sub{select_arith_conv_kind}0 "
6857  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
6858  InGroup<DeprecatedEnumEnumConversion>;
6859def warn_arith_conv_mixed_anon_enum_types : Warning<
6860  warn_arith_conv_mixed_enum_types.Text>,
6861  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
6862def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
6863  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6864  InGroup<DeprecatedAnonEnumEnumConversion>;
6865def warn_conditional_mixed_enum_types : Warning<
6866  warn_arith_conv_mixed_enum_types.Text>,
6867  InGroup<EnumCompareConditional>, DefaultIgnore;
6868def warn_conditional_mixed_enum_types_cxx20 : Warning<
6869  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6870  InGroup<DeprecatedEnumCompareConditional>;
6871def warn_comparison_mixed_enum_types : Warning<
6872  warn_arith_conv_mixed_enum_types.Text>,
6873  InGroup<EnumCompare>;
6874def warn_comparison_mixed_enum_types_cxx20 : Warning<
6875  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6876  InGroup<DeprecatedEnumCompare>;
6877def warn_comparison_of_mixed_enum_types_switch : Warning<
6878  "comparison of different enumeration types in switch statement"
6879  "%diff{ ($ and $)|}0,1">,
6880  InGroup<EnumCompareSwitch>;
6881
6882def err_typecheck_assign_const : Error<
6883  "%select{"
6884  "cannot assign to return value because function %1 returns a const value|"
6885  "cannot assign to variable %1 with const-qualified type %2|"
6886  "cannot assign to %select{non-|}1static data member %2 "
6887  "with const-qualified type %3|"
6888  "cannot assign to non-static data member within const member function %1|"
6889  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
6890  "with %select{|nested }3const-qualified data member %4|"
6891  "read-only variable is not assignable}0">;
6892
6893def note_typecheck_assign_const : Note<
6894  "%select{"
6895  "function %1 which returns const-qualified type %2 declared here|"
6896  "variable %1 declared const here|"
6897  "%select{non-|}1static data member %2 declared const here|"
6898  "member function %q1 is declared const here|"
6899  "%select{|nested }1data member %2 declared const here}0">;
6900
6901def warn_unsigned_always_true_comparison : Warning<
6902  "result of comparison of %select{%3|unsigned expression}0 %2 "
6903  "%select{unsigned expression|%3}0 is always %4">,
6904  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
6905def warn_unsigned_char_always_true_comparison : Warning<
6906  "result of comparison of %select{%3|char expression}0 %2 "
6907  "%select{char expression|%3}0 is always %4, since char is interpreted as "
6908  "unsigned">, InGroup<TautologicalUnsignedCharZeroCompare>, DefaultIgnore;
6909def warn_unsigned_enum_always_true_comparison : Warning<
6910  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
6911  "%select{unsigned enum expression|%3}0 is always %4">,
6912  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
6913def warn_tautological_constant_compare : Warning<
6914  "result of comparison %select{%3|%1}0 %2 "
6915  "%select{%1|%3}0 is always %4">,
6916  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
6917def warn_tautological_compare_objc_bool : Warning<
6918  "result of comparison of constant %0 with expression of type 'BOOL'"
6919  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
6920  InGroup<TautologicalObjCBoolCompare>;
6921def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
6922def warn_tautological_compare_value_range : Warning<
6923  "result of comparison of "
6924  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
6925  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
6926  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
6927
6928def warn_mixed_sign_comparison : Warning<
6929  "comparison of integers of different signs: %0 and %1">,
6930  InGroup<SignCompare>, DefaultIgnore;
6931def warn_out_of_range_compare : Warning<
6932  "result of comparison of %select{constant %0|true|false}1 with "
6933  "%select{expression of type %2|boolean expression}3 is always %4">,
6934  InGroup<TautologicalOutOfRangeCompare>;
6935def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
6936  InGroup<TautologicalConstantCompare>;
6937def warn_integer_constants_in_conditional_always_true : Warning<
6938  "converting the result of '?:' with integer constants to a boolean always "
6939  "evaluates to 'true'">,
6940  InGroup<TautologicalConstantCompare>;
6941def warn_left_shift_always : Warning<
6942  "converting the result of '<<' to a boolean always evaluates "
6943  "to %select{false|true}0">,
6944  InGroup<TautologicalConstantCompare>;
6945def warn_null_in_arithmetic_operation : Warning<
6946  "use of NULL in arithmetic operation">,
6947  InGroup<NullArithmetic>;
6948def warn_null_in_comparison_operation : Warning<
6949  "comparison between NULL and non-pointer "
6950  "%select{(%1 and NULL)|(NULL and %1)}0">,
6951  InGroup<NullArithmetic>;
6952def err_shift_rhs_only_vector : Error<
6953  "requested shift is a vector of type %0 but the first operand is not a "
6954  "vector (%1)">;
6955
6956def warn_logical_not_on_lhs_of_check : Warning<
6957  "logical not is only applied to the left hand side of this "
6958  "%select{comparison|bitwise operator}0">,
6959  InGroup<LogicalNotParentheses>;
6960def note_logical_not_fix : Note<
6961  "add parentheses after the '!' to evaluate the "
6962  "%select{comparison|bitwise operator}0 first">;
6963def note_logical_not_silence_with_parens : Note<
6964  "add parentheses around left hand side expression to silence this warning">;
6965
6966def err_invalid_this_use : Error<
6967  "invalid use of 'this' outside of a non-static member function">;
6968def err_this_static_member_func : Error<
6969  "'this' cannot be%select{| implicitly}0 used in a static member function "
6970  "declaration">;
6971def err_invalid_member_use_in_static_method : Error<
6972  "invalid use of member %0 in static member function">;
6973def err_invalid_qualified_function_type : Error<
6974  "%select{non-member function|static member function|deduction guide}0 "
6975  "%select{of type %2 |}1cannot have '%3' qualifier">;
6976def err_compound_qualified_function_type : Error<
6977  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
6978  "cannot have '%3' qualifier">;
6979def err_qualified_function_typeid : Error<
6980  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
6981
6982def err_ref_qualifier_overload : Error<
6983  "cannot overload a member function %select{without a ref-qualifier|with "
6984  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
6985  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
6986
6987def err_invalid_non_static_member_use : Error<
6988  "invalid use of non-static data member %0">;
6989def err_nested_non_static_member_use : Error<
6990  "%select{call to non-static member function|use of non-static data member}0 "
6991  "%2 of %1 from nested type %3">;
6992def warn_cxx98_compat_non_static_member_use : Warning<
6993  "use of non-static data member %0 in an unevaluated context is "
6994  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6995def err_invalid_incomplete_type_use : Error<
6996  "invalid use of incomplete type %0">;
6997def err_builtin_func_cast_more_than_one_arg : Error<
6998  "function-style cast to a builtin type can only take one argument">;
6999def err_value_init_for_array_type : Error<
7000  "array types cannot be value-initialized">;
7001def err_init_for_function_type : Error<
7002  "cannot create object of function type %0">;
7003def warn_format_nonliteral_noargs : Warning<
7004  "format string is not a string literal (potentially insecure)">,
7005  InGroup<FormatSecurity>;
7006def warn_format_nonliteral : Warning<
7007  "format string is not a string literal">,
7008  InGroup<FormatNonLiteral>, DefaultIgnore;
7009
7010def err_unexpected_interface : Error<
7011  "unexpected interface name %0: expected expression">;
7012def err_ref_non_value : Error<"%0 does not refer to a value">;
7013def err_ref_vm_type : Error<
7014  "cannot refer to declaration with a variably modified type inside block">;
7015def err_ref_flexarray_type : Error<
7016  "cannot refer to declaration of structure variable with flexible array member "
7017  "inside block">;
7018def err_ref_array_type : Error<
7019  "cannot refer to declaration with an array type inside block">;
7020def err_property_not_found : Error<
7021  "property %0 not found on object of type %1">;
7022def err_invalid_property_name : Error<
7023  "%0 is not a valid property name (accessing an object of type %1)">;
7024def err_getter_not_found : Error<
7025  "no getter method for read from property">;
7026def err_objc_subscript_method_not_found : Error<
7027  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
7028  "found on object of type %0">;
7029def err_objc_subscript_index_type : Error<
7030  "method index parameter type %0 is not integral type">;
7031def err_objc_subscript_key_type : Error<
7032  "method key parameter type %0 is not object type">;
7033def err_objc_subscript_dic_object_type : Error<
7034  "method object parameter type %0 is not object type">;
7035def err_objc_subscript_object_type : Error<
7036  "cannot assign to this %select{dictionary|array}1 because assigning method's "
7037  "2nd parameter of type %0 is not an Objective-C pointer type">;
7038def err_objc_subscript_base_type : Error<
7039  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
7040def err_objc_multiple_subscript_type_conversion : Error<
7041  "indexing expression is invalid because subscript type %0 has "
7042  "multiple type conversion functions">;
7043def err_objc_subscript_type_conversion : Error<
7044  "indexing expression is invalid because subscript type %0 is not an integral"
7045  " or Objective-C pointer type">;
7046def err_objc_subscript_pointer : Error<
7047  "indexing expression is invalid because subscript type %0 is not an"
7048  " Objective-C pointer">;
7049def err_objc_indexing_method_result_type : Error<
7050  "method for accessing %select{dictionary|array}1 element must have Objective-C"
7051  " object return type instead of %0">;
7052def err_objc_index_incomplete_class_type : Error<
7053  "Objective-C index expression has incomplete class type %0">;
7054def err_illegal_container_subscripting_op : Error<
7055  "illegal operation on Objective-C container subscripting">;
7056def err_property_not_found_forward_class : Error<
7057  "property %0 cannot be found in forward class object %1">;
7058def err_property_not_as_forward_class : Error<
7059  "property %0 refers to an incomplete Objective-C class %1 "
7060  "(with no @interface available)">;
7061def note_forward_class : Note<
7062  "forward declaration of class here">;
7063def err_duplicate_property : Error<
7064  "property has a previous declaration">;
7065def ext_gnu_void_ptr : Extension<
7066  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
7067  InGroup<PointerArith>;
7068def ext_gnu_ptr_func_arith : Extension<
7069  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
7070  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
7071  InGroup<PointerArith>;
7072def err_readonly_message_assignment : Error<
7073  "assigning to 'readonly' return result of an Objective-C message not allowed">;
7074def ext_integer_increment_complex : Extension<
7075  "ISO C does not support '++'/'--' on complex integer type %0">;
7076def ext_integer_complement_complex : Extension<
7077  "ISO C does not support '~' for complex conjugation of %0">;
7078def err_nosetter_property_assignment : Error<
7079  "%select{assignment to readonly property|"
7080  "no setter method %1 for assignment to property}0">;
7081def err_nosetter_property_incdec : Error<
7082  "%select{%select{increment|decrement}1 of readonly property|"
7083  "no setter method %2 for %select{increment|decrement}1 of property}0">;
7084def err_nogetter_property_compound_assignment : Error<
7085  "a getter method is needed to perform a compound assignment on a property">;
7086def err_nogetter_property_incdec : Error<
7087  "no getter method %1 for %select{increment|decrement}0 of property">;
7088def err_no_subobject_property_setting : Error<
7089  "expression is not assignable">;
7090def err_qualified_objc_access : Error<
7091  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
7092
7093def ext_freestanding_complex : Extension<
7094  "complex numbers are an extension in a freestanding C99 implementation">;
7095
7096// FIXME: Remove when we support imaginary.
7097def err_imaginary_not_supported : Error<"imaginary types are not supported">;
7098
7099// Obj-c expressions
7100def warn_root_inst_method_not_found : Warning<
7101  "instance method %0 is being used on 'Class' which is not in the root class">,
7102  InGroup<MethodAccess>;
7103def warn_class_method_not_found : Warning<
7104  "class method %objcclass0 not found (return type defaults to 'id')">,
7105  InGroup<MethodAccess>;
7106def warn_instance_method_on_class_found : Warning<
7107  "instance method %0 found instead of class method %1">,
7108  InGroup<MethodAccess>;
7109def warn_inst_method_not_found : Warning<
7110  "instance method %objcinstance0 not found (return type defaults to 'id')">,
7111  InGroup<MethodAccess>;
7112def warn_instance_method_not_found_with_typo : Warning<
7113  "instance method %objcinstance0 not found (return type defaults to 'id')"
7114  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
7115def warn_class_method_not_found_with_typo : Warning<
7116  "class method %objcclass0 not found (return type defaults to 'id')"
7117  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
7118def err_method_not_found_with_typo : Error<
7119  "%select{instance|class}1 method %0 not found "
7120  "; did you mean %2?">;
7121def err_no_super_class_message : Error<
7122  "no @interface declaration found in class messaging of %0">;
7123def err_root_class_cannot_use_super : Error<
7124  "%0 cannot use 'super' because it is a root class">;
7125def err_invalid_receiver_to_message_super : Error<
7126  "'super' is only valid in a method body">;
7127def err_invalid_receiver_class_message : Error<
7128  "receiver type %0 is not an Objective-C class">;
7129def err_missing_open_square_message_send : Error<
7130  "missing '[' at start of message send expression">;
7131def warn_bad_receiver_type : Warning<
7132  "receiver type %0 is not 'id' or interface pointer, consider "
7133  "casting it to 'id'">,InGroup<ObjCReceiver>;
7134def err_bad_receiver_type : Error<"bad receiver type %0">;
7135def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
7136def err_unknown_receiver_suggest : Error<
7137  "unknown receiver %0; did you mean %1?">;
7138def err_objc_throw_expects_object : Error<
7139  "@throw requires an Objective-C object type (%0 invalid)">;
7140def err_objc_synchronized_expects_object : Error<
7141  "@synchronized requires an Objective-C object type (%0 invalid)">;
7142def err_rethrow_used_outside_catch : Error<
7143  "@throw (rethrow) used outside of a @catch block">;
7144def err_attribute_multiple_objc_gc : Error<
7145  "multiple garbage collection attributes specified for type">;
7146def err_catch_param_not_objc_type : Error<
7147  "@catch parameter is not a pointer to an interface type">;
7148def err_illegal_qualifiers_on_catch_parm : Error<
7149  "illegal qualifiers on @catch parameter">;
7150def err_storage_spec_on_catch_parm : Error<
7151  "@catch parameter cannot have storage specifier '%0'">;
7152def warn_register_objc_catch_parm : Warning<
7153  "'register' storage specifier on @catch parameter will be ignored">;
7154def err_qualified_objc_catch_parm : Error<
7155  "@catch parameter declarator cannot be qualified">;
7156def warn_objc_pointer_cxx_catch_fragile : Warning<
7157  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7158  "exception model">, InGroup<ObjCNonUnifiedException>;
7159def err_objc_object_catch : Error<
7160  "cannot catch an Objective-C object by value">;
7161def err_incomplete_type_objc_at_encode : Error<
7162  "'@encode' of incomplete type %0">;
7163def warn_objc_circular_container : Warning<
7164  "adding %0 to %1 might cause circular dependency in container">,
7165  InGroup<DiagGroup<"objc-circular-container">>;
7166def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7167def warn_objc_unsafe_perform_selector : Warning<
7168  "%0 is incompatible with selectors that return a "
7169  "%select{struct|union|vector}1 type">,
7170  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7171def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7172  "method %0 that returns %1 declared here">;
7173def err_attribute_arm_builtin_alias : Error<
7174  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7175def err_attribute_arm_mve_polymorphism : Error<
7176  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7177
7178def warn_setter_getter_impl_required : Warning<
7179  "property %0 requires method %1 to be defined - "
7180  "use @synthesize, @dynamic or provide a method implementation "
7181  "in this class implementation">,
7182  InGroup<ObjCPropertyImpl>;
7183def warn_setter_getter_impl_required_in_category : Warning<
7184  "property %0 requires method %1 to be defined - "
7185  "use @dynamic or provide a method implementation in this category">,
7186  InGroup<ObjCPropertyImpl>;
7187def note_parameter_named_here : Note<
7188  "passing argument to parameter %0 here">;
7189def note_parameter_here : Note<
7190  "passing argument to parameter here">;
7191def note_method_return_type_change : Note<
7192  "compiler has implicitly changed method %0 return type">;
7193
7194def warn_impl_required_for_class_property : Warning<
7195  "class property %0 requires method %1 to be defined - "
7196  "use @dynamic or provide a method implementation "
7197  "in this class implementation">,
7198  InGroup<ObjCPropertyImpl>;
7199def warn_impl_required_in_category_for_class_property : Warning<
7200  "class property %0 requires method %1 to be defined - "
7201  "use @dynamic or provide a method implementation in this category">,
7202  InGroup<ObjCPropertyImpl>;
7203
7204// C++ casts
7205// These messages adhere to the TryCast pattern: %0 is an int specifying the
7206// cast type, %1 is the source type, %2 is the destination type.
7207def err_bad_reinterpret_cast_overload : Error<
7208  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7209
7210def warn_reinterpret_different_from_static : Warning<
7211  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7212  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7213  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7214def note_reinterpret_updowncast_use_static: Note<
7215  "use 'static_cast' to adjust the pointer correctly while "
7216  "%select{upcasting|downcasting}0">;
7217
7218def err_bad_static_cast_overload : Error<
7219  "address of overloaded function %0 cannot be static_cast to type %1">;
7220
7221def err_bad_cstyle_cast_overload : Error<
7222  "address of overloaded function %0 cannot be cast to type %1">;
7223
7224
7225def err_bad_cxx_cast_generic : Error<
7226  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7227  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7228def err_bad_cxx_cast_unrelated_class : Error<
7229  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7230  "functional-style cast|}0 from %1 to %2, which are not related by "
7231  "inheritance, is not allowed">;
7232def note_type_incomplete : Note<"%0 is incomplete">;
7233def err_bad_cxx_cast_rvalue : Error<
7234  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7235  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7236def err_bad_cxx_cast_bitfield : Error<
7237  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7238  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7239def err_bad_cxx_cast_qualifiers_away : Error<
7240  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7241  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7242def err_bad_cxx_cast_addr_space_mismatch : Error<
7243  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7244  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7245  " spaces">;
7246def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7247  "ISO C++ does not allow "
7248  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7249  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7250  "even though the source and destination types are unrelated">,
7251  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7252def err_bad_const_cast_dest : Error<
7253  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7254  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7255def ext_cast_fn_obj : Extension<
7256  "cast between pointer-to-function and pointer-to-object is an extension">;
7257def ext_ms_cast_fn_obj : ExtWarn<
7258  "static_cast between pointer-to-function and pointer-to-object is a "
7259  "Microsoft extension">, InGroup<MicrosoftCast>;
7260def warn_cxx98_compat_cast_fn_obj : Warning<
7261  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7262  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7263def err_bad_reinterpret_cast_small_int : Error<
7264  "cast from pointer to smaller type %2 loses information">;
7265def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7266  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7267  "to scalar %2 of different size">;
7268def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7269  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7270  "to vector %2 of different size">;
7271def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7272  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7273  "to vector %2 of different size">;
7274def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7275  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7276  "changes address space of nested pointers">,
7277  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7278def err_bad_lvalue_to_rvalue_cast : Error<
7279  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7280  "not compatible">;
7281def err_bad_rvalue_to_rvalue_cast : Error<
7282  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7283  "not compatible">;
7284def err_bad_static_cast_pointer_nonpointer : Error<
7285  "cannot cast from type %1 to pointer type %2">;
7286def err_bad_static_cast_member_pointer_nonmp : Error<
7287  "cannot cast from type %1 to member pointer type %2">;
7288def err_bad_cxx_cast_member_pointer_size : Error<
7289  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7290  "type %1 to member pointer type %2 of different size">;
7291def err_bad_reinterpret_cast_reference : Error<
7292  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7293def warn_undefined_reinterpret_cast : Warning<
7294  "reinterpret_cast from %0 to %1 has undefined behavior">,
7295  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7296
7297// These messages don't adhere to the pattern.
7298// FIXME: Display the path somehow better.
7299def err_ambiguous_base_to_derived_cast : Error<
7300  "ambiguous cast from base %0 to derived %1:%2">;
7301def err_static_downcast_via_virtual : Error<
7302  "cannot cast %0 to %1 via virtual base %2">;
7303def err_downcast_from_inaccessible_base : Error<
7304  "cannot cast %select{private|protected}2 base class %1 to %0">;
7305def err_upcast_to_inaccessible_base : Error<
7306  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7307def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7308  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7309def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7310def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7311def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7312def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7313
7314// Other C++ expressions
7315def err_need_header_before_typeid : Error<
7316  "you need to include <typeinfo> before using the 'typeid' operator">;
7317def err_need_header_before_ms_uuidof : Error<
7318  "you need to include <guiddef.h> before using the '__uuidof' operator">;
7319def err_need_header_before_placement_new : Error<
7320  "no matching %0 function for non-allocating placement new expression; "
7321  "include <new>">;
7322def err_ms___leave_not_in___try : Error<
7323  "'__leave' statement not in __try block">;
7324def err_uuidof_without_guid : Error<
7325  "cannot call operator __uuidof on a type with no GUID">;
7326def err_uuidof_with_multiple_guids : Error<
7327  "cannot call operator __uuidof on a type with multiple GUIDs">;
7328def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7329def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7330def err_static_illegal_in_new : Error<
7331  "the 'static' modifier for the array size is not legal in new expressions">;
7332def err_array_new_needs_size : Error<
7333  "array size must be specified in new expression with no initializer">;
7334def err_bad_new_type : Error<
7335  "cannot allocate %select{function|reference}1 type %0 with new">;
7336def err_new_incomplete_or_sizeless_type : Error<
7337  "allocation of %select{incomplete|sizeless}0 type %1">;
7338def err_new_array_nonconst : Error<
7339  "only the first dimension of an allocated array may have dynamic size">;
7340def err_new_array_size_unknown_from_init : Error<
7341  "cannot determine allocated array size from initializer">;
7342def err_new_array_init_args : Error<
7343  "array 'new' cannot have initialization arguments">;
7344def ext_new_paren_array_nonconst : ExtWarn<
7345  "when type is in parentheses, array cannot have dynamic size">;
7346def err_placement_new_non_placement_delete : Error<
7347  "'new' expression with placement arguments refers to non-placement "
7348  "'operator delete'">;
7349def err_array_size_not_integral : Error<
7350  "array size expression must have integral or %select{|unscoped }0"
7351  "enumeration type, not %1">;
7352def err_array_size_incomplete_type : Error<
7353  "array size expression has incomplete class type %0">;
7354def err_array_size_explicit_conversion : Error<
7355  "array size expression of type %0 requires explicit conversion to type %1">;
7356def note_array_size_conversion : Note<
7357  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7358def err_array_size_ambiguous_conversion : Error<
7359  "ambiguous conversion of array size expression of type %0 to an integral or "
7360  "enumeration type">;
7361def ext_array_size_conversion : Extension<
7362  "implicit conversion from array size expression of type %0 to "
7363  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7364  InGroup<CXX11>;
7365def warn_cxx98_compat_array_size_conversion : Warning<
7366  "implicit conversion from array size expression of type %0 to "
7367  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7368  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7369def err_address_space_qualified_new : Error<
7370  "'new' cannot allocate objects of type %0 in address space '%1'">;
7371def err_address_space_qualified_delete : Error<
7372  "'delete' cannot delete objects of type %0 in address space '%1'">;
7373
7374def err_default_init_const : Error<
7375  "default initialization of an object of const type %0"
7376  "%select{| without a user-provided default constructor}1">;
7377def ext_default_init_const : ExtWarn<
7378  "default initialization of an object of const type %0"
7379  "%select{| without a user-provided default constructor}1 "
7380  "is a Microsoft extension">,
7381  InGroup<MicrosoftConstInit>;
7382def err_delete_operand : Error<"cannot delete expression of type %0">;
7383def ext_delete_void_ptr_operand : ExtWarn<
7384  "cannot delete expression with pointer-to-'void' type %0">,
7385  InGroup<DeleteIncomplete>;
7386def err_ambiguous_delete_operand : Error<
7387  "ambiguous conversion of delete expression of type %0 to a pointer">;
7388def warn_delete_incomplete : Warning<
7389  "deleting pointer to incomplete type %0 may cause undefined behavior">,
7390  InGroup<DeleteIncomplete>;
7391def err_delete_incomplete_class_type : Error<
7392  "deleting incomplete class type %0; no conversions to pointer type">;
7393def err_delete_explicit_conversion : Error<
7394  "converting delete expression from type %0 to type %1 invokes an explicit "
7395  "conversion function">;
7396def note_delete_conversion : Note<"conversion to pointer type %0">;
7397def warn_delete_array_type : Warning<
7398  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
7399def warn_mismatched_delete_new : Warning<
7400  "'delete%select{|[]}0' applied to a pointer that was allocated with "
7401  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
7402  InGroup<DiagGroup<"mismatched-new-delete">>;
7403def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
7404def err_no_suitable_delete_member_function_found : Error<
7405  "no suitable member %0 in %1">;
7406def err_ambiguous_suitable_delete_member_function_found : Error<
7407  "multiple suitable %0 functions in %1">;
7408def warn_ambiguous_suitable_delete_function_found : Warning<
7409  "multiple suitable %0 functions for %1; no 'operator delete' function "
7410  "will be invoked if initialization throws an exception">,
7411  InGroup<DiagGroup<"ambiguous-delete">>;
7412def note_member_declared_here : Note<
7413  "member %0 declared here">;
7414def note_member_first_declared_here : Note<
7415  "member %0 first declared here">;
7416def warn_bitwise_negation_bool : Warning<
7417  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
7418  "did you mean logical negation?">,
7419  InGroup<DiagGroup<"bool-operation">>;
7420def err_decrement_bool : Error<"cannot decrement expression of type bool">;
7421def warn_increment_bool : Warning<
7422  "incrementing expression of type bool is deprecated and "
7423  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
7424def ext_increment_bool : ExtWarn<
7425  "ISO C++17 does not allow incrementing expression of type bool">,
7426  DefaultError, InGroup<IncrementBool>;
7427def err_increment_decrement_enum : Error<
7428  "cannot %select{decrement|increment}0 expression of enum type %1">;
7429
7430def warn_deprecated_increment_decrement_volatile : Warning<
7431  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
7432  "is deprecated">, InGroup<DeprecatedVolatile>;
7433def warn_deprecated_simple_assign_volatile : Warning<
7434  "use of result of assignment to object of volatile-qualified type %0 "
7435  "is deprecated">, InGroup<DeprecatedVolatile>;
7436def warn_deprecated_compound_assign_volatile : Warning<
7437  "compound assignment to object of volatile-qualified type %0 is deprecated">,
7438  InGroup<DeprecatedVolatile>;
7439def warn_deprecated_volatile_return : Warning<
7440  "volatile-qualified return type %0 is deprecated">,
7441  InGroup<DeprecatedVolatile>;
7442def warn_deprecated_volatile_param : Warning<
7443  "volatile-qualified parameter type %0 is deprecated">,
7444  InGroup<DeprecatedVolatile>;
7445def warn_deprecated_volatile_structured_binding : Warning<
7446  "volatile qualifier in structured binding declaration is deprecated">,
7447  InGroup<DeprecatedVolatile>;
7448
7449def warn_deprecated_altivec_src_compat : Warning<
7450  "Current handling of vector bool and vector pixel types in this context are "
7451  "deprecated. The default behaviour will soon change to that implied by the "
7452  "'-altivec-compat=xl' option">,
7453  InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7454
7455def err_catch_incomplete_ptr : Error<
7456  "cannot catch pointer to incomplete type %0">;
7457def err_catch_incomplete_ref : Error<
7458  "cannot catch reference to incomplete type %0">;
7459def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
7460def err_catch_sizeless : Error<
7461  "cannot catch %select{|reference to }0sizeless type %1">;
7462def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
7463def err_catch_variably_modified : Error<
7464  "cannot catch variably modified type %0">;
7465def err_qualified_catch_declarator : Error<
7466  "exception declarator cannot be qualified">;
7467def err_early_catch_all : Error<"catch-all handler must come last">;
7468def err_bad_memptr_rhs : Error<
7469  "right hand operand to %0 has non-pointer-to-member type %1">;
7470def err_bad_memptr_lhs : Error<
7471  "left hand operand to %0 must be a %select{|pointer to }1class "
7472  "compatible with the right hand operand, but is %2">;
7473def err_memptr_incomplete : Error<
7474  "member pointer has incomplete base type %0">;
7475def warn_exception_caught_by_earlier_handler : Warning<
7476  "exception of type %0 will be caught by earlier handler">,
7477  InGroup<Exceptions>;
7478def note_previous_exception_handler : Note<"for type %0">;
7479def err_exceptions_disabled : Error<
7480  "cannot use '%0' with exceptions disabled">;
7481def err_objc_exceptions_disabled : Error<
7482  "cannot use '%0' with Objective-C exceptions disabled">;
7483def warn_throw_in_noexcept_func : Warning<
7484  "%0 has a non-throwing exception specification but can still throw">,
7485  InGroup<Exceptions>;
7486def note_throw_in_dtor : Note<
7487  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
7488  "non-throwing}1 exception specification">;
7489def note_throw_in_function : Note<"function declared non-throwing here">;
7490def err_seh_try_outside_functions : Error<
7491  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
7492def err_mixing_cxx_try_seh_try : Error<
7493  "cannot use C++ 'try' in the same function as SEH '__try'">;
7494def err_seh_try_unsupported : Error<
7495  "SEH '__try' is not supported on this target">;
7496def note_conflicting_try_here : Note<
7497  "conflicting %0 here">;
7498def warn_jump_out_of_seh_finally : Warning<
7499  "jump out of __finally block has undefined behavior">,
7500  InGroup<DiagGroup<"jump-seh-finally">>;
7501def warn_non_virtual_dtor : Warning<
7502  "%0 has virtual functions but non-virtual destructor">,
7503  InGroup<NonVirtualDtor>, DefaultIgnore;
7504def warn_delete_non_virtual_dtor : Warning<
7505  "%select{delete|destructor}0 called on non-final %1 that has "
7506  "virtual functions but non-virtual destructor">,
7507  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
7508def note_delete_non_virtual : Note<
7509  "qualify call to silence this warning">;
7510def warn_delete_abstract_non_virtual_dtor : Warning<
7511  "%select{delete|destructor}0 called on %1 that is abstract but has "
7512  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
7513def warn_overloaded_virtual : Warning<
7514  "%q0 hides overloaded virtual %select{function|functions}1">,
7515  InGroup<OverloadedVirtual>, DefaultIgnore;
7516def note_hidden_overloaded_virtual_declared_here : Note<
7517  "hidden overloaded virtual function %q0 declared here"
7518  "%select{|: different classes%diff{ ($ vs $)|}2,3"
7519  "|: different number of parameters (%2 vs %3)"
7520  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
7521  "|: different return type%diff{ ($ vs $)|}2,3"
7522  "|: different qualifiers (%2 vs %3)"
7523  "|: different exception specifications}1">;
7524def warn_using_directive_in_header : Warning<
7525  "using namespace directive in global context in header">,
7526  InGroup<HeaderHygiene>, DefaultIgnore;
7527def warn_overaligned_type : Warning<
7528  "type %0 requires %1 bytes of alignment and the default allocator only "
7529  "guarantees %2 bytes">,
7530  InGroup<OveralignedType>, DefaultIgnore;
7531def err_aligned_allocation_unavailable : Error<
7532  "aligned %select{allocation|deallocation}0 function of type '%1' is "
7533  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
7534def note_silence_aligned_allocation_unavailable : Note<
7535  "if you supply your own aligned allocation functions, use "
7536  "-faligned-allocation to silence this diagnostic">;
7537
7538def err_conditional_void_nonvoid : Error<
7539  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
7540  "is of type %0">;
7541def err_conditional_ambiguous : Error<
7542  "conditional expression is ambiguous; "
7543  "%diff{$ can be converted to $ and vice versa|"
7544  "types can be convert to each other}0,1">;
7545def err_conditional_ambiguous_ovl : Error<
7546  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
7547  "can be converted to several common types">;
7548def err_conditional_vector_size : Error<
7549  "vector condition type %0 and result type %1 do not have the same number "
7550  "of elements">;
7551def err_conditional_vector_element_size : Error<
7552  "vector condition type %0 and result type %1 do not have elements of the "
7553  "same size">;
7554def err_conditional_vector_has_void : Error<
7555  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
7556def err_conditional_vector_operand_type
7557    : Error<"enumeration type %0 is not allowed in a vector conditional">;
7558def err_conditional_vector_cond_result_mismatch
7559    : Error<"cannot mix vectors and extended vectors in a vector conditional">;
7560def err_conditional_vector_mismatched
7561    : Error<"vector operands to the vector conditional must be the same type "
7562            "%diff{($ and $)|}0,1}">;
7563
7564def err_throw_incomplete : Error<
7565  "cannot throw object of incomplete type %0">;
7566def err_throw_incomplete_ptr : Error<
7567  "cannot throw pointer to object of incomplete type %0">;
7568def err_throw_sizeless : Error<
7569  "cannot throw object of sizeless type %0">;
7570def warn_throw_underaligned_obj : Warning<
7571  "underaligned exception object thrown">,
7572  InGroup<UnderalignedExceptionObject>;
7573def note_throw_underaligned_obj : Note<
7574  "required alignment of type %0 (%1 bytes) is larger than the supported "
7575  "alignment of C++ exception objects on this target (%2 bytes)">;
7576def err_return_in_constructor_handler : Error<
7577  "return in the catch of a function try block of a constructor is illegal">;
7578def warn_cdtor_function_try_handler_mem_expr : Warning<
7579  "cannot refer to a non-static member from the handler of a "
7580  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
7581
7582let CategoryName = "Lambda Issue" in {
7583  def err_capture_more_than_once : Error<
7584    "%0 can appear only once in a capture list">;
7585  def err_reference_capture_with_reference_default : Error<
7586    "'&' cannot precede a capture when the capture default is '&'">;
7587  def err_copy_capture_with_copy_default : Error<
7588    "'&' must precede a capture when the capture default is '='">;
7589  def err_capture_does_not_name_variable : Error<
7590    "%0 in capture list does not name a variable">;
7591  def err_capture_non_automatic_variable : Error<
7592    "%0 cannot be captured because it does not have automatic storage "
7593    "duration">;
7594  def err_this_capture : Error<
7595    "'this' cannot be %select{implicitly |}0captured in this context">;
7596  def note_lambda_this_capture_fixit : Note<
7597    "explicitly capture 'this'">;
7598  def err_lambda_capture_anonymous_var : Error<
7599    "unnamed variable cannot be implicitly captured in a lambda expression">;
7600  def err_lambda_capture_flexarray_type : Error<
7601    "variable %0 with flexible array member cannot be captured in "
7602    "a lambda expression">;
7603  def err_lambda_impcap : Error<
7604    "variable %0 cannot be implicitly captured in a lambda with no "
7605    "capture-default specified">;
7606  def note_lambda_variable_capture_fixit : Note<
7607    "capture %0 by %select{value|reference}1">;
7608  def note_lambda_default_capture_fixit : Note<
7609    "default capture by %select{value|reference}0">;
7610  def note_lambda_decl : Note<"lambda expression begins here">;
7611  def err_lambda_unevaluated_operand : Error<
7612    "lambda expression in an unevaluated operand">;
7613  def err_lambda_in_constant_expression : Error<
7614    "a lambda expression may not appear inside of a constant expression">;
7615  def err_lambda_in_invalid_context : Error<
7616    "a lambda expression cannot appear in this context">;
7617  def err_lambda_return_init_list : Error<
7618    "cannot deduce lambda return type from initializer list">;
7619  def err_lambda_capture_default_arg : Error<
7620    "lambda expression in default argument cannot capture any entity">;
7621  def err_lambda_incomplete_result : Error<
7622    "incomplete result type %0 in lambda expression">;
7623  def err_noreturn_lambda_has_return_expr : Error<
7624    "lambda declared 'noreturn' should not return">;
7625  def warn_maybe_falloff_nonvoid_lambda : Warning<
7626    "non-void lambda does not return a value in all control paths">,
7627    InGroup<ReturnType>;
7628  def warn_falloff_nonvoid_lambda : Warning<
7629    "non-void lambda does not return a value">,
7630    InGroup<ReturnType>;
7631  def err_access_lambda_capture : Error<
7632    // The ERRORs represent other special members that aren't constructors, in
7633    // hopes that someone will bother noticing and reporting if they appear
7634    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
7635    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
7636    AccessControl;
7637  def note_lambda_to_block_conv : Note<
7638    "implicit capture of lambda object due to conversion to block pointer "
7639    "here">;
7640  def note_var_explicitly_captured_here : Note<"variable %0 is"
7641    "%select{| explicitly}1 captured here">;
7642
7643  // C++14 lambda init-captures.
7644  def warn_cxx11_compat_init_capture : Warning<
7645    "initialized lambda captures are incompatible with C++ standards "
7646    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
7647  def ext_init_capture : ExtWarn<
7648    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
7649  def err_init_capture_no_expression : Error<
7650    "initializer missing for lambda capture %0">;
7651  def err_init_capture_multiple_expressions : Error<
7652    "initializer for lambda capture %0 contains multiple expressions">;
7653  def err_init_capture_paren_braces : Error<
7654    "cannot deduce type for lambda capture %1 from "
7655    "%select{parenthesized|nested}0 initializer list">;
7656  def err_init_capture_deduction_failure : Error<
7657    "cannot deduce type for lambda capture %0 from initializer of type %2">;
7658  def err_init_capture_deduction_failure_from_init_list : Error<
7659    "cannot deduce type for lambda capture %0 from initializer list">;
7660  def warn_cxx17_compat_init_capture_pack : Warning<
7661    "initialized lambda capture packs are incompatible with C++ standards "
7662    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7663  def ext_init_capture_pack : ExtWarn<
7664    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
7665
7666  // C++14 generic lambdas.
7667  def warn_cxx11_compat_generic_lambda : Warning<
7668    "generic lambdas are incompatible with C++11">,
7669    InGroup<CXXPre14Compat>, DefaultIgnore;
7670
7671  // C++17 '*this' captures.
7672  def warn_cxx14_compat_star_this_lambda_capture : Warning<
7673    "by value capture of '*this' is incompatible with C++ standards before C++17">,
7674     InGroup<CXXPre17Compat>, DefaultIgnore;
7675  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
7676    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
7677
7678  // C++17 parameter shadows capture
7679  def err_parameter_shadow_capture : Error<
7680    "a lambda parameter cannot shadow an explicitly captured entity">;
7681
7682  // C++20 [=, this] captures.
7683  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
7684    "explicit capture of 'this' with a capture default of '=' is incompatible "
7685    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7686  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
7687    "explicit capture of 'this' with a capture default of '=' "
7688    "is a C++20 extension">, InGroup<CXX20>;
7689  def warn_deprecated_this_capture : Warning<
7690    "implicit capture of 'this' with a capture default of '=' is deprecated">,
7691    InGroup<DeprecatedThisCapture>, DefaultIgnore;
7692  def note_deprecated_this_capture : Note<
7693    "add an explicit capture of 'this' to capture '*this' by reference">;
7694
7695  // C++20 default constructible / assignable lambdas.
7696  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
7697    "%select{default construction|assignment}0 of lambda is incompatible with "
7698    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7699}
7700
7701def err_return_in_captured_stmt : Error<
7702  "cannot return from %0">;
7703def err_capture_block_variable : Error<
7704  "__block variable %0 cannot be captured in a "
7705  "%select{lambda expression|captured statement}1">;
7706
7707def err_operator_arrow_circular : Error<
7708  "circular pointer delegation detected">;
7709def err_operator_arrow_depth_exceeded : Error<
7710  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
7711  "'operator->' calls">;
7712def note_operator_arrow_here : Note<
7713  "'operator->' declared here produces an object of type %0">;
7714def note_operator_arrows_suppressed : Note<
7715  "(skipping %0 'operator->'%s0 in backtrace)">;
7716def note_operator_arrow_depth : Note<
7717  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
7718
7719def err_pseudo_dtor_base_not_scalar : Error<
7720  "object expression of non-scalar type %0 cannot be used in a "
7721  "pseudo-destructor expression">;
7722def ext_pseudo_dtor_on_void : ExtWarn<
7723  "pseudo-destructors on type void are a Microsoft extension">,
7724  InGroup<MicrosoftVoidPseudoDtor>;
7725def err_pseudo_dtor_type_mismatch : Error<
7726  "the type of object expression "
7727  "%diff{($) does not match the type being destroyed ($)|"
7728  "does not match the type being destroyed}0,1 "
7729  "in pseudo-destructor expression">;
7730def err_pseudo_dtor_call_with_args : Error<
7731  "call to pseudo-destructor cannot have any arguments">;
7732def err_dtor_expr_without_call : Error<
7733  "reference to %select{destructor|pseudo-destructor}0 must be called"
7734  "%select{|; did you mean to call it with no arguments?}1">;
7735def err_pseudo_dtor_destructor_non_type : Error<
7736  "%0 does not refer to a type name in pseudo-destructor expression; expected "
7737  "the name of type %1">;
7738def err_invalid_use_of_function_type : Error<
7739  "a function type is not allowed here">;
7740def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
7741def err_typecheck_bool_condition : Error<
7742  "value of type %0 is not contextually convertible to 'bool'">;
7743def err_typecheck_ambiguous_condition : Error<
7744  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
7745def err_typecheck_nonviable_condition : Error<
7746  "no viable conversion%select{%diff{ from $ to $|}1,2|"
7747  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
7748def err_typecheck_nonviable_condition_incomplete : Error<
7749  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
7750def err_typecheck_deleted_function : Error<
7751  "conversion function %diff{from $ to $|between types}0,1 "
7752  "invokes a deleted function">;
7753
7754def err_expected_class_or_namespace : Error<"%0 is not a class"
7755  "%select{ or namespace|, namespace, or enumeration}1">;
7756def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
7757  "because namespace %1 does not enclose namespace %2">;
7758def err_invalid_declarator_global_scope : Error<
7759  "definition or redeclaration of %0 cannot name the global scope">;
7760def err_invalid_declarator_in_function : Error<
7761  "definition or redeclaration of %0 not allowed inside a function">;
7762def err_invalid_declarator_in_block : Error<
7763  "definition or redeclaration of %0 not allowed inside a block">;
7764def err_not_tag_in_scope : Error<
7765  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
7766
7767def err_no_typeid_with_fno_rtti : Error<
7768  "use of typeid requires -frtti">;
7769def err_no_dynamic_cast_with_fno_rtti : Error<
7770  "use of dynamic_cast requires -frtti">;
7771def warn_no_dynamic_cast_with_rtti_disabled: Warning<
7772  "dynamic_cast will not work since RTTI data is disabled by "
7773  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7774def warn_no_typeid_with_rtti_disabled: Warning<
7775  "typeid will not work since RTTI data is disabled by "
7776  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7777
7778def err_cannot_form_pointer_to_member_of_reference_type : Error<
7779  "cannot form a pointer-to-member to member %0 of reference type %1">;
7780def err_incomplete_object_call : Error<
7781  "incomplete type in call to object of type %0">;
7782
7783def warn_condition_is_assignment : Warning<"using the result of an "
7784  "assignment as a condition without parentheses">,
7785  InGroup<Parentheses>;
7786def warn_free_nonheap_object
7787  : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">,
7788    InGroup<FreeNonHeapObject>;
7789
7790// Completely identical except off by default.
7791def warn_condition_is_idiomatic_assignment : Warning<"using the result "
7792  "of an assignment as a condition without parentheses">,
7793  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
7794def note_condition_assign_to_comparison : Note<
7795  "use '==' to turn this assignment into an equality comparison">;
7796def note_condition_or_assign_to_comparison : Note<
7797  "use '!=' to turn this compound assignment into an inequality comparison">;
7798def note_condition_assign_silence : Note<
7799  "place parentheses around the assignment to silence this warning">;
7800
7801def warn_equality_with_extra_parens : Warning<"equality comparison with "
7802  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
7803def note_equality_comparison_to_assign : Note<
7804  "use '=' to turn this equality comparison into an assignment">;
7805def note_equality_comparison_silence : Note<
7806  "remove extraneous parentheses around the comparison to silence this warning">;
7807
7808// assignment related diagnostics (also for argument passing, returning, etc).
7809// In most of these diagnostics the %2 is a value from the
7810// Sema::AssignmentAction enumeration
7811def err_typecheck_convert_incompatible : Error<
7812  "%select{%diff{assigning to $ from incompatible type $|"
7813  "assigning to type from incompatible type}0,1"
7814  "|%diff{passing $ to parameter of incompatible type $|"
7815  "passing type to parameter of incompatible type}0,1"
7816  "|%diff{returning $ from a function with incompatible result type $|"
7817  "returning type from a function with incompatible result type}0,1"
7818  "|%diff{converting $ to incompatible type $|"
7819  "converting type to incompatible type}0,1"
7820  "|%diff{initializing $ with an expression of incompatible type $|"
7821  "initializing type with an expression of incompatible type}0,1"
7822  "|%diff{sending $ to parameter of incompatible type $|"
7823  "sending type to parameter of incompatible type}0,1"
7824  "|%diff{casting $ to incompatible type $|"
7825  "casting type to incompatible type}0,1}2"
7826  "%select{|; dereference with *|"
7827  "; take the address with &|"
7828  "; remove *|"
7829  "; remove &}3"
7830  "%select{|: different classes%diff{ ($ vs $)|}5,6"
7831  "|: different number of parameters (%5 vs %6)"
7832  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
7833  "|: different return type%diff{ ($ vs $)|}5,6"
7834  "|: different qualifiers (%5 vs %6)"
7835  "|: different exception specifications}4">;
7836def err_typecheck_missing_return_type_incompatible : Error<
7837  "%diff{return type $ must match previous return type $|"
7838  "return type must match previous return type}0,1 when %select{block "
7839  "literal|lambda expression}2 has unspecified explicit return type">;
7840
7841def note_incomplete_class_and_qualified_id : Note<
7842  "conformance of forward class %0 to protocol %1 can not be confirmed">;
7843def warn_incompatible_qualified_id : Warning<
7844  "%select{%diff{assigning to $ from incompatible type $|"
7845  "assigning to type from incompatible type}0,1"
7846  "|%diff{passing $ to parameter of incompatible type $|"
7847  "passing type to parameter of incompatible type}0,1"
7848  "|%diff{returning $ from a function with incompatible result type $|"
7849  "returning type from a function with incompatible result type}0,1"
7850  "|%diff{converting $ to incompatible type $|"
7851  "converting type to incompatible type}0,1"
7852  "|%diff{initializing $ with an expression of incompatible type $|"
7853  "initializing type with an expression of incompatible type}0,1"
7854  "|%diff{sending $ to parameter of incompatible type $|"
7855  "sending type to parameter of incompatible type}0,1"
7856  "|%diff{casting $ to incompatible type $|"
7857  "casting type to incompatible type}0,1}2">;
7858def err_incompatible_qualified_id : Error<
7859  "%select{%diff{assigning to $ from incompatible type $|"
7860  "assigning to type from incompatible type}0,1"
7861  "|%diff{passing $ to parameter of incompatible type $|"
7862  "passing type to parameter of incompatible type}0,1"
7863  "|%diff{returning $ from a function with incompatible result type $|"
7864  "returning type from a function with incompatible result type}0,1"
7865  "|%diff{converting $ to incompatible type $|"
7866  "converting type to incompatible type}0,1"
7867  "|%diff{initializing $ with an expression of incompatible type $|"
7868  "initializing type with an expression of incompatible type}0,1"
7869  "|%diff{sending $ to parameter of incompatible type $|"
7870  "sending type to parameter of incompatible type}0,1"
7871  "|%diff{casting $ to incompatible type $|"
7872  "casting type to incompatible type}0,1}2">;
7873def ext_typecheck_convert_pointer_int : ExtWarn<
7874  "incompatible pointer to integer conversion "
7875  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7876  "|%diff{passing $ to parameter of type $|"
7877  "passing to parameter of different type}0,1"
7878  "|%diff{returning $ from a function with result type $|"
7879  "returning from function with different return type}0,1"
7880  "|%diff{converting $ to type $|converting between types}0,1"
7881  "|%diff{initializing $ with an expression of type $|"
7882  "initializing with expression of different type}0,1"
7883  "|%diff{sending $ to parameter of type $|"
7884  "sending to parameter of different type}0,1"
7885  "|%diff{casting $ to type $|casting between types}0,1}2"
7886  "%select{|; dereference with *|"
7887  "; take the address with &|"
7888  "; remove *|"
7889  "; remove &}3">,
7890  InGroup<IntConversion>;
7891def err_typecheck_convert_pointer_int : Error<
7892  "incompatible pointer to integer conversion "
7893  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7894  "|%diff{passing $ to parameter of type $|"
7895  "passing to parameter of different type}0,1"
7896  "|%diff{returning $ from a function with result type $|"
7897  "returning from function with different return type}0,1"
7898  "|%diff{converting $ to type $|converting between types}0,1"
7899  "|%diff{initializing $ with an expression of type $|"
7900  "initializing with expression of different type}0,1"
7901  "|%diff{sending $ to parameter of type $|"
7902  "sending to parameter of different type}0,1"
7903  "|%diff{casting $ to type $|casting between types}0,1}2"
7904  "%select{|; dereference with *|"
7905  "; take the address with &|"
7906  "; remove *|"
7907  "; remove &}3">;
7908def ext_typecheck_convert_int_pointer : ExtWarn<
7909  "incompatible integer to pointer conversion "
7910  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7911  "|%diff{passing $ to parameter of type $|"
7912  "passing to parameter of different type}0,1"
7913  "|%diff{returning $ from a function with result type $|"
7914  "returning from function with different return type}0,1"
7915  "|%diff{converting $ to type $|converting between types}0,1"
7916  "|%diff{initializing $ with an expression of type $|"
7917  "initializing with expression of different type}0,1"
7918  "|%diff{sending $ to parameter of type $|"
7919  "sending to parameter of different type}0,1"
7920  "|%diff{casting $ to type $|casting between types}0,1}2"
7921  "%select{|; dereference with *|"
7922  "; take the address with &|"
7923  "; remove *|"
7924  "; remove &}3">,
7925  InGroup<IntConversion>, SFINAEFailure;
7926def err_typecheck_convert_int_pointer : Error<
7927  "incompatible integer to pointer conversion "
7928  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7929  "|%diff{passing $ to parameter of type $|"
7930  "passing to parameter of different type}0,1"
7931  "|%diff{returning $ from a function with result type $|"
7932  "returning from function with different return type}0,1"
7933  "|%diff{converting $ to type $|converting between types}0,1"
7934  "|%diff{initializing $ with an expression of type $|"
7935  "initializing with expression of different type}0,1"
7936  "|%diff{sending $ to parameter of type $|"
7937  "sending to parameter of different type}0,1"
7938  "|%diff{casting $ to type $|casting between types}0,1}2"
7939  "%select{|; dereference with *|"
7940  "; take the address with &|"
7941  "; remove *|"
7942  "; remove &}3">;
7943def ext_typecheck_convert_pointer_void_func : Extension<
7944  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7945  "|%diff{passing $ to parameter of type $|"
7946  "passing to parameter of different type}0,1"
7947  "|%diff{returning $ from a function with result type $|"
7948  "returning from function with different return type}0,1"
7949  "|%diff{converting $ to type $|converting between types}0,1"
7950  "|%diff{initializing $ with an expression of type $|"
7951  "initializing with expression of different type}0,1"
7952  "|%diff{sending $ to parameter of type $|"
7953  "sending to parameter of different type}0,1"
7954  "|%diff{casting $ to type $|casting between types}0,1}2"
7955  " converts between void pointer and function pointer">;
7956def err_typecheck_convert_pointer_void_func : Error<
7957  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7958  "|%diff{passing $ to parameter of type $|"
7959  "passing to parameter of different type}0,1"
7960  "|%diff{returning $ from a function with result type $|"
7961  "returning from function with different return type}0,1"
7962  "|%diff{converting $ to type $|converting between types}0,1"
7963  "|%diff{initializing $ with an expression of type $|"
7964  "initializing with expression of different type}0,1"
7965  "|%diff{sending $ to parameter of type $|"
7966  "sending to parameter of different type}0,1"
7967  "|%diff{casting $ to type $|casting between types}0,1}2"
7968  " converts between void pointer and function pointer">;
7969def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
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 pointers to integer types %select{with different sign|"
7982  "where one is of the unique plain 'char' type and the other is not}3">,
7983  InGroup<DiagGroup<"pointer-sign">>;
7984def err_typecheck_convert_incompatible_pointer_sign :
7985  Error<ext_typecheck_convert_incompatible_pointer_sign.Text>;
7986def ext_typecheck_convert_incompatible_pointer : ExtWarn<
7987  "incompatible pointer types "
7988  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7989  "|%diff{passing $ to parameter of type $|"
7990  "passing to parameter of different type}0,1"
7991  "|%diff{returning $ from a function with result type $|"
7992  "returning from function with different return type}0,1"
7993  "|%diff{converting $ to type $|converting between types}0,1"
7994  "|%diff{initializing $ with an expression of type $|"
7995  "initializing with expression of different type}0,1"
7996  "|%diff{sending $ to parameter of type $|"
7997  "sending to parameter of different type}0,1"
7998  "|%diff{casting $ to type $|casting between types}0,1}2"
7999  "%select{|; dereference with *|"
8000  "; take the address with &|"
8001  "; remove *|"
8002  "; remove &}3">,
8003  InGroup<IncompatiblePointerTypes>;
8004def err_typecheck_convert_incompatible_pointer : Error<
8005  "incompatible pointer types "
8006  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8007  "|%diff{passing $ to parameter of type $|"
8008  "passing to parameter of different type}0,1"
8009  "|%diff{returning $ from a function with result type $|"
8010  "returning from function with different return type}0,1"
8011  "|%diff{converting $ to type $|converting between types}0,1"
8012  "|%diff{initializing $ with an expression of type $|"
8013  "initializing with expression of different type}0,1"
8014  "|%diff{sending $ to parameter of type $|"
8015  "sending to parameter of different type}0,1"
8016  "|%diff{casting $ to type $|casting between types}0,1}2"
8017  "%select{|; dereference with *|"
8018  "; take the address with &|"
8019  "; remove *|"
8020  "; remove &}3">;
8021def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
8022  "incompatible function pointer types "
8023  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8024  "|%diff{passing $ to parameter of type $|"
8025  "passing to parameter of different type}0,1"
8026  "|%diff{returning $ from a function with result type $|"
8027  "returning from function with different return type}0,1"
8028  "|%diff{converting $ to type $|converting between types}0,1"
8029  "|%diff{initializing $ with an expression of type $|"
8030  "initializing with expression of different type}0,1"
8031  "|%diff{sending $ to parameter of type $|"
8032  "sending to parameter of different type}0,1"
8033  "|%diff{casting $ to type $|casting between types}0,1}2"
8034  "%select{|; dereference with *|"
8035  "; take the address with &|"
8036  "; remove *|"
8037  "; remove &}3">,
8038  InGroup<IncompatibleFunctionPointerTypes>;
8039def err_typecheck_convert_incompatible_function_pointer : Error<
8040  "incompatible function pointer types "
8041  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8042  "|%diff{passing $ to parameter of type $|"
8043  "passing to parameter of different type}0,1"
8044  "|%diff{returning $ from a function with result type $|"
8045  "returning from function with different return type}0,1"
8046  "|%diff{converting $ to type $|converting between types}0,1"
8047  "|%diff{initializing $ with an expression of type $|"
8048  "initializing with expression of different type}0,1"
8049  "|%diff{sending $ to parameter of type $|"
8050  "sending to parameter of different type}0,1"
8051  "|%diff{casting $ to type $|casting between types}0,1}2"
8052  "%select{|; dereference with *|"
8053  "; take the address with &|"
8054  "; remove *|"
8055  "; remove &}3">;
8056def ext_typecheck_convert_discards_qualifiers : ExtWarn<
8057  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8058  "|%diff{passing $ to parameter of type $|"
8059  "passing to parameter of different type}0,1"
8060  "|%diff{returning $ from a function with result type $|"
8061  "returning from function with different return type}0,1"
8062  "|%diff{converting $ to type $|converting between types}0,1"
8063  "|%diff{initializing $ with an expression of type $|"
8064  "initializing with expression of different type}0,1"
8065  "|%diff{sending $ to parameter of type $|"
8066  "sending to parameter of different type}0,1"
8067  "|%diff{casting $ to type $|casting between types}0,1}2"
8068  " discards qualifiers">,
8069  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8070def err_typecheck_convert_discards_qualifiers : Error<
8071  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8072  "|%diff{passing $ to parameter of type $|"
8073  "passing to parameter of different type}0,1"
8074  "|%diff{returning $ from a function with result type $|"
8075  "returning from function with different return type}0,1"
8076  "|%diff{converting $ to type $|converting between types}0,1"
8077  "|%diff{initializing $ with an expression of type $|"
8078  "initializing with expression of different type}0,1"
8079  "|%diff{sending $ to parameter of type $|"
8080  "sending to parameter of different type}0,1"
8081  "|%diff{casting $ to type $|casting between types}0,1}2"
8082  " discards qualifiers">;
8083def ext_nested_pointer_qualifier_mismatch : ExtWarn<
8084  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8085  "|%diff{passing $ to parameter of type $|"
8086  "passing to parameter of different type}0,1"
8087  "|%diff{returning $ from a function with result type $|"
8088  "returning from function with different return type}0,1"
8089  "|%diff{converting $ to type $|converting between types}0,1"
8090  "|%diff{initializing $ with an expression of type $|"
8091  "initializing with expression of different type}0,1"
8092  "|%diff{sending $ to parameter of type $|"
8093  "sending to parameter of different type}0,1"
8094  "|%diff{casting $ to type $|casting between types}0,1}2"
8095  " discards qualifiers in nested pointer types">,
8096  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
8097def err_nested_pointer_qualifier_mismatch : Error<
8098  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8099  "|%diff{passing $ to parameter of type $|"
8100  "passing to parameter of different type}0,1"
8101  "|%diff{returning $ from a function with result type $|"
8102  "returning from function with different return type}0,1"
8103  "|%diff{converting $ to type $|converting between types}0,1"
8104  "|%diff{initializing $ with an expression of type $|"
8105  "initializing with expression of different type}0,1"
8106  "|%diff{sending $ to parameter of type $|"
8107  "sending to parameter of different type}0,1"
8108  "|%diff{casting $ to type $|casting between types}0,1}2"
8109  " discards qualifiers in nested pointer types">;
8110def warn_incompatible_vectors : Warning<
8111  "incompatible vector types "
8112  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8113  "|%diff{passing $ to parameter of type $|"
8114  "passing to parameter of different type}0,1"
8115  "|%diff{returning $ from a function with result type $|"
8116  "returning from function with different return type}0,1"
8117  "|%diff{converting $ to type $|converting between types}0,1"
8118  "|%diff{initializing $ with an expression of type $|"
8119  "initializing with expression of different type}0,1"
8120  "|%diff{sending $ to parameter of type $|"
8121  "sending to parameter of different type}0,1"
8122  "|%diff{casting $ to type $|casting between types}0,1}2">,
8123  InGroup<VectorConversion>, DefaultIgnore;
8124def err_incompatible_vectors : Error<
8125  "incompatible vector types "
8126  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8127  "|%diff{passing $ to parameter of type $|"
8128  "passing to parameter of different type}0,1"
8129  "|%diff{returning $ from a function with result type $|"
8130  "returning from function with different return type}0,1"
8131  "|%diff{converting $ to type $|converting between types}0,1"
8132  "|%diff{initializing $ with an expression of type $|"
8133  "initializing with expression of different type}0,1"
8134  "|%diff{sending $ to parameter of type $|"
8135  "sending to parameter of different type}0,1"
8136  "|%diff{casting $ to type $|casting between types}0,1}2">;
8137def err_int_to_block_pointer : Error<
8138  "invalid block pointer conversion "
8139  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
8140  "|%diff{passing $ to parameter of type $|"
8141  "passing to parameter of different type}0,1"
8142  "|%diff{returning $ from a function with result type $|"
8143  "returning from function with different return type}0,1"
8144  "|%diff{converting $ to type $|converting between types}0,1"
8145  "|%diff{initializing $ with an expression of type $|"
8146  "initializing with expression of different type}0,1"
8147  "|%diff{sending $ to parameter of type $|"
8148  "sending to parameter of different type}0,1"
8149  "|%diff{casting $ to type $|casting between types}0,1}2">;
8150def err_typecheck_convert_incompatible_block_pointer : Error<
8151  "incompatible block pointer 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_typecheck_incompatible_address_space : Error<
8164  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8165  "|%diff{passing $ to parameter of type $|"
8166  "passing to parameter of different type}0,1"
8167  "|%diff{returning $ from a function with result type $|"
8168  "returning from function with different return type}0,1"
8169  "|%diff{converting $ to type $|converting between types}0,1"
8170  "|%diff{initializing $ with an expression of type $|"
8171  "initializing with expression of different type}0,1"
8172  "|%diff{sending $ to parameter of type $|"
8173  "sending to parameter of different type}0,1"
8174  "|%diff{casting $ to type $|casting between types}0,1}2"
8175  " changes address space of pointer">;
8176def err_typecheck_incompatible_nested_address_space : Error<
8177  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8178  "|%diff{passing $ to parameter of type $|"
8179  "passing to parameter of different type}0,1"
8180  "|%diff{returning $ from a function with result type $|"
8181  "returning from function with different return type}0,1"
8182  "|%diff{converting $ to type $|converting between types}0,1"
8183  "|%diff{initializing $ with an expression of type $|"
8184  "initializing with expression of different type}0,1"
8185  "|%diff{sending $ to parameter of type $|"
8186  "sending to parameter of different type}0,1"
8187  "|%diff{casting $ to type $|casting between types}0,1}2"
8188  " changes address space of nested pointer">;
8189def err_typecheck_incompatible_ownership : 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 retain/release properties of pointer">;
8202def err_typecheck_comparison_of_distinct_blocks : Error<
8203  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8204
8205def err_typecheck_array_not_modifiable_lvalue : Error<
8206  "array type %0 is not assignable">;
8207def err_typecheck_non_object_not_modifiable_lvalue : Error<
8208  "non-object type %0 is not assignable">;
8209def err_typecheck_expression_not_modifiable_lvalue : Error<
8210  "expression is not assignable">;
8211def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8212  "incomplete type %0 is not assignable">;
8213def err_typecheck_lvalue_casts_not_supported : Error<
8214  "assignment to cast is illegal, lvalue casts are not supported">;
8215
8216def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8217  "vector is not assignable (contains duplicate components)">;
8218def err_block_decl_ref_not_modifiable_lvalue : Error<
8219  "variable is not assignable (missing __block type specifier)">;
8220def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8221  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8222def err_typecheck_call_not_function : Error<
8223  "called object type %0 is not a function or function pointer">;
8224def err_call_incomplete_return : Error<
8225  "calling function with incomplete return type %0">;
8226def err_call_function_incomplete_return : Error<
8227  "calling %0 with incomplete return type %1">;
8228def err_call_incomplete_argument : Error<
8229  "argument type %0 is incomplete">;
8230def err_typecheck_call_too_few_args : Error<
8231  "too few %select{|||execution configuration }0arguments to "
8232  "%select{function|block|method|kernel function}0 call, "
8233  "expected %1, have %2">;
8234def err_typecheck_call_too_few_args_one : Error<
8235  "too few %select{|||execution configuration }0arguments to "
8236  "%select{function|block|method|kernel function}0 call, "
8237  "single argument %1 was not specified">;
8238def err_typecheck_call_too_few_args_at_least : Error<
8239  "too few %select{|||execution configuration }0arguments to "
8240  "%select{function|block|method|kernel function}0 call, "
8241  "expected at least %1, have %2">;
8242def err_typecheck_call_too_few_args_at_least_one : Error<
8243  "too few %select{|||execution configuration }0arguments to "
8244  "%select{function|block|method|kernel function}0 call, "
8245  "at least argument %1 must be specified">;
8246def err_typecheck_call_too_few_args_suggest : Error<
8247  "too few %select{|||execution configuration }0arguments to "
8248  "%select{function|block|method|kernel function}0 call, "
8249  "expected %1, have %2; did you mean %3?">;
8250def err_typecheck_call_too_few_args_at_least_suggest : Error<
8251  "too few %select{|||execution configuration }0arguments to "
8252  "%select{function|block|method|kernel function}0 call, "
8253  "expected at least %1, have %2; did you mean %3?">;
8254def err_typecheck_call_too_many_args : Error<
8255  "too many %select{|||execution configuration }0arguments to "
8256  "%select{function|block|method|kernel function}0 call, "
8257  "expected %1, have %2">;
8258def err_typecheck_call_too_many_args_one : Error<
8259  "too many %select{|||execution configuration }0arguments to "
8260  "%select{function|block|method|kernel function}0 call, "
8261  "expected single argument %1, have %2 arguments">;
8262def err_typecheck_call_too_many_args_at_most : Error<
8263  "too many %select{|||execution configuration }0arguments to "
8264  "%select{function|block|method|kernel function}0 call, "
8265  "expected at most %1, have %2">;
8266def err_typecheck_call_too_many_args_at_most_one : Error<
8267  "too many %select{|||execution configuration }0arguments to "
8268  "%select{function|block|method|kernel function}0 call, "
8269  "expected at most single argument %1, have %2 arguments">;
8270def err_typecheck_call_too_many_args_suggest : Error<
8271  "too many %select{|||execution configuration }0arguments to "
8272  "%select{function|block|method|kernel function}0 call, "
8273  "expected %1, have %2; did you mean %3?">;
8274def err_typecheck_call_too_many_args_at_most_suggest : Error<
8275  "too many %select{|||execution configuration }0arguments to "
8276  "%select{function|block|method|kernel function}0 call, "
8277  "expected at most %1, have %2; did you mean %3?">;
8278
8279def err_arc_typecheck_convert_incompatible_pointer : Error<
8280  "incompatible pointer types passing retainable parameter of type %0"
8281  "to a CF function expecting %1 type">;
8282
8283def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8284
8285def warn_call_wrong_number_of_arguments : Warning<
8286  "too %select{few|many}0 arguments in call to %1">;
8287def err_atomic_builtin_must_be_pointer : Error<
8288  "address argument to atomic builtin must be a pointer (%0 invalid)">;
8289def err_atomic_builtin_must_be_pointer_intptr : Error<
8290  "address argument to atomic builtin must be a pointer to integer or pointer"
8291  " (%0 invalid)">;
8292def err_atomic_builtin_cannot_be_const : Error<
8293  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8294def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8295  "address argument to atomic builtin must be a pointer to integer,"
8296  " floating-point or pointer (%0 invalid)">;
8297def err_atomic_builtin_pointer_size : Error<
8298  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8299  "type (%0 invalid)">;
8300def err_atomic_exclusive_builtin_pointer_size : Error<
8301  "address argument to load or store exclusive builtin must be a pointer to"
8302  " 1,2,4 or 8 byte type (%0 invalid)">;
8303def err_atomic_builtin_ext_int_size : Error<
8304  "Atomic memory operand must have a power-of-two size">;
8305def err_atomic_builtin_ext_int_prohibit : Error<
8306  "argument to atomic builtin of type '_ExtInt' is not supported">;
8307def err_atomic_op_needs_atomic : Error<
8308  "address argument to atomic operation must be a pointer to _Atomic "
8309  "type (%0 invalid)">;
8310def err_atomic_op_needs_non_const_atomic : Error<
8311  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8312  "type (%1 invalid)">;
8313def err_atomic_op_needs_non_const_pointer : Error<
8314  "address argument to atomic operation must be a pointer to non-const "
8315  "type (%0 invalid)">;
8316def err_atomic_op_needs_trivial_copy : Error<
8317  "address argument to atomic operation must be a pointer to a "
8318  "trivially-copyable type (%0 invalid)">;
8319def err_atomic_op_needs_atomic_int_ptr_or_fp : Error<
8320  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8321  "integer, pointer or supported floating point type (%1 invalid)">;
8322def err_atomic_op_needs_atomic_int_or_ptr : Error<
8323  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8324  "integer or pointer (%1 invalid)">;
8325def err_atomic_op_needs_atomic_int : Error<
8326  "address argument to atomic operation must be a pointer to "
8327  "%select{|atomic }0integer (%1 invalid)">;
8328def warn_atomic_op_has_invalid_memory_order : Warning<
8329  "memory order argument to atomic operation is invalid">,
8330  InGroup<DiagGroup<"atomic-memory-ordering">>;
8331def err_atomic_op_has_invalid_synch_scope : Error<
8332  "synchronization scope argument to atomic operation is invalid">;
8333def warn_atomic_implicit_seq_cst : Warning<
8334  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8335  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8336
8337def err_overflow_builtin_must_be_int : Error<
8338  "operand argument to overflow builtin must be an integer (%0 invalid)">;
8339def err_overflow_builtin_must_be_ptr_int : Error<
8340  "result argument to overflow builtin must be a pointer "
8341  "to a non-const integer (%0 invalid)">;
8342def err_overflow_builtin_ext_int_max_size : Error<
8343  "__builtin_mul_overflow does not support signed _ExtInt operands of more "
8344  "than %0 bits">;
8345
8346def err_atomic_load_store_uses_lib : Error<
8347  "atomic %select{load|store}0 requires runtime support that is not "
8348  "available for this target">;
8349
8350def err_nontemporal_builtin_must_be_pointer : Error<
8351  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8352def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8353  "address argument to nontemporal builtin must be a pointer to integer, float, "
8354  "pointer, or a vector of such types (%0 invalid)">;
8355
8356def err_deleted_function_use : Error<"attempt to use a deleted function">;
8357def err_deleted_inherited_ctor_use : Error<
8358  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8359
8360def note_called_by : Note<"called by %0">;
8361def err_kern_type_not_void_return : Error<
8362  "kernel function type %0 must have void return type">;
8363def err_kern_is_nonstatic_method : Error<
8364  "kernel function %0 must be a free function or static member function">;
8365def err_config_scalar_return : Error<
8366  "CUDA special function '%0' must have scalar return type">;
8367def err_kern_call_not_global_function : Error<
8368  "kernel call to non-global function %0">;
8369def err_global_call_not_config : Error<
8370  "call to global function %0 not configured">;
8371def err_ref_bad_target : Error<
8372  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8373  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
8374def note_cuda_const_var_unpromoted : Note<
8375  "const variable cannot be emitted on device side due to dynamic initialization">;
8376def note_cuda_host_var : Note<
8377  "host variable declared here">;
8378def err_ref_bad_target_global_initializer : Error<
8379  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8380  "function %1 in global initializer">;
8381def err_capture_bad_target : Error<
8382  "capture host variable %0 by reference in device or host device lambda function">;
8383def err_capture_bad_target_this_ptr : Error<
8384  "capture host side class data member by this pointer in device or host device lambda function">;
8385def warn_kern_is_method : Extension<
8386  "kernel function %0 is a member function; this may not be accepted by nvcc">,
8387  InGroup<CudaCompat>;
8388def warn_kern_is_inline : Warning<
8389  "ignored 'inline' attribute on kernel function %0">,
8390  InGroup<CudaCompat>;
8391def err_variadic_device_fn : Error<
8392  "CUDA device code does not support variadic functions">;
8393def err_va_arg_in_device : Error<
8394  "CUDA device code does not support va_arg">;
8395def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
8396def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
8397  "constexpr function %0 without __host__ or __device__ attributes cannot "
8398  "overload __device__ function with same signature.  Add a __host__ "
8399  "attribute, or build with -fno-cuda-host-device-constexpr.">;
8400def note_cuda_conflicting_device_function_declared_here : Note<
8401  "conflicting __device__ function declared here">;
8402def err_cuda_device_exceptions : Error<
8403  "cannot use '%0' in "
8404  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
8405def err_dynamic_var_init : Error<
8406    "dynamic initialization is not supported for "
8407    "__device__, __constant__, __shared__, and __managed__ variables.">;
8408def err_shared_var_init : Error<
8409    "initialization is not supported for __shared__ variables.">;
8410def err_cuda_vla : Error<
8411    "cannot use variable-length arrays in "
8412    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8413def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
8414def err_cuda_host_shared : Error<
8415    "__shared__ local variables not allowed in "
8416    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8417def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
8418    "__managed__ are not allowed on non-static local variables">;
8419def err_cuda_ovl_target : Error<
8420  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
8421  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
8422def note_cuda_ovl_candidate_target_mismatch : Note<
8423    "candidate template ignored: target attributes do not match">;
8424
8425def err_cuda_device_builtin_surftex_cls_template : Error<
8426    "illegal device builtin %select{surface|texture}0 reference "
8427    "class template %1 declared here">;
8428def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
8429    "%0 needs to have exactly %1 template parameters">;
8430def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
8431    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
8432    "%select{a type|an integer or enum value}2">;
8433
8434def err_cuda_device_builtin_surftex_ref_decl : Error<
8435    "illegal device builtin %select{surface|texture}0 reference "
8436    "type %1 declared here">;
8437def note_cuda_device_builtin_surftex_should_be_template_class : Note<
8438    "%0 needs to be instantiated from a class template with proper "
8439    "template arguments">;
8440
8441def err_hip_invalid_args_builtin_mangled_name : Error<
8442    "invalid argument: symbol must be a device-side function or global variable">;
8443
8444def warn_non_pod_vararg_with_format_string : Warning<
8445  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
8446  "%select{function|block|method|constructor}2; expected type from format "
8447  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
8448// The arguments to this diagnostic should match the warning above.
8449def err_cannot_pass_objc_interface_to_vararg_format : Error<
8450  "cannot pass object with interface type %1 by value to variadic "
8451  "%select{function|block|method|constructor}2; expected type from format "
8452  "string was %3">;
8453def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
8454  "cannot pass non-trivial C object of type %0 by value to variadic "
8455  "%select{function|block|method|constructor}1">;
8456
8457
8458def err_cannot_pass_objc_interface_to_vararg : Error<
8459  "cannot pass object with interface type %0 by value through variadic "
8460  "%select{function|block|method|constructor}1">;
8461def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
8462  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
8463  " %select{function|block|method|constructor}2; call will abort at runtime">,
8464  InGroup<NonPODVarargs>, DefaultError;
8465def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
8466  "passing object of trivial but non-POD type %0 through variadic"
8467  " %select{function|block|method|constructor}1 is incompatible with C++98">,
8468  InGroup<CXX98Compat>, DefaultIgnore;
8469def warn_pass_class_arg_to_vararg : Warning<
8470  "passing object of class type %0 through variadic "
8471  "%select{function|block|method|constructor}1"
8472  "%select{|; did you mean to call '%3'?}2">,
8473  InGroup<ClassVarargs>, DefaultIgnore;
8474def err_cannot_pass_to_vararg : Error<
8475  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8476  "%select{function|block|method|constructor}2">;
8477def err_cannot_pass_to_vararg_format : Error<
8478  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8479  "%select{function|block|method|constructor}2; expected type from format "
8480  "string was %3">;
8481
8482def err_typecheck_call_invalid_ordered_compare : Error<
8483  "ordered compare requires two args of floating point type"
8484  "%diff{ ($ and $)|}0,1">;
8485def err_typecheck_call_invalid_unary_fp : Error<
8486  "floating point classification requires argument of floating point type "
8487  "(passed in %0)">;
8488def err_typecheck_cond_expect_int_float : Error<
8489  "used type %0 where integer or floating point type is required">;
8490def err_typecheck_cond_expect_scalar : Error<
8491  "used type %0 where arithmetic or pointer type is required">;
8492def err_typecheck_cond_expect_nonfloat : Error<
8493  "used type %0 where floating point type is not allowed">;
8494def ext_typecheck_cond_one_void : Extension<
8495  "C99 forbids conditional expressions with only one void side">;
8496def err_typecheck_cast_to_incomplete : Error<
8497  "cast to incomplete type %0">;
8498def ext_typecheck_cast_nonscalar : Extension<
8499  "C99 forbids casting nonscalar type %0 to the same type">;
8500def ext_typecheck_cast_to_union : Extension<
8501  "cast to union type is a GNU extension">,
8502  InGroup<GNUUnionCast>;
8503def err_typecheck_cast_to_union_no_type : Error<
8504  "cast to union type from type %0 not present in union">;
8505def err_cast_pointer_from_non_pointer_int : Error<
8506  "operand of type %0 cannot be cast to a pointer type">;
8507def warn_cast_pointer_from_sel : Warning<
8508  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
8509  InGroup<SelTypeCast>;
8510def warn_function_def_in_objc_container : Warning<
8511  "function definition inside an Objective-C container is deprecated">,
8512  InGroup<FunctionDefInObjCContainer>;
8513def err_typecheck_call_requires_real_fp : Error<
8514  "argument type %0 is not a real floating point type">;
8515def err_typecheck_call_different_arg_types : Error<
8516  "arguments are of different types%diff{ ($ vs $)|}0,1">;
8517
8518def warn_cast_calling_conv : Warning<
8519  "cast between incompatible calling conventions '%0' and '%1'; "
8520  "calls through this pointer may abort at runtime">,
8521  InGroup<DiagGroup<"cast-calling-convention">>;
8522def note_change_calling_conv_fixit : Note<
8523  "consider defining %0 with the '%1' calling convention">;
8524def warn_bad_function_cast : Warning<
8525  "cast from function call of type %0 to non-matching type %1">,
8526  InGroup<BadFunctionCast>, DefaultIgnore;
8527def warn_cast_function_type : Warning<
8528  "cast %diff{from $ to $ |}0,1converts to incompatible function type">,
8529  InGroup<CastFunctionType>, DefaultIgnore;
8530def err_cast_pointer_to_non_pointer_int : Error<
8531  "pointer cannot be cast to type %0">;
8532def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">;
8533def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">;
8534def err_typecheck_expect_scalar_operand : Error<
8535  "operand of type %0 where arithmetic or pointer type is required">;
8536def err_typecheck_cond_incompatible_operands : Error<
8537  "incompatible operand types%diff{ ($ and $)|}0,1">;
8538def err_typecheck_expect_flt_or_vector : Error<
8539  "invalid operand of type %0 where floating, complex or "
8540  "a vector of such types is required">;
8541def err_cast_selector_expr : Error<
8542  "cannot type cast @selector expression">;
8543def ext_typecheck_cond_incompatible_pointers : ExtWarn<
8544  "pointer type mismatch%diff{ ($ and $)|}0,1">,
8545  InGroup<DiagGroup<"pointer-type-mismatch">>;
8546def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
8547  "pointer/integer type mismatch in conditional expression"
8548  "%diff{ ($ and $)|}0,1">,
8549  InGroup<DiagGroup<"conditional-type-mismatch">>;
8550def err_typecheck_choose_expr_requires_constant : Error<
8551  "'__builtin_choose_expr' requires a constant expression">;
8552def warn_unused_expr : Warning<"expression result unused">,
8553  InGroup<UnusedValue>;
8554def warn_unused_voidptr : Warning<
8555  "expression result unused; should this cast be to 'void'?">,
8556  InGroup<UnusedValue>;
8557def warn_unused_property_expr : Warning<
8558 "property access result unused - getters should not be used for side effects">,
8559  InGroup<UnusedGetterReturnValue>;
8560def warn_unused_container_subscript_expr : Warning<
8561 "container access result unused - container access should not be used for side effects">,
8562  InGroup<UnusedValue>;
8563def warn_unused_call : Warning<
8564  "ignoring return value of function declared with %0 attribute">,
8565  InGroup<UnusedValue>;
8566def warn_unused_constructor : Warning<
8567  "ignoring temporary created by a constructor declared with %0 attribute">,
8568  InGroup<UnusedValue>;
8569def warn_unused_constructor_msg : Warning<
8570  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
8571  InGroup<UnusedValue>;
8572def warn_side_effects_unevaluated_context : Warning<
8573  "expression with side effects has no effect in an unevaluated context">,
8574  InGroup<UnevaluatedExpression>;
8575def warn_side_effects_typeid : Warning<
8576  "expression with side effects will be evaluated despite being used as an "
8577  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
8578def warn_unused_result : Warning<
8579  "ignoring return value of function declared with %0 attribute">,
8580  InGroup<UnusedResult>;
8581def warn_unused_result_msg : Warning<
8582  "ignoring return value of function declared with %0 attribute: %1">,
8583  InGroup<UnusedResult>;
8584def warn_unused_volatile : Warning<
8585  "expression result unused; assign into a variable to force a volatile load">,
8586  InGroup<DiagGroup<"unused-volatile-lvalue">>;
8587
8588def ext_cxx14_attr : Extension<
8589  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
8590def ext_cxx17_attr : Extension<
8591  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
8592def ext_cxx20_attr : Extension<
8593  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20>;
8594
8595def warn_unused_comparison : Warning<
8596  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
8597  InGroup<UnusedComparison>;
8598def note_inequality_comparison_to_or_assign : Note<
8599  "use '|=' to turn this inequality comparison into an or-assignment">;
8600
8601def err_incomplete_type_used_in_type_trait_expr : Error<
8602  "incomplete type %0 used in type trait expression">;
8603
8604// C++20 constinit and require_constant_initialization attribute
8605def warn_cxx20_compat_constinit : Warning<
8606  "'constinit' specifier is incompatible with C++ standards before C++20">,
8607  InGroup<CXX20Compat>, DefaultIgnore;
8608def err_constinit_local_variable : Error<
8609  "local variable cannot be declared 'constinit'">;
8610def err_require_constant_init_failed : Error<
8611  "variable does not have a constant initializer">;
8612def note_declared_required_constant_init_here : Note<
8613  "required by %select{'require_constant_initialization' attribute|"
8614  "'constinit' specifier}0 here">;
8615def ext_constinit_missing : ExtWarn<
8616  "'constinit' specifier missing on initializing declaration of %0">,
8617  InGroup<DiagGroup<"missing-constinit">>;
8618def note_constinit_specified_here : Note<"variable declared constinit here">;
8619def err_constinit_added_too_late : Error<
8620  "'constinit' specifier added after initialization of variable">;
8621def warn_require_const_init_added_too_late : Warning<
8622  "'require_constant_initialization' attribute added after initialization "
8623  "of variable">, InGroup<IgnoredAttributes>;
8624def note_constinit_missing_here : Note<
8625  "add the "
8626  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
8627  "to the initializing declaration here">;
8628
8629def err_dimension_expr_not_constant_integer : Error<
8630  "dimension expression does not evaluate to a constant unsigned int">;
8631
8632def err_typecheck_cond_incompatible_operands_null : Error<
8633  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
8634def ext_empty_struct_union : Extension<
8635  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
8636def ext_no_named_members_in_struct_union : Extension<
8637  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
8638def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
8639  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8640  InGroup<CXXCompat>, DefaultIgnore;
8641def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
8642  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8643  InGroup<ExternCCompat>;
8644def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
8645  "volatile qualifiers|const qualifier|volatile qualifier}2">,
8646  InGroup<CastQual>, DefaultIgnore;
8647def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
8648  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
8649def warn_redefine_extname_not_applied : Warning<
8650  "#pragma redefine_extname is applicable to external C declarations only; "
8651  "not applied to %select{function|variable}0 %1">,
8652  InGroup<Pragmas>;
8653} // End of general sema category.
8654
8655// inline asm.
8656let CategoryName = "Inline Assembly Issue" in {
8657  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
8658  def err_asm_invalid_output_constraint : Error<
8659    "invalid output constraint '%0' in asm">;
8660  def err_asm_invalid_lvalue_in_input : Error<
8661    "invalid lvalue in asm input for constraint '%0'">;
8662  def err_asm_invalid_input_constraint : Error<
8663    "invalid input constraint '%0' in asm">;
8664  def err_asm_tying_incompatible_types : Error<
8665    "unsupported inline asm: input with type "
8666    "%diff{$ matching output with type $|}0,1">;
8667  def err_asm_unexpected_constraint_alternatives : Error<
8668    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
8669  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
8670  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
8671  def err_asm_unwind_and_goto : Error<"unwind clobber can't be used with asm goto">;
8672  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
8673    "global register variables on this target">;
8674  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
8675    "match variable size">;
8676  def err_asm_bad_register_type : Error<"bad type for named register variable">;
8677  def err_asm_invalid_input_size : Error<
8678    "invalid input size for constraint '%0'">;
8679  def err_asm_invalid_output_size : Error<
8680    "invalid output size for constraint '%0'">;
8681  def err_invalid_asm_cast_lvalue : Error<
8682    "invalid use of a cast in a inline asm context requiring an lvalue: "
8683    "remove the cast or build with -fheinous-gnu-extensions">;
8684  def err_invalid_asm_value_for_constraint
8685      : Error <"value '%0' out of range for constraint '%1'">;
8686  def err_asm_non_addr_value_in_memory_constraint : Error <
8687    "reference to a %select{bit-field|vector element|global register variable}0"
8688    " in asm %select{input|output}1 with a memory constraint '%2'">;
8689  def err_asm_input_duplicate_match : Error<
8690    "more than one input constraint matches the same output '%0'">;
8691
8692  def warn_asm_label_on_auto_decl : Warning<
8693    "ignored asm label '%0' on automatic variable">;
8694  def warn_invalid_asm_cast_lvalue : Warning<
8695    "invalid use of a cast in an inline asm context requiring an lvalue: "
8696    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
8697    "for this in the future">;
8698  def warn_asm_mismatched_size_modifier : Warning<
8699    "value size does not match register size specified by the constraint "
8700    "and modifier">,
8701    InGroup<ASMOperandWidths>;
8702
8703  def note_asm_missing_constraint_modifier : Note<
8704    "use constraint modifier \"%0\"">;
8705  def note_asm_input_duplicate_first : Note<
8706    "constraint '%0' is already present here">;
8707 def error_duplicate_asm_operand_name : Error<
8708    "duplicate use of asm operand name \"%0\"">;
8709 def note_duplicate_asm_operand_name : Note<
8710    "asm operand name \"%0\" first referenced here">;
8711}
8712
8713  def error_inoutput_conflict_with_clobber : Error<
8714    "asm-specifier for input or output variable conflicts with asm"
8715    " clobber list">;
8716
8717let CategoryName = "Semantic Issue" in {
8718
8719def err_invalid_conversion_between_matrixes : Error<
8720  "conversion between matrix types%diff{ $ and $|}0,1 of different size is not allowed">;
8721
8722def err_invalid_conversion_between_matrix_and_type : Error<
8723  "conversion between matrix type %0 and incompatible type %1 is not allowed">;
8724
8725def err_invalid_conversion_between_vectors : Error<
8726  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
8727  "size">;
8728def err_invalid_conversion_between_vector_and_integer : Error<
8729  "invalid conversion between vector type %0 and integer type %1 "
8730  "of different size">;
8731
8732def err_opencl_function_pointer : Error<
8733  "%select{pointers|references}0 to functions are not allowed">;
8734
8735def err_opencl_taking_address_capture : Error<
8736  "taking address of a capture is not allowed">;
8737
8738def err_invalid_conversion_between_vector_and_scalar : Error<
8739  "invalid conversion between vector type %0 and scalar type %1">;
8740
8741// C++ member initializers.
8742def err_only_constructors_take_base_inits : Error<
8743  "only constructors take base initializers">;
8744
8745def err_multiple_mem_initialization : Error <
8746  "multiple initializations given for non-static member %0">;
8747def err_multiple_mem_union_initialization : Error <
8748  "initializing multiple members of union">;
8749def err_multiple_base_initialization : Error <
8750  "multiple initializations given for base %0">;
8751
8752def err_mem_init_not_member_or_class : Error<
8753  "member initializer %0 does not name a non-static data member or base "
8754  "class">;
8755
8756def warn_initializer_out_of_order : Warning<
8757  "%select{field|base class}0 %1 will be initialized after "
8758  "%select{field|base}2 %3">,
8759  InGroup<ReorderCtor>, DefaultIgnore;
8760
8761def warn_some_initializers_out_of_order : Warning<
8762  "initializer order does not match the declaration order">,
8763  InGroup<ReorderCtor>, DefaultIgnore;
8764
8765def note_initializer_out_of_order : Note<
8766  "%select{field|base class}0 %1 will be initialized after "
8767  "%select{field|base}2 %3">;
8768
8769def warn_abstract_vbase_init_ignored : Warning<
8770  "initializer for virtual base class %0 of abstract class %1 "
8771  "will never be used">,
8772  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
8773
8774def err_base_init_does_not_name_class : Error<
8775  "constructor initializer %0 does not name a class">;
8776def err_base_init_direct_and_virtual : Error<
8777  "base class initializer %0 names both a direct base class and an "
8778  "inherited virtual base class">;
8779def err_not_direct_base_or_virtual : Error<
8780  "type %0 is not a direct or virtual base of %1">;
8781
8782def err_in_class_initializer_non_const : Error<
8783  "non-const static data member must be initialized out of line">;
8784def err_in_class_initializer_volatile : Error<
8785  "static const volatile data member must be initialized out of line">;
8786def err_in_class_initializer_bad_type : Error<
8787  "static data member of type %0 must be initialized out of line">;
8788def ext_in_class_initializer_float_type : ExtWarn<
8789  "in-class initializer for static data member of type %0 is a GNU extension">,
8790  InGroup<GNUStaticFloatInit>;
8791def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
8792  "in-class initializer for static data member of type %0 requires "
8793  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
8794def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
8795def err_in_class_initializer_literal_type : Error<
8796  "in-class initializer for static data member of type %0 requires "
8797  "'constexpr' specifier">;
8798def err_in_class_initializer_non_constant : Error<
8799  "in-class initializer for static data member is not a constant expression">;
8800def err_default_member_initializer_not_yet_parsed : Error<
8801  "default member initializer for %1 needed within definition of enclosing "
8802  "class %0 outside of member functions">;
8803def note_default_member_initializer_not_yet_parsed : Note<
8804  "default member initializer declared here">;
8805def err_default_member_initializer_cycle
8806    : Error<"default member initializer for %0 uses itself">;
8807
8808def ext_in_class_initializer_non_constant : Extension<
8809  "in-class initializer for static data member is not a constant expression; "
8810  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
8811
8812def err_thread_dynamic_init : Error<
8813  "initializer for thread-local variable must be a constant expression">;
8814def err_thread_nontrivial_dtor : Error<
8815  "type of thread-local variable has non-trivial destruction">;
8816def note_use_thread_local : Note<
8817  "use 'thread_local' to allow this">;
8818
8819// C++ anonymous unions and GNU anonymous structs/unions
8820def ext_anonymous_union : Extension<
8821  "anonymous unions are a C11 extension">, InGroup<C11>;
8822def ext_gnu_anonymous_struct : Extension<
8823  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
8824def ext_c11_anonymous_struct : Extension<
8825  "anonymous structs are a C11 extension">, InGroup<C11>;
8826def err_anonymous_union_not_static : Error<
8827  "anonymous unions at namespace or global scope must be declared 'static'">;
8828def err_anonymous_union_with_storage_spec : Error<
8829  "anonymous union at class scope must not have a storage specifier">;
8830def err_anonymous_struct_not_member : Error<
8831  "anonymous %select{structs|structs and classes}0 must be "
8832  "%select{struct or union|class}0 members">;
8833def err_anonymous_record_member_redecl : Error<
8834  "member of anonymous %select{struct|union}0 redeclares %1">;
8835def err_anonymous_record_with_type : Error<
8836  "types cannot be declared in an anonymous %select{struct|union}0">;
8837def ext_anonymous_record_with_type : Extension<
8838  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
8839  "extension">, InGroup<MicrosoftAnonTag>;
8840def ext_anonymous_record_with_anonymous_type : Extension<
8841  "anonymous types declared in an anonymous %select{struct|union}0 "
8842  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
8843def err_anonymous_record_with_function : Error<
8844  "functions cannot be declared in an anonymous %select{struct|union}0">;
8845def err_anonymous_record_with_static : Error<
8846  "static members cannot be declared in an anonymous %select{struct|union}0">;
8847def err_anonymous_record_bad_member : Error<
8848  "anonymous %select{struct|union}0 can only contain non-static data members">;
8849def err_anonymous_record_nonpublic_member : Error<
8850  "anonymous %select{struct|union}0 cannot contain a "
8851  "%select{private|protected}1 data member">;
8852def ext_ms_anonymous_record : ExtWarn<
8853  "anonymous %select{structs|unions}0 are a Microsoft extension">,
8854  InGroup<MicrosoftAnonTag>;
8855
8856// C++ local classes
8857def err_reference_to_local_in_enclosing_context : Error<
8858  "reference to local %select{variable|binding}1 %0 declared in enclosing "
8859  "%select{%3|block literal|lambda expression|context}2">;
8860
8861def err_static_data_member_not_allowed_in_local_class : Error<
8862  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
8863
8864// C++ derived classes
8865def err_base_clause_on_union : Error<"unions cannot have base classes">;
8866def err_base_must_be_class : Error<"base specifier must name a class">;
8867def err_union_as_base_class : Error<"unions cannot be base classes">;
8868def err_circular_inheritance : Error<
8869  "circular inheritance between %0 and %1">;
8870def err_base_class_has_flexible_array_member : Error<
8871  "base class %0 has a flexible array member">;
8872def err_incomplete_base_class : Error<"base class has incomplete type">;
8873def err_duplicate_base_class : Error<
8874  "base class %0 specified more than once as a direct base class">;
8875def warn_inaccessible_base_class : Warning<
8876  "direct base %0 is inaccessible due to ambiguity:%1">,
8877  InGroup<DiagGroup<"inaccessible-base">>;
8878// FIXME: better way to display derivation?  Pass entire thing into diagclient?
8879def err_ambiguous_derived_to_base_conv : Error<
8880  "ambiguous conversion from derived class %0 to base class %1:%2">;
8881def err_ambiguous_memptr_conv : Error<
8882  "ambiguous conversion from pointer to member of %select{base|derived}0 "
8883  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
8884def ext_ms_ambiguous_direct_base : ExtWarn<
8885  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
8886  InGroup<MicrosoftInaccessibleBase>;
8887
8888def err_memptr_conv_via_virtual : Error<
8889  "conversion from pointer to member of class %0 to pointer to member "
8890  "of class %1 via virtual base %2 is not allowed">;
8891
8892// C++ member name lookup
8893def err_ambiguous_member_multiple_subobjects : Error<
8894  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
8895def err_ambiguous_member_multiple_subobject_types : Error<
8896  "member %0 found in multiple base classes of different types">;
8897def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
8898def note_ambiguous_member_type_found : Note<
8899  "member type %0 found by ambiguous name lookup">;
8900def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
8901def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
8902def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
8903  "declaration in a different namespace">;
8904def note_hidden_tag : Note<"type declaration hidden">;
8905def note_hiding_object : Note<"declaration hides type">;
8906
8907// C++ operator overloading
8908def err_operator_overload_needs_class_or_enum : Error<
8909  "overloaded %0 must have at least one parameter of class "
8910  "or enumeration type">;
8911
8912def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
8913def err_operator_overload_static : Error<
8914  "overloaded %0 cannot be a static member function">;
8915def err_operator_overload_default_arg : Error<
8916  "parameter of overloaded %0 cannot have a default argument">;
8917def err_operator_overload_must_be : Error<
8918  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
8919  "(has %1 parameter%s1)">;
8920
8921def err_operator_overload_must_be_member : Error<
8922  "overloaded %0 must be a non-static member function">;
8923def err_operator_overload_post_incdec_must_be_int : Error<
8924  "parameter of overloaded post-%select{increment|decrement}1 operator must "
8925  "have type 'int' (not %0)">;
8926
8927// C++ allocation and deallocation functions.
8928def err_operator_new_delete_declared_in_namespace : Error<
8929  "%0 cannot be declared inside a namespace">;
8930def err_operator_new_delete_declared_static : Error<
8931  "%0 cannot be declared static in global scope">;
8932def ext_operator_new_delete_declared_inline : ExtWarn<
8933  "replacement function %0 cannot be declared 'inline'">,
8934  InGroup<DiagGroup<"inline-new-delete">>;
8935def err_operator_new_delete_invalid_result_type : Error<
8936  "%0 must return type %1">;
8937def err_operator_new_delete_dependent_result_type : Error<
8938  "%0 cannot have a dependent return type; use %1 instead">;
8939def err_operator_new_delete_too_few_parameters : Error<
8940  "%0 must have at least one parameter">;
8941def err_operator_new_delete_template_too_few_parameters : Error<
8942  "%0 template must have at least two parameters">;
8943def warn_operator_new_returns_null : Warning<
8944  "%0 should not return a null pointer unless it is declared 'throw()'"
8945  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
8946
8947def err_operator_new_dependent_param_type : Error<
8948  "%0 cannot take a dependent type as first parameter; "
8949  "use size_t (%1) instead">;
8950def err_operator_new_param_type : Error<
8951  "%0 takes type size_t (%1) as first parameter">;
8952def err_operator_new_default_arg: Error<
8953  "parameter of %0 cannot have a default argument">;
8954def err_operator_delete_dependent_param_type : Error<
8955  "%0 cannot take a dependent type as first parameter; use %1 instead">;
8956def err_operator_delete_param_type : Error<
8957  "first parameter of %0 must have type %1">;
8958def err_destroying_operator_delete_not_usual : Error<
8959  "destroying operator delete can have only an optional size and optional "
8960  "alignment parameter">;
8961def note_implicit_delete_this_in_destructor_here : Note<
8962  "while checking implicit 'delete this' for virtual destructor">;
8963def err_builtin_operator_new_delete_not_usual : Error<
8964  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
8965  "selects non-usual %select{allocation|deallocation}0 function">;
8966def note_non_usual_function_declared_here : Note<
8967  "non-usual %0 declared here">;
8968
8969// C++ literal operators
8970def err_literal_operator_outside_namespace : Error<
8971  "literal operator %0 must be in a namespace or global scope">;
8972def err_literal_operator_id_outside_namespace : Error<
8973  "non-namespace scope '%0' cannot have a literal operator member">;
8974def err_literal_operator_default_argument : Error<
8975  "literal operator cannot have a default argument">;
8976def err_literal_operator_bad_param_count : Error<
8977  "non-template literal operator must have one or two parameters">;
8978def err_literal_operator_invalid_param : Error<
8979  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
8980def err_literal_operator_param : Error<
8981  "invalid literal operator parameter type %0, did you mean %1?">;
8982def err_literal_operator_template_with_params : Error<
8983  "literal operator template cannot have any parameters">;
8984def err_literal_operator_template : Error<
8985  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
8986def err_literal_operator_extern_c : Error<
8987  "literal operator must have C++ linkage">;
8988def ext_string_literal_operator_template : ExtWarn<
8989  "string literal operator templates are a GNU extension">,
8990  InGroup<GNUStringLiteralOperatorTemplate>;
8991def warn_user_literal_reserved : Warning<
8992  "user-defined literal suffixes not starting with '_' are reserved"
8993  "%select{; no literal will invoke this operator|}0">,
8994  InGroup<UserDefinedLiterals>;
8995
8996// C++ conversion functions
8997def err_conv_function_not_member : Error<
8998  "conversion function must be a non-static member function">;
8999def err_conv_function_return_type : Error<
9000  "conversion function cannot have a return type">;
9001def err_conv_function_with_params : Error<
9002  "conversion function cannot have any parameters">;
9003def err_conv_function_variadic : Error<
9004  "conversion function cannot be variadic">;
9005def err_conv_function_to_array : Error<
9006  "conversion function cannot convert to an array type">;
9007def err_conv_function_to_function : Error<
9008  "conversion function cannot convert to a function type">;
9009def err_conv_function_with_complex_decl : Error<
9010  "cannot specify any part of a return type in the "
9011  "declaration of a conversion function"
9012  "%select{"
9013  "; put the complete type after 'operator'|"
9014  "; use a typedef to declare a conversion to %1|"
9015  "; use an alias template to declare a conversion to %1|"
9016  "}0">;
9017def err_conv_function_redeclared : Error<
9018  "conversion function cannot be redeclared">;
9019def warn_conv_to_self_not_used : Warning<
9020  "conversion function converting %0 to itself will never be used">,
9021  InGroup<ClassConversion>;
9022def warn_conv_to_base_not_used : Warning<
9023  "conversion function converting %0 to its base class %1 will never be used">,
9024  InGroup<ClassConversion>;
9025def warn_conv_to_void_not_used : Warning<
9026  "conversion function converting %0 to %1 will never be used">,
9027  InGroup<ClassConversion>;
9028
9029def warn_not_compound_assign : Warning<
9030  "use of unary operator that may be intended as compound assignment (%0=)">;
9031
9032// C++11 explicit conversion operators
9033def ext_explicit_conversion_functions : ExtWarn<
9034  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
9035def warn_cxx98_compat_explicit_conversion_functions : Warning<
9036  "explicit conversion functions are incompatible with C++98">,
9037  InGroup<CXX98Compat>, DefaultIgnore;
9038
9039// C++11 defaulted functions
9040def err_defaulted_special_member_params : Error<
9041  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9042  "have default arguments">;
9043def err_defaulted_special_member_variadic : Error<
9044  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
9045  "be variadic">;
9046def err_defaulted_special_member_return_type : Error<
9047  "explicitly-defaulted %select{copy|move}0 assignment operator must "
9048  "return %1">;
9049def err_defaulted_special_member_quals : Error<
9050  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
9051  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
9052def err_defaulted_special_member_volatile_param : Error<
9053  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
9054  "may not be volatile">;
9055def err_defaulted_special_member_move_const_param : Error<
9056  "the parameter for an explicitly-defaulted move "
9057  "%select{constructor|assignment operator}0 may not be const">;
9058def err_defaulted_special_member_copy_const_param : Error<
9059  "the parameter for this explicitly-defaulted copy "
9060  "%select{constructor|assignment operator}0 is const, but a member or base "
9061  "requires it to be non-const">;
9062def err_defaulted_copy_assign_not_ref : Error<
9063  "the parameter for an explicitly-defaulted copy assignment operator must be an "
9064  "lvalue reference type">;
9065def err_incorrect_defaulted_constexpr : Error<
9066  "defaulted definition of %sub{select_special_member_kind}0 "
9067  "is not constexpr">;
9068def err_incorrect_defaulted_consteval : Error<
9069  "defaulted declaration of %sub{select_special_member_kind}0 "
9070  "cannot be consteval because implicit definition is not constexpr">;
9071def warn_defaulted_method_deleted : Warning<
9072  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
9073  "deleted">, InGroup<DefaultedFunctionDeleted>;
9074def err_out_of_line_default_deletes : Error<
9075  "defaulting this %sub{select_special_member_kind}0 "
9076  "would delete it after its first declaration">;
9077def note_deleted_type_mismatch : Note<
9078  "function is implicitly deleted because its declared type does not match "
9079  "the type of an implicit %sub{select_special_member_kind}0">;
9080def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
9081  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
9082  "different from the implicit type is incompatible with C++ standards before "
9083  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9084def warn_vbase_moved_multiple_times : Warning<
9085  "defaulted move assignment operator of %0 will move assign virtual base "
9086  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
9087def note_vbase_moved_here : Note<
9088  "%select{%1 is a virtual base class of base class %2 declared here|"
9089  "virtual base class %1 declared here}0">;
9090
9091// C++20 defaulted comparisons
9092// This corresponds to values of Sema::DefaultedComparisonKind.
9093def select_defaulted_comparison_kind : TextSubstitution<
9094  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
9095  "operator">;
9096def ext_defaulted_comparison : ExtWarn<
9097  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
9098def warn_cxx17_compat_defaulted_comparison : Warning<
9099  "defaulted comparison operators are incompatible with C++ standards "
9100  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
9101def err_defaulted_comparison_template : Error<
9102  "comparison operator template cannot be defaulted">;
9103def err_defaulted_comparison_out_of_class : Error<
9104  "%sub{select_defaulted_comparison_kind}0 can only be defaulted in a class "
9105  "definition">;
9106def err_defaulted_comparison_param : Error<
9107  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
9108  "; found %1, expected %2%select{| or %4}3">;
9109def err_defaulted_comparison_param_mismatch : Error<
9110  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
9111  "must have the same type%diff{ (found $ vs $)|}1,2">;
9112def err_defaulted_comparison_non_const : Error<
9113  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
9114  "const-qualified">;
9115def err_defaulted_comparison_return_type_not_bool : Error<
9116  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9117  "must be 'bool', not %1">;
9118def err_defaulted_comparison_deduced_return_type_not_auto : Error<
9119  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
9120  "must be 'auto', not %1">;
9121def warn_defaulted_comparison_deleted : Warning<
9122  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
9123  "deleted">, InGroup<DefaultedFunctionDeleted>;
9124def err_non_first_default_compare_deletes : Error<
9125  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
9126  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
9127  "would delete it after its first declaration">;
9128def note_defaulted_comparison_union : Note<
9129  "defaulted %0 is implicitly deleted because "
9130  "%2 is a %select{union-like class|union}1 with variant members">;
9131def note_defaulted_comparison_reference_member : Note<
9132  "defaulted %0 is implicitly deleted because "
9133  "class %1 has a reference member">;
9134def note_defaulted_comparison_ambiguous : Note<
9135  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
9136  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
9137def note_defaulted_comparison_inaccessible : Note<
9138  "defaulted %0 is implicitly deleted because it would invoke a "
9139  "%select{private|protected}3 %4%select{ member of %6|"
9140  " member of %6 to compare member %2| to compare base class %2}1">;
9141def note_defaulted_comparison_calls_deleted : Note<
9142  "defaulted %0 is implicitly deleted because it would invoke a deleted "
9143  "comparison function%select{| for member %2| for base class %2}1">;
9144def note_defaulted_comparison_no_viable_function : Note<
9145  "defaulted %0 is implicitly deleted because there is no viable three-way "
9146  "comparison function for%select{| member| base class}1 %2">;
9147def note_defaulted_comparison_no_viable_function_synthesized : Note<
9148  "three-way comparison cannot be synthesized because there is no viable "
9149  "function for %select{'=='|'<'}0 comparison">;
9150def note_defaulted_comparison_not_rewritten_callee : Note<
9151  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
9152  "function would be the best match for the comparison">;
9153def note_defaulted_comparison_cannot_deduce : Note<
9154  "return type of defaulted 'operator<=>' cannot be deduced because "
9155  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
9156  "is not a standard comparison category type">;
9157def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
9158  "return type of defaulted 'operator<=>' cannot be deduced because "
9159  "three-way comparison for %select{|member|base class}0 %1 "
9160  "has a deduced return type and is not yet defined">;
9161def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
9162  "%select{|member|base class}0 %1 declared here">;
9163def note_defaulted_comparison_cannot_deduce_callee : Note<
9164  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
9165def err_incorrect_defaulted_comparison_constexpr : Error<
9166  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
9167  "three-way comparison operator}0 "
9168  "cannot be declared %select{constexpr|consteval}2 because "
9169  "%select{it|the corresponding implicit 'operator=='}0 "
9170  "invokes a non-constexpr comparison function">;
9171def note_defaulted_comparison_not_constexpr : Note<
9172  "non-constexpr comparison function would be used to compare "
9173  "%select{|member %1|base class %1}0">;
9174def note_defaulted_comparison_not_constexpr_here : Note<
9175  "non-constexpr comparison function declared here">;
9176def note_in_declaration_of_implicit_equality_comparison : Note<
9177  "while declaring the corresponding implicit 'operator==' "
9178  "for this defaulted 'operator<=>'">;
9179
9180def ext_implicit_exception_spec_mismatch : ExtWarn<
9181  "function previously declared with an %select{explicit|implicit}0 exception "
9182  "specification redeclared with an %select{implicit|explicit}0 exception "
9183  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
9184
9185def warn_ptr_arith_precedes_bounds : Warning<
9186  "the pointer decremented by %0 refers before the beginning of the array">,
9187  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9188def warn_ptr_arith_exceeds_bounds : Warning<
9189  "the pointer incremented by %0 refers past the end of the array (that "
9190  "contains %1 element%s2)">,
9191  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9192def warn_array_index_precedes_bounds : Warning<
9193  "array index %0 is before the beginning of the array">,
9194  InGroup<ArrayBounds>;
9195def warn_array_index_exceeds_bounds : Warning<
9196  "array index %0 is past the end of the array (which contains %1 "
9197  "element%s2)">, InGroup<ArrayBounds>;
9198def warn_ptr_arith_exceeds_max_addressable_bounds : Warning<
9199  "the pointer incremented by %0 refers past the last possible element for an array in %1-bit "
9200  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9201  InGroup<ArrayBounds>;
9202def warn_array_index_exceeds_max_addressable_bounds : Warning<
9203  "array index %0 refers past the last possible element for an array in %1-bit "
9204  "address space containing %2-bit (%3-byte) elements (max possible %4 element%s5)">,
9205  InGroup<ArrayBounds>;
9206def note_array_declared_here : Note<
9207  "array %0 declared here">;
9208
9209def warn_printf_insufficient_data_args : Warning<
9210  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9211def warn_printf_data_arg_not_used : Warning<
9212  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9213def warn_format_invalid_conversion : Warning<
9214  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9215def warn_printf_incomplete_specifier : Warning<
9216  "incomplete format specifier">, InGroup<Format>;
9217def warn_missing_format_string : Warning<
9218  "format string missing">, InGroup<Format>;
9219def warn_scanf_nonzero_width : Warning<
9220  "zero field width in scanf format string is unused">,
9221  InGroup<Format>;
9222def warn_format_conversion_argument_type_mismatch : Warning<
9223  "format specifies type %0 but the argument has "
9224  "%select{type|underlying type}2 %1">,
9225  InGroup<Format>;
9226def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9227  warn_format_conversion_argument_type_mismatch.Text>,
9228  InGroup<FormatPedantic>;
9229def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9230  warn_format_conversion_argument_type_mismatch.Text>,
9231  InGroup<FormatTypeConfusion>, DefaultIgnore;
9232def warn_format_argument_needs_cast : Warning<
9233  "%select{values of type|enum values with underlying type}2 '%0' should not "
9234  "be used as format arguments; add an explicit cast to %1 instead">,
9235  InGroup<Format>;
9236def warn_format_argument_needs_cast_pedantic : Warning<
9237  warn_format_argument_needs_cast.Text>,
9238  InGroup<FormatPedantic>, DefaultIgnore;
9239def warn_printf_positional_arg_exceeds_data_args : Warning <
9240  "data argument position '%0' exceeds the number of data arguments (%1)">,
9241  InGroup<Format>;
9242def warn_format_zero_positional_specifier : Warning<
9243  "position arguments in format strings start counting at 1 (not 0)">,
9244  InGroup<Format>;
9245def warn_format_invalid_positional_specifier : Warning<
9246  "invalid position specified for %select{field width|field precision}0">,
9247  InGroup<Format>;
9248def warn_format_mix_positional_nonpositional_args : Warning<
9249  "cannot mix positional and non-positional arguments in format string">,
9250  InGroup<Format>;
9251def warn_static_array_too_small : Warning<
9252  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9253  " callee requires at least %1">,
9254  InGroup<ArrayBounds>;
9255def note_callee_static_array : Note<
9256  "callee declares array parameter as static here">;
9257def warn_empty_format_string : Warning<
9258  "format string is empty">, InGroup<FormatZeroLength>;
9259def warn_format_string_is_wide_literal : Warning<
9260  "format string should not be a wide string">, InGroup<Format>;
9261def warn_printf_format_string_contains_null_char : Warning<
9262  "format string contains '\\0' within the string body">, InGroup<Format>;
9263def warn_printf_format_string_not_null_terminated : Warning<
9264  "format string is not null-terminated">, InGroup<Format>;
9265def warn_printf_asterisk_missing_arg : Warning<
9266  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9267  InGroup<Format>;
9268def warn_printf_asterisk_wrong_type : Warning<
9269  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9270  InGroup<Format>;
9271def warn_printf_nonsensical_optional_amount: Warning<
9272  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9273  InGroup<Format>;
9274def warn_printf_nonsensical_flag: Warning<
9275  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9276  InGroup<Format>;
9277def warn_format_nonsensical_length: Warning<
9278  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9279  InGroup<Format>;
9280def warn_format_non_standard_positional_arg: Warning<
9281  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9282def warn_format_non_standard: Warning<
9283  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
9284  InGroup<FormatNonStandard>, DefaultIgnore;
9285def warn_format_non_standard_conversion_spec: Warning<
9286  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
9287  InGroup<FormatNonStandard>, DefaultIgnore;
9288def err_invalid_mask_type_size : Error<
9289  "mask type size must be between 1-byte and 8-bytes">;
9290def warn_format_invalid_annotation : Warning<
9291  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
9292  InGroup<Format>;
9293def warn_format_P_no_precision : Warning<
9294  "using '%%P' format specifier without precision">,
9295  InGroup<Format>;
9296def warn_printf_ignored_flag: Warning<
9297  "flag '%0' is ignored when flag '%1' is present">,
9298  InGroup<Format>;
9299def warn_printf_empty_objc_flag: Warning<
9300  "missing object format flag">,
9301  InGroup<Format>;
9302def warn_printf_ObjCflags_without_ObjCConversion: Warning<
9303  "object format flags cannot be used with '%0' conversion specifier">,
9304  InGroup<Format>;
9305def warn_printf_invalid_objc_flag: Warning<
9306    "'%0' is not a valid object format flag">,
9307    InGroup<Format>;
9308def warn_scanf_scanlist_incomplete : Warning<
9309  "no closing ']' for '%%[' in scanf format string">,
9310  InGroup<Format>;
9311def warn_format_bool_as_character : Warning<
9312  "using '%0' format specifier, but argument has boolean value">,
9313  InGroup<Format>;
9314def note_format_string_defined : Note<"format string is defined here">;
9315def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
9316def note_printf_c_str: Note<"did you mean to call the %0 method?">;
9317def note_format_security_fixit: Note<
9318  "treat the string as an argument to avoid this">;
9319
9320def warn_null_arg : Warning<
9321  "null passed to a callee that requires a non-null argument">,
9322  InGroup<NonNull>;
9323def warn_null_ret : Warning<
9324  "null returned from %select{function|method}0 that requires a non-null return value">,
9325  InGroup<NonNull>;
9326
9327def err_lifetimebound_no_object_param : Error<
9328  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
9329  "function has no implicit object parameter">;
9330def err_lifetimebound_ctor_dtor : Error<
9331  "'lifetimebound' attribute cannot be applied to a "
9332  "%select{constructor|destructor}0">;
9333
9334// CHECK: returning address/reference of stack memory
9335def warn_ret_stack_addr_ref : Warning<
9336  "%select{address of|reference to}0 stack memory associated with "
9337  "%select{local variable|parameter}2 %1 returned">,
9338  InGroup<ReturnStackAddress>;
9339def warn_ret_local_temp_addr_ref : Warning<
9340  "returning %select{address of|reference to}0 local temporary object">,
9341  InGroup<ReturnStackAddress>;
9342def warn_ret_addr_label : Warning<
9343  "returning address of label, which is local">,
9344  InGroup<ReturnStackAddress>;
9345def err_ret_local_block : Error<
9346  "returning block that lives on the local stack">;
9347def note_local_var_initializer : Note<
9348  "%select{via initialization of|binding reference}0 variable "
9349  "%select{%2 |}1here">;
9350def note_lambda_capture_initializer : Note<
9351  "%select{implicitly |}2captured%select{| by reference}3"
9352  "%select{%select{ due to use|}2 here|"
9353  " via initialization of lambda capture %0}1">;
9354def note_init_with_default_member_initalizer : Note<
9355  "initializing field %0 with default member initializer">;
9356
9357// Check for initializing a member variable with the address or a reference to
9358// a constructor parameter.
9359def warn_bind_ref_member_to_parameter : Warning<
9360  "binding reference member %0 to stack allocated "
9361  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9362def warn_init_ptr_member_to_parameter_addr : Warning<
9363  "initializing pointer member %0 with the stack address of "
9364  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9365def note_ref_or_ptr_member_declared_here : Note<
9366  "%select{reference|pointer}0 member declared here">;
9367
9368def err_dangling_member : Error<
9369  "%select{reference|backing array for 'std::initializer_list'}2 "
9370  "%select{|subobject of }1member %0 "
9371  "%select{binds to|is}2 a temporary object "
9372  "whose lifetime would be shorter than the lifetime of "
9373  "the constructed object">;
9374def warn_dangling_member : Warning<
9375  "%select{reference|backing array for 'std::initializer_list'}2 "
9376  "%select{|subobject of }1member %0 "
9377  "%select{binds to|is}2 a temporary object "
9378  "whose lifetime is shorter than the lifetime of the constructed object">,
9379  InGroup<DanglingField>;
9380def warn_dangling_lifetime_pointer_member : Warning<
9381  "initializing pointer member %0 to point to a temporary object "
9382  "whose lifetime is shorter than the lifetime of the constructed object">,
9383  InGroup<DanglingGsl>;
9384def note_lifetime_extending_member_declared_here : Note<
9385  "%select{%select{reference|'std::initializer_list'}0 member|"
9386  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
9387  "declared here">;
9388def warn_dangling_variable : Warning<
9389  "%select{temporary %select{whose address is used as value of|"
9390  "%select{|implicitly }2bound to}4 "
9391  "%select{%select{|reference }4member of local variable|"
9392  "local %select{variable|reference}4}1|"
9393  "array backing "
9394  "%select{initializer list subobject of local variable|"
9395  "local initializer list}1}0 "
9396  "%select{%3 |}2will be destroyed at the end of the full-expression">,
9397  InGroup<Dangling>;
9398def warn_new_dangling_reference : Warning<
9399  "temporary bound to reference member of allocated object "
9400  "will be destroyed at the end of the full-expression">,
9401  InGroup<DanglingField>;
9402def warn_dangling_lifetime_pointer : Warning<
9403  "object backing the pointer "
9404  "will be destroyed at the end of the full-expression">,
9405  InGroup<DanglingGsl>;
9406def warn_new_dangling_initializer_list : Warning<
9407  "array backing "
9408  "%select{initializer list subobject of the allocated object|"
9409  "the allocated initializer list}0 "
9410  "will be destroyed at the end of the full-expression">,
9411  InGroup<DanglingInitializerList>;
9412def warn_unsupported_lifetime_extension : Warning<
9413  "sorry, lifetime extension of "
9414  "%select{temporary|backing array of initializer list}0 created "
9415  "by aggregate initialization using default member initializer "
9416  "is not supported; lifetime of %select{temporary|backing array}0 "
9417  "will end at the end of the full-expression">, InGroup<Dangling>;
9418
9419// For non-floating point, expressions of the form x == x or x != x
9420// should result in a warning, since these always evaluate to a constant.
9421// Array comparisons have similar warnings
9422def warn_comparison_always : Warning<
9423  "%select{self-|array }0comparison always evaluates to "
9424  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
9425  InGroup<TautologicalCompare>;
9426def warn_comparison_bitwise_always : Warning<
9427  "bitwise comparison always evaluates to %select{false|true}0">,
9428  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9429def warn_comparison_bitwise_or : Warning<
9430  "bitwise or with non-zero value always evaluates to true">,
9431  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9432def warn_tautological_overlap_comparison : Warning<
9433  "overlapping comparisons always evaluate to %select{false|true}0">,
9434  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
9435def warn_depr_array_comparison : Warning<
9436  "comparison between two arrays is deprecated; "
9437  "to compare array addresses, use unary '+' to decay operands to pointers">,
9438  InGroup<DeprecatedArrayCompare>;
9439
9440def warn_stringcompare : Warning<
9441  "result of comparison against %select{a string literal|@encode}0 is "
9442  "unspecified (use an explicit string comparison function instead)">,
9443  InGroup<StringCompare>;
9444
9445def warn_identity_field_assign : Warning<
9446  "assigning %select{field|instance variable}0 to itself">,
9447  InGroup<SelfAssignmentField>;
9448
9449// Type safety attributes
9450def err_type_tag_for_datatype_not_ice : Error<
9451  "'type_tag_for_datatype' attribute requires the initializer to be "
9452  "an %select{integer|integral}0 constant expression">;
9453def err_type_tag_for_datatype_too_large : Error<
9454  "'type_tag_for_datatype' attribute requires the initializer to be "
9455  "an %select{integer|integral}0 constant expression "
9456  "that can be represented by a 64 bit integer">;
9457def err_tag_index_out_of_range : Error<
9458  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
9459def warn_type_tag_for_datatype_wrong_kind : Warning<
9460  "this type tag was not designed to be used with this function">,
9461  InGroup<TypeSafety>;
9462def warn_type_safety_type_mismatch : Warning<
9463  "argument type %0 doesn't match specified %1 type tag "
9464  "%select{that requires %3|}2">, InGroup<TypeSafety>;
9465def warn_type_safety_null_pointer_required : Warning<
9466  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
9467
9468// Generic selections.
9469def err_assoc_type_incomplete : Error<
9470  "type %0 in generic association incomplete">;
9471def err_assoc_type_nonobject : Error<
9472  "type %0 in generic association not an object type">;
9473def err_assoc_type_variably_modified : Error<
9474  "type %0 in generic association is a variably modified type">;
9475def err_assoc_compatible_types : Error<
9476  "type %0 in generic association compatible with previously specified type %1">;
9477def note_compat_assoc : Note<
9478  "compatible type %0 specified here">;
9479def err_generic_sel_no_match : Error<
9480  "controlling expression type %0 not compatible with any generic association type">;
9481def err_generic_sel_multi_match : Error<
9482  "controlling expression type %0 compatible with %1 generic association types">;
9483
9484
9485// Blocks
9486def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
9487  " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">;
9488def err_block_returning_array_function : Error<
9489  "block cannot return %select{array|function}0 type %1">;
9490
9491// Builtin annotation
9492def err_builtin_annotation_first_arg : Error<
9493  "first argument to __builtin_annotation must be an integer">;
9494def err_builtin_annotation_second_arg : Error<
9495  "second argument to __builtin_annotation must be a non-wide string constant">;
9496def err_msvc_annotation_wide_str : Error<
9497  "arguments to __annotation must be wide string constants">;
9498
9499// CFString checking
9500def err_cfstring_literal_not_string_constant : Error<
9501  "CFString literal is not a string constant">;
9502def warn_cfstring_truncated : Warning<
9503  "input conversion stopped due to an input byte that does not "
9504  "belong to the input codeset UTF-8">,
9505  InGroup<DiagGroup<"CFString-literal">>;
9506
9507// os_log checking
9508// TODO: separate diagnostic for os_trace()
9509def err_os_log_format_not_string_constant : Error<
9510  "os_log() format argument is not a string constant">;
9511def err_os_log_argument_too_big : Error<
9512  "os_log() argument %0 is too big (%1 bytes, max %2)">;
9513def warn_os_log_format_narg : Error<
9514 "os_log() '%%n' format specifier is not allowed">, DefaultError;
9515
9516// Statements.
9517def err_continue_not_in_loop : Error<
9518  "'continue' statement not in loop statement">;
9519def err_break_not_in_loop_or_switch : Error<
9520  "'break' statement not in loop or switch statement">;
9521def warn_loop_ctrl_binds_to_inner : Warning<
9522  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
9523  InGroup<GccCompat>;
9524def warn_break_binds_to_switch : Warning<
9525  "'break' is bound to loop, GCC binds it to switch">,
9526  InGroup<GccCompat>;
9527def err_default_not_in_switch : Error<
9528  "'default' statement not in switch statement">;
9529def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
9530def warn_bool_switch_condition : Warning<
9531  "switch condition has boolean value">, InGroup<SwitchBool>;
9532def warn_case_value_overflow : Warning<
9533  "overflow converting case value to switch condition type (%0 to %1)">,
9534  InGroup<Switch>;
9535def err_duplicate_case : Error<"duplicate case value '%0'">;
9536def err_duplicate_case_differing_expr : Error<
9537  "duplicate case value: '%0' and '%1' both equal '%2'">;
9538def warn_case_empty_range : Warning<"empty case range specified">;
9539def warn_missing_case_for_condition :
9540  Warning<"no case matching constant switch condition '%0'">;
9541
9542def warn_def_missing_case : Warning<"%plural{"
9543  "1:enumeration value %1 not explicitly handled in switch|"
9544  "2:enumeration values %1 and %2 not explicitly handled in switch|"
9545  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
9546  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
9547  InGroup<SwitchEnum>, DefaultIgnore;
9548
9549def warn_missing_case : Warning<"%plural{"
9550  "1:enumeration value %1 not handled in switch|"
9551  "2:enumeration values %1 and %2 not handled in switch|"
9552  "3:enumeration values %1, %2, and %3 not handled in switch|"
9553  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
9554  InGroup<Switch>;
9555
9556def warn_unannotated_fallthrough : Warning<
9557  "unannotated fall-through between switch labels">,
9558  InGroup<ImplicitFallthrough>, DefaultIgnore;
9559def warn_unannotated_fallthrough_per_function : Warning<
9560  "unannotated fall-through between switch labels in partly-annotated "
9561  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
9562def note_insert_fallthrough_fixit : Note<
9563  "insert '%0;' to silence this warning">;
9564def note_insert_break_fixit : Note<
9565  "insert 'break;' to avoid fall-through">;
9566def err_fallthrough_attr_wrong_target : Error<
9567  "%0 attribute is only allowed on empty statements">;
9568def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
9569def err_fallthrough_attr_outside_switch : Error<
9570  "fallthrough annotation is outside switch statement">;
9571def err_fallthrough_attr_invalid_placement : Error<
9572  "fallthrough annotation does not directly precede switch label">;
9573def warn_fallthrough_attr_unreachable : Warning<
9574  "fallthrough annotation in unreachable code">,
9575  InGroup<ImplicitFallthrough>, DefaultIgnore;
9576
9577def warn_unreachable_default : Warning<
9578  "default label in switch which covers all enumeration values">,
9579  InGroup<CoveredSwitchDefault>, DefaultIgnore;
9580def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
9581  InGroup<Switch>;
9582def warn_not_in_enum_assignment : Warning<"integer constant not in range "
9583  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
9584def err_typecheck_statement_requires_scalar : Error<
9585  "statement requires expression of scalar type (%0 invalid)">;
9586def err_typecheck_statement_requires_integer : Error<
9587  "statement requires expression of integer type (%0 invalid)">;
9588def err_multiple_default_labels_defined : Error<
9589  "multiple default labels in one switch">;
9590def err_switch_multiple_conversions : Error<
9591  "multiple conversions from switch condition type %0 to an integral or "
9592  "enumeration type">;
9593def note_switch_conversion : Note<
9594  "conversion to %select{integral|enumeration}0 type %1">;
9595def err_switch_explicit_conversion : Error<
9596  "switch condition type %0 requires explicit conversion to %1">;
9597def err_switch_incomplete_class_type : Error<
9598  "switch condition has incomplete class type %0">;
9599
9600def warn_empty_if_body : Warning<
9601  "if statement has empty body">, InGroup<EmptyBody>;
9602def warn_empty_for_body : Warning<
9603  "for loop has empty body">, InGroup<EmptyBody>;
9604def warn_empty_range_based_for_body : Warning<
9605  "range-based for loop has empty body">, InGroup<EmptyBody>;
9606def warn_empty_while_body : Warning<
9607  "while loop has empty body">, InGroup<EmptyBody>;
9608def warn_empty_switch_body : Warning<
9609  "switch statement has empty body">, InGroup<EmptyBody>;
9610def note_empty_body_on_separate_line : Note<
9611  "put the semicolon on a separate line to silence this warning">;
9612
9613def err_va_start_captured_stmt : Error<
9614  "'va_start' cannot be used in a captured statement">;
9615def err_va_start_outside_function : Error<
9616  "'va_start' cannot be used outside a function">;
9617def err_va_start_fixed_function : Error<
9618  "'va_start' used in function with fixed args">;
9619def err_va_start_used_in_wrong_abi_function : Error<
9620  "'va_start' used in %select{System V|Win64}0 ABI function">;
9621def err_ms_va_start_used_in_sysv_function : Error<
9622  "'__builtin_ms_va_start' used in System V ABI function">;
9623def warn_second_arg_of_va_start_not_last_named_param : Warning<
9624  "second argument to 'va_start' is not the last named parameter">,
9625  InGroup<Varargs>;
9626def warn_va_start_type_is_undefined : Warning<
9627  "passing %select{an object that undergoes default argument promotion|"
9628  "an object of reference type|a parameter declared with the 'register' "
9629  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
9630def err_first_argument_to_va_arg_not_of_type_va_list : Error<
9631  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
9632def err_second_parameter_to_va_arg_incomplete: Error<
9633  "second argument to 'va_arg' is of incomplete type %0">;
9634def err_second_parameter_to_va_arg_abstract: Error<
9635  "second argument to 'va_arg' is of abstract type %0">;
9636def warn_second_parameter_to_va_arg_not_pod : Warning<
9637  "second argument to 'va_arg' is of non-POD type %0">,
9638  InGroup<NonPODVarargs>, DefaultError;
9639def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
9640  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
9641  InGroup<NonPODVarargs>, DefaultError;
9642def warn_second_parameter_to_va_arg_never_compatible : Warning<
9643  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
9644  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
9645
9646def warn_return_missing_expr : Warning<
9647  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9648  InGroup<ReturnType>;
9649def ext_return_missing_expr : ExtWarn<
9650  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9651  InGroup<ReturnType>;
9652def ext_return_has_expr : ExtWarn<
9653  "%select{void function|void method|constructor|destructor}1 %0 "
9654  "should not return a value">,
9655  DefaultError, InGroup<ReturnType>;
9656def ext_return_has_void_expr : Extension<
9657  "void %select{function|method|block}1 %0 should not return void expression">;
9658def err_return_init_list : Error<
9659  "%select{void function|void method|constructor|destructor}1 %0 "
9660  "must not return a value">;
9661def err_ctor_dtor_returns_void : Error<
9662  "%select{constructor|destructor}1 %0 must not return void expression">;
9663def warn_noreturn_function_has_return_expr : Warning<
9664  "function %0 declared 'noreturn' should not return">,
9665  InGroup<InvalidNoreturn>;
9666def warn_falloff_noreturn_function : Warning<
9667  "function declared 'noreturn' should not return">,
9668  InGroup<InvalidNoreturn>;
9669def err_noreturn_block_has_return_expr : Error<
9670  "block declared 'noreturn' should not return">;
9671def err_noreturn_missing_on_first_decl : Error<
9672  "function declared '[[noreturn]]' after its first declaration">;
9673def note_noreturn_missing_first_decl : Note<
9674  "declaration missing '[[noreturn]]' attribute is here">;
9675def err_carries_dependency_missing_on_first_decl : Error<
9676  "%select{function|parameter}0 declared '[[carries_dependency]]' "
9677  "after its first declaration">;
9678def note_carries_dependency_missing_first_decl : Note<
9679  "declaration missing '[[carries_dependency]]' attribute is here">;
9680def err_carries_dependency_param_not_function_decl : Error<
9681  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
9682  "declaration or lambda">;
9683def err_block_on_nonlocal : Error<
9684  "__block attribute not allowed, only allowed on local variables">;
9685def err_block_on_vm : Error<
9686  "__block attribute not allowed on declaration with a variably modified type">;
9687def err_sizeless_nonlocal : Error<
9688  "non-local variable with sizeless type %0">;
9689
9690def err_vec_builtin_non_vector : Error<
9691 "first two arguments to %0 must be vectors">;
9692def err_vec_builtin_incompatible_vector : Error<
9693  "first two arguments to %0 must have the same type">;
9694def err_vsx_builtin_nonconstant_argument : Error<
9695  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
9696
9697def err_shufflevector_nonconstant_argument : Error<
9698  "index for __builtin_shufflevector must be a constant integer">;
9699def err_shufflevector_argument_too_large : Error<
9700  "index for __builtin_shufflevector must be less than the total number "
9701  "of vector elements">;
9702
9703def err_convertvector_non_vector : Error<
9704  "first argument to __builtin_convertvector must be a vector">;
9705def err_convertvector_non_vector_type : Error<
9706  "second argument to __builtin_convertvector must be a vector type">;
9707def err_convertvector_incompatible_vector : Error<
9708  "first two arguments to __builtin_convertvector must have the same number of elements">;
9709
9710def err_first_argument_to_cwsc_not_call : Error<
9711  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
9712def err_first_argument_to_cwsc_block_call : Error<
9713  "first argument to __builtin_call_with_static_chain must not be a block call">;
9714def err_first_argument_to_cwsc_builtin_call : Error<
9715  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
9716def err_first_argument_to_cwsc_pdtor_call : Error<
9717  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
9718def err_second_argument_to_cwsc_not_pointer : Error<
9719  "second argument to __builtin_call_with_static_chain must be of pointer type">;
9720
9721def err_vector_incorrect_num_initializers : Error<
9722  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
9723def err_altivec_empty_initializer : Error<"expected initializer">;
9724
9725def err_invalid_neon_type_code : Error<
9726  "incompatible constant for this __builtin_neon function">;
9727def err_argument_invalid_range : Error<
9728  "argument value %0 is outside the valid range [%1, %2]">;
9729def warn_argument_invalid_range : Warning<
9730  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
9731  InGroup<DiagGroup<"argument-outside-range">>;
9732def err_argument_not_multiple : Error<
9733  "argument should be a multiple of %0">;
9734def err_argument_not_power_of_2 : Error<
9735  "argument should be a power of 2">;
9736def err_argument_not_shifted_byte : Error<
9737  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
9738def err_argument_not_shifted_byte_or_xxff : Error<
9739  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9740def err_argument_not_contiguous_bit_field : Error<
9741  "argument %0 value should represent a contiguous bit field">;
9742def err_rotation_argument_to_cadd
9743    : Error<"argument should be the value 90 or 270">;
9744def err_rotation_argument_to_cmla
9745    : Error<"argument should be the value 0, 90, 180 or 270">;
9746def warn_neon_vector_initializer_non_portable : Warning<
9747  "vector initializers are not compatible with NEON intrinsics in big endian "
9748  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
9749def note_neon_vector_initializer_non_portable : Note<
9750  "consider using vld1_%0%1() to initialize a vector from memory, or "
9751  "vcreate_%0%1() to initialize from an integer constant">;
9752def note_neon_vector_initializer_non_portable_q : Note<
9753  "consider using vld1q_%0%1() to initialize a vector from memory, or "
9754  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
9755  "constants">;
9756def err_systemz_invalid_tabort_code : Error<
9757  "invalid transaction abort code">;
9758def err_64_bit_builtin_32_bit_tgt : Error<
9759  "this builtin is only available on 64-bit targets">;
9760def err_32_bit_builtin_64_bit_tgt : Error<
9761  "this builtin is only available on 32-bit targets">;
9762def err_builtin_x64_aarch64_only : Error<
9763  "this builtin is only available on x86-64 and aarch64 targets">;
9764def err_mips_builtin_requires_dsp : Error<
9765  "this builtin requires 'dsp' ASE, please use -mdsp">;
9766def err_mips_builtin_requires_dspr2 : Error<
9767  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
9768def err_mips_builtin_requires_msa : Error<
9769  "this builtin requires 'msa' ASE, please use -mmsa">;
9770def err_ppc_builtin_only_on_arch : Error<
9771  "this builtin is only valid on POWER%0 or later CPUs">;
9772def err_ppc_invalid_use_mma_type : Error<
9773  "invalid use of PPC MMA type">;
9774def err_x86_builtin_invalid_rounding : Error<
9775  "invalid rounding argument">;
9776def err_x86_builtin_invalid_scale : Error<
9777  "scale argument must be 1, 2, 4, or 8">;
9778def err_x86_builtin_tile_arg_duplicate : Error<
9779  "tile arguments must refer to different tiles">;
9780
9781def err_builtin_target_unsupported : Error<
9782  "builtin is not supported on this target">;
9783def err_builtin_longjmp_unsupported : Error<
9784  "__builtin_longjmp is not supported for the current target">;
9785def err_builtin_setjmp_unsupported : Error<
9786  "__builtin_setjmp is not supported for the current target">;
9787
9788def err_builtin_longjmp_invalid_val : Error<
9789  "argument to __builtin_longjmp must be a constant 1">;
9790def err_builtin_requires_language : Error<"'%0' is only available in %1">;
9791
9792def err_constant_integer_arg_type : Error<
9793  "argument to %0 must be a constant integer">;
9794
9795def ext_mixed_decls_code : Extension<
9796  "ISO C90 forbids mixing declarations and code">,
9797  InGroup<DiagGroup<"declaration-after-statement">>;
9798
9799def err_non_local_variable_decl_in_for : Error<
9800  "declaration of non-local variable in 'for' loop">;
9801def err_non_variable_decl_in_for : Error<
9802  "non-variable declaration in 'for' loop">;
9803def err_toomany_element_decls : Error<
9804  "only one element declaration is allowed">;
9805def err_selector_element_not_lvalue : Error<
9806  "selector element is not a valid lvalue">;
9807def err_selector_element_type : Error<
9808  "selector element type %0 is not a valid object">;
9809def err_selector_element_const_type : Error<
9810  "selector element of type %0 cannot be a constant lvalue expression">;
9811def err_collection_expr_type : Error<
9812  "the type %0 is not a pointer to a fast-enumerable object">;
9813def warn_collection_expr_type : Warning<
9814  "collection expression type %0 may not respond to %1">;
9815
9816def err_invalid_conversion_between_ext_vectors : Error<
9817  "invalid conversion between ext-vector type %0 and %1">;
9818
9819def warn_duplicate_attribute_exact : Warning<
9820  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
9821
9822def warn_duplicate_attribute : Warning<
9823  "attribute %0 is already applied with different arguments">,
9824  InGroup<IgnoredAttributes>;
9825
9826def warn_sync_fetch_and_nand_semantics_change : Warning<
9827  "the semantics of this intrinsic changed with GCC "
9828  "version 4.4 - the newer semantics are provided here">,
9829  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
9830
9831// Type
9832def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
9833  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
9834def warn_receiver_forward_class : Warning<
9835  "receiver %0 is a forward class and corresponding @interface may not exist">,
9836  InGroup<ForwardClassReceiver>;
9837def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
9838def ext_missing_declspec : ExtWarn<
9839  "declaration specifier missing, defaulting to 'int'">;
9840def ext_missing_type_specifier : ExtWarn<
9841  "type specifier missing, defaults to 'int'">,
9842  InGroup<ImplicitInt>;
9843def err_decimal_unsupported : Error<
9844  "GNU decimal type extension not supported">;
9845def err_missing_type_specifier : Error<
9846  "C++ requires a type specifier for all declarations">;
9847def err_objc_array_of_interfaces : Error<
9848  "array of interface %0 is invalid (probably should be an array of pointers)">;
9849def ext_c99_array_usage : Extension<
9850  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9851  "feature">, InGroup<C99>;
9852def err_c99_array_usage_cxx : Error<
9853  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9854  "feature, not permitted in C++">;
9855def err_type_unsupported : Error<
9856  "%0 is not supported on this target">;
9857def err_nsconsumed_attribute_mismatch : Error<
9858  "overriding method has mismatched ns_consumed attribute on its"
9859  " parameter">;
9860def err_nsreturns_retained_attribute_mismatch : Error<
9861  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
9862  " attributes">;
9863def err_nserrordomain_invalid_decl : Error<
9864  "domain argument %select{|%1 }0does not refer to global constant">;
9865def err_nserrordomain_wrong_type : Error<
9866  "domain argument %0 does not point to an NSString or CFString constant">;
9867
9868def warn_nsconsumed_attribute_mismatch : Warning<
9869  err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
9870def warn_nsreturns_retained_attribute_mismatch : Warning<
9871  err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
9872
9873def note_getter_unavailable : Note<
9874  "or because setter is declared here, but no getter method %0 is found">;
9875def err_invalid_protocol_qualifiers : Error<
9876  "invalid protocol qualifiers on non-ObjC type">;
9877def warn_ivar_use_hidden : Warning<
9878  "local declaration of %0 hides instance variable">,
9879   InGroup<ShadowIvar>;
9880def warn_direct_initialize_call : Warning<
9881  "explicit call to +initialize results in duplicate call to +initialize">,
9882   InGroup<ExplicitInitializeCall>;
9883def warn_direct_super_initialize_call : Warning<
9884  "explicit call to [super initialize] should only be in implementation "
9885  "of +initialize">,
9886   InGroup<ExplicitInitializeCall>;
9887def err_ivar_use_in_class_method : Error<
9888  "instance variable %0 accessed in class method">;
9889def err_private_ivar_access : Error<"instance variable %0 is private">,
9890  AccessControl;
9891def err_protected_ivar_access : Error<"instance variable %0 is protected">,
9892  AccessControl;
9893def warn_maynot_respond : Warning<"%0 may not respond to %1">;
9894def ext_typecheck_base_super : Warning<
9895  "method parameter type "
9896  "%diff{$ does not match super class method parameter type $|"
9897  "does not match super class method parameter type}0,1">,
9898   InGroup<SuperSubClassMismatch>, DefaultIgnore;
9899def warn_missing_method_return_type : Warning<
9900  "method has no return type specified; defaults to 'id'">,
9901  InGroup<MissingMethodReturnType>, DefaultIgnore;
9902def warn_direct_ivar_access : Warning<"instance variable %0 is being "
9903  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
9904
9905// Spell-checking diagnostics
9906def err_unknown_typename : Error<
9907  "unknown type name %0">;
9908def err_unknown_type_or_class_name_suggest : Error<
9909  "unknown %select{type|class}1 name %0; did you mean %2?">;
9910def err_unknown_typename_suggest : Error<
9911  "unknown type name %0; did you mean %1?">;
9912def err_unknown_nested_typename_suggest : Error<
9913  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
9914def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
9915def err_undeclared_use_suggest : Error<
9916  "use of undeclared %0; did you mean %1?">;
9917def err_undeclared_var_use_suggest : Error<
9918  "use of undeclared identifier %0; did you mean %1?">;
9919def err_no_template : Error<"no template named %0">;
9920def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
9921def err_no_member_template : Error<"no template named %0 in %1">;
9922def err_no_member_template_suggest : Error<
9923  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
9924def err_non_template_in_template_id : Error<
9925  "%0 does not name a template but is followed by template arguments">;
9926def err_non_template_in_template_id_suggest : Error<
9927  "%0 does not name a template but is followed by template arguments; "
9928  "did you mean %1?">;
9929def err_non_template_in_member_template_id_suggest : Error<
9930  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
9931def note_non_template_in_template_id_found : Note<
9932  "non-template declaration found by name lookup">;
9933def err_mem_init_not_member_or_class_suggest : Error<
9934  "initializer %0 does not name a non-static data member or base "
9935  "class; did you mean the %select{base class|member}1 %2?">;
9936def err_field_designator_unknown_suggest : Error<
9937  "field designator %0 does not refer to any field in type %1; did you mean "
9938  "%2?">;
9939def err_typecheck_member_reference_ivar_suggest : Error<
9940  "%0 does not have a member named %1; did you mean %2?">;
9941def err_property_not_found_suggest : Error<
9942  "property %0 not found on object of type %1; did you mean %2?">;
9943def err_class_property_found : Error<
9944  "property %0 is a class property; did you mean to access it with class '%1'?">;
9945def err_ivar_access_using_property_syntax_suggest : Error<
9946  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
9947def warn_property_access_suggest : Warning<
9948"property %0 not found on object of type %1; did you mean to access property %2?">,
9949InGroup<PropertyAccessDotSyntax>;
9950def err_property_found_suggest : Error<
9951  "property %0 found on object of type %1; did you mean to access "
9952  "it with the \".\" operator?">;
9953def err_undef_interface_suggest : Error<
9954  "cannot find interface declaration for %0; did you mean %1?">;
9955def warn_undef_interface_suggest : Warning<
9956  "cannot find interface declaration for %0; did you mean %1?">;
9957def err_undef_superclass_suggest : Error<
9958  "cannot find interface declaration for %0, superclass of %1; did you mean "
9959  "%2?">;
9960def err_undeclared_protocol_suggest : Error<
9961  "cannot find protocol declaration for %0; did you mean %1?">;
9962def note_base_class_specified_here : Note<
9963  "base class %0 specified here">;
9964def err_using_directive_suggest : Error<
9965  "no namespace named %0; did you mean %1?">;
9966def err_using_directive_member_suggest : Error<
9967  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
9968def note_namespace_defined_here : Note<"namespace %0 defined here">;
9969def err_sizeof_pack_no_pack_name_suggest : Error<
9970  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
9971def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
9972
9973def err_uncasted_use_of_unknown_any : Error<
9974  "%0 has unknown type; cast it to its declared type to use it">;
9975def err_uncasted_call_of_unknown_any : Error<
9976  "%0 has unknown return type; cast the call to its declared return type">;
9977def err_uncasted_send_to_unknown_any_method : Error<
9978  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
9979  "message send to the method's return type">;
9980def err_unsupported_unknown_any_decl : Error<
9981  "%0 has unknown type, which is not supported for this kind of declaration">;
9982def err_unsupported_unknown_any_expr : Error<
9983  "unsupported expression with unknown type">;
9984def err_unsupported_unknown_any_call : Error<
9985  "call to unsupported expression with unknown type">;
9986def err_unknown_any_addrof : Error<
9987  "the address of a declaration with unknown type "
9988  "can only be cast to a pointer type">;
9989def err_unknown_any_addrof_call : Error<
9990  "address-of operator cannot be applied to a call to a function with "
9991  "unknown return type">;
9992def err_unknown_any_var_function_type : Error<
9993  "variable %0 with unknown type cannot be given a function type">;
9994def err_unknown_any_function : Error<
9995  "function %0 with unknown type must be given a function type">;
9996
9997def err_filter_expression_integral : Error<
9998  "filter expression has non-integral type %0">;
9999
10000def err_non_asm_stmt_in_naked_function : Error<
10001  "non-ASM statement in naked function is not supported">;
10002def err_asm_naked_this_ref : Error<
10003  "'this' pointer references not allowed in naked functions">;
10004def err_asm_naked_parm_ref : Error<
10005  "parameter references not allowed in naked functions">;
10006
10007// OpenCL warnings and errors.
10008def err_invalid_astype_of_different_size : Error<
10009  "invalid reinterpretation: sizes of %0 and %1 must match">;
10010def err_static_kernel : Error<
10011  "kernel functions cannot be declared static">;
10012def err_method_kernel : Error<
10013  "kernel functions cannot be class members">;
10014def err_template_kernel : Error<
10015  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
10016def err_opencl_ptrptr_kernel_param : Error<
10017  "kernel parameter cannot be declared as a pointer to a pointer">;
10018def err_kernel_arg_address_space : Error<
10019  "pointer arguments to kernel functions must reside in '__global', "
10020  "'__constant' or '__local' address space">;
10021def err_opencl_ext_vector_component_invalid_length : Error<
10022  "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
10023def err_opencl_function_variable : Error<
10024  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
10025def err_opencl_addrspace_scope : Error<
10026  "variables in the %0 address space can only be declared in the outermost "
10027  "scope of a kernel function">;
10028def err_static_function_scope : Error<
10029  "variables in function scope cannot be declared static">;
10030def err_opencl_bitfields : Error<
10031  "bit-fields are not supported in OpenCL">;
10032def err_opencl_vla : Error<
10033  "variable length arrays are not supported in OpenCL">;
10034def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
10035    "scalar operand type has greater rank than the type of the vector "
10036    "element. (%0 and %1)">;
10037def err_bad_kernel_param_type : Error<
10038  "%0 cannot be used as the type of a kernel parameter">;
10039def err_opencl_implicit_function_decl : Error<
10040  "implicit declaration of function %0 is invalid in OpenCL">;
10041def err_record_with_pointers_kernel_param : Error<
10042  "%select{struct|union}0 kernel parameters may not contain pointers">;
10043def note_within_field_of_type : Note<
10044  "within field of type %0 declared here">;
10045def note_illegal_field_declared_here : Note<
10046  "field of illegal %select{type|pointer type}0 %1 declared here">;
10047def err_opencl_type_struct_or_union_field : Error<
10048  "the %0 type cannot be used to declare a structure or union field">;
10049def err_event_t_addr_space_qual : Error<
10050  "the event_t type can only be used with __private address space qualifier">;
10051def err_expected_kernel_void_return_type : Error<
10052  "kernel must have void return type">;
10053def err_sampler_initializer_not_integer : Error<
10054  "sampler_t initialization requires 32-bit integer, not %0">;
10055def warn_sampler_initializer_invalid_bits : Warning<
10056  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
10057def err_sampler_argument_required : Error<
10058  "sampler_t variable required - got %0">;
10059def err_wrong_sampler_addressspace: Error<
10060  "sampler type cannot be used with the __local and __global address space qualifiers">;
10061def err_opencl_nonconst_global_sampler : Error<
10062  "global sampler requires a const or constant address space qualifier">;
10063def err_opencl_cast_non_zero_to_event_t : Error<
10064  "cannot cast non-zero value '%0' to 'event_t'">;
10065def err_opencl_global_invalid_addr_space : Error<
10066  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
10067def err_missing_actual_pipe_type : Error<
10068  "missing actual type specifier for pipe">;
10069def err_reference_pipe_type : Error <
10070  "pipes packet types cannot be of reference type">;
10071def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
10072def err_opencl_kernel_attr :
10073  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
10074def err_opencl_return_value_with_address_space : Error<
10075  "return value cannot be qualified with address space">;
10076def err_opencl_constant_no_init : Error<
10077  "variable in constant address space must be initialized">;
10078def err_opencl_atomic_init: Error<
10079  "atomic variable can be %select{assigned|initialized}0 to a variable only "
10080  "in global address space">;
10081def err_opencl_implicit_vector_conversion : Error<
10082  "implicit conversions between vector types (%0 and %1) are not permitted">;
10083def err_opencl_invalid_type_array : Error<
10084  "array of %0 type is invalid in OpenCL">;
10085def err_opencl_ternary_with_block : Error<
10086  "block type cannot be used as expression in ternary expression in OpenCL">;
10087def err_opencl_pointer_to_type : Error<
10088  "pointer to type %0 is invalid in OpenCL">;
10089def err_opencl_type_can_only_be_used_as_function_parameter : Error <
10090  "type %0 can only be used as a function parameter in OpenCL">;
10091def err_opencl_type_not_found : Error<
10092  "%0 type %1 not found; include the base header with -finclude-default-header">;
10093def warn_opencl_attr_deprecated_ignored : Warning <
10094  "%0 attribute is deprecated and ignored in OpenCL version %1">,
10095  InGroup<IgnoredAttributes>;
10096def err_opencl_variadic_function : Error<
10097  "invalid prototype, variadic arguments are not allowed in OpenCL">;
10098def err_opencl_requires_extension : Error<
10099  "use of %select{type|declaration}0 %1 requires %2 support">;
10100def ext_opencl_double_without_pragma : Extension<
10101  "Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
10102  " supported">;
10103def warn_opencl_generic_address_space_arg : Warning<
10104  "passing non-generic address space pointer to %0"
10105  " may cause dynamic conversion affecting performance">,
10106  InGroup<Conversion>, DefaultIgnore;
10107
10108// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
10109def err_opencl_builtin_pipe_first_arg : Error<
10110  "first argument to %0 must be a pipe type">;
10111def err_opencl_builtin_pipe_arg_num : Error<
10112  "invalid number of arguments to function: %0">;
10113def err_opencl_builtin_pipe_invalid_arg : Error<
10114  "invalid argument type to function %0 (expecting %1 having %2)">;
10115def err_opencl_builtin_pipe_invalid_access_modifier : Error<
10116  "invalid pipe access modifier (expecting %0)">;
10117
10118// OpenCL access qualifier
10119def err_opencl_invalid_access_qualifier : Error<
10120  "access qualifier can only be used for pipe and image type">;
10121def err_opencl_invalid_read_write : Error<
10122  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL C version 2.0 or in version 3.0 "
10123  "and without __opencl_c_read_write_images feature}2">;
10124def err_opencl_multiple_access_qualifiers : Error<
10125  "multiple access qualifiers">;
10126def note_opencl_typedef_access_qualifier : Note<
10127  "previously declared '%0' here">;
10128
10129// OpenCL v2.0 s6.12.5 Blocks restrictions
10130def err_opencl_block_storage_type : Error<
10131  "the __block storage type is not permitted">;
10132def err_opencl_invalid_block_declaration : Error<
10133  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
10134def err_opencl_extern_block_declaration : Error<
10135  "invalid block variable declaration - using 'extern' storage class is disallowed">;
10136def err_opencl_block_ref_block : Error<
10137  "cannot refer to a block inside block">;
10138
10139// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
10140def err_opencl_builtin_to_addr_invalid_arg : Error<
10141  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
10142
10143// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
10144def err_opencl_enqueue_kernel_incorrect_args : Error<
10145  "illegal call to enqueue_kernel, incorrect argument types">;
10146def err_opencl_enqueue_kernel_local_size_args : Error<
10147  "mismatch in number of block parameters and local size arguments passed">;
10148def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
10149  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
10150def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
10151  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
10152def err_opencl_enqueue_kernel_blocks_no_args : Error<
10153  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
10154
10155def err_opencl_builtin_expected_type : Error<
10156  "illegal call to %0, expected %1 argument type">;
10157
10158// OpenCL v3.0 s6.3.7 - Vector Components
10159def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
10160  "vector component name '%0' is an OpenCL C version 3.0 feature">,
10161  InGroup<OpenCLUnsupportedRGBA>;
10162
10163def err_openclcxx_placement_new : Error<
10164  "use of placement new requires explicit declaration">;
10165
10166// MIG routine annotations.
10167def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
10168  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
10169  InGroup<IgnoredAttributes>;
10170} // end of sema category
10171
10172let CategoryName = "OpenMP Issue" in {
10173// OpenMP support.
10174def err_omp_expected_var_arg : Error<
10175  "%0 is not a global variable, static local variable or static data member">;
10176def err_omp_expected_var_arg_suggest : Error<
10177  "%0 is not a global variable, static local variable or static data member; "
10178  "did you mean %1">;
10179def err_omp_global_var_arg : Error<
10180  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
10181def err_omp_ref_type_arg : Error<
10182  "arguments of '#pragma omp %0' cannot be of reference type %1">;
10183def err_omp_region_not_file_context : Error<
10184  "directive must be at file or namespace scope">;
10185def err_omp_var_scope : Error<
10186  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
10187def err_omp_var_used : Error<
10188  "'#pragma omp %0' must precede all references to variable %q1">;
10189def err_omp_var_thread_local : Error<
10190  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
10191def err_omp_private_incomplete_type : Error<
10192  "a private variable with incomplete type %0">;
10193def err_omp_firstprivate_incomplete_type : Error<
10194  "a firstprivate variable with incomplete type %0">;
10195def err_omp_lastprivate_incomplete_type : Error<
10196  "a lastprivate variable with incomplete type %0">;
10197def err_omp_reduction_incomplete_type : Error<
10198  "a reduction list item with incomplete type %0">;
10199def err_omp_unexpected_clause_value : Error<
10200  "expected %0 in OpenMP clause '%1'">;
10201def err_omp_expected_var_name_member_expr : Error<
10202  "expected variable name%select{| or data member of current class}0">;
10203def err_omp_expected_var_name_member_expr_or_array_item : Error<
10204  "expected variable name%select{|, data member of current class}0, array element or array section">;
10205def err_omp_expected_addressable_lvalue_or_array_item : Error<
10206  "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">;
10207def err_omp_expected_named_var_member_or_array_expression: Error<
10208  "expected expression containing only member accesses and/or array sections based on named variables">;
10209def err_omp_bit_fields_forbidden_in_clause : Error<
10210  "bit fields cannot be used to specify storage in a '%0' clause">;
10211def err_array_section_does_not_specify_contiguous_storage : Error<
10212  "array section does not specify contiguous storage">;
10213def err_array_section_does_not_specify_length : Error<
10214  "array section does not specify length for outermost dimension">;
10215def err_omp_union_type_not_allowed : Error<
10216  "mapping of union members is not allowed">;
10217def err_omp_expected_access_to_data_field : Error<
10218  "expected access to data field">;
10219def err_omp_multiple_array_items_in_map_clause : Error<
10220  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
10221def err_omp_duplicate_map_type_modifier : Error<
10222  "same map type modifier has been specified more than once">;
10223def err_omp_duplicate_motion_modifier : Error<
10224  "same motion modifier has been specified more than once">;
10225def err_omp_pointer_mapped_along_with_derived_section : Error<
10226  "pointer cannot be mapped along with a section derived from itself">;
10227def err_omp_original_storage_is_shared_and_does_not_contain : Error<
10228  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
10229def err_omp_same_pointer_dereferenced : Error<
10230  "same pointer dereferenced in multiple different ways in map clause expressions">;
10231def note_omp_task_predetermined_firstprivate_here : Note<
10232  "predetermined as a firstprivate in a task construct here">;
10233def err_omp_threadprivate_incomplete_type : Error<
10234  "threadprivate variable with incomplete type %0">;
10235def err_omp_no_dsa_for_variable : Error<
10236  "variable %0 must have explicitly specified data sharing attributes">;
10237def err_omp_defaultmap_no_attr_for_variable : Error<
10238  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
10239def note_omp_default_dsa_none : Note<
10240  "explicit data sharing attribute requested here">;
10241def note_omp_defaultmap_attr_none : Note<
10242  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
10243def err_omp_wrong_dsa : Error<
10244  "%0 variable cannot be %1">;
10245def err_omp_variably_modified_type_not_supported : Error<
10246  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
10247def note_omp_explicit_dsa : Note<
10248  "defined as %0">;
10249def note_omp_predetermined_dsa : Note<
10250  "%select{static data member is predetermined as shared|"
10251  "variable with static storage duration is predetermined as shared|"
10252  "loop iteration variable is predetermined as private|"
10253  "loop iteration variable is predetermined as linear|"
10254  "loop iteration variable is predetermined as lastprivate|"
10255  "constant variable is predetermined as shared|"
10256  "global variable is predetermined as shared|"
10257  "non-shared variable in a task construct is predetermined as firstprivate|"
10258  "variable with automatic storage duration is predetermined as private}0"
10259  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
10260def note_omp_implicit_dsa : Note<
10261  "implicitly determined as %0">;
10262def err_omp_loop_var_dsa : Error<
10263  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
10264def err_omp_not_for : Error<
10265  "%select{statement after '#pragma omp %1' must be a for loop|"
10266  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
10267def note_omp_collapse_ordered_expr : Note<
10268  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
10269def err_omp_negative_expression_in_clause : Error<
10270  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
10271def err_omp_not_integral : Error<
10272  "expression must have integral or unscoped enumeration "
10273  "type, not %0">;
10274def err_omp_threadprivate_in_target : Error<
10275  "threadprivate variables cannot be used in target constructs">;
10276def err_omp_incomplete_type : Error<
10277  "expression has incomplete class type %0">;
10278def err_omp_explicit_conversion : Error<
10279  "expression requires explicit conversion from %0 to %1">;
10280def note_omp_conversion_here : Note<
10281  "conversion to %select{integral|enumeration}0 type %1 declared here">;
10282def err_omp_ambiguous_conversion : Error<
10283  "ambiguous conversion from type %0 to an integral or unscoped "
10284  "enumeration type">;
10285def err_omp_iterator_not_integral_or_pointer : Error<
10286  "expected integral or pointer type as the iterator-type, not %0">;
10287def err_omp_iterator_step_not_integral : Error<
10288  "iterator step expression %0 is not the integral expression">;
10289def err_omp_iterator_step_constant_zero : Error<
10290  "iterator step expression %0 evaluates to 0">;
10291def err_omp_required_access : Error<
10292  "%0 variable must be %1">;
10293def err_omp_const_variable : Error<
10294  "const-qualified variable cannot be %0">;
10295def err_omp_const_not_mutable_variable : Error<
10296  "const-qualified variable without mutable fields cannot be %0">;
10297def err_omp_const_list_item : Error<
10298  "const-qualified list item cannot be %0">;
10299def err_omp_linear_incomplete_type : Error<
10300  "a linear variable with incomplete type %0">;
10301def err_omp_linear_expected_int_or_ptr : Error<
10302  "argument of a linear clause should be of integral or pointer "
10303  "type, not %0">;
10304def warn_omp_linear_step_zero : Warning<
10305  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
10306  InGroup<OpenMPClauses>;
10307def warn_omp_alignment_not_power_of_two : Warning<
10308  "aligned clause will be ignored because the requested alignment is not a power of 2">,
10309  InGroup<OpenMPClauses>;
10310def err_omp_invalid_target_decl : Error<
10311  "%0 used in declare target directive is not a variable or a function name">;
10312def err_omp_declare_target_to_and_link : Error<
10313  "%0 must not appear in both clauses 'to' and 'link'">;
10314def warn_omp_not_in_target_context : Warning<
10315  "declaration is not declared in any declare target region">,
10316  InGroup<OpenMPTarget>;
10317def err_omp_function_in_link_clause : Error<
10318  "function name is not allowed in 'link' clause">;
10319def err_omp_aligned_expected_array_or_ptr : Error<
10320  "argument of aligned clause should be array"
10321  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
10322  ", not %0">;
10323def err_omp_used_in_clause_twice : Error<
10324  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
10325def err_omp_local_var_in_threadprivate_init : Error<
10326  "variable with local storage in initial value of threadprivate variable">;
10327def err_omp_loop_not_canonical_init : Error<
10328  "initialization clause of OpenMP for loop is not in canonical form "
10329  "('var = init' or 'T var = init')">;
10330def ext_omp_loop_not_canonical_init : ExtWarn<
10331  "initialization clause of OpenMP for loop is not in canonical form "
10332  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
10333def err_omp_loop_not_canonical_cond : Error<
10334  "condition of OpenMP for loop must be a relational comparison "
10335  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
10336def err_omp_loop_not_canonical_incr : Error<
10337  "increment clause of OpenMP for loop must perform simple addition "
10338  "or subtraction on loop variable %0">;
10339def err_omp_loop_variable_type : Error<
10340  "variable must be of integer or %select{pointer|random access iterator}0 type">;
10341def err_omp_loop_incr_not_compatible : Error<
10342  "increment expression must cause %0 to %select{decrease|increase}1 "
10343  "on each iteration of OpenMP for loop">;
10344def note_omp_loop_cond_requres_compatible_incr : Note<
10345  "loop step is expected to be %select{negative|positive}0 due to this condition">;
10346def err_omp_loop_diff_cxx : Error<
10347  "could not calculate number of iterations calling 'operator-' with "
10348  "upper and lower loop bounds">;
10349def err_omp_loop_cannot_use_stmt : Error<
10350  "'%0' statement cannot be used in OpenMP for loop">;
10351def err_omp_simd_region_cannot_use_stmt : Error<
10352  "'%0' statement cannot be used in OpenMP simd region">;
10353def warn_omp_loop_64_bit_var : Warning<
10354  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
10355  InGroup<OpenMPLoopForm>;
10356def err_omp_unknown_reduction_identifier : Error<
10357  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
10358  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
10359def err_omp_not_resolved_reduction_identifier : Error<
10360  "unable to resolve declare reduction construct for type %0">;
10361def err_omp_reduction_ref_type_arg : Error<
10362  "argument of OpenMP clause '%0' must reference the same object in all threads">;
10363def err_omp_clause_not_arithmetic_type_arg : Error<
10364  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
10365def err_omp_clause_floating_type_arg : Error<
10366  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
10367def err_omp_once_referenced : Error<
10368  "variable can appear only once in OpenMP '%0' clause">;
10369def err_omp_once_referenced_in_target_update : Error<
10370  "variable can appear only once in OpenMP 'target update' construct">;
10371def note_omp_referenced : Note<
10372  "previously referenced here">;
10373def err_omp_reduction_in_task : Error<
10374  "reduction variables may not be accessed in an explicit task">;
10375def err_omp_reduction_id_not_compatible : Error<
10376  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
10377def err_omp_reduction_identifier_mismatch : Error<
10378  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
10379def note_omp_previous_reduction_identifier : Note<
10380  "previously marked as task_reduction with different reduction operation">;
10381def err_omp_prohibited_region : Error<
10382  "region cannot be%select{| closely}0 nested inside '%1' region"
10383  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
10384  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
10385  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
10386  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
10387  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
10388def err_omp_prohibited_region_simd : Error<
10389  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
10390def err_omp_prohibited_region_atomic : Error<
10391  "OpenMP constructs may not be nested inside an atomic region">;
10392def err_omp_prohibited_region_critical_same_name : Error<
10393  "cannot nest 'critical' regions having the same name %0">;
10394def note_omp_previous_critical_region : Note<
10395  "previous 'critical' region starts here">;
10396def err_omp_several_directives_in_region : Error<
10397  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
10398def note_omp_previous_directive : Note<
10399  "previous '%0' directive used here">;
10400def err_omp_sections_not_compound_stmt : Error<
10401  "the statement for '#pragma omp sections' must be a compound statement">;
10402def err_omp_parallel_sections_not_compound_stmt : Error<
10403  "the statement for '#pragma omp parallel sections' must be a compound statement">;
10404def err_omp_orphaned_section_directive : Error<
10405  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
10406  " must be closely nested to a sections region%select{|, not a %1 region}0">;
10407def err_omp_sections_substmt_not_section : Error<
10408  "statement in 'omp sections' directive must be enclosed into a section region">;
10409def err_omp_parallel_sections_substmt_not_section : Error<
10410  "statement in 'omp parallel sections' directive must be enclosed into a section region">;
10411def err_omp_parallel_reduction_in_task_firstprivate : Error<
10412  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
10413def err_omp_atomic_read_not_expression_statement : Error<
10414  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
10415  " where v and x are both lvalue expressions with scalar type">;
10416def note_omp_atomic_read_write: Note<
10417  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
10418def err_omp_atomic_write_not_expression_statement : Error<
10419  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
10420  " where x is a lvalue expression with scalar type">;
10421def err_omp_atomic_update_not_expression_statement : Error<
10422  "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',"
10423  " where x is an lvalue expression with scalar type">;
10424def err_omp_atomic_not_expression_statement : Error<
10425  "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',"
10426  " where x is an lvalue expression with scalar type">;
10427def note_omp_atomic_update: Note<
10428  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
10429  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
10430  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
10431def err_omp_atomic_capture_not_expression_statement : Error<
10432  "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',"
10433  " where x and v are both lvalue expressions with scalar type">;
10434def err_omp_atomic_capture_not_compound_statement : Error<
10435  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
10436  " '{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;}',"
10437  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
10438  " where x is an lvalue expression with scalar type">;
10439def note_omp_atomic_capture: Note<
10440  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
10441def err_omp_atomic_several_clauses : Error<
10442  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
10443def err_omp_several_mem_order_clauses : Error<
10444  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
10445def err_omp_atomic_incompatible_mem_order_clause : Error<
10446  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
10447def note_omp_previous_mem_order_clause : Note<
10448  "'%0' clause used here">;
10449def err_omp_target_contains_not_only_teams : Error<
10450  "target construct with nested teams region contains statements outside of the teams construct">;
10451def note_omp_nested_teams_construct_here : Note<
10452  "nested teams construct here">;
10453def note_omp_nested_statement_here : Note<
10454  "%select{statement|directive}0 outside teams construct here">;
10455def err_omp_single_copyprivate_with_nowait : Error<
10456  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
10457def note_omp_nowait_clause_here : Note<
10458  "'nowait' clause is here">;
10459def err_omp_single_decl_in_declare_simd_variant : Error<
10460  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
10461def err_omp_function_expected : Error<
10462  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
10463def err_omp_wrong_cancel_region : Error<
10464  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
10465def err_omp_parent_cancel_region_nowait : Error<
10466  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
10467def err_omp_parent_cancel_region_ordered : Error<
10468  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
10469def 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">;
10470def 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">;
10471def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
10472def err_omp_mapper_wrong_type : Error<
10473  "mapper type must be of struct, union or class type">;
10474def err_omp_declare_mapper_wrong_var : Error<
10475  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
10476def err_omp_declare_mapper_redefinition : Error<
10477  "redefinition of user-defined mapper for type %0 with name %1">;
10478def err_omp_invalid_mapper: Error<
10479  "cannot find a valid user-defined mapper for type %0 with name %1">;
10480def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
10481def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
10482def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
10483def err_omp_typecheck_section_value : Error<
10484  "subscripted value is not an array or pointer">;
10485def err_omp_typecheck_section_not_integer : Error<
10486  "array section %select{lower bound|length}0 is not an integer">;
10487def err_omp_typecheck_shaping_not_integer : Error<
10488  "array shaping operation dimension is not an integer">;
10489def err_omp_shaping_dimension_not_positive : Error<
10490  "array shaping dimension is evaluated to a non-positive value %0">;
10491def err_omp_section_function_type : Error<
10492  "section of pointer to function type %0">;
10493def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
10494  InGroup<CharSubscript>, DefaultIgnore;
10495def err_omp_section_incomplete_type : Error<
10496  "section of pointer to incomplete type %0">;
10497def err_omp_section_not_subset_of_array : Error<
10498  "array section must be a subset of the original array">;
10499def err_omp_section_length_negative : Error<
10500  "section length is evaluated to a negative value %0">;
10501def err_omp_section_stride_non_positive : Error<
10502  "section stride is evaluated to a non-positive value %0">;
10503def err_omp_section_length_undefined : Error<
10504  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
10505def err_omp_wrong_linear_modifier : Error<
10506  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
10507def err_omp_wrong_linear_modifier_non_reference : Error<
10508  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
10509def err_omp_wrong_simdlen_safelen_values : Error<
10510  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
10511def err_omp_wrong_if_directive_name_modifier : Error<
10512  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
10513def err_omp_no_more_if_clause : Error<
10514  "no more 'if' clause is allowed">;
10515def err_omp_unnamed_if_clause : Error<
10516  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
10517def note_omp_previous_named_if_clause : Note<
10518  "previous clause with directive name modifier specified here">;
10519def err_omp_ordered_directive_with_param : Error<
10520  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
10521def err_omp_ordered_directive_without_param : Error<
10522  "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
10523def note_omp_ordered_param : Note<
10524  "'ordered' clause%select{| with specified parameter}0">;
10525def err_omp_expected_base_var_name : Error<
10526  "expected variable name as a base of the array %select{subscript|section}0">;
10527def err_omp_map_shared_storage : Error<
10528  "variable already marked as mapped in current construct">;
10529def err_omp_invalid_map_type_for_directive : Error<
10530  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
10531def err_omp_no_clause_for_directive : Error<
10532  "expected at least one %0 clause for '#pragma omp %1'">;
10533def err_omp_threadprivate_in_clause : Error<
10534  "threadprivate variables are not allowed in '%0' clause">;
10535def err_omp_wrong_ordered_loop_count : Error<
10536  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
10537def note_collapse_loop_count : Note<
10538  "parameter of the 'collapse' clause">;
10539def err_omp_clauses_mutually_exclusive : Error<
10540  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
10541def note_omp_previous_clause : Note<
10542  "'%0' clause is specified here">;
10543def err_omp_hint_clause_no_name : Error<
10544  "the name of the construct must be specified in presence of 'hint' clause">;
10545def err_omp_critical_with_hint : Error<
10546  "constructs with the same name must have a 'hint' clause with the same value">;
10547def note_omp_critical_hint_here : Note<
10548  "%select{|previous }0'hint' clause with value '%1'">;
10549def note_omp_critical_no_hint : Note<
10550  "%select{|previous }0directive with no 'hint' clause specified">;
10551def err_omp_depend_clause_thread_simd : Error<
10552  "'depend' clauses cannot be mixed with '%0' clause">;
10553def err_omp_depend_sink_expected_loop_iteration : Error<
10554  "expected%select{| %1}0 loop iteration variable">;
10555def err_omp_depend_sink_unexpected_expr : Error<
10556  "unexpected expression: number of expressions is larger than the number of associated loops">;
10557def err_omp_depend_sink_expected_plus_minus : Error<
10558  "expected '+' or '-' operation">;
10559def err_omp_depend_sink_source_not_allowed : Error<
10560  "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
10561def err_omp_depend_zero_length_array_section_not_allowed : Error<
10562  "zero-length array section is not allowed in 'depend' clause">;
10563def err_omp_depend_sink_source_with_modifier : Error<
10564  "depend modifier cannot be used with 'sink' or 'source' depend type">;
10565def err_omp_depend_modifier_not_iterator : Error<
10566  "expected iterator specification as depend modifier">;
10567def err_omp_linear_ordered : Error<
10568  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
10569def err_omp_unexpected_schedule_modifier : Error<
10570  "modifier '%0' cannot be used along with modifier '%1'">;
10571def err_omp_schedule_nonmonotonic_static : Error<
10572  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
10573def err_omp_simple_clause_incompatible_with_ordered : Error<
10574  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
10575def err_omp_ordered_simd : Error<
10576  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
10577def err_omp_variable_in_given_clause_and_dsa : Error<
10578  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
10579def err_omp_param_or_this_in_clause : Error<
10580  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
10581def err_omp_expected_uniform_param : Error<
10582  "expected a reference to a parameter specified in a 'uniform' clause">;
10583def err_omp_expected_int_param : Error<
10584  "expected a reference to an integer-typed parameter">;
10585def err_omp_at_least_one_motion_clause_required : Error<
10586  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
10587def err_omp_usedeviceptr_not_a_pointer : Error<
10588  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
10589def err_omp_argument_type_isdeviceptr : Error <
10590  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
10591def warn_omp_nesting_simd : Warning<
10592  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
10593  InGroup<SourceUsesOpenMP>;
10594def err_omp_orphaned_device_directive : Error<
10595  "orphaned 'omp %0' directives are prohibited"
10596  "; perhaps you forget to enclose the directive into a "
10597  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
10598def err_omp_reduction_non_addressable_expression : Error<
10599  "expected addressable reduction item for the task-based directives">;
10600def err_omp_reduction_with_nogroup : Error<
10601  "'reduction' clause cannot be used with 'nogroup' clause">;
10602def err_omp_reduction_vla_unsupported : Error<
10603  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
10604def err_omp_linear_distribute_var_non_loop_iteration : Error<
10605  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
10606def warn_omp_non_trivial_type_mapped : Warning<
10607  "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
10608  InGroup<OpenMPMapping>;
10609def err_omp_requires_clause_redeclaration : Error <
10610  "Only one %0 clause can appear on a requires directive in a single translation unit">;
10611def note_omp_requires_previous_clause : Note <
10612  "%0 clause previously used here">;
10613def err_omp_directive_before_requires : Error <
10614  "'%0' region encountered before requires directive with '%1' clause">;
10615def note_omp_requires_encountered_directive : Note <
10616  "'%0' previously encountered here">;
10617def err_omp_invalid_scope : Error <
10618  "'#pragma omp %0' directive must appear only in file scope">;
10619def note_omp_invalid_length_on_this_ptr_mapping : Note <
10620  "expected length on mapping of 'this' array section expression to be '1'">;
10621def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
10622  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
10623def note_omp_invalid_subscript_on_this_ptr_map : Note <
10624  "expected 'this' subscript expression on map clause to be 'this[0]'">;
10625def err_omp_invalid_map_this_expr : Error <
10626  "invalid 'this' expression on 'map' clause">;
10627def err_omp_implied_type_not_found : Error<
10628  "'%0' type not found; include <omp.h>">;
10629def err_omp_expected_omp_depend_t_lvalue : Error<
10630  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
10631def err_omp_depobj_expected : Error<
10632  "expected depobj expression">;
10633def err_omp_depobj_single_clause_expected : Error<
10634  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
10635def err_omp_scan_single_clause_expected : Error<
10636  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
10637def err_omp_inclusive_exclusive_not_reduction : Error<
10638  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
10639  "of the parent directive">;
10640def err_omp_reduction_not_inclusive_exclusive : Error<
10641  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
10642  " 'exclusive' clause on an inner 'omp scan' directive">;
10643def err_omp_wrong_inscan_reduction : Error<
10644  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
10645  " 'omp parallel for', or 'omp parallel for simd' directive">;
10646def err_omp_inscan_reduction_expected : Error<
10647  "expected 'reduction' clause with the 'inscan' modifier">;
10648def note_omp_previous_inscan_reduction : Note<
10649  "'reduction' clause with 'inscan' modifier is used here">;
10650def err_omp_expected_predefined_allocator : Error<
10651  "expected one of the predefined allocators for the variables with the static "
10652  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
10653  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
10654  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
10655def warn_omp_used_different_allocator : Warning<
10656  "allocate directive specifies %select{default|'%1'}0 allocator while "
10657  "previously used %select{default|'%3'}2">,
10658  InGroup<OpenMPClauses>;
10659def note_omp_previous_allocator : Note<
10660  "previous allocator is specified here">;
10661def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
10662  "inside of the target region; provide an 'allocator' clause or use 'requires'"
10663  " directive with the 'dynamic_allocators' clause">;
10664def err_expected_allocator_expression : Error<"expected an allocator expression "
10665  "inside of the target region; provide an allocator expression or use 'requires'"
10666  " directive with the 'dynamic_allocators' clause">;
10667def warn_omp_allocate_thread_on_task_target_directive : Warning<
10668  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
10669  InGroup<OpenMPClauses>;
10670def err_omp_expected_private_copy_for_allocate : Error<
10671  "the referenced item is not found in any private clause on the same directive">;
10672def err_omp_stmt_depends_on_loop_counter : Error<
10673  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
10674def err_omp_invariant_dependency : Error<
10675  "expected loop invariant expression">;
10676def err_omp_invariant_or_linear_dependency : Error<
10677  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
10678def err_omp_wrong_dependency_iterator_type : Error<
10679  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
10680def err_device_unsupported_type
10681    : Error<"%0 requires %select{|%2 bit size}1 %3 type support, but device "
10682            "'%4' does not support it">;
10683def err_omp_lambda_capture_in_declare_target_not_to : Error<
10684  "variable captured in declare target region must appear in a to clause">;
10685def err_omp_device_type_mismatch : Error<
10686  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
10687def err_omp_wrong_device_function_call : Error<
10688  "function with 'device_type(%0)' is not available on %select{device|host}1">;
10689def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
10690def warn_omp_declare_target_after_first_use : Warning<
10691  "declaration marked as declare target after first use, it may lead to incorrect results">,
10692  InGroup<OpenMPTarget>;
10693def err_omp_declare_variant_incompat_attributes : Error<
10694  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
10695def warn_omp_declare_variant_score_not_constant
10696    : Warning<"score expressions in the OpenMP context selector need to be "
10697              "constant; %0 is not and will be ignored">,
10698      InGroup<SourceUsesOpenMP>;
10699def err_omp_declare_variant_user_condition_not_constant
10700    : Error<"the user condition in the OpenMP context selector needs to be "
10701            "constant; %0 is not">;
10702def warn_omp_declare_variant_after_used : Warning<
10703  "'#pragma omp declare variant' cannot be applied for function after first "
10704  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
10705def warn_omp_declare_variant_after_emitted : Warning<
10706  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
10707  " the original function might be used">, InGroup<SourceUsesOpenMP>;
10708def err_omp_declare_variant_doesnt_support : Error<
10709  "'#pragma omp declare variant' does not "
10710  "support %select{function templates|virtual functions|"
10711  "deduced return types|constructors|destructors|deleted functions|"
10712  "defaulted functions|constexpr functions|consteval function}0">;
10713def err_omp_declare_variant_diff : Error<
10714  "function with '#pragma omp declare variant' has a different %select{calling convention"
10715  "|return type|constexpr specification|inline specification|storage class|"
10716  "linkage}0">;
10717def err_omp_declare_variant_incompat_types : Error<
10718  "variant in '#pragma omp declare variant' with type %0 is incompatible with type %1"
10719  >;
10720def warn_omp_declare_variant_marked_as_declare_variant : Warning<
10721  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
10722  >, InGroup<SourceUsesOpenMP>;
10723def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
10724def err_omp_one_defaultmap_each_category: Error<
10725  "at most one defaultmap clause for each variable-category can appear on the directive">;
10726def err_omp_lastprivate_conditional_non_scalar : Error<
10727  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
10728  >;
10729def err_omp_flush_order_clause_and_list : Error<
10730  "'flush' directive with memory order clause '%0' cannot have the list">;
10731def note_omp_flush_order_clause_here : Note<
10732  "memory order clause '%0' is specified here">;
10733def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
10734  "expected addressable lvalue in '%0' clause">;
10735def err_omp_var_expected : Error<
10736  "expected variable of the '%0' type%select{|, not %2}1">;
10737def warn_unknown_declare_variant_isa_trait
10738    : Warning<"isa trait '%0' is not known to the current target; verify the "
10739              "spelling or consider restricting the context selector with the "
10740              "'arch' selector further">,
10741      InGroup<SourceUsesOpenMP>;
10742def err_omp_non_pointer_type_array_shaping_base : Error<
10743  "expected expression with a pointer to a complete type as a base of an array "
10744  "shaping operation">;
10745def err_omp_reduction_task_not_parallel_or_worksharing : Error<
10746  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
10747  " worksharing constructs">;
10748def err_omp_expected_array_alloctraits : Error<
10749  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
10750def err_omp_predefined_allocator_with_traits : Error<
10751  "predefined allocator cannot have traits specified">;
10752def note_omp_predefined_allocator : Note<
10753  "predefined trait '%0' used here">;
10754def err_omp_nonpredefined_allocator_without_traits : Error<
10755  "non-predefined allocator must have traits specified">;
10756def err_omp_allocator_used_in_clauses : Error<
10757  "allocators used in 'uses_allocators' clause cannot appear in other "
10758  "data-sharing or data-mapping attribute clauses">;
10759def err_omp_allocator_not_in_uses_allocators : Error<
10760  "allocator must be specified in the 'uses_allocators' clause">;
10761def note_omp_protected_structured_block
10762    : Note<"jump bypasses OpenMP structured block">;
10763def note_omp_exits_structured_block
10764    : Note<"jump exits scope of OpenMP structured block">;
10765def err_omp_interop_variable_expected : Error<
10766  "expected%select{| non-const}0 variable of type 'omp_interop_t'">;
10767def err_omp_interop_variable_wrong_type : Error<
10768  "interop variable must be of type 'omp_interop_t'">;
10769def err_omp_interop_prefer_type : Error<
10770  "prefer_list item must be a string literal or constant integral "
10771  "expression">;
10772def err_omp_interop_bad_depend_clause : Error<
10773  "'depend' clause requires the 'targetsync' interop type">;
10774def err_omp_interop_var_multiple_actions : Error<
10775  "interop variable %0 used in multiple action clauses">;
10776def err_omp_dispatch_statement_call
10777    : Error<"statement after '#pragma omp dispatch' must be a direct call"
10778            " to a target function or an assignment to one">;
10779def err_omp_unroll_full_variable_trip_count : Error<
10780  "loop to be fully unrolled must have a constant trip count">;
10781def note_omp_directive_here : Note<"'%0' directive found here">;
10782} // end of OpenMP category
10783
10784let CategoryName = "Related Result Type Issue" in {
10785// Objective-C related result type compatibility
10786def warn_related_result_type_compatibility_class : Warning<
10787  "method is expected to return an instance of its class type "
10788  "%diff{$, but is declared to return $|"
10789  ", but is declared to return different type}0,1">;
10790def warn_related_result_type_compatibility_protocol : Warning<
10791  "protocol method is expected to return an instance of the implementing "
10792  "class, but is declared to return %0">;
10793def note_related_result_type_family : Note<
10794  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
10795  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
10796  "self}1' method family%select{| and is expected to return an instance of its "
10797  "class type}0">;
10798def note_related_result_type_overridden : Note<
10799  "overridden method returns an instance of its class type">;
10800def note_related_result_type_inferred : Note<
10801  "%select{class|instance}0 method %1 is assumed to return an instance of "
10802  "its receiver type (%2)">;
10803def note_related_result_type_explicit : Note<
10804  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
10805  "%select{| and is expected to return an instance of its class type}0">;
10806def err_invalid_type_for_program_scope_var : Error<
10807  "the %0 type cannot be used to declare a program scope variable">;
10808
10809}
10810
10811let CategoryName = "Modules Issue" in {
10812def err_module_decl_in_module_map_module : Error<
10813  "'module' declaration found while building module from module map">;
10814def err_module_decl_in_header_module : Error<
10815  "'module' declaration found while building header unit">;
10816def err_module_interface_implementation_mismatch : Error<
10817  "missing 'export' specifier in module declaration while "
10818  "building module interface">;
10819def err_current_module_name_mismatch : Error<
10820  "module name '%0' specified on command line does not match name of module">;
10821def err_module_redefinition : Error<
10822  "redefinition of module '%0'">;
10823def note_prev_module_definition : Note<"previously defined here">;
10824def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
10825def err_module_not_defined : Error<
10826  "definition of module '%0' is not available; use -fmodule-file= to specify "
10827  "path to precompiled module interface">;
10828def err_module_redeclaration : Error<
10829  "translation unit contains multiple module declarations">;
10830def note_prev_module_declaration : Note<"previous module declaration is here">;
10831def err_module_declaration_missing : Error<
10832  "missing 'export module' declaration in module interface unit">;
10833def err_module_declaration_missing_after_global_module_introducer : Error<
10834  "missing 'module' declaration at end of global module fragment "
10835  "introduced here">;
10836def err_module_private_specialization : Error<
10837  "%select{template|partial|member}0 specialization cannot be "
10838  "declared __module_private__">;
10839def err_module_private_local : Error<
10840  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
10841  "__module_private__">;
10842def err_module_private_local_class : Error<
10843  "local %select{struct|interface|union|class|enum}0 cannot be declared "
10844  "__module_private__">;
10845def err_module_unimported_use : Error<
10846  "%select{declaration|definition|default argument|"
10847  "explicit specialization|partial specialization}0 of %1 must be imported "
10848  "from module '%2' before it is required">;
10849def err_module_unimported_use_header : Error<
10850  "%select{missing '#include'|missing '#include %3'}2; "
10851  "%select{||default argument of |explicit specialization of |"
10852  "partial specialization of }0%1 must be "
10853  "%select{declared|defined|defined|declared|declared}0 "
10854  "before it is used">;
10855def err_module_unimported_use_multiple : Error<
10856  "%select{declaration|definition|default argument|"
10857  "explicit specialization|partial specialization}0 of %1 must be imported "
10858  "from one of the following modules before it is required:%2">;
10859def note_unreachable_entity : Note<
10860  "%select{declaration|definition|default argument declared|"
10861  "explicit specialization declared|partial specialization declared}0 here "
10862  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
10863def ext_module_import_in_extern_c : ExtWarn<
10864  "import of C++ module '%0' appears within extern \"C\" language linkage "
10865  "specification">, DefaultError,
10866  InGroup<DiagGroup<"module-import-in-extern-c">>;
10867def err_module_import_not_at_top_level_fatal : Error<
10868  "import of module '%0' appears within %1">, DefaultFatal;
10869def ext_module_import_not_at_top_level_noop : ExtWarn<
10870  "redundant #include of module '%0' appears within %1">, DefaultError,
10871  InGroup<DiagGroup<"modules-import-nested-redundant">>;
10872def note_module_import_not_at_top_level : Note<"%0 begins here">;
10873def err_module_self_import : Error<
10874  "import of module '%0' appears within same top-level module '%1'">;
10875def err_module_import_in_implementation : Error<
10876  "@import of module '%0' in implementation of '%1'; use #import">;
10877
10878// C++ Modules
10879def err_module_decl_not_at_start : Error<
10880  "module declaration must occur at the start of the translation unit">;
10881def note_global_module_introducer_missing : Note<
10882  "add 'module;' to the start of the file to introduce a "
10883  "global module fragment">;
10884def err_export_within_anonymous_namespace : Error<
10885  "export declaration appears within anonymous namespace">;
10886def note_anonymous_namespace : Note<"anonymous namespace begins here">;
10887def ext_export_no_name_block : ExtWarn<
10888  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
10889  "to appear in an export block">, InGroup<ExportUnnamed>;
10890def ext_export_no_names : ExtWarn<
10891  "ISO C++20 does not permit a declaration that does not introduce any names "
10892  "to be exported">, InGroup<ExportUnnamed>;
10893def note_export : Note<"export block begins here">;
10894def err_export_no_name : Error<
10895  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
10896def ext_export_using_directive : ExtWarn<
10897  "ISO C++20 does not permit using directive to be exported">,
10898  InGroup<DiagGroup<"export-using-directive">>;
10899def err_export_within_export : Error<
10900  "export declaration appears within another export declaration">;
10901def err_export_internal : Error<
10902  "declaration of %0 with internal linkage cannot be exported">;
10903def err_export_using_internal : Error<
10904  "using declaration referring to %0 with internal linkage cannot be exported">;
10905def err_export_not_in_module_interface : Error<
10906  "export declaration can only be used within a module interface unit"
10907  "%select{ after the module declaration|}0">;
10908def err_export_in_private_module_fragment : Error<
10909  "export declaration cannot be used in a private module fragment">;
10910def note_private_module_fragment : Note<
10911  "private module fragment begins here">;
10912def err_private_module_fragment_not_module : Error<
10913  "private module fragment declaration with no preceding module declaration">;
10914def err_private_module_fragment_redefined : Error<
10915  "private module fragment redefined">;
10916def err_private_module_fragment_not_module_interface : Error<
10917  "private module fragment in module implementation unit">;
10918def note_not_module_interface_add_export : Note<
10919  "add 'export' here if this is intended to be a module interface unit">;
10920
10921def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
10922  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
10923  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
10924def note_equivalent_internal_linkage_decl : Note<
10925  "declared here%select{ in module '%1'|}0">;
10926
10927def note_redefinition_modules_same_file : Note<
10928  "'%0' included multiple times, additional include site in header from module '%1'">;
10929def note_redefinition_include_same_file : Note<
10930  "'%0' included multiple times, additional include site here">;
10931}
10932
10933let CategoryName = "Coroutines Issue" in {
10934def err_return_in_coroutine : Error<
10935  "return statement not allowed in coroutine; did you mean 'co_return'?">;
10936def note_declared_coroutine_here : Note<
10937  "function is a coroutine due to use of '%0' here">;
10938def err_coroutine_objc_method : Error<
10939  "Objective-C methods as coroutines are not yet supported">;
10940def err_coroutine_unevaluated_context : Error<
10941  "'%0' cannot be used in an unevaluated context">;
10942def err_coroutine_within_handler : Error<
10943  "'%0' cannot be used in the handler of a try block">;
10944def err_coroutine_outside_function : Error<
10945  "'%0' cannot be used outside a function">;
10946def err_coroutine_invalid_func_context : Error<
10947  "'%1' cannot be used in %select{a constructor|a destructor"
10948  "|the 'main' function|a constexpr function"
10949  "|a function with a deduced return type|a varargs function"
10950  "|a consteval function}0">;
10951def err_implied_coroutine_type_not_found : Error<
10952  "%0 type was not found; include <experimental/coroutine> before defining "
10953  "a coroutine">;
10954def err_implicit_coroutine_std_nothrow_type_not_found : Error<
10955  "std::nothrow was not found; include <new> before defining a coroutine which "
10956  "uses get_return_object_on_allocation_failure()">;
10957def err_malformed_std_nothrow : Error<
10958  "std::nothrow must be a valid variable declaration">;
10959def err_malformed_std_coroutine_handle : Error<
10960  "std::experimental::coroutine_handle must be a class template">;
10961def err_coroutine_handle_missing_member : Error<
10962  "std::experimental::coroutine_handle missing a member named '%0'">;
10963def err_malformed_std_coroutine_traits : Error<
10964  "'std::experimental::coroutine_traits' must be a class template">;
10965def err_implied_std_coroutine_traits_promise_type_not_found : Error<
10966  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
10967def err_implied_std_coroutine_traits_promise_type_not_class : Error<
10968  "this function cannot be a coroutine: %0 is not a class">;
10969def err_coroutine_promise_type_incomplete : Error<
10970  "this function cannot be a coroutine: %0 is an incomplete type">;
10971def err_coroutine_type_missing_specialization : Error<
10972  "this function cannot be a coroutine: missing definition of "
10973  "specialization %0">;
10974def err_coroutine_promise_incompatible_return_functions : Error<
10975  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
10976def err_coroutine_promise_requires_return_function : Error<
10977  "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
10978def note_coroutine_promise_implicit_await_transform_required_here : Note<
10979  "call to 'await_transform' implicitly required by 'co_await' here">;
10980def note_coroutine_promise_suspend_implicitly_required : Note<
10981  "call to '%select{initial_suspend|final_suspend}0' implicitly "
10982  "required by the %select{initial suspend point|final suspend point}0">;
10983def err_coroutine_promise_unhandled_exception_required : Error<
10984  "%0 is required to declare the member 'unhandled_exception()'">;
10985def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
10986  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
10987  InGroup<CoroutineMissingUnhandledException>;
10988def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
10989  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
10990def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
10991  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
10992def err_coroutine_promise_new_requires_nothrow : Error<
10993  "%0 is required to have a non-throwing noexcept specification when the promise "
10994   "type declares 'get_return_object_on_allocation_failure()'">;
10995def note_coroutine_promise_call_implicitly_required : Note<
10996  "call to %0 implicitly required by coroutine function here">;
10997def err_await_suspend_invalid_return_type : Error<
10998  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
10999>;
11000def note_await_ready_no_bool_conversion : Note<
11001  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
11002>;
11003def warn_coroutine_handle_address_invalid_return_type : Warning <
11004  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">,
11005  InGroup<Coroutine>;
11006def err_coroutine_promise_final_suspend_requires_nothrow : Error<
11007  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
11008>;
11009def note_coroutine_function_declare_noexcept : Note<
11010  "must be declared with 'noexcept'"
11011>;
11012} // end of coroutines issue category
11013
11014let CategoryName = "Documentation Issue" in {
11015def warn_not_a_doxygen_trailing_member_comment : Warning<
11016  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
11017} // end of documentation issue category
11018
11019let CategoryName = "Nullability Issue" in {
11020
11021def warn_mismatched_nullability_attr : Warning<
11022  "nullability specifier %0 conflicts with existing specifier %1">,
11023  InGroup<Nullability>;
11024
11025def warn_nullability_declspec : Warning<
11026  "nullability specifier %0 cannot be applied "
11027  "to non-pointer type %1; did you mean to apply the specifier to the "
11028  "%select{pointer|block pointer|member pointer|function pointer|"
11029  "member function pointer}2?">,
11030  InGroup<NullabilityDeclSpec>,
11031  DefaultError;
11032
11033def note_nullability_here : Note<"%0 specified here">;
11034
11035def err_nullability_nonpointer : Error<
11036  "nullability specifier %0 cannot be applied to non-pointer type %1">;
11037
11038def warn_nullability_lost : Warning<
11039  "implicit conversion from nullable pointer %0 to non-nullable pointer "
11040  "type %1">,
11041  InGroup<NullableToNonNullConversion>, DefaultIgnore;
11042def warn_zero_as_null_pointer_constant : Warning<
11043  "zero as null pointer constant">,
11044  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
11045
11046def err_nullability_cs_multilevel : Error<
11047  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
11048def note_nullability_type_specifier : Note<
11049  "use nullability type specifier %0 to affect the innermost "
11050  "pointer type of %1">;
11051
11052def warn_null_resettable_setter : Warning<
11053  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
11054  InGroup<Nullability>;
11055
11056def warn_nullability_missing : Warning<
11057  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
11058  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
11059  InGroup<NullabilityCompleteness>;
11060def warn_nullability_missing_array : Warning<
11061  "array parameter is missing a nullability type specifier (_Nonnull, "
11062  "_Nullable, or _Null_unspecified)">,
11063  InGroup<NullabilityCompletenessOnArrays>;
11064def note_nullability_fix_it : Note<
11065  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
11066  "%select{pointer|block pointer|member pointer|array parameter}1 "
11067  "%select{should never be null|may be null|should not declare nullability}0">;
11068
11069def warn_nullability_inferred_on_nested_type : Warning<
11070  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
11071  "deprecated">,
11072  InGroup<NullabilityInferredOnNestedType>;
11073
11074def err_objc_type_arg_explicit_nullability : Error<
11075  "type argument %0 cannot explicitly specify nullability">;
11076
11077def err_objc_type_param_bound_explicit_nullability : Error<
11078  "type parameter %0 bound %1 cannot explicitly specify nullability">;
11079
11080}
11081
11082let CategoryName = "Generics Issue" in {
11083
11084def err_objc_type_param_bound_nonobject : Error<
11085  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
11086
11087def err_objc_type_param_bound_missing_pointer : Error<
11088  "missing '*' in type bound %0 for type parameter %1">;
11089def err_objc_type_param_bound_qualified : Error<
11090  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
11091
11092def err_objc_type_param_redecl : Error<
11093  "redeclaration of type parameter %0">;
11094
11095def err_objc_type_param_arity_mismatch : Error<
11096  "%select{forward class declaration|class definition|category|extension}0 has "
11097  "too %select{few|many}1 type parameters (expected %2, have %3)">;
11098
11099def err_objc_type_param_bound_conflict : Error<
11100  "type bound %0 for type parameter %1 conflicts with "
11101  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
11102
11103def err_objc_type_param_variance_conflict : Error<
11104  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
11105  "%select{in|co|contra}2variant type parameter %3">;
11106
11107def note_objc_type_param_here : Note<"type parameter %0 declared here">;
11108
11109def err_objc_type_param_bound_missing : Error<
11110  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
11111
11112def err_objc_parameterized_category_nonclass : Error<
11113  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
11114  "parameters">;
11115
11116def err_objc_parameterized_forward_class : Error<
11117  "forward declaration of non-parameterized class %0 cannot have type "
11118  "parameters">;
11119
11120def err_objc_parameterized_forward_class_first : Error<
11121  "class %0 previously declared with type parameters">;
11122
11123def err_objc_type_arg_missing_star : Error<
11124  "type argument %0 must be a pointer (requires a '*')">;
11125def err_objc_type_arg_qualified : Error<
11126  "type argument %0 cannot be qualified with '%1'">;
11127
11128def err_objc_type_arg_missing : Error<
11129  "no type or protocol named %0">;
11130
11131def err_objc_type_args_and_protocols : Error<
11132  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
11133  "%select{protocol|type}0 (%2)">;
11134
11135def err_objc_type_args_non_class : Error<
11136  "type arguments cannot be applied to non-class type %0">;
11137
11138def err_objc_type_args_non_parameterized_class : Error<
11139  "type arguments cannot be applied to non-parameterized class %0">;
11140
11141def err_objc_type_args_specialized_class : Error<
11142  "type arguments cannot be applied to already-specialized class type %0">;
11143
11144def err_objc_type_args_wrong_arity : Error<
11145  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
11146}
11147
11148def err_objc_type_arg_not_id_compatible : Error<
11149  "type argument %0 is neither an Objective-C object nor a block type">;
11150
11151def err_objc_type_arg_does_not_match_bound : Error<
11152  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
11153
11154def warn_objc_redundant_qualified_class_type : Warning<
11155  "parameterized class %0 already conforms to the protocols listed; did you "
11156  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
11157
11158def warn_block_literal_attributes_on_omitted_return_type : Warning<
11159  "attribute %0 ignored, because it cannot be applied to omitted return type">,
11160  InGroup<IgnoredAttributes>;
11161
11162def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
11163  "'%0' qualifier on omitted return type %1 has no effect">,
11164  InGroup<IgnoredQualifiers>;
11165
11166def warn_shadow_field : Warning<
11167  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
11168  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
11169def note_shadow_field : Note<"declared here">;
11170
11171def err_multiversion_required_in_redecl : Error<
11172  "function declaration is missing %select{'target'|'cpu_specific' or "
11173  "'cpu_dispatch'}0 attribute in a multiversioned function">;
11174def note_multiversioning_caused_here : Note<
11175  "function multiversioning caused by this declaration">;
11176def err_multiversion_after_used : Error<
11177  "function declaration cannot become a multiversioned function after first "
11178  "usage">;
11179def err_bad_multiversion_option : Error<
11180  "function multiversioning doesn't support %select{feature|architecture}0 "
11181  "'%1'">;
11182def err_multiversion_duplicate : Error<
11183  "multiversioned function redeclarations require identical target attributes">;
11184def err_multiversion_noproto : Error<
11185  "multiversioned function must have a prototype">;
11186def err_multiversion_disallowed_other_attr : Error<
11187  "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined"
11188  " with attribute %1">;
11189def err_multiversion_mismatched_attrs
11190    : Error<"attributes on multiversioned functions must all match, attribute "
11191            "%0 %select{is missing|has different arguments}1">;
11192def err_multiversion_diff : Error<
11193  "multiversioned function declaration has a different %select{calling convention"
11194  "|return type|constexpr specification|inline specification|storage class|"
11195  "linkage}0">;
11196def err_multiversion_doesnt_support : Error<
11197  "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not "
11198  "yet support %select{function templates|virtual functions|"
11199  "deduced return types|constructors|destructors|deleted functions|"
11200  "defaulted functions|constexpr functions|consteval function}1">;
11201def err_multiversion_not_allowed_on_main : Error<
11202  "'main' cannot be a multiversioned function">;
11203def err_multiversion_not_supported : Error<
11204 "function multiversioning is not supported on the current target">;
11205def err_multiversion_types_mixed : Error<
11206  "multiversioning attributes cannot be combined">;
11207def err_cpu_dispatch_mismatch : Error<
11208 "'cpu_dispatch' function redeclared with different CPUs">;
11209def err_cpu_specific_multiple_defs : Error<
11210 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
11211def warn_multiversion_duplicate_entries : Warning<
11212 "CPU list contains duplicate entries; attribute ignored">,
11213  InGroup<FunctionMultiVersioning>;
11214def warn_dispatch_body_ignored : Warning<
11215  "body of cpu_dispatch function will be ignored">,
11216  InGroup<FunctionMultiVersioning>;
11217
11218// three-way comparison operator diagnostics
11219def err_implied_comparison_category_type_not_found : Error<
11220  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
11221  "because type '%0' was not found; include <compare>">;
11222def err_spaceship_argument_narrowing : Error<
11223  "argument to 'operator<=>' "
11224  "%select{cannot be narrowed from type %1 to %2|"
11225  "evaluates to %1, which cannot be narrowed to type %2}0">;
11226def err_std_compare_type_not_supported : Error<
11227  "standard library implementation of %0 is not supported; "
11228   "%select{member '%2' does not have expected form|"
11229   "member '%2' is missing|"
11230   "the type is not trivially copyable|"
11231   "the type does not have the expected form}1">;
11232def note_rewriting_operator_as_spaceship : Note<
11233  "while rewriting comparison as call to 'operator<=>' declared here">;
11234def err_three_way_vector_comparison : Error<
11235  "three-way comparison between vectors is not supported">;
11236
11237// Memory Tagging Extensions (MTE) diagnostics
11238def err_memtag_arg_null_or_pointer : Error<
11239  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
11240def err_memtag_any2arg_pointer : Error<
11241  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
11242def err_memtag_arg_must_be_pointer : Error<
11243  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
11244def err_memtag_arg_must_be_integer : Error<
11245  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
11246
11247def warn_dereference_of_noderef_type : Warning<
11248  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
11249def warn_dereference_of_noderef_type_no_decl : Warning<
11250  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
11251def warn_noderef_on_non_pointer_or_array : Warning<
11252  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
11253def warn_noderef_to_dereferenceable_pointer : Warning<
11254  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
11255
11256def err_builtin_launder_invalid_arg : Error<
11257  "%select{non-pointer|function pointer|void pointer}0 argument to "
11258  "'__builtin_launder' is not allowed">;
11259
11260def err_builtin_matrix_disabled: Error<
11261  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
11262def err_matrix_index_not_integer: Error<
11263  "matrix %select{row|column}0 index is not an integer">;
11264def err_matrix_index_outside_range: Error<
11265  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
11266def err_matrix_incomplete_index: Error<
11267  "single subscript expressions are not allowed for matrix values">;
11268def err_matrix_separate_incomplete_index: Error<
11269  "matrix row and column subscripts cannot be separated by any expression">;
11270def err_matrix_subscript_comma: Error<
11271  "comma expressions are not allowed as indices in matrix subscript expressions">;
11272def err_builtin_matrix_arg: Error<"1st argument must be a matrix">;
11273def err_builtin_matrix_scalar_unsigned_arg: Error<
11274  "%0 argument must be a constant unsigned integer expression">;
11275def err_builtin_matrix_pointer_arg: Error<
11276  "%ordinal0 argument must be a pointer to a valid matrix element type">;
11277def err_builtin_matrix_pointer_arg_mismatch: Error<
11278  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
11279def err_builtin_matrix_store_to_const: Error<
11280  "cannot store matrix to read-only pointer">;
11281def err_builtin_matrix_stride_too_small: Error<
11282  "stride must be greater or equal to the number of rows">;
11283def err_builtin_matrix_invalid_dimension: Error<
11284  "%0 dimension is outside the allowed range [1, %1]">;
11285
11286def warn_mismatched_import : Warning<
11287  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
11288  "previous declaration">,
11289  InGroup<IgnoredAttributes>;
11290def warn_import_on_definition : Warning<
11291  "import %select{module|name}0 cannot be applied to a function with a definition">,
11292  InGroup<IgnoredAttributes>;
11293
11294def err_preserve_field_info_not_field : Error<
11295  "__builtin_preserve_field_info argument %0 not a field access">;
11296def err_preserve_field_info_not_const: Error<
11297  "__builtin_preserve_field_info argument %0 not a constant">;
11298def err_btf_type_id_not_const: Error<
11299  "__builtin_btf_type_id argument %0 not a constant">;
11300def err_preserve_type_info_invalid : Error<
11301  "__builtin_preserve_type_info argument %0 invalid">;
11302def err_preserve_type_info_not_const: Error<
11303  "__builtin_preserve_type_info argument %0 not a constant">;
11304def err_preserve_enum_value_invalid : Error<
11305  "__builtin_preserve_enum_value argument %0 invalid">;
11306def err_preserve_enum_value_not_const: Error<
11307  "__builtin_preserve_enum_value argument %0 not a constant">;
11308
11309def err_bit_cast_non_trivially_copyable : Error<
11310  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
11311def err_bit_cast_type_size_mismatch : Error<
11312  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
11313
11314// SYCL-specific diagnostics
11315def warn_sycl_kernel_num_of_template_params : Warning<
11316  "'sycl_kernel' attribute only applies to a function template with at least"
11317  " two template parameters">, InGroup<IgnoredAttributes>;
11318def warn_sycl_kernel_invalid_template_param_type : Warning<
11319  "template parameter of a function template with the 'sycl_kernel' attribute"
11320  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
11321def warn_sycl_kernel_num_of_function_params : Warning<
11322  "function template with 'sycl_kernel' attribute must have a single parameter">,
11323  InGroup<IgnoredAttributes>;
11324def warn_sycl_kernel_return_type : Warning<
11325  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
11326  InGroup<IgnoredAttributes>;
11327
11328def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must "
11329                                 "have a bit size of at least %select{2|1}0">;
11330def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit "
11331                                 "sizes greater than %1 not supported">;
11332
11333// errors of expect.with.probability
11334def err_probability_not_constant_float : Error<
11335   "probability argument to __builtin_expect_with_probability must be constant "
11336   "floating-point expression">;
11337def err_probability_out_of_range : Error<
11338   "probability argument to __builtin_expect_with_probability is outside the "
11339   "range [0.0, 1.0]">;
11340
11341// TCB warnings
11342def err_tcb_conflicting_attributes : Error<
11343  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
11344def warn_tcb_enforcement_violation : Warning<
11345  "calling %0 is a violation of trusted computing base '%1'">,
11346  InGroup<DiagGroup<"tcb-enforcement">>;
11347
11348// RISC-V builtin required extension warning
11349def err_riscv_builtin_requires_extension : Error<
11350  "builtin requires '%0' extension support to be enabled">;
11351def err_riscv_builtin_invalid_lmul : Error<
11352  "LMUL argument must be in the range [0,3] or [5,7]">;
11353} // end of sema component.
11354