xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td (revision 79ac3c12a714bcd3f2354c52d948aed9575c46d6)
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|constexpr if condition|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|constexpr if condition|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 cl_khr_fp64, casting to single precision">;
122def err_half_const_requires_fp16 : Error<
123  "half precision constant requires cl_khr_fp16">;
124
125// C99 variable-length arrays
126def ext_vla : Extension<"variable length arrays are a C99 feature">,
127  InGroup<VLAExtension>;
128def warn_vla_used : Warning<"variable length array used">,
129  InGroup<VLA>, DefaultIgnore;
130def err_vla_in_sfinae : Error<
131  "variable length array cannot be formed during template argument deduction">;
132def err_array_star_in_function_definition : Error<
133  "variable length array must be bound in function definition">;
134def err_vla_decl_in_file_scope : Error<
135  "variable length array declaration not allowed at file scope">;
136def err_vla_decl_has_static_storage : Error<
137  "variable length array declaration cannot have 'static' storage duration">;
138def err_vla_decl_has_extern_linkage : Error<
139  "variable length array declaration cannot have 'extern' linkage">;
140def ext_vla_folded_to_constant : ExtWarn<
141  "variable length array folded to constant array as an extension">,
142  InGroup<GNUFoldingConstant>;
143def err_vla_unsupported : Error<
144  "variable length arrays are not supported for the current target">;
145def note_vla_unsupported : Note<
146  "variable length arrays are not supported for the current target">;
147
148// C99 variably modified types
149def err_variably_modified_template_arg : Error<
150  "variably modified type %0 cannot be used as a template argument">;
151def err_variably_modified_nontype_template_param : Error<
152  "non-type template parameter of variably modified type %0">;
153def err_variably_modified_new_type : Error<
154  "'new' cannot allocate object of variably modified type %0">;
155
156// C99 Designated Initializers
157def ext_designated_init : Extension<
158  "designated initializers are a C99 feature">, InGroup<C99Designator>;
159def err_array_designator_negative : Error<
160  "array designator value '%0' is negative">;
161def err_array_designator_empty_range : Error<
162  "array designator range [%0, %1] is empty">;
163def err_array_designator_non_array : Error<
164  "array designator cannot initialize non-array type %0">;
165def err_array_designator_too_large : Error<
166  "array designator index (%0) exceeds array bounds (%1)">;
167def err_field_designator_non_aggr : Error<
168  "field designator cannot initialize a "
169  "%select{non-struct, non-union|non-class}0 type %1">;
170def err_field_designator_unknown : Error<
171  "field designator %0 does not refer to any field in type %1">;
172def err_field_designator_nonfield : Error<
173  "field designator %0 does not refer to a non-static data member">;
174def note_field_designator_found : Note<"field designator refers here">;
175def err_designator_for_scalar_or_sizeless_init : Error<
176  "designator in initializer for %select{scalar|indivisible sizeless}0 "
177  "type %1">;
178def warn_initializer_overrides : Warning<
179  "initializer %select{partially |}0overrides prior initialization of "
180  "this subobject">, InGroup<InitializerOverrides>;
181def ext_initializer_overrides : ExtWarn<warn_initializer_overrides.Text>,
182  InGroup<InitializerOverrides>, SFINAEFailure;
183def err_initializer_overrides_destructed : Error<
184  "initializer would partially override prior initialization of object of "
185  "type %1 with non-trivial destruction">;
186def note_previous_initializer : Note<
187  "previous initialization %select{|with side effects }0is here"
188  "%select{| (side effects will not occur at run time)}0">;
189def err_designator_into_flexible_array_member : Error<
190  "designator into flexible array member subobject">;
191def note_flexible_array_member : Note<
192  "initialized flexible array member %0 is here">;
193def ext_flexible_array_init : Extension<
194  "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
195
196// C++20 designated initializers
197def ext_cxx_designated_init : Extension<
198  "designated initializers are a C++20 extension">, InGroup<CXX20Designator>;
199def warn_cxx17_compat_designated_init : Warning<
200  "designated initializers are incompatible with C++ standards before C++20">,
201  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
202def ext_designated_init_mixed : ExtWarn<
203  "mixture of designated and non-designated initializers in the same "
204  "initializer list is a C99 extension">, InGroup<C99Designator>;
205def note_designated_init_mixed : Note<
206  "first non-designated initializer is here">;
207def ext_designated_init_array : ExtWarn<
208  "array designators are a C99 extension">, InGroup<C99Designator>;
209def ext_designated_init_nested : ExtWarn<
210  "nested designators are a C99 extension">, InGroup<C99Designator>;
211def ext_designated_init_reordered : ExtWarn<
212  "ISO C++ requires field designators to be specified in declaration order; "
213  "field %1 will be initialized after field %0">, InGroup<ReorderInitList>,
214  SFINAEFailure;
215def note_previous_field_init : Note<
216  "previous initialization for field %0 is here">;
217
218// Declarations.
219def ext_plain_complex : ExtWarn<
220  "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
221def ext_imaginary_constant : Extension<
222  "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
223def ext_integer_complex : Extension<
224  "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
225
226def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
227  "'_Fract' or '_Accum', not '%0'">;
228def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
229def err_invalid_width_spec : Error<
230  "'%select{|short|long|long long}0 %1' is invalid">;
231def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
232
233def ext_auto_type_specifier : ExtWarn<
234  "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
235def warn_auto_storage_class : Warning<
236  "'auto' storage class specifier is redundant and incompatible with C++11">,
237  InGroup<CXX11Compat>, DefaultIgnore;
238
239def warn_deprecated_register : Warning<
240  "'register' storage class specifier is deprecated "
241  "and incompatible with C++17">, InGroup<DeprecatedRegister>;
242def ext_register_storage_class : ExtWarn<
243  "ISO C++17 does not allow 'register' storage class specifier">,
244  DefaultError, InGroup<Register>;
245
246def err_invalid_decl_spec_combination : Error<
247  "cannot combine with previous '%0' declaration specifier">;
248def err_invalid_vector_decl_spec_combination : Error<
249  "cannot combine with previous '%0' declaration specifier. "
250  "'__vector' must be first">;
251def err_invalid_pixel_decl_spec_combination : Error<
252  "'__pixel' must be preceded by '__vector'.  "
253  "'%0' declaration specifier not allowed here">;
254def err_invalid_vector_bool_decl_spec : Error<
255  "cannot use '%0' with '__vector bool'">;
256def err_invalid_vector_long_decl_spec : Error<
257  "cannot use 'long' with '__vector'">;
258def err_invalid_vector_float_decl_spec : Error<
259  "cannot use 'float' with '__vector'">;
260def err_invalid_vector_double_decl_spec : Error <
261  "use of 'double' with '__vector' requires VSX support to be enabled "
262  "(available on POWER7 or later)">;
263def err_invalid_vector_bool_int128_decl_spec : Error <
264  "use of '__int128' with '__vector bool' requires VSX support enabled (on "
265  "POWER10 or later)">;
266def err_invalid_vector_long_long_decl_spec : Error <
267  "use of 'long long' with '__vector bool' requires VSX support (available on "
268  "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
269  "to be enabled">;
270def err_invalid_vector_long_double_decl_spec : Error<
271  "cannot use 'long double' with '__vector'">;
272def warn_vector_long_decl_spec_combination : Warning<
273  "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
274
275def err_redeclaration_different_type : Error<
276  "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
277def err_bad_variable_name : Error<
278  "%0 cannot be the name of a variable or data member">;
279def err_bad_parameter_name : Error<
280  "%0 cannot be the name of a parameter">;
281def err_bad_parameter_name_template_id : Error<
282  "parameter name cannot have template arguments">;
283def ext_parameter_name_omitted_c2x : ExtWarn<
284  "omitting the parameter name in a function definition is a C2x extension">,
285  InGroup<C2x>;
286def err_anyx86_interrupt_attribute : Error<
287  "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
288  "have %select{a 'void' return type|"
289  "only a pointer parameter optionally followed by an integer parameter|"
290  "a pointer as the first parameter|a %2 type as the second parameter}1">;
291def err_anyx86_interrupt_called : Error<
292  "interrupt service routine cannot be called directly">;
293def warn_arm_interrupt_calling_convention : Warning<
294   "call to function without interrupt attribute could clobber interruptee's VFP registers">,
295   InGroup<Extra>;
296def warn_interrupt_attribute_invalid : Warning<
297   "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to "
298   "functions that have %select{no parameters|a 'void' return type}1">,
299   InGroup<IgnoredAttributes>;
300def warn_riscv_repeated_interrupt_attribute : Warning<
301  "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
302def note_riscv_repeated_interrupt_attribute : Note<
303  "repeated RISC-V 'interrupt' attribute is here">;
304def warn_unused_parameter : Warning<"unused parameter %0">,
305  InGroup<UnusedParameter>, DefaultIgnore;
306def warn_unused_variable : Warning<"unused variable %0">,
307  InGroup<UnusedVariable>, DefaultIgnore;
308def warn_unused_local_typedef : Warning<
309  "unused %select{typedef|type alias}0 %1">,
310  InGroup<UnusedLocalTypedef>, DefaultIgnore;
311def warn_unused_property_backing_ivar :
312  Warning<"ivar %0 which backs the property is not "
313  "referenced in this property's accessor">,
314  InGroup<UnusedPropertyIvar>, DefaultIgnore;
315def warn_unused_const_variable : Warning<"unused variable %0">,
316  InGroup<UnusedConstVariable>, DefaultIgnore;
317def warn_unused_exception_param : Warning<"unused exception parameter %0">,
318  InGroup<UnusedExceptionParameter>, DefaultIgnore;
319def warn_decl_in_param_list : Warning<
320  "declaration of %0 will not be visible outside of this function">,
321  InGroup<Visibility>;
322def warn_redefinition_in_param_list : Warning<
323  "redefinition of %0 will not be visible outside of this function">,
324  InGroup<Visibility>;
325def warn_empty_parens_are_function_decl : Warning<
326  "empty parentheses interpreted as a function declaration">,
327  InGroup<VexingParse>;
328def warn_parens_disambiguated_as_function_declaration : Warning<
329  "parentheses were disambiguated as a function declaration">,
330  InGroup<VexingParse>;
331def warn_parens_disambiguated_as_variable_declaration : Warning<
332  "parentheses were disambiguated as redundant parentheses around declaration "
333  "of variable named %0">, InGroup<VexingParse>;
334def warn_redundant_parens_around_declarator : Warning<
335  "redundant parentheses surrounding declarator">,
336  InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
337def note_additional_parens_for_variable_declaration : Note<
338  "add a pair of parentheses to declare a variable">;
339def note_raii_guard_add_name : Note<
340  "add a variable name to declare a %0 initialized with %1">;
341def note_function_style_cast_add_parentheses : Note<
342  "add enclosing parentheses to perform a function-style cast">;
343def note_remove_parens_for_variable_declaration : Note<
344  "remove parentheses to silence this warning">;
345def note_empty_parens_function_call : Note<
346  "change this ',' to a ';' to call %0">;
347def note_empty_parens_default_ctor : Note<
348  "remove parentheses to declare a variable">;
349def note_empty_parens_zero_initialize : Note<
350  "replace parentheses with an initializer to declare a variable">;
351def warn_unused_function : Warning<"unused function %0">,
352  InGroup<UnusedFunction>, DefaultIgnore;
353def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
354  InGroup<UnusedTemplate>, DefaultIgnore;
355def warn_unused_member_function : Warning<"unused member function %0">,
356  InGroup<UnusedMemberFunction>, DefaultIgnore;
357def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
358  InGroup<UsedButMarkedUnused>, DefaultIgnore;
359def warn_unneeded_internal_decl : Warning<
360  "%select{function|variable}0 %1 is not needed and will not be emitted">,
361  InGroup<UnneededInternalDecl>, DefaultIgnore;
362def warn_unneeded_static_internal_decl : Warning<
363  "'static' function %0 declared in header file "
364  "should be declared 'static inline'">,
365  InGroup<UnneededInternalDecl>, DefaultIgnore;
366def warn_unneeded_member_function : Warning<
367  "member function %0 is not needed and will not be emitted">,
368  InGroup<UnneededMemberFunction>, DefaultIgnore;
369def warn_unused_private_field: Warning<"private field %0 is not used">,
370  InGroup<UnusedPrivateField>, DefaultIgnore;
371def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
372  "%select{used|required to be captured for this use}1">,
373  InGroup<UnusedLambdaCapture>, DefaultIgnore;
374
375def warn_parameter_size: Warning<
376  "%0 is a large (%1 bytes) pass-by-value argument; "
377  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
378def warn_return_value_size: Warning<
379  "return value of %0 is a large (%1 bytes) pass-by-value object; "
380  "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
381def warn_return_value_udt: Warning<
382  "%0 has C-linkage specified, but returns user-defined type %1 which is "
383  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
384def warn_return_value_udt_incomplete: Warning<
385  "%0 has C-linkage specified, but returns incomplete type %1 which could be "
386  "incompatible with C">, InGroup<ReturnTypeCLinkage>;
387def warn_implicit_function_decl : Warning<
388  "implicit declaration of function %0">,
389  InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
390def ext_implicit_function_decl : ExtWarn<
391  "implicit declaration of function %0 is invalid in C99">,
392  InGroup<ImplicitFunctionDeclare>;
393def note_function_suggestion : Note<"did you mean %0?">;
394
395def err_ellipsis_first_param : Error<
396  "ISO C requires a named parameter before '...'">;
397def err_declarator_need_ident : Error<"declarator requires an identifier">;
398def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
399def err_language_linkage_spec_not_ascii : Error<
400  "string literal in language linkage specifier cannot have an "
401  "encoding-prefix">;
402def ext_use_out_of_scope_declaration : ExtWarn<
403  "use of out-of-scope declaration of %0%select{| whose type is not "
404  "compatible with that of an implicit declaration}1">,
405  InGroup<DiagGroup<"out-of-scope-function">>;
406def err_inline_non_function : Error<
407  "'inline' can only appear on functions%select{| and non-local variables}0">;
408def err_noreturn_non_function : Error<
409  "'_Noreturn' can only appear on functions">;
410def warn_qual_return_type : Warning<
411  "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
412  InGroup<IgnoredQualifiers>, DefaultIgnore;
413def warn_deprecated_redundant_constexpr_static_def : Warning<
414  "out-of-line definition of constexpr static data member is redundant "
415  "in C++17 and is deprecated">,
416  InGroup<Deprecated>, DefaultIgnore;
417
418def warn_decl_shadow :
419  Warning<"declaration shadows a %select{"
420          "local variable|"
421          "variable in %2|"
422          "static data member of %2|"
423          "field of %2|"
424          "typedef in %2|"
425          "type alias in %2}1">,
426  InGroup<Shadow>, DefaultIgnore;
427def warn_decl_shadow_uncaptured_local :
428  Warning<warn_decl_shadow.Text>,
429  InGroup<ShadowUncapturedLocal>, DefaultIgnore;
430def warn_ctor_parm_shadows_field:
431  Warning<"constructor parameter %0 shadows the field %1 of %2">,
432  InGroup<ShadowFieldInConstructor>, DefaultIgnore;
433def warn_modifying_shadowing_decl :
434  Warning<"modifying constructor parameter %0 that shadows a "
435          "field of %1">,
436  InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
437
438// C++ decomposition declarations
439def err_decomp_decl_context : Error<
440  "decomposition declaration not permitted in this context">;
441def warn_cxx14_compat_decomp_decl : Warning<
442  "decomposition declarations are incompatible with "
443  "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
444def ext_decomp_decl : ExtWarn<
445  "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
446def ext_decomp_decl_cond : ExtWarn<
447  "ISO C++17 does not permit structured binding declaration in a condition">,
448  InGroup<DiagGroup<"binding-in-condition">>;
449def err_decomp_decl_spec : Error<
450  "decomposition declaration cannot be declared "
451  "%plural{1:'%1'|:with '%1' specifiers}0">;
452def ext_decomp_decl_spec : ExtWarn<
453  "decomposition declaration declared "
454  "%plural{1:'%1'|:with '%1' specifiers}0 is a C++20 extension">,
455  InGroup<CXX20>;
456def warn_cxx17_compat_decomp_decl_spec : Warning<
457  "decomposition declaration declared "
458  "%plural{1:'%1'|:with '%1' specifiers}0 "
459  "is incompatible with C++ standards before C++20">,
460  InGroup<CXXPre20Compat>, DefaultIgnore;
461def err_decomp_decl_type : Error<
462  "decomposition declaration cannot be declared with type %0; "
463  "declared type must be 'auto' or reference to 'auto'">;
464def err_decomp_decl_parens : Error<
465  "decomposition declaration cannot be declared with parentheses">;
466def err_decomp_decl_template : Error<
467  "decomposition declaration template not supported">;
468def err_decomp_decl_not_alone : Error<
469  "decomposition declaration must be the only declaration in its group">;
470def err_decomp_decl_requires_init : Error<
471  "decomposition declaration %0 requires an initializer">;
472def err_decomp_decl_wrong_number_bindings : Error<
473  "type %0 decomposes into %3 %plural{1:element|:elements}2, but "
474  "%select{%plural{0:no|:only %1}1|%1}4 "
475  "%plural{1:name was|:names were}1 provided">;
476def err_decomp_decl_unbindable_type : Error<
477  "cannot decompose %select{union|non-class, non-array}1 type %2">;
478def err_decomp_decl_multiple_bases_with_members : Error<
479  "cannot decompose class type %1: "
480  "%select{its base classes %2 and|both it and its base class}0 %3 "
481  "have non-static data members">;
482def err_decomp_decl_ambiguous_base : Error<
483  "cannot decompose members of ambiguous base class %1 of %0:%2">;
484def err_decomp_decl_inaccessible_base : Error<
485  "cannot decompose members of inaccessible base class %1 of %0">,
486  AccessControl;
487def err_decomp_decl_inaccessible_field : Error<
488  "cannot decompose %select{private|protected}0 member %1 of %3">,
489  AccessControl;
490def err_decomp_decl_lambda : Error<
491  "cannot decompose lambda closure type">;
492def err_decomp_decl_anon_union_member : Error<
493  "cannot decompose class type %0 because it has an anonymous "
494  "%select{struct|union}1 member">;
495def err_decomp_decl_std_tuple_element_not_specialized : Error<
496  "cannot decompose this type; 'std::tuple_element<%0>::type' "
497  "does not name a type">;
498def err_decomp_decl_std_tuple_size_not_constant : Error<
499  "cannot decompose this type; 'std::tuple_size<%0>::value' "
500  "is not a valid integral constant expression">;
501def note_in_binding_decl_init : Note<
502  "in implicit initialization of binding declaration %0">;
503
504def err_std_type_trait_not_class_template : Error<
505  "unsupported standard library implementation: "
506  "'std::%0' is not a class template">;
507
508// C++ using declarations
509def err_using_requires_qualname : Error<
510  "using declaration requires a qualified name">;
511def err_using_typename_non_type : Error<
512  "'typename' keyword used on a non-type">;
513def err_using_dependent_value_is_type : Error<
514  "dependent using declaration resolved to type without 'typename'">;
515def err_using_decl_nested_name_specifier_is_not_class : Error<
516  "using declaration in class refers into '%0', which is not a class">;
517def err_using_decl_nested_name_specifier_is_current_class : Error<
518  "using declaration refers to its own class">;
519def err_using_decl_nested_name_specifier_is_not_base_class : Error<
520  "using declaration refers into '%0', which is not a base class of %1">;
521def err_using_decl_constructor_not_in_direct_base : Error<
522  "%0 is not a direct base of %1, cannot inherit constructors">;
523def err_using_decl_can_not_refer_to_class_member : Error<
524  "using declaration cannot refer to class member">;
525def err_ambiguous_inherited_constructor : Error<
526  "constructor of %0 inherited from multiple base class subobjects">;
527def note_ambiguous_inherited_constructor_using : Note<
528  "inherited from base class %0 here">;
529def note_using_decl_class_member_workaround : Note<
530  "use %select{an alias declaration|a typedef declaration|a reference|"
531  "a const variable|a constexpr variable}0 instead">;
532def err_using_decl_can_not_refer_to_namespace : Error<
533  "using declaration cannot refer to a namespace">;
534def err_using_decl_can_not_refer_to_scoped_enum : Error<
535  "using declaration cannot refer to a scoped enumerator">;
536def err_using_decl_constructor : Error<
537  "using declaration cannot refer to a constructor">;
538def warn_cxx98_compat_using_decl_constructor : Warning<
539  "inheriting constructors are incompatible with C++98">,
540  InGroup<CXX98Compat>, DefaultIgnore;
541def err_using_decl_destructor : Error<
542  "using declaration cannot refer to a destructor">;
543def err_using_decl_template_id : Error<
544  "using declaration cannot refer to a template specialization">;
545def note_using_decl_target : Note<"target of using declaration">;
546def note_using_decl_conflict : Note<"conflicting declaration">;
547def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
548def err_using_decl_conflict : Error<
549  "target of using declaration conflicts with declaration already in scope">;
550def err_using_decl_conflict_reverse : Error<
551  "declaration conflicts with target of using declaration already in scope">;
552def note_using_decl : Note<"%select{|previous }0using declaration">;
553def err_using_decl_redeclaration_expansion : Error<
554  "using declaration pack expansion at block scope produces multiple values">;
555
556def warn_access_decl_deprecated : Warning<
557  "access declarations are deprecated; use using declarations instead">,
558  InGroup<Deprecated>;
559def err_access_decl : Error<
560  "ISO C++11 does not allow access declarations; "
561  "use using declarations instead">;
562def warn_deprecated_copy_operation : Warning<
563  "definition of implicit copy %select{constructor|assignment operator}1 "
564  "for %0 is deprecated because it has a user-declared copy "
565  "%select{assignment operator|constructor}1">,
566  InGroup<DeprecatedCopy>, DefaultIgnore;
567def warn_deprecated_copy_dtor_operation : Warning<
568  "definition of implicit copy %select{constructor|assignment operator}1 "
569  "for %0 is deprecated because it has a user-declared destructor">,
570  InGroup<DeprecatedCopyDtor>, DefaultIgnore;
571def warn_cxx17_compat_exception_spec_in_signature : Warning<
572  "mangled name of %0 will change in C++17 due to non-throwing exception "
573  "specification in function signature">, InGroup<CXX17CompatMangling>;
574
575def warn_global_constructor : Warning<
576  "declaration requires a global constructor">,
577  InGroup<GlobalConstructors>, DefaultIgnore;
578def warn_global_destructor : Warning<
579  "declaration requires a global destructor">,
580   InGroup<GlobalConstructors>, DefaultIgnore;
581def warn_exit_time_destructor : Warning<
582  "declaration requires an exit-time destructor">,
583  InGroup<ExitTimeDestructors>, DefaultIgnore;
584
585def err_invalid_thread : Error<
586  "'%0' is only allowed on variable declarations">;
587def err_thread_non_global : Error<
588  "'%0' variables must have global storage">;
589def err_thread_unsupported : Error<
590  "thread-local storage is not supported for the current target">;
591
592// FIXME: Combine fallout warnings to just one warning.
593def warn_maybe_falloff_nonvoid_function : Warning<
594  "non-void function does not return a value in all control paths">,
595  InGroup<ReturnType>;
596def warn_falloff_nonvoid_function : Warning<
597  "non-void function does not return a value">,
598  InGroup<ReturnType>;
599def err_maybe_falloff_nonvoid_block : Error<
600  "non-void block does not return a value in all control paths">;
601def err_falloff_nonvoid_block : Error<
602  "non-void block does not return a value">;
603def warn_maybe_falloff_nonvoid_coroutine : Warning<
604  "non-void coroutine does not return a value in all control paths">,
605  InGroup<ReturnType>;
606def warn_falloff_nonvoid_coroutine : Warning<
607  "non-void coroutine does not return a value">,
608  InGroup<ReturnType>;
609def warn_suggest_noreturn_function : Warning<
610  "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
611  InGroup<MissingNoreturn>, DefaultIgnore;
612def warn_suggest_noreturn_block : Warning<
613  "block could be declared with attribute 'noreturn'">,
614  InGroup<MissingNoreturn>, DefaultIgnore;
615
616// Unreachable code.
617def warn_unreachable : Warning<
618  "code will never be executed">,
619  InGroup<UnreachableCode>, DefaultIgnore;
620def warn_unreachable_break : Warning<
621  "'break' will never be executed">,
622  InGroup<UnreachableCodeBreak>, DefaultIgnore;
623def warn_unreachable_return : Warning<
624  "'return' will never be executed">,
625  InGroup<UnreachableCodeReturn>, DefaultIgnore;
626def warn_unreachable_loop_increment : Warning<
627  "loop will run at most once (loop increment never executed)">,
628  InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
629def note_unreachable_silence : Note<
630  "silence by adding parentheses to mark code as explicitly dead">;
631
632/// Built-in functions.
633def ext_implicit_lib_function_decl : ExtWarn<
634  "implicitly declaring library function '%0' with type %1">,
635  InGroup<ImplicitFunctionDeclare>;
636def note_include_header_or_declare : Note<
637  "include the header <%0> or explicitly provide a declaration for '%1'">;
638def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
639def warn_implicit_decl_no_jmp_buf
640    : Warning<"declaration of built-in function '%0' requires the declaration"
641    " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.">,
642      InGroup<DiagGroup<"incomplete-setjmp-declaration">>;
643def warn_implicit_decl_requires_sysheader : Warning<
644  "declaration of built-in function '%1' requires inclusion of the header <%0>">,
645  InGroup<BuiltinRequiresHeader>;
646def warn_redecl_library_builtin : Warning<
647  "incompatible redeclaration of library function %0">,
648  InGroup<DiagGroup<"incompatible-library-redeclaration">>;
649def err_builtin_definition : Error<"definition of builtin function %0">;
650def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
651def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
652def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as "
653  "%select{GCP|CDE}1">;
654def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
655def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
656def err_invalid_cpu_specific_dispatch_value : Error<
657"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
658def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
659  InGroup<ImplicitFunctionDeclare>, DefaultError;
660def warn_cstruct_memaccess : Warning<
661  "%select{destination for|source of|first operand of|second operand of}0 this "
662  "%1 call is a pointer to record %2 that is not trivial to "
663  "%select{primitive-default-initialize|primitive-copy}3">,
664  InGroup<NonTrivialMemaccess>;
665def note_nontrivial_field : Note<
666  "field is non-trivial to %select{copy|default-initialize}0">;
667def err_non_trivial_c_union_in_invalid_context : Error<
668  "cannot %select{"
669  "use type %1 for a function/method parameter|"
670  "use type %1 for function/method return|"
671  "default-initialize an object of type %1|"
672  "declare an automatic variable of type %1|"
673  "copy-initialize an object of type %1|"
674  "assign to a variable of type %1|"
675  "construct an automatic compound literal of type %1|"
676  "capture a variable of type %1|"
677  "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion"
678  "}3 "
679  "since it %select{contains|is}2 a union that is non-trivial to "
680  "%select{default-initialize|destruct|copy}0">;
681def note_non_trivial_c_union : Note<
682  "%select{%2 has subobjects that are|%3 has type %2 that is}0 "
683  "non-trivial to %select{default-initialize|destruct|copy}1">;
684def warn_dyn_class_memaccess : Warning<
685  "%select{destination for|source of|first operand of|second operand of}0 this "
686  "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
687  "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
688  InGroup<DynamicClassMemaccess>;
689def note_bad_memaccess_silence : Note<
690  "explicitly cast the pointer to silence this warning">;
691def warn_sizeof_pointer_expr_memaccess : Warning<
692  "'%0' call operates on objects of type %1 while the size is based on a "
693  "different type %2">,
694  InGroup<SizeofPointerMemaccess>;
695def warn_sizeof_pointer_expr_memaccess_note : Note<
696  "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
697  "it by the number of elements)|remove the addressof in the argument to "
698  "'sizeof' (and multiply it by the number of elements)|provide an explicit "
699  "length}0?">;
700def warn_sizeof_pointer_type_memaccess : Warning<
701  "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
702  "%select{destination|source}2; expected %3 or an explicit length">,
703  InGroup<SizeofPointerMemaccess>;
704def warn_strlcpycat_wrong_size : Warning<
705  "size argument in %0 call appears to be size of the source; "
706  "expected the size of the destination">,
707  InGroup<DiagGroup<"strlcpy-strlcat-size">>;
708def note_strlcpycat_wrong_size : Note<
709  "change size argument to be the size of the destination">;
710def warn_memsize_comparison : Warning<
711  "size argument in %0 call is a comparison">,
712  InGroup<DiagGroup<"memsize-comparison">>;
713def note_memsize_comparison_paren : Note<
714  "did you mean to compare the result of %0 instead?">;
715def note_memsize_comparison_cast_silence : Note<
716  "explicitly cast the argument to size_t to silence this warning">;
717def warn_suspicious_sizeof_memset : Warning<
718  "%select{'size' argument to memset is '0'|"
719  "setting buffer to a 'sizeof' expression}0"
720  "; did you mean to transpose the last two arguments?">,
721  InGroup<MemsetTransposedArgs>;
722def note_suspicious_sizeof_memset_silence : Note<
723  "%select{parenthesize the third argument|"
724  "cast the second argument to 'int'}0 to silence">;
725def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
726  InGroup<SuspiciousBzero>;
727def note_suspicious_bzero_size_silence : Note<
728  "parenthesize the second argument to silence">;
729
730def warn_strncat_large_size : Warning<
731  "the value of the size argument in 'strncat' is too large, might lead to a "
732  "buffer overflow">, InGroup<StrncatSize>;
733def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
734  "to be size of the source">, InGroup<StrncatSize>;
735def warn_strncat_wrong_size : Warning<
736  "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
737def note_strncat_wrong_size : Note<
738  "change the argument to be the free space in the destination buffer minus "
739  "the terminating null byte">;
740
741def warn_assume_side_effects : Warning<
742  "the argument to %0 has side effects that will be discarded">,
743  InGroup<DiagGroup<"assume">>;
744def warn_assume_attribute_string_unknown : Warning<
745  "unknown assumption string '%0'; attribute is potentially ignored">,
746  InGroup<UnknownAssumption>;
747def warn_assume_attribute_string_unknown_suggested : Warning<
748  "unknown assumption string '%0' may be misspelled; attribute is potentially "
749  "ignored, did you mean '%1'?">,
750  InGroup<MisspelledAssumption>;
751
752def warn_builtin_chk_overflow : Warning<
753  "'%0' will always overflow; destination buffer has size %1,"
754  " but size argument is %2">,
755  InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
756
757def warn_fortify_source_overflow
758  : Warning<warn_builtin_chk_overflow.Text>, InGroup<FortifySource>;
759def warn_fortify_source_size_mismatch : Warning<
760  "'%0' size argument is too large; destination buffer has size %1,"
761  " but size argument is %2">, InGroup<FortifySource>;
762
763def warn_fortify_source_format_overflow : Warning<
764  "'%0' will always overflow; destination buffer has size %1,"
765  " but format string expands to at least %2">,
766  InGroup<FortifySource>;
767
768
769/// main()
770// static main() is not an error in C, just in C++.
771def warn_static_main : Warning<"'main' should not be declared static">,
772    InGroup<Main>;
773def err_static_main : Error<"'main' is not allowed to be declared static">;
774def err_inline_main : Error<"'main' is not allowed to be declared inline">;
775def ext_variadic_main : ExtWarn<
776  "'main' is not allowed to be declared variadic">, InGroup<Main>;
777def ext_noreturn_main : ExtWarn<
778  "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
779def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
780def err_constexpr_main : Error<
781  "'main' is not allowed to be declared %select{constexpr|consteval}0">;
782def err_deleted_main : Error<"'main' is not allowed to be deleted">;
783def err_mainlike_template_decl : Error<"%0 cannot be a template">;
784def err_main_returns_nonint : Error<"'main' must return 'int'">;
785def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
786    InGroup<MainReturnType>;
787def note_main_change_return_type : Note<"change return type to 'int'">;
788def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
789    "must be 0, 2, or 3">;
790def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
791    InGroup<Main>;
792def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
793    "parameter of 'main' (%select{argument count|argument array|environment|"
794    "platform-specific data}0) must be of type %1">;
795def warn_main_returns_bool_literal : Warning<"bool literal returned from "
796    "'main'">, InGroup<Main>;
797def err_main_global_variable :
798    Error<"main cannot be declared as global variable">;
799def warn_main_redefined : Warning<"variable named 'main' with external linkage "
800    "has undefined behavior">, InGroup<Main>;
801def ext_main_used : Extension<
802  "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
803
804/// parser diagnostics
805def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
806  InGroup<MissingDeclarations>;
807def err_no_declarators : Error<"declaration does not declare anything">;
808def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
809  InGroup<MissingDeclarations>;
810def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
811
812def ext_non_c_like_anon_struct_in_typedef : ExtWarn<
813  "anonymous non-C-compatible type given name for linkage purposes "
814  "by %select{typedef|alias}0 declaration; "
815  "add a tag name here">, InGroup<DiagGroup<"non-c-typedef-for-linkage">>;
816def err_non_c_like_anon_struct_in_typedef : Error<
817  "anonymous non-C-compatible type given name for linkage purposes "
818  "by %select{typedef|alias}0 declaration after its linkage was computed; "
819  "add a tag name here to establish linkage prior to definition">;
820def err_typedef_changes_linkage : Error<
821  "unsupported: anonymous type given name for linkage purposes "
822  "by %select{typedef|alias}0 declaration after its linkage was computed; "
823  "add a tag name here to establish linkage prior to definition">;
824def note_non_c_like_anon_struct : Note<
825  "type is not C-compatible due to this "
826  "%select{base class|default member initializer|lambda expression|"
827  "friend declaration|member declaration}0">;
828def note_typedef_for_linkage_here : Note<
829  "type is given name %0 for linkage purposes by this "
830  "%select{typedef|alias}1 declaration">;
831
832def err_statically_allocated_object : Error<
833  "interface type cannot be statically allocated">;
834def err_object_cannot_be_passed_returned_by_value : Error<
835  "interface type %1 cannot be %select{returned|passed}0 by value"
836  "; did you forget * in %1?">;
837def err_parameters_retval_cannot_have_fp16_type : Error<
838  "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
839def err_opencl_half_load_store : Error<
840  "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
841  "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
842def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
843def err_opencl_half_declaration : Error<
844  "declaring variable of type %0 is not allowed">;
845def err_opencl_invalid_param : Error<
846  "declaring function parameter of type %0 is not allowed%select{; did you forget * ?|}1">;
847def err_opencl_invalid_return : Error<
848  "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
849def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
850def warn_pragma_options_align_reset_failed : Warning<
851  "#pragma options align=reset failed: %0">,
852  InGroup<IgnoredPragmas>;
853def err_pragma_options_align_mac68k_target_unsupported : Error<
854  "mac68k alignment pragma is not supported on this target">;
855def warn_pragma_pack_invalid_alignment : Warning<
856  "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
857  InGroup<IgnoredPragmas>;
858def err_pragma_pack_invalid_alignment : Error<
859  warn_pragma_pack_invalid_alignment.Text>;
860def warn_pragma_pack_non_default_at_include : Warning<
861  "non-default #pragma pack value changes the alignment of struct or union "
862  "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
863  DefaultIgnore;
864def warn_pragma_pack_modified_after_include : Warning<
865  "the current #pragma pack alignment value is modified in the included "
866  "file">, InGroup<PragmaPack>;
867def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
868  "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
869def note_pragma_pack_here : Note<
870  "previous '#pragma pack' directive that modifies alignment is here">;
871def note_pragma_pack_pop_instead_reset : Note<
872  "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
873// Follow the Microsoft implementation.
874def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
875def warn_pragma_pack_pop_identifier_and_alignment : Warning<
876  "specifying both a name and alignment to 'pop' is undefined">;
877def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
878  InGroup<IgnoredPragmas>;
879def err_pragma_fc_pp_scope : Error<
880  "'#pragma float_control push/pop' can only appear at file scope or namespace scope">;
881def err_pragma_fc_noprecise_requires_nofenv : Error<
882  "'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
883def err_pragma_fc_except_requires_precise : Error<
884  "'#pragma float_control(except, on)' is illegal when precise is disabled">;
885def err_pragma_fc_noprecise_requires_noexcept : Error<
886  "'#pragma float_control(precise, off)' is illegal when except is enabled">;
887def err_pragma_fenv_requires_precise : Error<
888  "'#pragma STDC FENV_ACCESS ON' is illegal when precise is disabled">;
889def warn_cxx_ms_struct :
890  Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
891          "with base classes or virtual functions">,
892  DefaultError, InGroup<IncompatibleMSStruct>;
893def err_pragma_pack_identifer_not_supported : Error<
894  "specifying an identifier within `#pragma pack` is not supported on this target">;
895def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
896def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
897def err_invalid_super_scope : Error<"invalid use of '__super', "
898  "this keyword can only be used inside class or member function scope">;
899def err_super_in_lambda_unsupported : Error<
900  "use of '__super' inside a lambda is unsupported">;
901
902def warn_pragma_unused_undeclared_var : Warning<
903  "undeclared variable %0 used as an argument for '#pragma unused'">,
904  InGroup<IgnoredPragmas>;
905def warn_atl_uuid_deprecated : Warning<
906  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
907  InGroup<DeprecatedDeclarations>;
908def warn_pragma_unused_expected_var_arg : Warning<
909  "only variables can be arguments to '#pragma unused'">,
910  InGroup<IgnoredPragmas>;
911def err_pragma_push_visibility_mismatch : Error<
912  "#pragma visibility push with no matching #pragma visibility pop">;
913def note_surrounding_namespace_ends_here : Note<
914  "surrounding namespace with visibility attribute ends here">;
915def err_pragma_pop_visibility_mismatch : Error<
916  "#pragma visibility pop with no matching #pragma visibility push">;
917def note_surrounding_namespace_starts_here : Note<
918  "surrounding namespace with visibility attribute starts here">;
919def err_pragma_loop_invalid_argument_type : Error<
920  "invalid argument of type %0; expected an integer type">;
921def err_pragma_loop_invalid_argument_value : Error<
922  "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
923def err_pragma_loop_compatibility : Error<
924  "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
925def err_pragma_loop_precedes_nonloop : Error<
926  "expected a for, while, or do-while loop to follow '%0'">;
927
928def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
929  "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
930  "those declarations">;
931def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
932  "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
933def err_pragma_attribute_invalid_matchers : Error<
934  "attribute %0 can't be applied to %1">;
935def err_pragma_attribute_stack_mismatch : Error<
936  "'#pragma clang attribute %select{%1.|}0pop' with no matching"
937  " '#pragma clang attribute %select{%1.|}0push'">;
938def warn_pragma_attribute_unused : Warning<
939  "unused attribute %0 in '#pragma clang attribute push' region">,
940  InGroup<PragmaClangAttribute>;
941def note_pragma_attribute_region_ends_here : Note<
942  "'#pragma clang attribute push' regions ends here">;
943def err_pragma_attribute_no_pop_eof : Error<"unterminated "
944  "'#pragma clang attribute push' at end of file">;
945def note_pragma_attribute_applied_decl_here : Note<
946  "when applied to this declaration">;
947def err_pragma_attr_attr_no_push : Error<
948  "'#pragma clang attribute' attribute with no matching "
949  "'#pragma clang attribute push'">;
950
951/// Objective-C parser diagnostics
952def err_duplicate_class_def : Error<
953  "duplicate interface definition for class %0">;
954def err_undef_superclass : Error<
955  "cannot find interface declaration for %0, superclass of %1">;
956def err_forward_superclass : Error<
957  "attempting to use the forward class %0 as superclass of %1">;
958def err_no_nsconstant_string_class : Error<
959  "cannot find interface declaration for %0">;
960def err_recursive_superclass : Error<
961  "trying to recursively use %0 as superclass of %1">;
962def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
963def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
964def warn_duplicate_protocol_def : Warning<
965  "duplicate protocol definition of %0 is ignored">,
966  InGroup<DiagGroup<"duplicate-protocol">>;
967def err_protocol_has_circular_dependency : Error<
968  "protocol has circular dependency">;
969def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
970def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
971def err_atprotocol_protocol : Error<
972  "@protocol is using a forward protocol declaration of %0">;
973def warn_readonly_property : Warning<
974  "attribute 'readonly' of property %0 restricts attribute "
975  "'readwrite' of property inherited from %1">,
976  InGroup<PropertyAttr>;
977
978def warn_property_attribute : Warning<
979  "'%1' attribute on property %0 does not match the property inherited from %2">,
980  InGroup<PropertyAttr>;
981def warn_property_types_are_incompatible : Warning<
982  "property type %0 is incompatible with type %1 inherited from %2">,
983  InGroup<DiagGroup<"incompatible-property-type">>;
984def warn_protocol_property_mismatch : Warning<
985  "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
986  "getter %1|with setter %1}0 was selected for synthesis">,
987  InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
988def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
989def err_undef_interface : Error<"cannot find interface declaration for %0">;
990def err_category_forward_interface : Error<
991  "cannot define %select{category|class extension}0 for undefined class %1">;
992def err_class_extension_after_impl : Error<
993  "cannot declare class extension for %0 after class implementation">;
994def note_implementation_declared : Note<
995  "class implementation is declared here">;
996def note_while_in_implementation : Note<
997  "detected while default synthesizing properties in class implementation">;
998def note_class_declared : Note<
999  "class is declared here">;
1000def note_receiver_class_declared : Note<
1001  "receiver is instance of class declared here">;
1002def note_receiver_expr_here : Note<
1003  "receiver expression is here">;
1004def note_receiver_is_id : Note<
1005  "receiver is treated with 'id' type for purpose of method lookup">;
1006def note_suppressed_class_declare : Note<
1007  "class with specified objc_requires_property_definitions attribute is declared here">;
1008def err_objc_root_class_subclass : Error<
1009  "objc_root_class attribute may only be specified on a root class declaration">;
1010def err_restricted_superclass_mismatch : Error<
1011  "cannot subclass a class that was declared with the "
1012  "'objc_subclassing_restricted' attribute">;
1013def err_class_stub_subclassing_mismatch : Error<
1014  "'objc_class_stub' attribute cannot be specified on a class that does not "
1015  "have the 'objc_subclassing_restricted' attribute">;
1016def err_implementation_of_class_stub : Error<
1017  "cannot declare implementation of a class declared with the "
1018  "'objc_class_stub' attribute">;
1019def warn_objc_root_class_missing : Warning<
1020  "class %0 defined without specifying a base class">,
1021  InGroup<ObjCRootClass>;
1022def err_objc_runtime_visible_category : Error<
1023  "cannot implement a category for class %0 that is only visible via the "
1024  "Objective-C runtime">;
1025def err_objc_runtime_visible_subclass : Error<
1026  "cannot implement subclass %0 of a superclass %1 that is only visible via the "
1027  "Objective-C runtime">;
1028def note_objc_needs_superclass : Note<
1029  "add a super class to fix this problem">;
1030def err_conflicting_super_class : Error<"conflicting super class name %0">;
1031def err_dup_implementation_class : Error<"reimplementation of class %0">;
1032def err_dup_implementation_category : Error<
1033  "reimplementation of category %1 for class %0">;
1034def err_conflicting_ivar_type : Error<
1035  "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
1036def err_duplicate_ivar_declaration : Error<
1037  "instance variable is already declared">;
1038def warn_on_superclass_use : Warning<
1039  "class implementation may not have super class">;
1040def err_conflicting_ivar_bitwidth : Error<
1041  "instance variable %0 has conflicting bit-field width">;
1042def err_conflicting_ivar_name : Error<
1043  "conflicting instance variable names: %0 vs %1">;
1044def err_inconsistent_ivar_count : Error<
1045  "inconsistent number of instance variables specified">;
1046def warn_undef_method_impl : Warning<"method definition for %0 not found">,
1047  InGroup<DiagGroup<"incomplete-implementation">>;
1048def warn_objc_boxing_invalid_utf8_string : Warning<
1049  "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
1050  InGroup<ObjCBoxing>;
1051
1052def err_objc_non_runtime_protocol_in_protocol_expr : Error<
1053  "cannot use a protocol declared 'objc_non_runtime_protocol' in a @protocol expression">;
1054def err_objc_direct_on_protocol : Error<
1055  "'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
1056  "declared in an Objective-C protocol">;
1057def err_objc_direct_duplicate_decl : Error<
1058  "%select{|direct }0%select{method|property}1 declaration conflicts "
1059  "with previous %select{|direct }2declaration of %select{method|property}1 %3">;
1060def err_objc_direct_impl_decl_mismatch : Error<
1061  "direct method was declared in %select{the primary interface|an extension|a category}0 "
1062  "but is implemented in %select{the primary interface|a category|a different category}1">;
1063def err_objc_direct_missing_on_decl : Error<
1064  "direct method implementation was previously declared not direct">;
1065def err_objc_direct_on_override : Error<
1066  "methods that %select{override superclass methods|implement protocol requirements}0 cannot be direct">;
1067def err_objc_override_direct_method : Error<
1068  "cannot override a method that is declared direct by a superclass">;
1069def warn_objc_direct_ignored : Warning<
1070  "%0 attribute isn't implemented by this Objective-C runtime">,
1071  InGroup<IgnoredAttributes>;
1072def warn_objc_direct_property_ignored : Warning<
1073  "direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
1074  InGroup<IgnoredAttributes>;
1075def err_objc_direct_dynamic_property : Error<
1076  "direct property cannot be @dynamic">;
1077def err_objc_direct_protocol_conformance : Error<
1078  "%select{category %1|class extension}0 cannot conform to protocol %2 because "
1079  "of direct members declared in interface %3">;
1080def note_direct_member_here : Note<"direct member declared here">;
1081
1082def warn_conflicting_overriding_ret_types : Warning<
1083  "conflicting return type in "
1084  "declaration of %0%diff{: $ vs $|}1,2">,
1085  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1086
1087def warn_conflicting_ret_types : Warning<
1088  "conflicting return type in "
1089  "implementation of %0%diff{: $ vs $|}1,2">,
1090  InGroup<MismatchedReturnTypes>;
1091
1092def warn_conflicting_overriding_ret_type_modifiers : Warning<
1093  "conflicting distributed object modifiers on return type "
1094  "in declaration of %0">,
1095  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1096
1097def warn_conflicting_ret_type_modifiers : Warning<
1098  "conflicting distributed object modifiers on return type "
1099  "in implementation of %0">,
1100  InGroup<DistributedObjectModifiers>;
1101
1102def warn_non_covariant_overriding_ret_types : Warning<
1103  "conflicting return type in "
1104  "declaration of %0: %1 vs %2">,
1105  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1106
1107def warn_non_covariant_ret_types : Warning<
1108  "conflicting return type in "
1109  "implementation of %0: %1 vs %2">,
1110  InGroup<MethodSignatures>, DefaultIgnore;
1111
1112def warn_conflicting_overriding_param_types : Warning<
1113  "conflicting parameter types in "
1114  "declaration of %0%diff{: $ vs $|}1,2">,
1115  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1116
1117def warn_conflicting_param_types : Warning<
1118  "conflicting parameter types in "
1119  "implementation of %0%diff{: $ vs $|}1,2">,
1120  InGroup<MismatchedParameterTypes>;
1121
1122def warn_conflicting_param_modifiers : Warning<
1123  "conflicting distributed object modifiers on parameter type "
1124  "in implementation of %0">,
1125  InGroup<DistributedObjectModifiers>;
1126
1127def warn_conflicting_overriding_param_modifiers : Warning<
1128  "conflicting distributed object modifiers on parameter type "
1129  "in declaration of %0">,
1130  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1131
1132def warn_non_contravariant_overriding_param_types : Warning<
1133  "conflicting parameter types in "
1134  "declaration of %0: %1 vs %2">,
1135  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1136
1137def warn_non_contravariant_param_types : Warning<
1138  "conflicting parameter types in "
1139  "implementation of %0: %1 vs %2">,
1140  InGroup<MethodSignatures>, DefaultIgnore;
1141
1142def warn_conflicting_overriding_variadic :Warning<
1143  "conflicting variadic declaration of method and its "
1144  "implementation">,
1145  InGroup<OverridingMethodMismatch>, DefaultIgnore;
1146
1147def warn_conflicting_variadic :Warning<
1148  "conflicting variadic declaration of method and its "
1149  "implementation">;
1150
1151def warn_category_method_impl_match:Warning<
1152  "category is implementing a method which will also be implemented"
1153  " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1154
1155def warn_implements_nscopying : Warning<
1156"default assign attribute on property %0 which implements "
1157"NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1158
1159def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1160  InGroup<ObjCMultipleMethodNames>;
1161def warn_strict_multiple_method_decl : Warning<
1162  "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1163def warn_accessor_property_type_mismatch : Warning<
1164  "type of property %0 does not match type of accessor %1">;
1165def note_conv_function_declared_at : Note<"type conversion function declared here">;
1166def note_method_declared_at : Note<"method %0 declared here">;
1167def note_direct_method_declared_at : Note<"direct method %0 declared here">;
1168def note_property_attribute : Note<"property %0 is declared "
1169  "%select{deprecated|unavailable|partial}1 here">;
1170def err_setter_type_void : Error<"type of setter must be void">;
1171def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1172def warn_duplicate_method_decl :
1173  Warning<"multiple declarations of method %0 found and ignored">,
1174  InGroup<MethodDuplicate>, DefaultIgnore;
1175def warn_objc_cdirective_format_string :
1176  Warning<"using %0 directive in %select{NSString|CFString}1 "
1177          "which is being passed as a formatting argument to the formatting "
1178          "%select{method|CFfunction}2">,
1179  InGroup<ObjCCStringFormat>, DefaultIgnore;
1180def err_objc_var_decl_inclass :
1181    Error<"cannot declare variable inside @interface or @protocol">;
1182def err_missing_method_context : Error<
1183  "missing context for method declaration">;
1184def err_objc_property_attr_mutually_exclusive : Error<
1185  "property attributes '%0' and '%1' are mutually exclusive">;
1186def err_objc_property_requires_object : Error<
1187  "property with '%0' attribute must be of object type">;
1188def warn_objc_property_assign_on_object : Warning<
1189  "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1190  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1191def warn_objc_property_no_assignment_attribute : Warning<
1192  "no 'assign', 'retain', or 'copy' attribute is specified - "
1193  "'assign' is assumed">,
1194  InGroup<ObjCPropertyNoAttribute>;
1195def warn_objc_isa_use : Warning<
1196  "direct access to Objective-C's isa is deprecated in favor of "
1197  "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1198def warn_objc_isa_assign : Warning<
1199  "assignment to Objective-C's isa is deprecated in favor of "
1200  "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1201def warn_objc_pointer_masking : Warning<
1202  "bitmasking for introspection of Objective-C object pointers is strongly "
1203  "discouraged">,
1204  InGroup<ObjCPointerIntrospect>;
1205def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1206  InGroup<ObjCPointerIntrospectPerformSelector>;
1207def warn_objc_property_default_assign_on_object : Warning<
1208  "default property attribute 'assign' not appropriate for object">,
1209  InGroup<ObjCPropertyNoAttribute>;
1210def warn_property_attr_mismatch : Warning<
1211  "property attribute in class extension does not match the primary class">,
1212  InGroup<PropertyAttr>;
1213def warn_property_implicitly_mismatched : Warning <
1214  "primary property declaration is implicitly strong while redeclaration "
1215  "in class extension is weak">,
1216  InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1217def warn_objc_property_copy_missing_on_block : Warning<
1218    "'copy' attribute must be specified for the block property "
1219    "when -fobjc-gc-only is specified">;
1220def warn_objc_property_retain_of_block : Warning<
1221    "retain'ed block property does not copy the block "
1222    "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1223def warn_objc_readonly_property_has_setter : Warning<
1224    "setter cannot be specified for a readonly property">,
1225    InGroup<ObjCReadonlyPropertyHasSetter>;
1226def warn_atomic_property_rule : Warning<
1227  "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1228  "with a user defined %select{getter|setter}2">,
1229  InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1230def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1231  "synthesized, or both be user defined,or the property must be nonatomic">;
1232def err_atomic_property_nontrivial_assign_op : Error<
1233  "atomic property of reference type %0 cannot have non-trivial assignment"
1234  " operator">;
1235def warn_cocoa_naming_owned_rule : Warning<
1236  "property follows Cocoa naming"
1237  " convention for returning 'owned' objects">,
1238  InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1239def err_cocoa_naming_owned_rule : Error<
1240  "property follows Cocoa naming"
1241  " convention for returning 'owned' objects">;
1242def note_cocoa_naming_declare_family : Note<
1243  "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1244  "object">;
1245def warn_auto_synthesizing_protocol_property :Warning<
1246  "auto property synthesis will not synthesize property %0"
1247  " declared in protocol %1">,
1248  InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1249def note_add_synthesize_directive : Note<
1250  "add a '@synthesize' directive">;
1251def warn_no_autosynthesis_shared_ivar_property : Warning <
1252  "auto property synthesis will not synthesize property "
1253  "%0 because it cannot share an ivar with another synthesized property">,
1254  InGroup<ObjCNoPropertyAutoSynthesis>;
1255def warn_no_autosynthesis_property : Warning<
1256  "auto property synthesis will not synthesize property "
1257  "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1258  "via another property">,
1259  InGroup<ObjCNoPropertyAutoSynthesis>;
1260def warn_autosynthesis_property_in_superclass : Warning<
1261  "auto property synthesis will not synthesize property "
1262  "%0; it will be implemented by its superclass, use @dynamic to "
1263  "acknowledge intention">,
1264  InGroup<ObjCNoPropertyAutoSynthesis>;
1265def warn_autosynthesis_property_ivar_match :Warning<
1266  "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1267  "%2, not existing instance variable %3">,
1268  InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1269def warn_missing_explicit_synthesis : Warning <
1270  "auto property synthesis is synthesizing property not explicitly synthesized">,
1271  InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1272def warn_property_getter_owning_mismatch : Warning<
1273  "property declared as returning non-retained objects"
1274  "; getter returning retained objects">;
1275def warn_property_redecl_getter_mismatch : Warning<
1276  "getter name mismatch between property redeclaration (%1) and its original "
1277  "declaration (%0)">, InGroup<PropertyAttr>;
1278def err_property_setter_ambiguous_use : Error<
1279  "synthesized properties %0 and %1 both claim setter %2 -"
1280  " use of this setter will cause unexpected behavior">;
1281def warn_default_atomic_custom_getter_setter : Warning<
1282  "atomic by default property %0 has a user defined %select{getter|setter}1 "
1283  "(property should be marked 'atomic' if this is intended)">,
1284  InGroup<CustomAtomic>, DefaultIgnore;
1285def err_use_continuation_class : Error<
1286  "illegal redeclaration of property in class extension %0"
1287  " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1288def err_type_mismatch_continuation_class : Error<
1289  "type of property %0 in class extension does not match "
1290  "property type in primary class">;
1291def err_use_continuation_class_redeclaration_readwrite : Error<
1292  "illegal redeclaration of 'readwrite' property in class extension %0"
1293  " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1294  "'readonly' public property?)">;
1295def err_continuation_class : Error<"class extension has no primary class">;
1296def err_property_type : Error<"property cannot have array or function type %0">;
1297def err_missing_property_context : Error<
1298  "missing context for property implementation declaration">;
1299def err_bad_property_decl : Error<
1300  "property implementation must have its declaration in interface %0 or one of "
1301  "its extensions">;
1302def err_category_property : Error<
1303  "property declared in category %0 cannot be implemented in "
1304  "class implementation">;
1305def note_property_declare : Note<
1306  "property declared here">;
1307def note_protocol_property_declare : Note<
1308  "it could also be property "
1309  "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1310  "%1|with setter %1}0 declared here">;
1311def note_property_synthesize : Note<
1312  "property synthesized here">;
1313def err_synthesize_category_decl : Error<
1314  "@synthesize not allowed in a category's implementation">;
1315def err_synthesize_on_class_property : Error<
1316  "@synthesize not allowed on a class property %0">;
1317def err_missing_property_interface : Error<
1318  "property implementation in a category with no category declaration">;
1319def err_bad_category_property_decl : Error<
1320  "property implementation must have its declaration in the category %0">;
1321def err_bad_property_context : Error<
1322  "property implementation must be in a class or category implementation">;
1323def err_missing_property_ivar_decl : Error<
1324  "synthesized property %0 must either be named the same as a compatible"
1325  " instance variable or must explicitly name an instance variable">;
1326def err_arc_perform_selector_retains : Error<
1327  "performSelector names a selector which retains the object">;
1328def warn_arc_perform_selector_leaks : Warning<
1329  "performSelector may cause a leak because its selector is unknown">,
1330  InGroup<DiagGroup<"arc-performSelector-leaks">>;
1331def warn_dealloc_in_category : Warning<
1332"-dealloc is being overridden in a category">,
1333InGroup<DeallocInCategory>;
1334def err_gc_weak_property_strong_type : Error<
1335  "weak attribute declared on a __strong type property in GC mode">;
1336def warn_arc_repeated_use_of_weak : Warning <
1337  "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1338  "accessed multiple times in this %select{function|method|block|lambda}2 "
1339  "but may be unpredictably set to nil; assign to a strong variable to keep "
1340  "the object alive">,
1341  InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1342def warn_implicitly_retains_self : Warning <
1343  "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1344  "this is intended behavior">,
1345  InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1346def warn_arc_possible_repeated_use_of_weak : Warning <
1347  "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1348  "be accessed multiple times in this %select{function|method|block|lambda}2 "
1349  "and may be unpredictably set to nil; assign to a strong variable to keep "
1350  "the object alive">,
1351  InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1352def note_arc_weak_also_accessed_here : Note<
1353  "also accessed here">;
1354def err_incomplete_synthesized_property : Error<
1355  "cannot synthesize property %0 with incomplete type %1">;
1356
1357def err_property_ivar_type : Error<
1358  "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1359def err_property_accessor_type : Error<
1360  "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1361def err_ivar_in_superclass_use : Error<
1362  "property %0 attempting to use instance variable %1 declared in super class %2">;
1363def err_weak_property : Error<
1364  "existing instance variable %1 for __weak property %0 must be __weak">;
1365def err_strong_property : Error<
1366  "existing instance variable %1 for strong property %0 may not be __weak">;
1367def err_dynamic_property_ivar_decl : Error<
1368  "dynamic property cannot have instance variable specification">;
1369def err_duplicate_ivar_use : Error<
1370  "synthesized properties %0 and %1 both claim instance variable %2">;
1371def err_property_implemented : Error<"property %0 is already implemented">;
1372def warn_objc_missing_super_call : Warning<
1373  "method possibly missing a [super %0] call">,
1374  InGroup<ObjCMissingSuperCalls>;
1375def err_dealloc_bad_result_type : Error<
1376  "dealloc return type must be correctly specified as 'void' under ARC, "
1377  "instead of %0">;
1378def warn_undeclared_selector : Warning<
1379  "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1380def warn_undeclared_selector_with_typo : Warning<
1381  "undeclared selector %0; did you mean %1?">,
1382  InGroup<UndeclaredSelector>, DefaultIgnore;
1383def warn_implicit_atomic_property : Warning<
1384  "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1385def note_auto_readonly_iboutlet_fixup_suggest : Note<
1386  "property should be changed to be readwrite">;
1387def warn_auto_readonly_iboutlet_property : Warning<
1388  "readonly IBOutlet property %0 when auto-synthesized may "
1389  "not work correctly with 'nib' loader">,
1390  InGroup<DiagGroup<"readonly-iboutlet-property">>;
1391def warn_auto_implicit_atomic_property : Warning<
1392  "property is assumed atomic when auto-synthesizing the property">,
1393  InGroup<ImplicitAtomic>, DefaultIgnore;
1394def warn_unimplemented_selector:  Warning<
1395  "no method with selector %0 is implemented in this translation unit">,
1396  InGroup<Selector>, DefaultIgnore;
1397def warn_unimplemented_protocol_method : Warning<
1398  "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1399def warn_multiple_selectors: Warning<
1400  "several methods with selector %0 of mismatched types are found "
1401  "for the @selector expression">,
1402  InGroup<SelectorTypeMismatch>, DefaultIgnore;
1403def err_direct_selector_expression : Error<
1404  "@selector expression formed with direct selector %0">;
1405def warn_potentially_direct_selector_expression : Warning<
1406  "@selector expression formed with potentially direct selector %0">,
1407  InGroup<ObjCPotentiallyDirectSelector>;
1408def warn_strict_potentially_direct_selector_expression : Warning<
1409  warn_potentially_direct_selector_expression.Text>,
1410  InGroup<ObjCStrictPotentiallyDirectSelector>, DefaultIgnore;
1411
1412def err_objc_kindof_nonobject : Error<
1413  "'__kindof' specifier cannot be applied to non-object type %0">;
1414def err_objc_kindof_wrong_position : Error<
1415  "'__kindof' type specifier must precede the declarator">;
1416
1417def err_objc_method_unsupported_param_ret_type : Error<
1418  "%0 %select{parameter|return}1 type is unsupported; "
1419  "support for vector types for this target is introduced in %2">;
1420
1421def warn_messaging_unqualified_id : Warning<
1422  "messaging unqualified id">, DefaultIgnore,
1423  InGroup<DiagGroup<"objc-messaging-id">>;
1424def err_messaging_unqualified_id_with_direct_method : Error<
1425  "messaging unqualified id with a method that is possibly direct">;
1426def err_messaging_super_with_direct_method : Error<
1427  "messaging super with a direct method">;
1428def err_messaging_class_with_direct_method : Error<
1429  "messaging a Class with a method that is possibly direct">;
1430
1431// C++ declarations
1432def err_static_assert_expression_is_not_constant : Error<
1433  "static_assert expression is not an integral constant expression">;
1434def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1435def err_static_assert_requirement_failed : Error<
1436  "static_assert failed due to requirement '%0'%select{ %2|}1">;
1437
1438def ext_inline_variable : ExtWarn<
1439  "inline variables are a C++17 extension">, InGroup<CXX17>;
1440def warn_cxx14_compat_inline_variable : Warning<
1441  "inline variables are incompatible with C++ standards before C++17">,
1442  DefaultIgnore, InGroup<CXXPre17Compat>;
1443
1444def warn_inline_namespace_reopened_noninline : Warning<
1445  "inline namespace reopened as a non-inline namespace">,
1446  InGroup<InlineNamespaceReopenedNoninline>;
1447def err_inline_namespace_mismatch : Error<
1448  "non-inline namespace cannot be reopened as inline">;
1449
1450def err_unexpected_friend : Error<
1451  "friends can only be classes or functions">;
1452def ext_enum_friend : ExtWarn<
1453  "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1454def warn_cxx98_compat_enum_friend : Warning<
1455  "befriending enumeration type %0 is incompatible with C++98">,
1456  InGroup<CXX98Compat>, DefaultIgnore;
1457def ext_nonclass_type_friend : ExtWarn<
1458  "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1459def warn_cxx98_compat_nonclass_type_friend : Warning<
1460  "non-class friend type %0 is incompatible with C++98">,
1461  InGroup<CXX98Compat>, DefaultIgnore;
1462def err_friend_is_member : Error<
1463  "friends cannot be members of the declaring class">;
1464def warn_cxx98_compat_friend_is_member : Warning<
1465  "friend declaration naming a member of the declaring class is incompatible "
1466  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1467def ext_unelaborated_friend_type : ExtWarn<
1468  "unelaborated friend declaration is a C++11 extension; specify "
1469  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1470  InGroup<CXX11>;
1471def warn_cxx98_compat_unelaborated_friend_type : Warning<
1472  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1473  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1474def err_qualified_friend_no_match : Error<
1475  "friend declaration of %0 does not match any declaration in %1">;
1476def err_introducing_special_friend : Error<
1477  "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1478  " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1479  "as a friend">;
1480def err_tagless_friend_type_template : Error<
1481  "friend type templates must use an elaborated type">;
1482def err_no_matching_local_friend : Error<
1483  "no matching function found in local scope">;
1484def err_no_matching_local_friend_suggest : Error<
1485  "no matching function %0 found in local scope; did you mean %3?">;
1486def err_partial_specialization_friend : Error<
1487  "partial specialization cannot be declared as a friend">;
1488def err_qualified_friend_def : Error<
1489  "friend function definition cannot be qualified with '%0'">;
1490def err_friend_def_in_local_class : Error<
1491  "friend function cannot be defined in a local class">;
1492def err_friend_not_first_in_declaration : Error<
1493  "'friend' must appear first in a non-function declaration">;
1494def err_using_decl_friend : Error<
1495  "cannot befriend target of using declaration">;
1496def warn_template_qualified_friend_unsupported : Warning<
1497  "dependent nested name specifier '%0' for friend class declaration is "
1498  "not supported; turning off access control for %1">,
1499  InGroup<UnsupportedFriend>;
1500def warn_template_qualified_friend_ignored : Warning<
1501  "dependent nested name specifier '%0' for friend template declaration is "
1502  "not supported; ignoring this friend declaration">,
1503  InGroup<UnsupportedFriend>;
1504def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1505  "unqualified friend declaration referring to type outside of the nearest "
1506  "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1507  InGroup<MicrosoftUnqualifiedFriend>;
1508def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1509
1510def err_invalid_base_in_interface : Error<
1511  "interface type cannot inherit from "
1512  "%select{struct|non-public interface|class}0 %1">;
1513
1514def err_abstract_type_in_decl : Error<
1515  "%select{return|parameter|variable|field|instance variable|"
1516  "synthesized instance variable}0 type %1 is an abstract class">;
1517def err_allocation_of_abstract_type : Error<
1518  "allocating an object of abstract class type %0">;
1519def err_throw_abstract_type : Error<
1520  "cannot throw an object of abstract type %0">;
1521def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1522def err_capture_of_abstract_type : Error<
1523  "by-copy capture of value of abstract type %0">;
1524def err_capture_of_incomplete_or_sizeless_type : Error<
1525  "by-copy capture of variable %0 with %select{incomplete|sizeless}1 type %2">;
1526def err_capture_default_non_local : Error<
1527  "non-local lambda expression cannot have a capture-default">;
1528
1529def err_multiple_final_overriders : Error<
1530  "virtual function %q0 has more than one final overrider in %1">;
1531def note_final_overrider : Note<"final overrider of %q0 in %1">;
1532
1533def err_type_defined_in_type_specifier : Error<
1534  "%0 cannot be defined in a type specifier">;
1535def err_type_defined_in_result_type : Error<
1536  "%0 cannot be defined in the result type of a function">;
1537def err_type_defined_in_param_type : Error<
1538  "%0 cannot be defined in a parameter type">;
1539def err_type_defined_in_alias_template : Error<
1540  "%0 cannot be defined in a type alias template">;
1541def err_type_defined_in_condition : Error<
1542  "%0 cannot be defined in a condition">;
1543def err_type_defined_in_enum : Error<
1544  "%0 cannot be defined in an enumeration">;
1545
1546def note_pure_virtual_function : Note<
1547  "unimplemented pure virtual method %0 in %1">;
1548
1549def note_pure_qualified_call_kext : Note<
1550  "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1551
1552def err_deleted_decl_not_first : Error<
1553  "deleted definition must be first declaration">;
1554
1555def err_deleted_override : Error<
1556  "deleted function %0 cannot override a non-deleted function">;
1557def err_non_deleted_override : Error<
1558  "non-deleted function %0 cannot override a deleted function">;
1559def err_consteval_override : Error<
1560  "consteval function %0 cannot override a non-consteval function">;
1561def err_non_consteval_override : Error<
1562  "non-consteval function %0 cannot override a consteval function">;
1563
1564def warn_weak_vtable : Warning<
1565  "%0 has no out-of-line virtual method definitions; its vtable will be "
1566  "emitted in every translation unit">,
1567  InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1568def warn_weak_template_vtable : Warning<
1569  "explicit template instantiation %0 will emit a vtable in every "
1570  "translation unit">,
1571  InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1572
1573def ext_using_undefined_std : ExtWarn<
1574  "using directive refers to implicitly-defined namespace 'std'">;
1575
1576// C++ exception specifications
1577def err_exception_spec_in_typedef : Error<
1578  "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1579def err_distant_exception_spec : Error<
1580  "exception specifications are not allowed beyond a single level "
1581  "of indirection">;
1582def err_incomplete_in_exception_spec : Error<
1583  "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1584  "in exception specification">;
1585def err_sizeless_in_exception_spec : Error<
1586  "%select{|reference to }0sizeless type %1 is not allowed "
1587  "in exception specification">;
1588def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1589  InGroup<MicrosoftExceptionSpec>;
1590def err_rref_in_exception_spec : Error<
1591  "rvalue reference type %0 is not allowed in exception specification">;
1592def err_mismatched_exception_spec : Error<
1593  "exception specification in declaration does not match previous declaration">;
1594def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1595  InGroup<MicrosoftExceptionSpec>;
1596def err_override_exception_spec : Error<
1597  "exception specification of overriding function is more lax than "
1598  "base version">;
1599def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1600  InGroup<MicrosoftExceptionSpec>;
1601def err_incompatible_exception_specs : Error<
1602  "target exception specification is not superset of source">;
1603def warn_incompatible_exception_specs : Warning<
1604  err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1605def err_deep_exception_specs_differ : Error<
1606  "exception specifications of %select{return|argument}0 types differ">;
1607def warn_deep_exception_specs_differ : Warning<
1608  err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1609def err_missing_exception_specification : Error<
1610  "%0 is missing exception specification '%1'">;
1611def ext_missing_exception_specification : ExtWarn<
1612  err_missing_exception_specification.Text>,
1613  InGroup<DiagGroup<"missing-exception-spec">>;
1614def ext_ms_missing_exception_specification : ExtWarn<
1615  err_missing_exception_specification.Text>,
1616  InGroup<MicrosoftExceptionSpec>;
1617def err_noexcept_needs_constant_expression : Error<
1618  "argument to noexcept specifier must be a constant expression">;
1619def err_exception_spec_not_parsed : Error<
1620  "exception specification is not available until end of class definition">;
1621def err_exception_spec_cycle : Error<
1622  "exception specification of %0 uses itself">;
1623def err_exception_spec_incomplete_type : Error<
1624  "exception specification needed for member of incomplete class %0">;
1625def warn_wasm_dynamic_exception_spec_ignored : ExtWarn<
1626  "dynamic exception specifications with types are currently ignored in wasm">,
1627  InGroup<WebAssemblyExceptionSpec>;
1628
1629// C++ access checking
1630def err_class_redeclared_with_different_access : Error<
1631  "%0 redeclared with '%1' access">;
1632def err_access : Error<
1633  "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1634def ext_ms_using_declaration_inaccessible : ExtWarn<
1635  "using declaration referring to inaccessible member '%0' (which refers "
1636  "to accessible member '%1') is a Microsoft compatibility extension">,
1637    AccessControl, InGroup<MicrosoftUsingDecl>;
1638def err_access_ctor : Error<
1639  "calling a %select{private|protected}0 constructor of class %2">,
1640  AccessControl;
1641def ext_rvalue_to_reference_access_ctor : Extension<
1642  "C++98 requires an accessible copy constructor for class %2 when binding "
1643  "a reference to a temporary; was %select{private|protected}0">,
1644  AccessControl, InGroup<BindToTemporaryCopy>;
1645def err_access_base_ctor : Error<
1646  // The ERRORs represent other special members that aren't constructors, in
1647  // hopes that someone will bother noticing and reporting if they appear
1648  "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1649  "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1650  "|*ERROR*|}2constructor">, AccessControl;
1651def err_access_field_ctor : Error<
1652  // The ERRORs represent other special members that aren't constructors, in
1653  // hopes that someone will bother noticing and reporting if they appear
1654  "field of type %0 has %select{private|protected}2 "
1655  "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1656  AccessControl;
1657def err_access_friend_function : Error<
1658  "friend function %1 is a %select{private|protected}0 member of %3">,
1659  AccessControl;
1660
1661def err_access_dtor : Error<
1662  "calling a %select{private|protected}1 destructor of class %0">,
1663  AccessControl;
1664def err_access_dtor_base :
1665    Error<"base class %0 has %select{private|protected}1 destructor">,
1666    AccessControl;
1667def err_access_dtor_vbase :
1668    Error<"inherited virtual base class %1 has "
1669    "%select{private|protected}2 destructor">,
1670    AccessControl;
1671def err_access_dtor_temp :
1672    Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1673    AccessControl;
1674def err_access_dtor_exception :
1675    Error<"exception object of type %0 has %select{private|protected}1 "
1676          "destructor">, AccessControl;
1677def err_access_dtor_field :
1678    Error<"field of type %1 has %select{private|protected}2 destructor">,
1679    AccessControl;
1680def err_access_dtor_var :
1681    Error<"variable of type %1 has %select{private|protected}2 destructor">,
1682    AccessControl;
1683def err_access_dtor_ivar :
1684    Error<"instance variable of type %0 has %select{private|protected}1 "
1685          "destructor">,
1686    AccessControl;
1687def note_previous_access_declaration : Note<
1688  "previously declared '%1' here">;
1689def note_access_natural : Note<
1690  "%select{|implicitly }1declared %select{private|protected}0 here">;
1691def note_access_constrained_by_path : Note<
1692  "constrained by %select{|implicitly }1%select{private|protected}0"
1693  " inheritance here">;
1694def note_access_protected_restricted_noobject : Note<
1695  "must name member using the type of the current context %0">;
1696def note_access_protected_restricted_ctordtor : Note<
1697  "protected %select{constructor|destructor}0 can only be used to "
1698  "%select{construct|destroy}0 a base class subobject">;
1699def note_access_protected_restricted_object : Note<
1700  "can only access this member on an object of type %0">;
1701def warn_cxx98_compat_sfinae_access_control : Warning<
1702  "substitution failure due to access control is incompatible with C++98">,
1703  InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1704
1705// C++ name lookup
1706def err_incomplete_nested_name_spec : Error<
1707  "incomplete type %0 named in nested name specifier">;
1708def err_dependent_nested_name_spec : Error<
1709  "nested name specifier for a declaration cannot depend on a template "
1710  "parameter">;
1711def err_nested_name_member_ref_lookup_ambiguous : Error<
1712  "lookup of %0 in member access expression is ambiguous">;
1713def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1714  "lookup of %0 in member access expression is ambiguous; using member of %1">,
1715  InGroup<AmbigMemberTemplate>;
1716def note_ambig_member_ref_object_type : Note<
1717  "lookup in the object type %0 refers here">;
1718def note_ambig_member_ref_scope : Note<
1719  "lookup from the current scope refers here">;
1720def err_qualified_member_nonclass : Error<
1721  "qualified member access refers to a member in %0">;
1722def err_incomplete_member_access : Error<
1723  "member access into incomplete type %0">;
1724def err_incomplete_type : Error<
1725  "incomplete type %0 where a complete type is required">;
1726def warn_cxx98_compat_enum_nested_name_spec : Warning<
1727  "enumeration type in nested name specifier is incompatible with C++98">,
1728  InGroup<CXX98Compat>, DefaultIgnore;
1729def err_nested_name_spec_is_not_class : Error<
1730  "%0 cannot appear before '::' because it is not a class"
1731  "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1732def ext_nested_name_spec_is_enum : ExtWarn<
1733  "use of enumeration in a nested name specifier is a C++11 extension">,
1734  InGroup<CXX11>;
1735def err_out_of_line_qualified_id_type_names_constructor : Error<
1736  "qualified reference to %0 is a constructor name rather than a "
1737  "%select{template name|type}1 in this context">;
1738def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1739  "ISO C++ specifies that "
1740  "qualified reference to %0 is a constructor name rather than a "
1741  "%select{template name|type}1 in this context, despite preceding "
1742  "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1743  InGroup<DiagGroup<"injected-class-name">>;
1744
1745// C++ class members
1746def err_storageclass_invalid_for_member : Error<
1747  "storage class specified for a member declaration">;
1748def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1749def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1750def ext_mutable_reference : ExtWarn<
1751  "'mutable' on a reference type is a Microsoft extension">,
1752  InGroup<MicrosoftMutableReference>;
1753def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1754def err_mutable_nonmember : Error<
1755  "'mutable' can only be applied to member variables">;
1756def err_virtual_in_union : Error<
1757  "unions cannot have virtual functions">;
1758def err_virtual_non_function : Error<
1759  "'virtual' can only appear on non-static member functions">;
1760def err_virtual_out_of_class : Error<
1761  "'virtual' can only be specified inside the class definition">;
1762def err_virtual_member_function_template : Error<
1763  "'virtual' cannot be specified on member function templates">;
1764def err_static_overrides_virtual : Error<
1765  "'static' member function %0 overrides a virtual function in a base class">;
1766def err_explicit_non_function : Error<
1767  "'explicit' can only appear on non-static member functions">;
1768def err_explicit_out_of_class : Error<
1769  "'explicit' can only be specified inside the class definition">;
1770def err_explicit_non_ctor_or_conv_function : Error<
1771  "'explicit' can only be applied to a constructor or conversion function">;
1772def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1773def err_static_out_of_line : Error<
1774  "'static' can only be specified inside the class definition">;
1775def ext_static_out_of_line : ExtWarn<
1776  err_static_out_of_line.Text>,
1777  InGroup<MicrosoftTemplate>;
1778def err_storage_class_for_static_member : Error<
1779  "static data member definition cannot specify a storage class">;
1780def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1781def err_not_integral_type_bitfield : Error<
1782  "bit-field %0 has non-integral type %1">;
1783def err_not_integral_type_anon_bitfield : Error<
1784  "anonymous bit-field has non-integral type %0">;
1785def err_anon_bitfield_qualifiers : Error<
1786  "anonymous bit-field cannot have qualifiers">;
1787def err_member_function_initialization : Error<
1788  "initializer on function does not look like a pure-specifier">;
1789def err_non_virtual_pure : Error<
1790  "%0 is not virtual and cannot be declared pure">;
1791def ext_pure_function_definition : ExtWarn<
1792  "function definition with pure-specifier is a Microsoft extension">,
1793  InGroup<MicrosoftPureDefinition>;
1794def err_qualified_member_of_unrelated : Error<
1795  "%q0 is not a member of class %1">;
1796
1797def err_member_function_call_bad_cvr : Error<
1798  "'this' argument to member function %0 has type %1, but function is not marked "
1799  "%select{const|restrict|const or restrict|volatile|const or volatile|"
1800  "volatile or restrict|const, volatile, or restrict}2">;
1801def err_member_function_call_bad_ref : Error<
1802  "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1803  "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1804def err_member_function_call_bad_type : Error<
1805  "cannot initialize object parameter of type %0 with an expression "
1806  "of type %1">;
1807
1808def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1809  "call to pure virtual member function %0 has undefined behavior; "
1810  "overrides of %0 in subclasses are not available in the "
1811  "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
1812
1813def select_special_member_kind : TextSubstitution<
1814  "%select{default constructor|copy constructor|move constructor|"
1815  "copy assignment operator|move assignment operator|destructor}0">;
1816
1817def note_member_declared_at : Note<"member is declared here">;
1818def note_ivar_decl : Note<"instance variable is declared here">;
1819def note_bitfield_decl : Note<"bit-field is declared here">;
1820def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1821def note_member_synthesized_at : Note<
1822  "in %select{implicit|defaulted}0 %sub{select_special_member_kind}1 for %2 "
1823  "first required here">;
1824def note_comparison_synthesized_at : Note<
1825  "in defaulted %sub{select_defaulted_comparison_kind}0 for %1 "
1826  "first required here">;
1827def err_missing_default_ctor : Error<
1828  "%select{constructor for %1 must explicitly initialize the|"
1829  "implicit default constructor for %1 must explicitly initialize the|"
1830  "cannot use constructor inherited from base class %4;}0 "
1831  "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1832  "does not have a default constructor">;
1833def note_due_to_dllexported_class : Note<
1834  "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1835
1836def err_illegal_union_or_anon_struct_member : Error<
1837  "%select{anonymous struct|union}0 member %1 has a non-trivial "
1838  "%sub{select_special_member_kind}2">;
1839
1840def warn_frame_address : Warning<
1841  "calling '%0' with a nonzero argument is unsafe">,
1842  InGroup<FrameAddress>, DefaultIgnore;
1843
1844def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1845  "%select{anonymous struct|union}0 member %1 with a non-trivial "
1846  "%sub{select_special_member_kind}2 is incompatible with C++98">,
1847  InGroup<CXX98Compat>, DefaultIgnore;
1848
1849def note_nontrivial_virtual_dtor : Note<
1850  "destructor for %0 is not trivial because it is virtual">;
1851def note_nontrivial_has_virtual : Note<
1852  "because type %0 has a virtual %select{member function|base class}1">;
1853def note_nontrivial_no_def_ctor : Note<
1854  "because %select{base class of |field of |}0type %1 has no "
1855  "default constructor">;
1856def note_user_declared_ctor : Note<
1857  "implicit default constructor suppressed by user-declared constructor">;
1858def note_nontrivial_no_copy : Note<
1859  "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1860  "assignment operator|<<ERROR>>}2 can be used to "
1861  "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1862  "%select{base class|field|an object}0 of type %3">;
1863def note_nontrivial_user_provided : Note<
1864  "because %select{base class of |field of |}0type %1 has a user-provided "
1865  "%sub{select_special_member_kind}2">;
1866def note_nontrivial_default_member_init : Note<
1867  "because field %0 has an initializer">;
1868def note_nontrivial_param_type : Note<
1869  "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1870def note_nontrivial_default_arg : Note<"because it has a default argument">;
1871def note_nontrivial_variadic : Note<"because it is a variadic function">;
1872def note_nontrivial_subobject : Note<
1873  "because the function selected to %select{construct|copy|move|copy|move|"
1874  "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1875def note_nontrivial_objc_ownership : Note<
1876  "because type %0 has a member with %select{no|no|__strong|__weak|"
1877  "__autoreleasing}1 ownership">;
1878
1879/// Selector for a TagTypeKind value.
1880def select_tag_type_kind : TextSubstitution<
1881  "%select{struct|interface|union|class|enum}0">;
1882
1883def err_static_data_member_not_allowed_in_anon_struct : Error<
1884  "static data member %0 not allowed in anonymous "
1885  "%sub{select_tag_type_kind}1">;
1886def ext_static_data_member_in_union : ExtWarn<
1887  "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1888def warn_cxx98_compat_static_data_member_in_union : Warning<
1889  "static data member %0 in union is incompatible with C++98">,
1890  InGroup<CXX98Compat>, DefaultIgnore;
1891def ext_union_member_of_reference_type : ExtWarn<
1892  "union member %0 has reference type %1, which is a Microsoft extension">,
1893  InGroup<MicrosoftUnionMemberReference>;
1894def err_union_member_of_reference_type : Error<
1895  "union member %0 has reference type %1">;
1896def ext_anonymous_struct_union_qualified : Extension<
1897  "anonymous %select{struct|union}0 cannot be '%1'">;
1898def err_different_return_type_for_overriding_virtual_function : Error<
1899  "virtual function %0 has a different return type "
1900  "%diff{($) than the function it overrides (which has return type $)|"
1901  "than the function it overrides}1,2">;
1902def note_overridden_virtual_function : Note<
1903  "overridden virtual function is here">;
1904def err_conflicting_overriding_cc_attributes : Error<
1905  "virtual function %0 has different calling convention attributes "
1906  "%diff{($) than the function it overrides (which has calling convention $)|"
1907  "than the function it overrides}1,2">;
1908def warn_overriding_method_missing_noescape : Warning<
1909  "parameter of overriding method should be annotated with "
1910  "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1911def note_overridden_marked_noescape : Note<
1912  "parameter of overridden method is annotated with __attribute__((noescape))">;
1913def note_cat_conform_to_noescape_prot : Note<
1914  "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
1915
1916def err_covariant_return_inaccessible_base : Error<
1917  "invalid covariant return for virtual function: %1 is a "
1918  "%select{private|protected}2 base class of %0">, AccessControl;
1919def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1920  "return type of virtual function %3 is not covariant with the return type of "
1921  "the function it overrides (ambiguous conversion from derived class "
1922  "%0 to base class %1:%2)">;
1923def err_covariant_return_not_derived : Error<
1924  "return type of virtual function %0 is not covariant with the return type of "
1925  "the function it overrides (%1 is not derived from %2)">;
1926def err_covariant_return_incomplete : Error<
1927  "return type of virtual function %0 is not covariant with the return type of "
1928  "the function it overrides (%1 is incomplete)">;
1929def err_covariant_return_type_different_qualifications : Error<
1930  "return type of virtual function %0 is not covariant with the return type of "
1931  "the function it overrides (%1 has different qualifiers than %2)">;
1932def err_covariant_return_type_class_type_more_qualified : Error<
1933  "return type of virtual function %0 is not covariant with the return type of "
1934  "the function it overrides (class type %1 is more qualified than class "
1935  "type %2">;
1936
1937// C++ implicit special member functions
1938def note_in_declaration_of_implicit_special_member : Note<
1939  "while declaring the implicit %sub{select_special_member_kind}1"
1940  " for %0">;
1941
1942// C++ constructors
1943def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1944def err_invalid_qualified_constructor : Error<
1945  "'%0' qualifier is not allowed on a constructor">;
1946def err_ref_qualifier_constructor : Error<
1947  "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1948
1949def err_constructor_return_type : Error<
1950  "constructor cannot have a return type">;
1951def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1952def err_constructor_byvalue_arg : Error<
1953  "copy constructor must pass its first argument by reference">;
1954def warn_no_constructor_for_refconst : Warning<
1955  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1956  "constructor to initialize its non-modifiable members">;
1957def note_refconst_member_not_initialized : Note<
1958  "%select{const|reference}0 member %1 will never be initialized">;
1959def ext_ms_explicit_constructor_call : ExtWarn<
1960  "explicit constructor calls are a Microsoft extension">,
1961  InGroup<MicrosoftExplicitConstructorCall>;
1962
1963// C++ destructors
1964def err_destructor_not_member : Error<
1965  "destructor must be a non-static member function">;
1966def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1967def err_invalid_qualified_destructor : Error<
1968  "'%0' qualifier is not allowed on a destructor">;
1969def err_ref_qualifier_destructor : Error<
1970  "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1971def err_destructor_return_type : Error<"destructor cannot have a return type">;
1972def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1973def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1974def err_destructor_variadic : Error<"destructor cannot be variadic">;
1975def ext_destructor_typedef_name : ExtWarn<
1976  "destructor cannot be declared using a %select{typedef|type alias}1 %0 "
1977  "of the class name">, DefaultError, InGroup<DiagGroup<"dtor-typedef">>;
1978def err_undeclared_destructor_name : Error<
1979  "undeclared identifier %0 in destructor name">;
1980def err_destructor_name : Error<
1981  "expected the class name after '~' to name the enclosing class">;
1982def err_destructor_name_nontype : Error<
1983  "identifier %0 after '~' in destructor name does not name a type">;
1984def err_destructor_expr_mismatch : Error<
1985  "identifier %0 in object destruction expression does not name the type "
1986  "%1 of the object being destroyed">;
1987def err_destructor_expr_nontype : Error<
1988  "identifier %0 in object destruction expression does not name a type">;
1989def err_destructor_expr_type_mismatch : Error<
1990  "destructor type %0 in object destruction expression does not match the "
1991  "type %1 of the object being destroyed">;
1992def note_destructor_type_here : Note<
1993  "type %0 found by destructor name lookup">;
1994def note_destructor_nontype_here : Note<
1995  "non-type declaration found by destructor name lookup">;
1996def ext_dtor_named_in_wrong_scope : Extension<
1997  "ISO C++ requires the name after '::~' to be found in the same scope as "
1998  "the name before '::~'">, InGroup<DtorName>;
1999def ext_qualified_dtor_named_in_lexical_scope : ExtWarn<
2000  "qualified destructor name only found in lexical scope; omit the qualifier "
2001  "to find this type name by unqualified lookup">, InGroup<DtorName>;
2002def ext_dtor_name_ambiguous : Extension<
2003  "ISO C++ considers this destructor name lookup to be ambiguous">,
2004  InGroup<DtorName>;
2005
2006def err_destroy_attr_on_non_static_var : Error<
2007  "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
2008  " variable with static or thread storage duration">;
2009
2010def err_destructor_template : Error<
2011  "destructor cannot be declared as a template">;
2012
2013// C++ initialization
2014def err_init_conversion_failed : Error<
2015  "cannot initialize %select{a variable|a parameter|template parameter|"
2016  "return object|statement expression result|an "
2017  "exception object|a member subobject|an array element|a new value|a value|a "
2018  "base class|a constructor delegation|a vector element|a block element|a "
2019  "block element|a complex element|a lambda capture|a compound literal "
2020  "initializer|a related result|a parameter of CF audited function}0 "
2021  "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
2022  "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
2023  "%select{|: different classes%diff{ ($ vs $)|}5,6"
2024  "|: different number of parameters (%5 vs %6)"
2025  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
2026  "|: different return type%diff{ ($ vs $)|}5,6"
2027  "|: different qualifiers (%5 vs %6)"
2028  "|: different exception specifications}4">;
2029def note_forward_class_conversion : Note<"%0 is not defined, but forward "
2030  "declared here; conversion would be valid if it was derived from %1">;
2031
2032def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
2033  "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
2034def err_lvalue_reference_bind_to_initlist : Error<
2035  "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
2036  "initializer list temporary">;
2037def err_lvalue_reference_bind_to_temporary : Error<
2038  "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
2039  "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
2040def err_lvalue_reference_bind_to_unrelated : Error<
2041  "%select{non-const|volatile}0 lvalue reference "
2042  "%diff{to type $ cannot bind to a value of unrelated type $|"
2043  "cannot bind to a value of unrelated type}1,2">;
2044def err_reference_bind_drops_quals : Error<
2045  "binding reference %diff{of type $ to value of type $|to value}0,1 "
2046  "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space|"
2047  "not permitted due to incompatible qualifiers}2">;
2048def err_reference_bind_failed : Error<
2049  "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
2050  "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
2051  "incompatible type}0,3">;
2052def err_reference_bind_temporary_addrspace : Error<
2053  "reference of type %0 cannot bind to a temporary object because of "
2054  "address space mismatch">;
2055def err_reference_bind_init_list : Error<
2056  "reference to type %0 cannot bind to an initializer list">;
2057def err_init_list_bad_dest_type : Error<
2058  "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
2059  "list">;
2060def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
2061  "aggregate initialization of type %0 with user-declared constructors "
2062  "is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
2063
2064def err_reference_bind_to_bitfield : Error<
2065  "%select{non-const|volatile}0 reference cannot bind to "
2066  "bit-field%select{| %1}2">;
2067def err_reference_bind_to_vector_element : Error<
2068  "%select{non-const|volatile}0 reference cannot bind to vector element">;
2069def err_reference_bind_to_matrix_element : Error<
2070  "%select{non-const|volatile}0 reference cannot bind to matrix element">;
2071def err_reference_var_requires_init : Error<
2072  "declaration of reference variable %0 requires an initializer">;
2073def err_reference_without_init : Error<
2074  "reference to type %0 requires an initializer">;
2075def note_value_initialization_here : Note<
2076  "in value-initialization of type %0 here">;
2077def err_reference_has_multiple_inits : Error<
2078  "reference cannot be initialized with multiple values">;
2079def err_init_non_aggr_init_list : Error<
2080  "initialization of non-aggregate type %0 with an initializer list">;
2081def err_init_reference_member_uninitialized : Error<
2082  "reference member of type %0 uninitialized">;
2083def note_uninit_reference_member : Note<
2084  "uninitialized reference member is here">;
2085def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
2086  InGroup<Uninitialized>;
2087def warn_base_class_is_uninit : Warning<
2088  "base class %0 is uninitialized when used here to access %q1">,
2089  InGroup<Uninitialized>;
2090def warn_reference_field_is_uninit : Warning<
2091  "reference %0 is not yet bound to a value when used here">,
2092  InGroup<Uninitialized>;
2093def note_uninit_in_this_constructor : Note<
2094  "during field initialization in %select{this|the implicit default}0 "
2095  "constructor">;
2096def warn_static_self_reference_in_init : Warning<
2097  "static variable %0 is suspiciously used within its own initialization">,
2098  InGroup<UninitializedStaticSelfInit>;
2099def warn_uninit_self_reference_in_init : Warning<
2100  "variable %0 is uninitialized when used within its own initialization">,
2101  InGroup<Uninitialized>;
2102def warn_uninit_self_reference_in_reference_init : Warning<
2103  "reference %0 is not yet bound to a value when used within its own"
2104  " initialization">,
2105  InGroup<Uninitialized>;
2106def warn_uninit_var : Warning<
2107  "variable %0 is uninitialized when %select{used here|captured by block}1">,
2108  InGroup<Uninitialized>, DefaultIgnore;
2109def warn_sometimes_uninit_var : Warning<
2110  "variable %0 is %select{used|captured}1 uninitialized whenever "
2111  "%select{'%3' condition is %select{true|false}4|"
2112  "'%3' loop %select{is entered|exits because its condition is false}4|"
2113  "'%3' loop %select{condition is true|exits because its condition is false}4|"
2114  "switch %3 is taken|"
2115  "its declaration is reached|"
2116  "%3 is called}2">,
2117  InGroup<UninitializedSometimes>, DefaultIgnore;
2118def warn_maybe_uninit_var : Warning<
2119  "variable %0 may be uninitialized when "
2120  "%select{used here|captured by block}1">,
2121  InGroup<UninitializedMaybe>, DefaultIgnore;
2122def note_var_declared_here : Note<"variable %0 is declared here">;
2123def note_uninit_var_use : Note<
2124  "%select{uninitialized use occurs|variable is captured by block}0 here">;
2125def warn_uninit_byref_blockvar_captured_by_block : Warning<
2126  "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
2127  "block">, InGroup<Uninitialized>, DefaultIgnore;
2128def note_block_var_fixit_add_initialization : Note<
2129  "did you mean to use __block %0?">;
2130def note_in_omitted_aggregate_initializer : Note<
2131  "in implicit initialization of %select{"
2132  "array element %1 with omitted initializer|"
2133  "field %1 with omitted initializer|"
2134  "trailing array elements in runtime-sized array new}0">;
2135def note_in_reference_temporary_list_initializer : Note<
2136  "in initialization of temporary of type %0 created to "
2137  "list-initialize this reference">;
2138def note_var_fixit_add_initialization : Note<
2139  "initialize the variable %0 to silence this warning">;
2140def note_uninit_fixit_remove_cond : Note<
2141  "remove the %select{'%1' if its condition|condition if it}0 "
2142  "is always %select{false|true}2">;
2143def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
2144def err_list_init_in_parens : Error<
2145  "cannot initialize %select{non-class|reference}0 type %1 with a "
2146  "parenthesized initializer list">;
2147
2148def warn_uninit_const_reference : Warning<
2149  "variable %0 is uninitialized when passed as a const reference argument "
2150  "here">, InGroup<UninitializedConstReference>, DefaultIgnore;
2151
2152def warn_unsequenced_mod_mod : Warning<
2153  "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
2154def warn_unsequenced_mod_use : Warning<
2155  "unsequenced modification and access to %0">, InGroup<Unsequenced>;
2156
2157def select_initialized_entity_kind : TextSubstitution<
2158  "%select{copying variable|copying parameter|initializing template parameter|"
2159  "returning object|initializing statement expression result|"
2160  "throwing object|copying member subobject|copying array element|"
2161  "allocating object|copying temporary|initializing base subobject|"
2162  "initializing vector element|capturing value}0">;
2163
2164def err_temp_copy_no_viable : Error<
2165  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
2166def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
2167  "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
2168  "C++98 requires a copy constructor when binding a reference to a temporary">,
2169  InGroup<BindToTemporaryCopy>;
2170def err_temp_copy_ambiguous : Error<
2171  "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
2172  "of type %1">;
2173def err_temp_copy_deleted : Error<
2174  "%sub{select_initialized_entity_kind}0 of type %1 "
2175  "invokes deleted constructor">;
2176def err_temp_copy_incomplete : Error<
2177  "copying a temporary object of incomplete type %0">;
2178def warn_cxx98_compat_temp_copy : Warning<
2179  "%sub{select_initialized_entity_kind}1 "
2180  "of type %2 when binding a reference to a temporary would %select{invoke "
2181  "an inaccessible constructor|find no viable constructor|find ambiguous "
2182  "constructors|invoke a deleted constructor}0 in C++98">,
2183  InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2184def err_selected_explicit_constructor : Error<
2185  "chosen constructor is explicit in copy-initialization">;
2186def note_explicit_ctor_deduction_guide_here : Note<
2187  "explicit %select{constructor|deduction guide}0 declared here">;
2188
2189// C++11 decltype
2190def err_decltype_in_declarator : Error<
2191    "'decltype' cannot be used to name a declaration">;
2192
2193// C++11 auto
2194def warn_cxx98_compat_auto_type_specifier : Warning<
2195  "'auto' type specifier is incompatible with C++98">,
2196  InGroup<CXX98Compat>, DefaultIgnore;
2197def err_auto_variable_cannot_appear_in_own_initializer : Error<
2198  "variable %0 declared with deduced type %1 "
2199  "cannot appear in its own initializer">;
2200def err_binding_cannot_appear_in_own_initializer : Error<
2201  "binding %0 cannot appear in the initializer of its own "
2202  "decomposition declaration">;
2203def err_illegal_decl_array_of_auto : Error<
2204  "'%0' declared as array of %1">;
2205def err_new_array_of_auto : Error<
2206  "cannot allocate array of 'auto'">;
2207def err_auto_not_allowed : Error<
2208  "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2209  "use of "
2210  "%select{class template|function template|variable template|alias template|"
2211  "template template parameter|concept|template}2 %3 requires template "
2212  "arguments; argument deduction}0 not allowed "
2213  "%select{in function prototype"
2214  "|in non-static struct member|in struct member"
2215  "|in non-static union member|in union member"
2216  "|in non-static class member|in interface member"
2217  "|in exception declaration|in template parameter until C++17|in block literal"
2218  "|in template argument|in typedef|in type alias|in function return type"
2219  "|in conversion function type|here|in lambda parameter"
2220  "|in type allocated by 'new'|in K&R-style function parameter"
2221  "|in template parameter|in friend declaration|in function prototype that is "
2222  "not a function declaration|in requires expression parameter}1">;
2223def err_dependent_deduced_tst : Error<
2224  "typename specifier refers to "
2225  "%select{class template|function template|variable template|alias template|"
2226  "template template parameter|template}0 member in %1; "
2227  "argument deduction not allowed here">;
2228def err_deduced_tst : Error<
2229  "typename specifier refers to "
2230  "%select{class template|function template|variable template|alias template|"
2231  "template template parameter|template}0; argument deduction not allowed "
2232  "here">;
2233def err_auto_not_allowed_var_inst : Error<
2234  "'auto' variable template instantiation is not allowed">;
2235def err_auto_var_requires_init : Error<
2236  "declaration of variable %0 with deduced type %1 requires an initializer">;
2237def err_auto_new_requires_ctor_arg : Error<
2238  "new expression for type %0 requires a constructor argument">;
2239def ext_auto_new_list_init : Extension<
2240  "ISO C++ standards before C++17 do not allow new expression for "
2241  "type %0 to use list-initialization">, InGroup<CXX17>;
2242def err_auto_var_init_no_expression : Error<
2243  "initializer for variable %0 with type %1 is empty">;
2244def err_auto_var_init_multiple_expressions : Error<
2245  "initializer for variable %0 with type %1 contains multiple expressions">;
2246def err_auto_var_init_paren_braces : Error<
2247  "cannot deduce type for variable %1 with type %2 from "
2248  "%select{parenthesized|nested}0 initializer list">;
2249def err_auto_new_ctor_multiple_expressions : Error<
2250  "new expression for type %0 contains multiple constructor arguments">;
2251def err_auto_missing_trailing_return : Error<
2252  "'auto' return without trailing return type; deduced return types are a "
2253  "C++14 extension">;
2254def err_deduced_return_type : Error<
2255  "deduced return types are a C++14 extension">;
2256def err_trailing_return_without_auto : Error<
2257  "function with trailing return type must specify return type 'auto', not %0">;
2258def err_trailing_return_in_parens : Error<
2259  "trailing return type may not be nested within parentheses">;
2260def err_auto_var_deduction_failure : Error<
2261  "variable %0 with type %1 has incompatible initializer of type %2">;
2262def err_auto_var_deduction_failure_from_init_list : Error<
2263  "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2264def err_auto_new_deduction_failure : Error<
2265  "new expression for type %0 has incompatible constructor argument of type %1">;
2266def err_auto_inconsistent_deduction : Error<
2267  "deduced conflicting types %diff{($ vs $) |}0,1"
2268  "for initializer list element type">;
2269def err_auto_different_deductions : Error<
2270  "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2271  "deduced as %1 in declaration of %2 and "
2272  "deduced as %3 in declaration of %4">;
2273def err_auto_non_deduced_not_alone : Error<
2274  "%select{function with deduced return type|"
2275  "declaration with trailing return type}0 "
2276  "must be the only declaration in its group">;
2277def err_implied_std_initializer_list_not_found : Error<
2278  "cannot deduce type of initializer list because std::initializer_list was "
2279  "not found; include <initializer_list>">;
2280def err_malformed_std_initializer_list : Error<
2281  "std::initializer_list must be a class template with a single type parameter">;
2282def err_auto_init_list_from_c : Error<
2283  "cannot use __auto_type with initializer list in C">;
2284def err_auto_bitfield : Error<
2285  "cannot pass bit-field as __auto_type initializer in C">;
2286
2287// C++1y decltype(auto) type
2288def err_decltype_auto_invalid : Error<
2289  "'decltype(auto)' not allowed here">;
2290def err_decltype_auto_cannot_be_combined : Error<
2291  "'decltype(auto)' cannot be combined with other type specifiers">;
2292def err_decltype_auto_function_declarator_not_declaration : Error<
2293  "'decltype(auto)' can only be used as a return type "
2294  "in a function declaration">;
2295def err_decltype_auto_compound_type : Error<
2296  "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2297def err_decltype_auto_initializer_list : Error<
2298  "cannot deduce 'decltype(auto)' from initializer list">;
2299
2300// C++17 deduced class template specialization types
2301def err_deduced_class_template_compound_type : Error<
2302  "cannot %select{form pointer to|form reference to|form array of|"
2303  "form function returning|use parentheses when declaring variable with}0 "
2304  "deduced class template specialization type">;
2305def err_deduced_non_class_template_specialization_type : Error<
2306  "%select{<error>|function template|variable template|alias template|"
2307  "template template parameter|concept|template}0 %1 requires template "
2308  "arguments; argument deduction only allowed for class templates">;
2309def err_deduced_class_template_ctor_ambiguous : Error<
2310  "ambiguous deduction for template arguments of %0">;
2311def err_deduced_class_template_ctor_no_viable : Error<
2312  "no viable constructor or deduction guide for deduction of "
2313  "template arguments of %0">;
2314def err_deduced_class_template_incomplete : Error<
2315  "template %0 has no definition and no %select{|viable }1deduction guides "
2316  "for deduction of template arguments">;
2317def err_deduced_class_template_deleted : Error<
2318  "class template argument deduction for %0 selected a deleted constructor">;
2319def err_deduced_class_template_explicit : Error<
2320  "class template argument deduction for %0 selected an explicit "
2321  "%select{constructor|deduction guide}1 for copy-list-initialization">;
2322def err_deduction_guide_no_trailing_return_type : Error<
2323  "deduction guide declaration without trailing return type">;
2324def err_deduction_guide_bad_trailing_return_type : Error<
2325  "deduced type %1 of deduction guide is not %select{|written as }2"
2326  "a specialization of template %0">;
2327def err_deduction_guide_with_complex_decl : Error<
2328  "cannot specify any part of a return type in the "
2329  "declaration of a deduction guide">;
2330def err_deduction_guide_invalid_specifier : Error<
2331  "deduction guide cannot be declared '%0'">;
2332def err_deduction_guide_name_not_class_template : Error<
2333  "cannot specify deduction guide for "
2334  "%select{<error>|function template|variable template|alias template|"
2335  "template template parameter|concept|dependent template name}0 %1">;
2336def err_deduction_guide_wrong_scope : Error<
2337  "deduction guide must be declared in the same scope as template %q0">;
2338def err_deduction_guide_defines_function : Error<
2339  "deduction guide cannot have a function definition">;
2340def err_deduction_guide_redeclared : Error<
2341  "redeclaration of deduction guide">;
2342def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2343  "%select{explicitly instantiated|explicitly specialized}0">;
2344def err_deduction_guide_template_not_deducible : Error<
2345  "deduction guide template contains "
2346  "%select{a template parameter|template parameters}0 that cannot be "
2347  "deduced">;
2348def err_deduction_guide_wrong_access : Error<
2349  "deduction guide has different access from the corresponding "
2350  "member template">;
2351def note_deduction_guide_template_access : Note<
2352  "member template declared %0 here">;
2353def note_deduction_guide_access : Note<
2354  "deduction guide declared %0 by intervening access specifier">;
2355def warn_cxx14_compat_class_template_argument_deduction : Warning<
2356  "class template argument deduction is incompatible with C++ standards "
2357  "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2358  InGroup<CXXPre17Compat>, DefaultIgnore;
2359def warn_ctad_maybe_unsupported : Warning<
2360  "%0 may not intend to support class template argument deduction">,
2361  InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2362def note_suppress_ctad_maybe_unsupported : Note<
2363  "add a deduction guide to suppress this warning">;
2364
2365
2366// C++14 deduced return types
2367def err_auto_fn_deduction_failure : Error<
2368  "cannot deduce return type %0 from returned value of type %1">;
2369def err_auto_fn_different_deductions : Error<
2370  "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2371  "deduced as %2 in earlier return statement">;
2372def err_auto_fn_used_before_defined : Error<
2373  "function %0 with deduced return type cannot be used before it is defined">;
2374def err_auto_fn_no_return_but_not_auto : Error<
2375  "cannot deduce return type %0 for function with no return statements">;
2376def err_auto_fn_return_void_but_not_auto : Error<
2377  "cannot deduce return type %0 from omitted return expression">;
2378def err_auto_fn_return_init_list : Error<
2379  "cannot deduce return type from initializer list">;
2380def err_auto_fn_virtual : Error<
2381  "function with deduced return type cannot be virtual">;
2382def warn_cxx11_compat_deduced_return_type : Warning<
2383  "return type deduction is incompatible with C++ standards before C++14">,
2384  InGroup<CXXPre14Compat>, DefaultIgnore;
2385
2386// C++11 override control
2387def override_keyword_only_allowed_on_virtual_member_functions : Error<
2388  "only virtual member functions can be marked '%0'">;
2389def override_keyword_hides_virtual_member_function : Error<
2390  "non-virtual member function marked '%0' hides virtual member "
2391  "%select{function|functions}1">;
2392def err_function_marked_override_not_overriding : Error<
2393  "%0 marked 'override' but does not override any member functions">;
2394def warn_destructor_marked_not_override_overriding : TextSubstitution <
2395  "%0 overrides a destructor but is not marked 'override'">;
2396def warn_function_marked_not_override_overriding : TextSubstitution <
2397  "%0 overrides a member function but is not marked 'override'">;
2398def warn_inconsistent_destructor_marked_not_override_overriding : Warning <
2399  "%sub{warn_destructor_marked_not_override_overriding}0">,
2400  InGroup<CXX11WarnInconsistentOverrideDestructor>, DefaultIgnore;
2401def warn_inconsistent_function_marked_not_override_overriding : Warning <
2402  "%sub{warn_function_marked_not_override_overriding}0">,
2403  InGroup<CXX11WarnInconsistentOverrideMethod>;
2404def warn_suggest_destructor_marked_not_override_overriding : Warning <
2405  "%sub{warn_destructor_marked_not_override_overriding}0">,
2406  InGroup<CXX11WarnSuggestOverrideDestructor>, DefaultIgnore;
2407def warn_suggest_function_marked_not_override_overriding : Warning <
2408  "%sub{warn_function_marked_not_override_overriding}0">,
2409  InGroup<CXX11WarnSuggestOverride>, DefaultIgnore;
2410def err_class_marked_final_used_as_base : Error<
2411  "base %0 is marked '%select{final|sealed}1'">;
2412def warn_abstract_final_class : Warning<
2413  "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2414def warn_final_dtor_non_final_class : Warning<
2415  "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
2416  InGroup<FinalDtorNonFinalClass>;
2417def note_final_dtor_non_final_class_silence : Note<
2418  "mark %0 as '%select{final|sealed}1' to silence this warning">;
2419
2420// C++11 attributes
2421def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2422
2423// C++11 final
2424def err_final_function_overridden : Error<
2425  "declaration of %0 overrides a '%select{final|sealed}1' function">;
2426
2427// C++11 scoped enumerations
2428def err_enum_invalid_underlying : Error<
2429  "non-integral type %0 is an invalid underlying type">;
2430def err_enumerator_too_large : Error<
2431  "enumerator value is not representable in the underlying type %0">;
2432def ext_enumerator_too_large : Extension<
2433  "enumerator value is not representable in the underlying type %0">,
2434  InGroup<MicrosoftEnumValue>;
2435def err_enumerator_wrapped : Error<
2436  "enumerator value %0 is not representable in the underlying type %1">;
2437def err_enum_redeclare_type_mismatch : Error<
2438  "enumeration redeclared with different underlying type %0 (was %1)">;
2439def err_enum_redeclare_fixed_mismatch : Error<
2440  "enumeration previously declared with %select{non|}0fixed underlying type">;
2441def err_enum_redeclare_scoped_mismatch : Error<
2442  "enumeration previously declared as %select{un|}0scoped">;
2443def err_only_enums_have_underlying_types : Error<
2444  "only enumeration types have underlying types">;
2445def err_underlying_type_of_incomplete_enum : Error<
2446  "cannot determine underlying type of incomplete enumeration type %0">;
2447
2448// C++11 delegating constructors
2449def err_delegating_ctor : Error<
2450  "delegating constructors are permitted only in C++11">;
2451def warn_cxx98_compat_delegating_ctor : Warning<
2452  "delegating constructors are incompatible with C++98">,
2453  InGroup<CXX98Compat>, DefaultIgnore;
2454def err_delegating_initializer_alone : Error<
2455  "an initializer for a delegating constructor must appear alone">;
2456def warn_delegating_ctor_cycle : Warning<
2457  "constructor for %0 creates a delegation cycle">, DefaultError,
2458  InGroup<DelegatingCtorCycles>;
2459def note_it_delegates_to : Note<"it delegates to">;
2460def note_which_delegates_to : Note<"which delegates to">;
2461
2462// C++11 range-based for loop
2463def err_for_range_decl_must_be_var : Error<
2464  "for range declaration must declare a variable">;
2465def err_for_range_storage_class : Error<
2466  "loop variable %0 may not be declared %select{'extern'|'static'|"
2467  "'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}1">;
2468def err_type_defined_in_for_range : Error<
2469  "types may not be defined in a for range declaration">;
2470def err_for_range_deduction_failure : Error<
2471  "cannot use type %0 as a range">;
2472def err_for_range_incomplete_type : Error<
2473  "cannot use incomplete type %0 as a range">;
2474def err_for_range_iter_deduction_failure : Error<
2475  "cannot use type %0 as an iterator">;
2476def ext_for_range_begin_end_types_differ : ExtWarn<
2477  "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2478  InGroup<CXX17>;
2479def warn_for_range_begin_end_types_differ : Warning<
2480  "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2481  "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2482def note_in_for_range: Note<
2483  "when looking up '%select{begin|end}0' function for range expression "
2484  "of type %1">;
2485def err_for_range_invalid: Error<
2486  "invalid range expression of type %0; no viable '%select{begin|end}1' "
2487  "function available">;
2488def note_for_range_member_begin_end_ignored : Note<
2489  "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2490def err_range_on_array_parameter : Error<
2491  "cannot build range expression with array function parameter %0 since "
2492  "parameter with array type %1 is treated as pointer type %2">;
2493def err_for_range_dereference : Error<
2494  "invalid range expression of type %0; did you mean to dereference it "
2495  "with '*'?">;
2496def note_for_range_invalid_iterator : Note <
2497  "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2498def note_for_range_begin_end : Note<
2499  "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2500def warn_for_range_const_ref_binds_temp_built_from_ref : Warning<
2501  "loop variable %0 "
2502  "%diff{of type $ binds to a temporary constructed from type $"
2503  "|binds to a temporary constructed from a different type}1,2">,
2504  InGroup<RangeLoopConstruct>, DefaultIgnore;
2505def note_use_type_or_non_reference : Note<
2506  "use non-reference type %0 to make construction explicit or type %1 to prevent copying">;
2507def warn_for_range_ref_binds_ret_temp : Warning<
2508  "loop variable %0 binds to a temporary value produced by a range of type %1">,
2509  InGroup<RangeLoopBindReference>, DefaultIgnore;
2510def note_use_non_reference_type : Note<"use non-reference type %0">;
2511def warn_for_range_copy : Warning<
2512  "loop variable %0 creates a copy from type %1">,
2513  InGroup<RangeLoopConstruct>, DefaultIgnore;
2514def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2515def err_objc_for_range_init_stmt : Error<
2516  "initialization statement is not supported when iterating over Objective-C "
2517  "collection">;
2518
2519// C++11 constexpr
2520def warn_cxx98_compat_constexpr : Warning<
2521  "'constexpr' specifier is incompatible with C++98">,
2522  InGroup<CXX98Compat>, DefaultIgnore;
2523// FIXME: Maybe this should also go in -Wc++14-compat?
2524def warn_cxx14_compat_constexpr_not_const : Warning<
2525  "'constexpr' non-static member function will not be implicitly 'const' "
2526  "in C++14; add 'const' to avoid a change in behavior">,
2527  InGroup<DiagGroup<"constexpr-not-const">>;
2528def err_invalid_consteval_take_address : Error<
2529  "cannot take address of consteval function %0 outside"
2530  " of an immediate invocation">;
2531def err_invalid_consteval_call : Error<
2532  "call to consteval function %q0 is not a constant expression">;
2533def err_invalid_consteval_decl_kind : Error<
2534  "%0 cannot be declared consteval">;
2535def err_invalid_constexpr : Error<
2536  "%select{function parameter|typedef}0 "
2537  "cannot be %sub{select_constexpr_spec_kind}1">;
2538def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2539  "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2540def err_constexpr_tag : Error<
2541  "%select{class|struct|interface|union|enum}0 "
2542  "cannot be marked %sub{select_constexpr_spec_kind}1">;
2543def err_constexpr_dtor : Error<
2544  "destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
2545def err_constexpr_dtor_subobject : Error<
2546  "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
2547  "%select{data member %2|base class %3}1 does not have a "
2548  "constexpr destructor">;
2549def note_constexpr_dtor_subobject : Note<
2550  "%select{data member %1|base class %2}0 declared here">;
2551def err_constexpr_wrong_decl_kind : Error<
2552  "%sub{select_constexpr_spec_kind}0 can only be used "
2553  "in %select{|variable and function|function|variable}0 declarations">;
2554def err_invalid_constexpr_var_decl : Error<
2555  "constexpr variable declaration must be a definition">;
2556def err_constexpr_static_mem_var_requires_init : Error<
2557  "declaration of constexpr static data member %0 requires an initializer">;
2558def err_constexpr_var_non_literal : Error<
2559  "constexpr variable cannot have non-literal type %0">;
2560def err_constexpr_var_requires_const_init : Error<
2561  "constexpr variable %0 must be initialized by a constant expression">;
2562def err_constexpr_var_requires_const_destruction : Error<
2563  "constexpr variable %0 must have constant destruction">;
2564def err_constexpr_redecl_mismatch : Error<
2565  "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2566  " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2567def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2568def warn_cxx17_compat_constexpr_virtual : Warning<
2569  "virtual constexpr functions are incompatible with "
2570  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
2571def err_constexpr_virtual_base : Error<
2572  "constexpr %select{member function|constructor}0 not allowed in "
2573  "%select{struct|interface|class}1 with virtual base "
2574  "%plural{1:class|:classes}2">;
2575def note_non_literal_incomplete : Note<
2576  "incomplete type %0 is not a literal type">;
2577def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2578  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2579def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2580def err_constexpr_non_literal_return : Error<
2581  "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2582def err_constexpr_non_literal_param : Error<
2583  "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2584  "not a literal type">;
2585def err_constexpr_body_invalid_stmt : Error<
2586  "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2587def ext_constexpr_body_invalid_stmt : ExtWarn<
2588  "use of this statement in a constexpr %select{function|constructor}0 "
2589  "is a C++14 extension">, InGroup<CXX14>;
2590def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2591  "use of this statement in a constexpr %select{function|constructor}0 "
2592  "is incompatible with C++ standards before C++14">,
2593  InGroup<CXXPre14Compat>, DefaultIgnore;
2594def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
2595  "use of this statement in a constexpr %select{function|constructor}0 "
2596  "is a C++20 extension">, InGroup<CXX20>;
2597def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2598  "use of this statement in a constexpr %select{function|constructor}0 "
2599  "is incompatible with C++ standards before C++20">,
2600  InGroup<CXXPre20Compat>, DefaultIgnore;
2601def ext_constexpr_type_definition : ExtWarn<
2602  "type definition in a constexpr %select{function|constructor}0 "
2603  "is a C++14 extension">, InGroup<CXX14>;
2604def warn_cxx11_compat_constexpr_type_definition : Warning<
2605  "type definition in a constexpr %select{function|constructor}0 "
2606  "is incompatible with C++ standards before C++14">,
2607  InGroup<CXXPre14Compat>, DefaultIgnore;
2608def err_constexpr_vla : Error<
2609  "variably-modified type %0 cannot be used in a constexpr "
2610  "%select{function|constructor}1">;
2611def ext_constexpr_local_var : ExtWarn<
2612  "variable declaration in a constexpr %select{function|constructor}0 "
2613  "is a C++14 extension">, InGroup<CXX14>;
2614def warn_cxx11_compat_constexpr_local_var : Warning<
2615  "variable declaration in a constexpr %select{function|constructor}0 "
2616  "is incompatible with C++ standards before C++14">,
2617  InGroup<CXXPre14Compat>, DefaultIgnore;
2618def err_constexpr_local_var_static : Error<
2619  "%select{static|thread_local}1 variable not permitted in a constexpr "
2620  "%select{function|constructor}0">;
2621def err_constexpr_local_var_non_literal_type : Error<
2622  "variable of non-literal type %1 cannot be defined in a constexpr "
2623  "%select{function|constructor}0">;
2624def ext_constexpr_local_var_no_init : ExtWarn<
2625  "uninitialized variable in a constexpr %select{function|constructor}0 "
2626  "is a C++20 extension">, InGroup<CXX20>;
2627def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
2628  "uninitialized variable in a constexpr %select{function|constructor}0 "
2629  "is incompatible with C++ standards before C++20">,
2630  InGroup<CXXPre20Compat>, DefaultIgnore;
2631def ext_constexpr_function_never_constant_expr : ExtWarn<
2632  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
2633  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2634def err_attr_cond_never_constant_expr : Error<
2635  "%0 attribute expression never produces a constant expression">;
2636def err_diagnose_if_invalid_diagnostic_type : Error<
2637  "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2638  "instead">;
2639def err_constexpr_body_no_return : Error<
2640  "no return statement in %select{constexpr|consteval}0 function">;
2641def err_constexpr_return_missing_expr : Error<
2642  "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2643def warn_cxx11_compat_constexpr_body_no_return : Warning<
2644  "constexpr function with no return statements is incompatible with C++ "
2645  "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2646def ext_constexpr_body_multiple_return : ExtWarn<
2647  "multiple return statements in constexpr function is a C++14 extension">,
2648  InGroup<CXX14>;
2649def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2650  "multiple return statements in constexpr function "
2651  "is incompatible with C++ standards before C++14">,
2652  InGroup<CXXPre14Compat>, DefaultIgnore;
2653def note_constexpr_body_previous_return : Note<
2654  "previous return statement is here">;
2655
2656// C++20 function try blocks in constexpr
2657def ext_constexpr_function_try_block_cxx20 : ExtWarn<
2658  "function try block in constexpr %select{function|constructor}0 is "
2659  "a C++20 extension">, InGroup<CXX20>;
2660def warn_cxx17_compat_constexpr_function_try_block : Warning<
2661  "function try block in constexpr %select{function|constructor}0 is "
2662  "incompatible with C++ standards before C++20">,
2663  InGroup<CXXPre20Compat>, DefaultIgnore;
2664
2665def ext_constexpr_union_ctor_no_init : ExtWarn<
2666  "constexpr union constructor that does not initialize any member "
2667  "is a C++20 extension">, InGroup<CXX20>;
2668def warn_cxx17_compat_constexpr_union_ctor_no_init : Warning<
2669  "constexpr union constructor that does not initialize any member "
2670  "is incompatible with C++ standards before C++20">,
2671  InGroup<CXXPre20Compat>, DefaultIgnore;
2672def ext_constexpr_ctor_missing_init : ExtWarn<
2673  "constexpr constructor that does not initialize all members "
2674  "is a C++20 extension">, InGroup<CXX20>;
2675def warn_cxx17_compat_constexpr_ctor_missing_init : Warning<
2676  "constexpr constructor that does not initialize all members "
2677  "is incompatible with C++ standards before C++20">,
2678  InGroup<CXXPre20Compat>, DefaultIgnore;
2679def note_constexpr_ctor_missing_init : Note<
2680  "member not initialized by constructor">;
2681def note_non_literal_no_constexpr_ctors : Note<
2682  "%0 is not literal because it is not an aggregate and has no constexpr "
2683  "constructors other than copy or move constructors">;
2684def note_non_literal_base_class : Note<
2685  "%0 is not literal because it has base class %1 of non-literal type">;
2686def note_non_literal_field : Note<
2687  "%0 is not literal because it has data member %1 of "
2688  "%select{non-literal|volatile}3 type %2">;
2689def note_non_literal_user_provided_dtor : Note<
2690  "%0 is not literal because it has a user-provided destructor">;
2691def note_non_literal_nontrivial_dtor : Note<
2692  "%0 is not literal because it has a non-trivial destructor">;
2693def note_non_literal_non_constexpr_dtor : Note<
2694  "%0 is not literal because its destructor is not constexpr">;
2695def note_non_literal_lambda : Note<
2696  "lambda closure types are non-literal types before C++17">;
2697def warn_private_extern : Warning<
2698  "use of __private_extern__ on a declaration may not produce external symbol "
2699  "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2700def note_private_extern : Note<
2701  "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2702
2703// C++ Concepts
2704def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2705  "concept declarations may only appear in global or namespace scope">;
2706def err_concept_no_parameters : Error<
2707  "concept template parameter list must have at least one parameter; explicit "
2708  "specialization of concepts is not allowed">;
2709def err_concept_extra_headers : Error<
2710  "extraneous template parameter list in concept definition">;
2711def err_concept_no_associated_constraints : Error<
2712  "concept cannot have associated constraints">;
2713def err_non_constant_constraint_expression : Error<
2714  "substitution into constraint expression resulted in a non-constant "
2715  "expression">;
2716def err_non_bool_atomic_constraint : Error<
2717  "atomic constraint must be of type 'bool' (found %0)">;
2718def err_template_arg_list_constraints_not_satisfied : Error<
2719  "constraints not satisfied for %select{class template|function template|variable template|alias template|"
2720  "template template parameter|template}0 %1%2">;
2721def note_substituted_constraint_expr_is_ill_formed : Note<
2722  "because substituted constraint expression is ill-formed%0">;
2723def note_atomic_constraint_evaluated_to_false : Note<
2724  "%select{and|because}0 '%1' evaluated to false">;
2725def note_concept_specialization_constraint_evaluated_to_false : Note<
2726  "%select{and|because}0 '%1' evaluated to false">;
2727def note_single_arg_concept_specialization_constraint_evaluated_to_false : Note<
2728  "%select{and|because}0 %1 does not satisfy %2">;
2729def note_atomic_constraint_evaluated_to_false_elaborated : Note<
2730  "%select{and|because}0 '%1' (%2 %3 %4) evaluated to false">;
2731def err_constrained_virtual_method : Error<
2732  "virtual function cannot have a requires clause">;
2733def err_trailing_requires_clause_on_deduction_guide : Error<
2734  "deduction guide cannot have a requires clause">;
2735def err_reference_to_function_with_unsatisfied_constraints : Error<
2736  "invalid reference to function %0: constraints not satisfied">;
2737def err_requires_expr_local_parameter_default_argument : Error<
2738  "default arguments not allowed for parameters of a requires expression">;
2739def err_requires_expr_parameter_referenced_in_evaluated_context : Error<
2740  "constraint variable %0 cannot be used in an evaluated context">;
2741def note_expr_requirement_expr_substitution_error : Note<
2742  "%select{and|because}0 '%1' would be invalid: %2">;
2743def note_expr_requirement_expr_unknown_substitution_error : Note<
2744  "%select{and|because}0 '%1' would be invalid">;
2745def note_expr_requirement_noexcept_not_met : Note<
2746  "%select{and|because}0 '%1' may throw an exception">;
2747def note_expr_requirement_type_requirement_substitution_error : Note<
2748  "%select{and|because}0 '%1' would be invalid: %2">;
2749def note_expr_requirement_type_requirement_unknown_substitution_error : Note<
2750  "%select{and|because}0 '%1' would be invalid">;
2751def note_expr_requirement_constraints_not_satisfied : Note<
2752  "%select{and|because}0 type constraint '%1' was not satisfied:">;
2753def note_expr_requirement_constraints_not_satisfied_simple : Note<
2754  "%select{and|because}0 %1 does not satisfy %2:">;
2755def note_type_requirement_substitution_error : Note<
2756  "%select{and|because}0 '%1' would be invalid: %2">;
2757def note_type_requirement_unknown_substitution_error : Note<
2758  "%select{and|because}0 '%1' would be invalid">;
2759def note_nested_requirement_substitution_error : Note<
2760  "%select{and|because}0 '%1' would be invalid: %2">;
2761def note_nested_requirement_unknown_substitution_error : Note<
2762  "%select{and|because}0 '%1' would be invalid">;
2763def note_ambiguous_atomic_constraints : Note<
2764  "similar constraint expressions not considered equivalent; constraint "
2765  "expressions cannot be considered equivalent unless they originate from the "
2766  "same concept">;
2767def note_ambiguous_atomic_constraints_similar_expression : Note<
2768  "similar constraint expression here">;
2769def err_unsupported_placeholder_constraint : Error<
2770  "constrained placeholder types other than simple 'auto' on non-type template "
2771  "parameters not supported yet">;
2772
2773def err_template_different_requires_clause : Error<
2774  "requires clause differs in template redeclaration">;
2775def err_template_different_type_constraint : Error<
2776  "type constraint differs in template redeclaration">;
2777def err_template_template_parameter_not_at_least_as_constrained : Error<
2778  "template template argument %0 is more constrained than template template "
2779  "parameter %1">;
2780
2781def err_type_constraint_non_type_concept : Error<
2782  "concept named in type constraint is not a type concept">;
2783def err_type_constraint_missing_arguments : Error<
2784  "%0 requires more than 1 template argument; provide the remaining arguments "
2785  "explicitly to use it here">;
2786def err_placeholder_constraints_not_satisfied : Error<
2787  "deduced type %0 does not satisfy %1">;
2788
2789// C++11 char16_t/char32_t
2790def warn_cxx98_compat_unicode_type : Warning<
2791  "'%0' type specifier is incompatible with C++98">,
2792  InGroup<CXX98Compat>, DefaultIgnore;
2793def warn_cxx17_compat_unicode_type : Warning<
2794  "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2795  InGroup<CXXPre20Compat>, DefaultIgnore;
2796
2797// __make_integer_seq
2798def err_integer_sequence_negative_length : Error<
2799  "integer sequences must have non-negative sequence length">;
2800def err_integer_sequence_integral_element_type : Error<
2801  "integer sequences must have integral element type">;
2802
2803// __type_pack_element
2804def err_type_pack_element_out_of_bounds : Error<
2805  "a parameter pack may not be accessed at an out of bounds index">;
2806
2807// Objective-C++
2808def err_objc_decls_may_only_appear_in_global_scope : Error<
2809  "Objective-C declarations may only appear in global scope">;
2810def warn_auto_var_is_id : Warning<
2811  "'auto' deduced as 'id' in declaration of %0">,
2812  InGroup<DiagGroup<"auto-var-id">>;
2813
2814// Attributes
2815def warn_nomerge_attribute_ignored_in_stmt: Warning<
2816  "%0 attribute is ignored because there exists no call expression inside the "
2817  "statement">,
2818  InGroup<IgnoredAttributes>;
2819def err_nsobject_attribute : Error<
2820  "'NSObject' attribute is for pointer types only">;
2821def err_attributes_are_not_compatible : Error<
2822  "%0 and %1 attributes are not compatible">;
2823def err_attribute_invalid_argument : Error<
2824  "%select{a reference type|an array type|a non-vector or "
2825  "non-vectorizable scalar type}0 is an invalid argument to attribute %1">;
2826def err_attribute_wrong_number_arguments : Error<
2827  "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2828  ":requires exactly %1 arguments}1">;
2829def err_attribute_too_many_arguments : Error<
2830  "%0 attribute takes no more than %1 argument%s1">;
2831def err_attribute_too_few_arguments : Error<
2832  "%0 attribute takes at least %1 argument%s1">;
2833def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2834def err_attribute_invalid_matrix_type : Error<"invalid matrix element type %0">;
2835def err_attribute_bad_neon_vector_size : Error<
2836  "Neon vector size must be 64 or 128 bits">;
2837def err_attribute_invalid_sve_type : Error<
2838  "%0 attribute applied to non-SVE type %1">;
2839def err_attribute_bad_sve_vector_size : Error<
2840  "invalid SVE vector size '%0', must match value set by "
2841  "'-msve-vector-bits' ('%1')">;
2842def err_attribute_arm_feature_sve_bits_unsupported : Error<
2843  "%0 is only supported when '-msve-vector-bits=<bits>' is specified with a "
2844  "value of 128, 256, 512, 1024 or 2048.">;
2845def err_attribute_requires_positive_integer : Error<
2846  "%0 attribute requires a %select{positive|non-negative}1 "
2847  "integral compile time constant expression">;
2848def err_attribute_requires_opencl_version : Error<
2849  "%0 attribute requires OpenCL version %1%select{| or above}2">;
2850def err_invalid_branch_protection_spec : Error<
2851  "invalid or misplaced branch protection specification '%0'">;
2852def warn_unsupported_target_attribute
2853    : Warning<"%select{unsupported|duplicate|unknown}0%select{| architecture|"
2854              " tune CPU}1 '%2' in the 'target' attribute string; 'target' "
2855              "attribute ignored">,
2856      InGroup<IgnoredAttributes>;
2857def err_attribute_unsupported
2858    : Error<"%0 attribute is not supported on targets missing %1;"
2859            " specify an appropriate -march= or -mcpu=">;
2860// The err_*_attribute_argument_not_int are separate because they're used by
2861// VerifyIntegerConstantExpression.
2862def err_aligned_attribute_argument_not_int : Error<
2863  "'aligned' attribute requires integer constant">;
2864def err_align_value_attribute_argument_not_int : Error<
2865  "'align_value' attribute requires integer constant">;
2866def err_alignas_attribute_wrong_decl_type : Error<
2867  "%0 attribute cannot be applied to a %select{function parameter|"
2868  "variable with 'register' storage class|'catch' variable|bit-field}1">;
2869def err_alignas_missing_on_definition : Error<
2870  "%0 must be specified on definition if it is specified on any declaration">;
2871def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2872def err_alignas_mismatch : Error<
2873  "redeclaration has different alignment requirement (%1 vs %0)">;
2874def err_alignas_underaligned : Error<
2875  "requested alignment is less than minimum alignment of %1 for type %0">;
2876def err_attribute_sizeless_type : Error<
2877  "%0 attribute cannot be applied to sizeless type %1">;
2878def err_attribute_argument_n_type : Error<
2879  "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2880  "constant|a string|an identifier|a constant expression}2">;
2881def err_attribute_argument_type : Error<
2882  "%0 attribute requires %select{int or bool|an integer "
2883  "constant|a string|an identifier}1">;
2884def err_attribute_argument_out_of_range : Error<
2885  "%0 attribute requires integer constant between %1 and %2 inclusive">;
2886def err_init_priority_object_attr : Error<
2887  "can only use 'init_priority' attribute on file-scope definitions "
2888  "of objects of class type">;
2889def err_attribute_argument_out_of_bounds : Error<
2890  "%0 attribute parameter %1 is out of bounds">;
2891def err_attribute_only_once_per_parameter : Error<
2892  "%0 attribute can only be applied once per parameter">;
2893def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2894def note_previous_uuid : Note<"previous uuid specified here">;
2895def warn_attribute_pointers_only : Warning<
2896  "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2897  InGroup<IgnoredAttributes>;
2898def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2899def err_attribute_integers_only : Error<
2900  "%0 attribute argument may only refer to a function parameter of integer "
2901  "type">;
2902def warn_attribute_return_pointers_only : Warning<
2903  "%0 attribute only applies to return values that are pointers">,
2904  InGroup<IgnoredAttributes>;
2905def warn_attribute_return_pointers_refs_only : Warning<
2906  "%0 attribute only applies to return values that are pointers or references">,
2907  InGroup<IgnoredAttributes>;
2908def warn_attribute_pointer_or_reference_only : Warning<
2909  "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2910  InGroup<IgnoredAttributes>;
2911def err_attribute_no_member_pointers : Error<
2912  "%0 attribute cannot be used with pointers to members">;
2913def err_attribute_invalid_implicit_this_argument : Error<
2914  "%0 attribute is invalid for the implicit this argument">;
2915def err_ownership_type : Error<
2916  "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2917def err_ownership_returns_index_mismatch : Error<
2918  "'ownership_returns' attribute index does not match; here it is %0">;
2919def note_ownership_returns_index_mismatch : Note<
2920  "declared with index %0 here">;
2921def err_format_strftime_third_parameter : Error<
2922  "strftime format attribute requires 3rd parameter to be 0">;
2923def err_format_attribute_requires_variadic : Error<
2924  "format attribute requires variadic function">;
2925def err_format_attribute_not : Error<"format argument not %0">;
2926def err_format_attribute_result_not : Error<"function does not return %0">;
2927def err_format_attribute_implicit_this_format_string : Error<
2928  "format attribute cannot specify the implicit this argument as the format "
2929  "string">;
2930def err_callback_attribute_no_callee : Error<
2931  "'callback' attribute specifies no callback callee">;
2932def err_callback_attribute_invalid_callee : Error<
2933  "'callback' attribute specifies invalid callback callee">;
2934def err_callback_attribute_multiple : Error<
2935  "multiple 'callback' attributes specified">;
2936def err_callback_attribute_argument_unknown : Error<
2937  "'callback' attribute argument %0 is not a known function parameter">;
2938def err_callback_callee_no_function_type : Error<
2939  "'callback' attribute callee does not have function type">;
2940def err_callback_callee_is_variadic : Error<
2941  "'callback' attribute callee may not be variadic">;
2942def err_callback_implicit_this_not_available : Error<
2943  "'callback' argument at position %0 references unavailable implicit 'this'">;
2944def err_init_method_bad_return_type : Error<
2945  "init methods must return an object pointer type, not %0">;
2946def err_attribute_invalid_size : Error<
2947  "vector size not an integral multiple of component size">;
2948def err_attribute_zero_size : Error<"zero %0 size">;
2949def err_attribute_size_too_large : Error<"%0 size too large">;
2950def err_typecheck_sve_ambiguous : Error<
2951  "cannot combine fixed-length and sizeless SVE vectors in expression, result is ambiguous (%0 and %1)">;
2952def err_typecheck_sve_gnu_ambiguous : Error<
2953  "cannot combine GNU and SVE vectors in expression, result is ambiguous (%0 and %1)">;
2954def err_typecheck_vector_not_convertable_implict_truncation : Error<
2955   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
2956   " %2 as implicit conversion would cause truncation">;
2957def err_typecheck_vector_not_convertable : Error<
2958  "cannot convert between vector values of different size (%0 and %1)">;
2959def err_typecheck_vector_not_convertable_non_scalar : Error<
2960  "cannot convert between vector and non-scalar values (%0 and %1)">;
2961def err_typecheck_vector_lengths_not_equal : Error<
2962  "vector operands do not have the same number of elements (%0 and %1)">;
2963def warn_typecheck_vector_element_sizes_not_equal : Warning<
2964  "vector operands do not have the same elements sizes (%0 and %1)">,
2965  InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2966def err_ext_vector_component_exceeds_length : Error<
2967  "vector component access exceeds type %0">;
2968def err_ext_vector_component_name_illegal : Error<
2969  "illegal vector component name '%0'">;
2970def err_attribute_address_space_negative : Error<
2971  "address space is negative">;
2972def err_attribute_address_space_too_high : Error<
2973  "address space is larger than the maximum supported (%0)">;
2974def err_attribute_address_multiple_qualifiers : Error<
2975  "multiple address spaces specified for type">;
2976def warn_attribute_address_multiple_identical_qualifiers : Warning<
2977  "multiple identical address spaces specified for type">,
2978  InGroup<DuplicateDeclSpecifier>;
2979def err_attribute_not_clinkage : Error<
2980  "function type with %0 attribute must have C linkage">;
2981def err_function_decl_cmse_ns_call : Error<
2982  "functions may not be declared with 'cmse_nonsecure_call' attribute">;
2983def err_attribute_address_function_type : Error<
2984  "function type may not be qualified with an address space">;
2985def err_as_qualified_auto_decl : Error<
2986  "automatic variable qualified with an%select{| invalid}0 address space">;
2987def err_arg_with_address_space : Error<
2988  "parameter may not be qualified with an address space">;
2989def err_field_with_address_space : Error<
2990  "field may not be qualified with an address space">;
2991def err_compound_literal_with_address_space : Error<
2992  "compound literal in function scope may not be qualified with an address space">;
2993def err_address_space_mismatch_templ_inst : Error<
2994  "conflicting address space qualifiers are provided between types %0 and %1">;
2995def err_attr_objc_ownership_redundant : Error<
2996  "the type %0 is already explicitly ownership-qualified">;
2997def err_invalid_nsnumber_type : Error<
2998  "%0 is not a valid literal type for NSNumber">;
2999def err_objc_illegal_boxed_expression_type : Error<
3000  "illegal type %0 used in a boxed expression">;
3001def err_objc_non_trivially_copyable_boxed_expression_type : Error<
3002  "non-trivially copyable type %0 cannot be used in a boxed expression">;
3003def err_objc_incomplete_boxed_expression_type : Error<
3004  "incomplete type %0 used in a boxed expression">;
3005def err_undeclared_objc_literal_class : Error<
3006  "definition of class %0 must be available to use Objective-C "
3007  "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
3008  "string literals}1">;
3009def err_undeclared_boxing_method : Error<
3010  "declaration of %0 is missing in %1 class">;
3011def err_objc_literal_method_sig : Error<
3012  "literal construction method %0 has incompatible signature">;
3013def note_objc_literal_method_param : Note<
3014  "%select{first|second|third}0 parameter has unexpected type %1 "
3015  "(should be %2)">;
3016def note_objc_literal_method_return : Note<
3017  "method returns unexpected type %0 (should be an object type)">;
3018def err_invalid_collection_element : Error<
3019  "collection element of type %0 is not an Objective-C object">;
3020def err_box_literal_collection : Error<
3021  "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
3022  "in a collection">;
3023def warn_objc_literal_comparison : Warning<
3024  "direct comparison of %select{an array literal|a dictionary literal|"
3025  "a numeric literal|a boxed expression|}0 has undefined behavior">,
3026  InGroup<ObjCLiteralComparison>;
3027def err_missing_atsign_prefix : Error<
3028  "%select{string|numeric}0 literal must be prefixed by '@'">;
3029def warn_objc_string_literal_comparison : Warning<
3030  "direct comparison of a string literal has undefined behavior">,
3031  InGroup<ObjCStringComparison>;
3032def warn_concatenated_literal_array_init : Warning<
3033  "suspicious concatenation of string literals in an array initialization; "
3034  "did you mean to separate the elements with a comma?">,
3035  InGroup<StringConcatation>, DefaultIgnore;
3036def warn_concatenated_nsarray_literal : Warning<
3037  "concatenated NSString literal for an NSArray expression - "
3038  "possibly missing a comma">,
3039  InGroup<ObjCStringConcatenation>;
3040def note_objc_literal_comparison_isequal : Note<
3041  "use 'isEqual:' instead">;
3042def warn_objc_collection_literal_element : Warning<
3043  "object of type %0 is not compatible with "
3044  "%select{array element type|dictionary key type|dictionary value type}1 %2">,
3045  InGroup<ObjCLiteralConversion>;
3046def warn_nsdictionary_duplicate_key : Warning<
3047  "duplicate key in dictionary literal">,
3048  InGroup<DiagGroup<"objc-dictionary-duplicate-keys">>;
3049def note_nsdictionary_duplicate_key_here : Note<
3050  "previous equal key is here">;
3051def err_swift_param_attr_not_swiftcall : Error<
3052  "'%0' parameter can only be used with swiftcall calling convention">;
3053def err_swift_indirect_result_not_first : Error<
3054  "'swift_indirect_result' parameters must be first parameters of function">;
3055def err_swift_error_result_not_after_swift_context : Error<
3056  "'swift_error_result' parameter must follow 'swift_context' parameter">;
3057def err_swift_abi_parameter_wrong_type : Error<
3058  "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
3059  "type here is %2">;
3060
3061def err_attribute_argument_invalid : Error<
3062  "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
3063  "min must not be greater than max}1">;
3064def err_attribute_argument_is_zero : Error<
3065  "%0 attribute must be greater than 0">;
3066def warn_attribute_argument_n_negative : Warning<
3067  "%0 attribute parameter %1 is negative and will be ignored">,
3068  InGroup<CudaCompat>;
3069def err_property_function_in_objc_container : Error<
3070  "use of Objective-C property in function nested in Objective-C "
3071  "container not supported, move function outside its container">;
3072
3073let CategoryName = "Cocoa API Issue" in {
3074def warn_objc_redundant_literal_use : Warning<
3075  "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
3076}
3077
3078def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
3079  "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
3080
3081def err_tls_var_aligned_over_maximum : Error<
3082  "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
3083  "alignment (%2) for a thread-local variable on this target">;
3084
3085def err_only_annotate_after_access_spec : Error<
3086  "access specifier can only have annotation attributes">;
3087
3088def err_attribute_section_invalid_for_target : Error<
3089  "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
3090def warn_attribute_section_drectve : Warning<
3091  "#pragma %0(\".drectve\") has undefined behavior, "
3092  "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
3093def warn_mismatched_section : Warning<
3094  "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
3095def warn_attribute_section_on_redeclaration : Warning<
3096  "section attribute is specified on redeclared variable">, InGroup<Section>;
3097def err_mismatched_code_seg_base : Error<
3098  "derived class must specify the same code segment as its base classes">;
3099def err_mismatched_code_seg_override : Error<
3100  "overriding virtual function must specify the same code segment as its overridden function">;
3101def err_conflicting_codeseg_attribute : Error<
3102  "conflicting code segment specifiers">;
3103def warn_duplicate_codeseg_attribute : Warning<
3104  "duplicate code segment specifiers">, InGroup<Section>;
3105
3106def err_anonymous_property: Error<
3107  "anonymous property is not supported">;
3108def err_property_is_variably_modified : Error<
3109  "property %0 has a variably modified type">;
3110def err_no_accessor_for_property : Error<
3111  "no %select{getter|setter}0 defined for property %1">;
3112def err_cannot_find_suitable_accessor : Error<
3113  "cannot find suitable %select{getter|setter}0 for property %1">;
3114
3115def warn_alloca : Warning<
3116  "use of function %0 is discouraged; there is no way to check for failure but "
3117  "failure may still occur, resulting in a possibly exploitable security vulnerability">,
3118  InGroup<DiagGroup<"alloca">>, DefaultIgnore;
3119
3120def warn_alloca_align_alignof : Warning<
3121  "second argument to __builtin_alloca_with_align is supposed to be in bits">,
3122  InGroup<DiagGroup<"alloca-with-align-alignof">>;
3123
3124def err_alignment_too_small : Error<
3125  "requested alignment must be %0 or greater">;
3126def err_alignment_too_big : Error<
3127  "requested alignment must be %0 or smaller">;
3128def err_alignment_not_power_of_two : Error<
3129  "requested alignment is not a power of 2">;
3130def warn_alignment_not_power_of_two : Warning<
3131  err_alignment_not_power_of_two.Text>,
3132  InGroup<DiagGroup<"non-power-of-two-alignment">>;
3133def err_alignment_dependent_typedef_name : Error<
3134  "requested alignment is dependent but declaration is not dependent">;
3135
3136def warn_alignment_builtin_useless : Warning<
3137  "%select{aligning a value|the result of checking whether a value is aligned}0"
3138  " to 1 byte is %select{a no-op|always true}0">, InGroup<TautologicalCompare>;
3139def err_attribute_aligned_too_great : Error<
3140  "requested alignment must be %0 bytes or smaller">;
3141def warn_assume_aligned_too_great
3142    : Warning<"requested alignment must be %0 bytes or smaller; maximum "
3143              "alignment assumed">,
3144      InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3145def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
3146  "%q0 redeclared without %1 attribute: previous %1 ignored">,
3147  InGroup<MicrosoftInconsistentDllImport>;
3148def warn_redeclaration_without_import_attribute : Warning<
3149  "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
3150  InGroup<MicrosoftInconsistentDllImport>;
3151def warn_dllimport_dropped_from_inline_function : Warning<
3152  "%q0 redeclared inline; %1 attribute ignored">,
3153  InGroup<IgnoredAttributes>;
3154def warn_attribute_ignored : Warning<"%0 attribute ignored">,
3155  InGroup<IgnoredAttributes>;
3156def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
3157  " exception specification; attribute ignored">,
3158  InGroup<IgnoredAttributes>;
3159def warn_attribute_ignored_on_inline :
3160  Warning<"%0 attribute ignored on inline function">,
3161  InGroup<IgnoredAttributes>;
3162def warn_nocf_check_attribute_ignored :
3163  Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
3164  InGroup<IgnoredAttributes>;
3165def warn_attribute_after_definition_ignored : Warning<
3166  "attribute %0 after definition is ignored">,
3167   InGroup<IgnoredAttributes>;
3168def warn_attributes_likelihood_ifstmt_conflict
3169    : Warning<"conflicting attributes %0 are ignored">,
3170      InGroup<IgnoredAttributes>;
3171def warn_cxx11_gnu_attribute_on_type : Warning<
3172  "attribute %0 ignored, because it cannot be applied to a type">,
3173  InGroup<IgnoredAttributes>;
3174def warn_unhandled_ms_attribute_ignored : Warning<
3175  "__declspec attribute %0 is not supported">,
3176  InGroup<IgnoredAttributes>;
3177def warn_attribute_has_no_effect_on_infinite_loop : Warning<
3178  "attribute %0 has no effect when annotating an infinite loop">,
3179   InGroup<IgnoredAttributes>;
3180def note_attribute_has_no_effect_on_infinite_loop_here : Note<
3181  "annotating the infinite loop here">;
3182def warn_attribute_has_no_effect_on_if_constexpr : Warning<
3183  "attribute %0 has no effect when annotating an 'if constexpr' statement">,
3184   InGroup<IgnoredAttributes>;
3185def note_attribute_has_no_effect_on_if_constexpr_here : Note<
3186  "annotating the 'if constexpr' statement here">;
3187def err_decl_attribute_invalid_on_stmt : Error<
3188  "%0 attribute cannot be applied to a statement">;
3189def err_stmt_attribute_invalid_on_decl : Error<
3190  "%0 attribute cannot be applied to a declaration">;
3191def warn_declspec_attribute_ignored : Warning<
3192  "attribute %0 is ignored, place it after "
3193  "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
3194  "type declaration">, InGroup<IgnoredAttributes>;
3195def warn_attribute_precede_definition : Warning<
3196  "attribute declaration must precede definition">,
3197  InGroup<IgnoredAttributes>;
3198def warn_attribute_void_function_method : Warning<
3199  "attribute %0 cannot be applied to "
3200  "%select{functions|Objective-C method}1 without return value">,
3201  InGroup<IgnoredAttributes>;
3202def warn_attribute_weak_on_field : Warning<
3203  "__weak attribute cannot be specified on a field declaration">,
3204  InGroup<IgnoredAttributes>;
3205def warn_gc_attribute_weak_on_local : Warning<
3206  "Objective-C GC does not allow weak variables on the stack">,
3207  InGroup<IgnoredAttributes>;
3208def warn_nsobject_attribute : Warning<
3209  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
3210  InGroup<NSobjectAttribute>;
3211def warn_independentclass_attribute : Warning<
3212  "'objc_independent_class' attribute may be put on a typedef only; "
3213  "attribute is ignored">,
3214  InGroup<IndependentClassAttribute>;
3215def warn_ptr_independentclass_attribute : Warning<
3216  "'objc_independent_class' attribute may be put on Objective-C object "
3217  "pointer type only; attribute is ignored">,
3218  InGroup<IndependentClassAttribute>;
3219def warn_attribute_weak_on_local : Warning<
3220  "__weak attribute cannot be specified on an automatic variable when ARC "
3221  "is not enabled">,
3222  InGroup<IgnoredAttributes>;
3223def warn_weak_identifier_undeclared : Warning<
3224  "weak identifier %0 never declared">;
3225def warn_attribute_cmse_entry_static : Warning<
3226  "'cmse_nonsecure_entry' cannot be applied to functions with internal linkage">,
3227  InGroup<IgnoredAttributes>;
3228def warn_cmse_nonsecure_union : Warning<
3229  "passing union across security boundary via %select{parameter %1|return value}0 "
3230  "may leak information">,
3231  InGroup<DiagGroup<"cmse-union-leak">>;
3232def err_attribute_weak_static : Error<
3233  "weak declaration cannot have internal linkage">;
3234def err_attribute_selectany_non_extern_data : Error<
3235  "'selectany' can only be applied to data items with external linkage">;
3236def err_declspec_thread_on_thread_variable : Error<
3237  "'__declspec(thread)' applied to variable that already has a "
3238  "thread-local storage specifier">;
3239def err_attribute_dll_not_extern : Error<
3240  "%q0 must have external linkage when declared %q1">;
3241def err_attribute_dll_thread_local : Error<
3242  "%q0 cannot be thread local when declared %q1">;
3243def err_attribute_dll_lambda : Error<
3244  "lambda cannot be declared %0">;
3245def warn_attribute_invalid_on_definition : Warning<
3246  "'%0' attribute cannot be specified on a definition">,
3247  InGroup<IgnoredAttributes>;
3248def err_attribute_dll_redeclaration : Error<
3249  "redeclaration of %q0 cannot add %q1 attribute">;
3250def warn_attribute_dll_redeclaration : Warning<
3251  "redeclaration of %q0 should not add %q1 attribute">,
3252  InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
3253def err_attribute_dllimport_function_definition : Error<
3254  "dllimport cannot be applied to non-inline function definition">;
3255def err_attribute_dll_deleted : Error<
3256  "attribute %q0 cannot be applied to a deleted function">;
3257def err_attribute_dllimport_data_definition : Error<
3258  "definition of dllimport data">;
3259def err_attribute_dllimport_static_field_definition : Error<
3260  "definition of dllimport static field not allowed">;
3261def warn_attribute_dllimport_static_field_definition : Warning<
3262  "definition of dllimport static field">,
3263  InGroup<DiagGroup<"dllimport-static-field-def">>;
3264def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
3265  "explicit instantiation declaration should not be 'dllexport'">,
3266  InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
3267def warn_attribute_dllexport_explicit_instantiation_def : Warning<
3268  "'dllexport' attribute ignored on explicit instantiation definition">,
3269  InGroup<IgnoredAttributes>;
3270def warn_invalid_initializer_from_system_header : Warning<
3271  "invalid constructor from class in system header, should not be explicit">,
3272  InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
3273def note_used_in_initialization_here : Note<"used in initialization here">;
3274def err_attribute_dll_member_of_dll_class : Error<
3275  "attribute %q0 cannot be applied to member of %q1 class">;
3276def warn_attribute_dll_instantiated_base_class : Warning<
3277  "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
3278  "base class template without dll attribute is not supported">,
3279  InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
3280def err_attribute_dll_ambiguous_default_ctor : Error<
3281  "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
3282def err_attribute_weakref_not_static : Error<
3283  "weakref declaration must have internal linkage">;
3284def err_attribute_weakref_not_global_context : Error<
3285  "weakref declaration of %0 must be in a global context">;
3286def err_attribute_weakref_without_alias : Error<
3287  "weakref declaration of %0 must also have an alias attribute">;
3288def err_alias_not_supported_on_darwin : Error <
3289  "aliases are not supported on darwin">;
3290def warn_attribute_wrong_decl_type_str : Warning<
3291  "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
3292def err_attribute_wrong_decl_type_str : Error<
3293  warn_attribute_wrong_decl_type_str.Text>;
3294def warn_attribute_wrong_decl_type : Warning<
3295  "%0 attribute only applies to %select{"
3296  "functions"
3297  "|unions"
3298  "|variables and functions"
3299  "|functions and methods"
3300  "|functions, methods and blocks"
3301  "|functions, methods, and parameters"
3302  "|variables"
3303  "|variables and fields"
3304  "|variables, data members and tag types"
3305  "|types and namespaces"
3306  "|variables, functions and classes"
3307  "|kernel functions"
3308  "|non-K&R-style functions}1">,
3309  InGroup<IgnoredAttributes>;
3310def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
3311def warn_type_attribute_wrong_type : Warning<
3312  "'%0' only applies to %select{function|pointer|"
3313  "Objective-C object or block pointer}1 types; type here is %2">,
3314  InGroup<IgnoredAttributes>;
3315def warn_incomplete_encoded_type : Warning<
3316  "encoding of %0 type is incomplete because %1 component has unknown encoding">,
3317  InGroup<DiagGroup<"encode-type">>;
3318def warn_gnu_inline_attribute_requires_inline : Warning<
3319  "'gnu_inline' attribute requires function to be marked 'inline',"
3320  " attribute ignored">,
3321  InGroup<IgnoredAttributes>;
3322def warn_gnu_inline_cplusplus_without_extern : Warning<
3323  "'gnu_inline' attribute without 'extern' in C++ treated as externally"
3324  " available, this changed in Clang 10">,
3325  InGroup<DiagGroup<"gnu-inline-cpp-without-extern">>;
3326def err_attribute_vecreturn_only_vector_member : Error<
3327  "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
3328def err_attribute_vecreturn_only_pod_record : Error<
3329  "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
3330def err_cconv_change : Error<
3331  "function declared '%0' here was previously declared "
3332  "%select{'%2'|without calling convention}1">;
3333def warn_cconv_unsupported : Warning<
3334  "%0 calling convention is not supported %select{"
3335  // Use CallingConventionIgnoredReason Enum to specify these.
3336  "for this target"
3337  "|on variadic function"
3338  "|on constructor/destructor"
3339  "|on builtin function"
3340  "}1">,
3341  InGroup<IgnoredAttributes>;
3342def error_cconv_unsupported : Error<warn_cconv_unsupported.Text>;
3343def err_cconv_knr : Error<
3344  "function with no prototype cannot use the %0 calling convention">;
3345def warn_cconv_knr : Warning<
3346  err_cconv_knr.Text>,
3347  InGroup<DiagGroup<"missing-prototype-for-cc">>;
3348def err_cconv_varargs : Error<
3349  "variadic function cannot use %0 calling convention">;
3350def err_regparm_mismatch : Error<"function declared with regparm(%0) "
3351  "attribute was previously declared "
3352  "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
3353def err_function_attribute_mismatch : Error<
3354  "function declared with %0 attribute "
3355  "was previously declared without the %0 attribute">;
3356def err_objc_precise_lifetime_bad_type : Error<
3357  "objc_precise_lifetime only applies to retainable types; type here is %0">;
3358def warn_objc_precise_lifetime_meaningless : Error<
3359  "objc_precise_lifetime is not meaningful for "
3360  "%select{__unsafe_unretained|__autoreleasing}0 objects">;
3361def err_invalid_pcs : Error<"invalid PCS type">;
3362def warn_attribute_not_on_decl : Warning<
3363  "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
3364def err_base_specifier_attribute : Error<
3365  "%0 attribute cannot be applied to a base specifier">;
3366def err_invalid_attribute_on_virtual_function : Error<
3367  "%0 attribute cannot be applied to virtual functions">;
3368def warn_declspec_allocator_nonpointer : Warning<
3369  "ignoring __declspec(allocator) because the function return type %0 is not "
3370  "a pointer or reference type">, InGroup<IgnoredAttributes>;
3371def err_cconv_incomplete_param_type : Error<
3372  "parameter %0 must have a complete type to use function %1 with the %2 "
3373  "calling convention">;
3374def err_attribute_output_parameter : Error<
3375  "attribute only applies to output parameters">;
3376
3377def ext_cannot_use_trivial_abi : ExtWarn<
3378  "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3379def note_cannot_use_trivial_abi_reason : Note<
3380  "'trivial_abi' is disallowed on %0 because %select{"
3381  "its copy constructors and move constructors are all deleted|"
3382  "it is polymorphic|"
3383  "it has a base of a non-trivial class type|it has a virtual base|"
3384  "it has a __weak field|it has a field of a non-trivial class type}1">;
3385
3386// Availability attribute
3387def warn_availability_unknown_platform : Warning<
3388  "unknown platform %0 in availability macro">, InGroup<Availability>;
3389def warn_availability_version_ordering : Warning<
3390  "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3391  "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3392  "attribute ignored">, InGroup<Availability>;
3393def warn_mismatched_availability: Warning<
3394  "availability does not match previous declaration">, InGroup<Availability>;
3395def warn_mismatched_availability_override : Warning<
3396  "%select{|overriding }4method %select{introduced after|"
3397  "deprecated before|obsoleted before}0 "
3398  "%select{the protocol method it implements|overridden method}4 "
3399  "on %1 (%2 vs. %3)">, InGroup<Availability>;
3400def warn_mismatched_availability_override_unavail : Warning<
3401  "%select{|overriding }1method cannot be unavailable on %0 when "
3402  "%select{the protocol method it implements|its overridden method}1 is "
3403  "available">,
3404  InGroup<Availability>;
3405def warn_availability_on_static_initializer : Warning<
3406  "ignoring availability attribute %select{on '+load' method|"
3407  "with constructor attribute|with destructor attribute}0">,
3408  InGroup<Availability>;
3409def note_overridden_method : Note<
3410  "overridden method is here">;
3411def warn_availability_swift_unavailable_deprecated_only : Warning<
3412  "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3413  InGroup<Availability>;
3414def note_protocol_method : Note<
3415  "protocol method is here">;
3416
3417def warn_unguarded_availability :
3418  Warning<"%0 is only available on %1 %2 or newer">,
3419  InGroup<UnguardedAvailability>, DefaultIgnore;
3420def warn_unguarded_availability_new :
3421  Warning<warn_unguarded_availability.Text>,
3422  InGroup<UnguardedAvailabilityNew>;
3423def note_decl_unguarded_availability_silence : Note<
3424  "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3425def note_unguarded_available_silence : Note<
3426  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3427  " this warning">;
3428def warn_at_available_unchecked_use : Warning<
3429  "%select{@available|__builtin_available}0 does not guard availability here; "
3430  "use if (%select{@available|__builtin_available}0) instead">,
3431  InGroup<DiagGroup<"unsupported-availability-guard">>;
3432
3433// Thread Safety Attributes
3434def warn_thread_attribute_ignored : Warning<
3435  "ignoring %0 attribute because its argument is invalid">,
3436  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3437def warn_thread_attribute_not_on_non_static_member : Warning<
3438  "%0 attribute without capability arguments can only be applied to non-static "
3439  "methods of a class">,
3440  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3441def warn_thread_attribute_not_on_capability_member : Warning<
3442  "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3443  "annotated with 'capability' or 'scoped_lockable' attribute">,
3444  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3445def warn_thread_attribute_argument_not_lockable : Warning<
3446  "%0 attribute requires arguments whose type is annotated "
3447  "with 'capability' attribute; type here is %1">,
3448  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3449def warn_thread_attribute_decl_not_lockable : Warning<
3450  "%0 attribute can only be applied in a context annotated "
3451  "with 'capability' attribute">,
3452  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3453def warn_thread_attribute_decl_not_pointer : Warning<
3454  "%0 only applies to pointer types; type here is %1">,
3455  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3456def err_attribute_argument_out_of_bounds_extra_info : Error<
3457  "%0 attribute parameter %1 is out of bounds: "
3458  "%plural{0:no parameters to index into|"
3459  "1:can only be 1, since there is one parameter|"
3460  ":must be between 1 and %2}2">;
3461
3462// Thread Safety Analysis
3463def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3464  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3465def warn_unlock_kind_mismatch : Warning<
3466  "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3467  "%select{shared|exclusive}3 access">,
3468  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3469def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3470  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3471def warn_no_unlock : Warning<
3472  "%0 '%1' is still held at the end of function">,
3473  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3474def warn_expecting_locked : Warning<
3475  "expecting %0 '%1' to be held at the end of function">,
3476  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3477// FIXME: improve the error message about locks not in scope
3478def warn_lock_some_predecessors : Warning<
3479  "%0 '%1' is not held on every path through here">,
3480  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3481def warn_expecting_lock_held_on_loop : Warning<
3482  "expecting %0 '%1' to be held at start of each loop">,
3483  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3484def note_locked_here : Note<"%0 acquired here">;
3485def note_unlocked_here : Note<"%0 released here">;
3486def warn_lock_exclusive_and_shared : Warning<
3487  "%0 '%1' is acquired exclusively and shared in the same scope">,
3488  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3489def note_lock_exclusive_and_shared : Note<
3490  "the other acquisition of %0 '%1' is here">;
3491def warn_variable_requires_any_lock : Warning<
3492  "%select{reading|writing}1 variable %0 requires holding "
3493  "%select{any mutex|any mutex exclusively}1">,
3494  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3495def warn_var_deref_requires_any_lock : Warning<
3496  "%select{reading|writing}1 the value pointed to by %0 requires holding "
3497  "%select{any mutex|any mutex exclusively}1">,
3498  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3499def warn_fun_excludes_mutex : Warning<
3500  "cannot call function '%1' while %0 '%2' is held">,
3501  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3502def warn_cannot_resolve_lock : Warning<
3503  "cannot resolve lock expression">,
3504  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3505def warn_acquired_before : Warning<
3506  "%0 '%1' must be acquired before '%2'">,
3507  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3508def warn_acquired_before_after_cycle : Warning<
3509  "Cycle in acquired_before/after dependencies, starting with '%0'">,
3510  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3511
3512
3513// Thread safety warnings negative capabilities
3514def warn_acquire_requires_negative_cap : Warning<
3515  "acquiring %0 '%1' requires negative capability '%2'">,
3516  InGroup<ThreadSafetyNegative>, DefaultIgnore;
3517def warn_fun_requires_negative_cap : Warning<
3518  "calling function %0 requires negative capability '%1'">,
3519  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3520
3521// Thread safety warnings on pass by reference
3522def warn_guarded_pass_by_reference : Warning<
3523  "passing variable %1 by reference requires holding %0 "
3524  "%select{'%2'|'%2' exclusively}3">,
3525  InGroup<ThreadSafetyReference>, DefaultIgnore;
3526def warn_pt_guarded_pass_by_reference : Warning<
3527  "passing the value that %1 points to by reference requires holding %0 "
3528  "%select{'%2'|'%2' exclusively}3">,
3529  InGroup<ThreadSafetyReference>, DefaultIgnore;
3530
3531// Imprecise thread safety warnings
3532def warn_variable_requires_lock : Warning<
3533  "%select{reading|writing}3 variable %1 requires holding %0 "
3534  "%select{'%2'|'%2' exclusively}3">,
3535  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3536def warn_var_deref_requires_lock : Warning<
3537  "%select{reading|writing}3 the value pointed to by %1 requires "
3538  "holding %0 %select{'%2'|'%2' exclusively}3">,
3539  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3540def warn_fun_requires_lock : Warning<
3541  "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3542  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3543
3544// Precise thread safety warnings
3545def warn_variable_requires_lock_precise :
3546  Warning<warn_variable_requires_lock.Text>,
3547  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3548def warn_var_deref_requires_lock_precise :
3549  Warning<warn_var_deref_requires_lock.Text>,
3550  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3551def warn_fun_requires_lock_precise :
3552  Warning<warn_fun_requires_lock.Text>,
3553  InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3554def note_found_mutex_near_match : Note<"found near match '%0'">;
3555
3556// Verbose thread safety warnings
3557def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
3558  InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3559def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
3560def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
3561
3562// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3563def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
3564  InGroup<ThreadSafetyBeta>, DefaultIgnore;
3565
3566// Consumed warnings
3567def warn_use_in_invalid_state : Warning<
3568  "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3569  "state">, InGroup<Consumed>, DefaultIgnore;
3570def warn_use_of_temp_in_invalid_state : Warning<
3571  "invalid invocation of method '%0' on a temporary object while it is in the "
3572  "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3573def warn_attr_on_unconsumable_class : Warning<
3574  "consumed analysis attribute is attached to member of class %0 which isn't "
3575  "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3576def warn_return_typestate_for_unconsumable_type : Warning<
3577  "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3578  DefaultIgnore;
3579def warn_return_typestate_mismatch : Warning<
3580  "return value not in expected state; expected '%0', observed '%1'">,
3581  InGroup<Consumed>, DefaultIgnore;
3582def warn_loop_state_mismatch : Warning<
3583  "state of variable '%0' must match at the entry and exit of loop">,
3584  InGroup<Consumed>, DefaultIgnore;
3585def warn_param_return_typestate_mismatch : Warning<
3586  "parameter '%0' not in expected state when the function returns: expected "
3587  "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3588def warn_param_typestate_mismatch : Warning<
3589  "argument not in expected state; expected '%0', observed '%1'">,
3590  InGroup<Consumed>, DefaultIgnore;
3591
3592// no_sanitize attribute
3593def warn_unknown_sanitizer_ignored : Warning<
3594  "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3595
3596def warn_impcast_vector_scalar : Warning<
3597  "implicit conversion turns vector to scalar: %0 to %1">,
3598  InGroup<Conversion>, DefaultIgnore;
3599def warn_impcast_complex_scalar : Warning<
3600  "implicit conversion discards imaginary component: %0 to %1">,
3601  InGroup<Conversion>, DefaultIgnore;
3602def err_impcast_complex_scalar : Error<
3603  "implicit conversion from %0 to %1 is not permitted in C++">;
3604def warn_impcast_float_precision : Warning<
3605  "implicit conversion loses floating-point precision: %0 to %1">,
3606  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3607def warn_impcast_float_result_precision : Warning<
3608  "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3609  InGroup<ImplicitFloatConversion>, DefaultIgnore;
3610def warn_impcast_double_promotion : Warning<
3611  "implicit conversion increases floating-point precision: %0 to %1">,
3612  InGroup<DoublePromotion>, DefaultIgnore;
3613def warn_impcast_integer_sign : Warning<
3614  "implicit conversion changes signedness: %0 to %1">,
3615  InGroup<SignConversion>, DefaultIgnore;
3616def warn_impcast_integer_sign_conditional : Warning<
3617  "operand of ? changes signedness: %0 to %1">,
3618  InGroup<SignConversion>, DefaultIgnore;
3619def warn_impcast_integer_precision : Warning<
3620  "implicit conversion loses integer precision: %0 to %1">,
3621  InGroup<ImplicitIntConversion>, DefaultIgnore;
3622def warn_impcast_high_order_zero_bits : Warning<
3623  "higher order bits are zeroes after implicit conversion">,
3624  InGroup<ImplicitIntConversion>, DefaultIgnore;
3625def warn_impcast_nonnegative_result : Warning<
3626  "the resulting value is always non-negative after implicit conversion">,
3627  InGroup<SignConversion>, DefaultIgnore;
3628def warn_impcast_integer_64_32 : Warning<
3629  "implicit conversion loses integer precision: %0 to %1">,
3630  InGroup<Shorten64To32>, DefaultIgnore;
3631def warn_impcast_integer_precision_constant : Warning<
3632  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3633  InGroup<ConstantConversion>;
3634def warn_impcast_bitfield_precision_constant : Warning<
3635  "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3636  InGroup<BitFieldConstantConversion>;
3637def warn_impcast_constant_value_to_objc_bool : Warning<
3638  "implicit conversion from constant value %0 to 'BOOL'; "
3639  "the only well defined values for 'BOOL' are YES and NO">,
3640  InGroup<ObjCBoolConstantConversion>;
3641
3642def warn_impcast_fixed_point_range : Warning<
3643  "implicit conversion from %0 cannot fit within the range of values for %1">,
3644  InGroup<ImplicitFixedPointConversion>;
3645
3646def warn_impcast_literal_float_to_integer : Warning<
3647  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3648  InGroup<LiteralConversion>;
3649def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3650  "implicit conversion of out of range value from %0 to %1 is undefined">,
3651  InGroup<LiteralConversion>;
3652def warn_impcast_float_integer : Warning<
3653  "implicit conversion turns floating-point number into integer: %0 to %1">,
3654  InGroup<FloatConversion>, DefaultIgnore;
3655def warn_impcast_float_to_objc_signed_char_bool : Warning<
3656  "implicit conversion from floating-point type %0 to 'BOOL'">,
3657  InGroup<ObjCSignedCharBoolImplicitFloatConversion>;
3658def warn_impcast_int_to_objc_signed_char_bool : Warning<
3659  "implicit conversion from integral type %0 to 'BOOL'">,
3660  InGroup<ObjCSignedCharBoolImplicitIntConversion>, DefaultIgnore;
3661
3662// Implicit int -> float conversion precision loss warnings.
3663def warn_impcast_integer_float_precision : Warning<
3664  "implicit conversion from %0 to %1 may lose precision">,
3665  InGroup<ImplicitIntFloatConversion>, DefaultIgnore;
3666def warn_impcast_integer_float_precision_constant : Warning<
3667  "implicit conversion from %2 to %3 changes value from %0 to %1">,
3668  InGroup<ImplicitConstIntFloatConversion>;
3669
3670def warn_impcast_float_to_integer : Warning<
3671  "implicit conversion from %0 to %1 changes value from %2 to %3">,
3672  InGroup<FloatOverflowConversion>, DefaultIgnore;
3673def warn_impcast_float_to_integer_out_of_range : Warning<
3674  "implicit conversion of out of range value from %0 to %1 is undefined">,
3675  InGroup<FloatOverflowConversion>, DefaultIgnore;
3676def warn_impcast_float_to_integer_zero : Warning<
3677  "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3678  InGroup<FloatZeroConversion>, DefaultIgnore;
3679
3680def warn_impcast_string_literal_to_bool : Warning<
3681  "implicit conversion turns string literal into bool: %0 to %1">,
3682  InGroup<StringConversion>, DefaultIgnore;
3683def warn_impcast_different_enum_types : Warning<
3684  "implicit conversion from enumeration type %0 to different enumeration type "
3685  "%1">, InGroup<EnumConversion>;
3686def warn_impcast_bool_to_null_pointer : Warning<
3687    "initialization of pointer of type %0 to null from a constant boolean "
3688    "expression">, InGroup<BoolConversion>;
3689def warn_non_literal_null_pointer : Warning<
3690    "expression which evaluates to zero treated as a null pointer constant of "
3691    "type %0">, InGroup<NonLiteralNullConversion>;
3692def warn_pointer_compare : Warning<
3693    "comparing a pointer to a null character constant; did you mean "
3694    "to compare to %select{NULL|(void *)0}0?">,
3695    InGroup<DiagGroup<"pointer-compare">>;
3696def warn_impcast_null_pointer_to_integer : Warning<
3697    "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3698    InGroup<NullConversion>;
3699def warn_impcast_floating_point_to_bool : Warning<
3700    "implicit conversion turns floating-point number into bool: %0 to %1">,
3701    InGroup<ImplicitConversionFloatingPointToBool>;
3702def ext_ms_impcast_fn_obj : ExtWarn<
3703  "implicit conversion between pointer-to-function and pointer-to-object is a "
3704  "Microsoft extension">, InGroup<MicrosoftCast>;
3705
3706def warn_impcast_pointer_to_bool : Warning<
3707    "address of%select{| function| array}0 '%1' will always evaluate to "
3708    "'true'">,
3709    InGroup<PointerBoolConversion>;
3710def warn_cast_nonnull_to_bool : Warning<
3711    "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3712    "'true' on first encounter">,
3713    InGroup<PointerBoolConversion>;
3714def warn_this_bool_conversion : Warning<
3715  "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3716  "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3717def warn_address_of_reference_bool_conversion : Warning<
3718  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3719  "code; pointer may be assumed to always convert to true">,
3720  InGroup<UndefinedBoolConversion>;
3721
3722def warn_xor_used_as_pow : Warning<
3723  "result of '%0' is %1; did you mean exponentiation?">,
3724  InGroup<XorUsedAsPow>;
3725def warn_xor_used_as_pow_base_extra : Warning<
3726  "result of '%0' is %1; did you mean '%2' (%3)?">,
3727  InGroup<XorUsedAsPow>;
3728def warn_xor_used_as_pow_base : Warning<
3729  "result of '%0' is %1; did you mean '%2'?">,
3730  InGroup<XorUsedAsPow>;
3731def note_xor_used_as_pow_silence : Note<
3732  "replace expression with '%0' %select{|or use 'xor' instead of '^' }1to silence this warning">;
3733
3734def warn_null_pointer_compare : Warning<
3735    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3736    "equal to a null pointer is always %select{true|false}2">,
3737    InGroup<TautologicalPointerCompare>;
3738def warn_nonnull_expr_compare : Warning<
3739    "comparison of nonnull %select{function call|parameter}0 '%1' "
3740    "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3741    "encounter">,
3742    InGroup<TautologicalPointerCompare>;
3743def warn_this_null_compare : Warning<
3744  "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3745  "assumed to always evaluate to %select{true|false}0">,
3746  InGroup<TautologicalUndefinedCompare>;
3747def warn_address_of_reference_null_compare : Warning<
3748  "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3749  "code; comparison may be assumed to always evaluate to "
3750  "%select{true|false}0">,
3751  InGroup<TautologicalUndefinedCompare>;
3752def note_reference_is_return_value : Note<"%0 returns a reference">;
3753
3754def note_pointer_declared_here : Note<
3755  "pointer %0 declared here">;
3756def warn_division_sizeof_ptr : Warning<
3757  "'%0' will return the size of the pointer, not the array itself">,
3758  InGroup<DiagGroup<"sizeof-pointer-div">>;
3759def warn_division_sizeof_array : Warning<
3760  "expression does not compute the number of elements in this array; element "
3761  "type is %0, not %1">,
3762  InGroup<DiagGroup<"sizeof-array-div">>;
3763
3764def note_function_warning_silence : Note<
3765    "prefix with the address-of operator to silence this warning">;
3766def note_function_to_function_call : Note<
3767    "suffix with parentheses to turn this into a function call">;
3768def warn_impcast_objective_c_literal_to_bool : Warning<
3769    "implicit boolean conversion of Objective-C object literal always "
3770    "evaluates to true">,
3771    InGroup<ObjCLiteralConversion>;
3772
3773def warn_cast_align : Warning<
3774  "cast from %0 to %1 increases required alignment from %2 to %3">,
3775  InGroup<CastAlign>, DefaultIgnore;
3776def warn_old_style_cast : Warning<
3777  "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3778
3779// Separate between casts to void* and non-void* pointers.
3780// Some APIs use (abuse) void* for something like a user context,
3781// and often that value is an integer even if it isn't a pointer itself.
3782// Having a separate warning flag allows users to control the warning
3783// for their workflow.
3784def warn_int_to_pointer_cast : Warning<
3785  "cast to %1 from smaller integer type %0">,
3786  InGroup<IntToPointerCast>;
3787def warn_int_to_void_pointer_cast : Warning<
3788  "cast to %1 from smaller integer type %0">,
3789  InGroup<IntToVoidPointerCast>;
3790def warn_pointer_to_int_cast : Warning<
3791  "cast to smaller integer type %1 from %0">,
3792  InGroup<PointerToIntCast>;
3793def warn_pointer_to_enum_cast : Warning<
3794  warn_pointer_to_int_cast.Text>,
3795  InGroup<PointerToEnumCast>;
3796def warn_void_pointer_to_int_cast : Warning<
3797  "cast to smaller integer type %1 from %0">,
3798  InGroup<VoidPointerToIntCast>;
3799def warn_void_pointer_to_enum_cast : Warning<
3800  warn_void_pointer_to_int_cast.Text>,
3801  InGroup<VoidPointerToEnumCast>;
3802
3803def warn_attribute_ignored_for_field_of_type : Warning<
3804  "%0 attribute ignored for field of type %1">,
3805  InGroup<IgnoredAttributes>;
3806def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3807  "enums in the Microsoft ABI are signed integers by default; consider giving "
3808  "the enum %0 an unsigned underlying type to make this code portable">,
3809  InGroup<SignedEnumBitfield>, DefaultIgnore;
3810def warn_attribute_packed_for_bitfield : Warning<
3811  "'packed' attribute was ignored on bit-fields with single-byte alignment "
3812  "in older versions of GCC and Clang">,
3813  InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3814def warn_transparent_union_attribute_field_size_align : Warning<
3815  "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3816  "%select{alignment|size}0 of the first field in transparent union; "
3817  "transparent_union attribute ignored">,
3818  InGroup<IgnoredAttributes>;
3819def note_transparent_union_first_field_size_align : Note<
3820  "%select{alignment|size}0 of first field is %1 bits">;
3821def warn_transparent_union_attribute_not_definition : Warning<
3822  "transparent_union attribute can only be applied to a union definition; "
3823  "attribute ignored">,
3824  InGroup<IgnoredAttributes>;
3825def warn_transparent_union_attribute_floating : Warning<
3826  "first field of a transparent union cannot have %select{floating point|"
3827  "vector}0 type %1; transparent_union attribute ignored">,
3828  InGroup<IgnoredAttributes>;
3829def warn_transparent_union_attribute_zero_fields : Warning<
3830  "transparent union definition must contain at least one field; "
3831  "transparent_union attribute ignored">,
3832  InGroup<IgnoredAttributes>;
3833def warn_attribute_type_not_supported : Warning<
3834  "%0 attribute argument not supported: %1">,
3835  InGroup<IgnoredAttributes>;
3836def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3837  InGroup<IgnoredAttributes>;
3838def warn_attribute_protected_visibility :
3839  Warning<"target does not support 'protected' visibility; using 'default'">,
3840  InGroup<DiagGroup<"unsupported-visibility">>;
3841def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3842def note_previous_attribute : Note<"previous attribute is here">;
3843def note_conflicting_attribute : Note<"conflicting attribute is here">;
3844def note_attribute : Note<"attribute is here">;
3845def err_mismatched_ms_inheritance : Error<
3846  "inheritance model does not match %select{definition|previous declaration}0">;
3847def warn_ignored_ms_inheritance : Warning<
3848  "inheritance model ignored on %select{primary template|partial specialization}0">,
3849  InGroup<IgnoredAttributes>;
3850def note_previous_ms_inheritance : Note<
3851  "previous inheritance model specified here">;
3852def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3853def err_mode_not_primitive : Error<
3854  "mode attribute only supported for integer and floating-point types">;
3855def err_mode_wrong_type : Error<
3856  "type of machine mode does not match type of base type">;
3857def warn_vector_mode_deprecated : Warning<
3858  "specifying vector types with the 'mode' attribute is deprecated; "
3859  "use the 'vector_size' attribute instead">,
3860  InGroup<DeprecatedAttributes>;
3861def err_complex_mode_vector_type : Error<
3862  "type of machine mode does not support base vector types">;
3863def err_enum_mode_vector_type : Error<
3864  "mode %0 is not supported for enumeration types">;
3865def warn_attribute_nonnull_no_pointers : Warning<
3866  "'nonnull' attribute applied to function with no pointer arguments">,
3867  InGroup<IgnoredAttributes>;
3868def warn_attribute_nonnull_parm_no_args : Warning<
3869  "'nonnull' attribute when used on parameters takes no arguments">,
3870  InGroup<IgnoredAttributes>;
3871def note_declared_nonnull : Note<
3872  "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3873def warn_attribute_sentinel_named_arguments : Warning<
3874  "'sentinel' attribute requires named arguments">,
3875  InGroup<IgnoredAttributes>;
3876def warn_attribute_sentinel_not_variadic : Warning<
3877  "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3878  InGroup<IgnoredAttributes>;
3879def err_attribute_sentinel_less_than_zero : Error<
3880  "'sentinel' parameter 1 less than zero">;
3881def err_attribute_sentinel_not_zero_or_one : Error<
3882  "'sentinel' parameter 2 not 0 or 1">;
3883def warn_cleanup_ext : Warning<
3884  "GCC does not allow the 'cleanup' attribute argument to be anything other "
3885  "than a simple identifier">,
3886  InGroup<GccCompat>;
3887def err_attribute_cleanup_arg_not_function : Error<
3888  "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3889def err_attribute_cleanup_func_must_take_one_arg : Error<
3890  "'cleanup' function %0 must take 1 parameter">;
3891def err_attribute_cleanup_func_arg_incompatible_type : Error<
3892  "'cleanup' function %0 parameter has "
3893  "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3894def err_attribute_regparm_wrong_platform : Error<
3895  "'regparm' is not valid on this platform">;
3896def err_attribute_regparm_invalid_number : Error<
3897  "'regparm' parameter must be between 0 and %0 inclusive">;
3898def err_attribute_not_supported_in_lang : Error<
3899  "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3900def err_attribute_not_supported_on_arch
3901    : Error<"%0 attribute is not supported on '%1'">;
3902def warn_gcc_ignores_type_attr : Warning<
3903  "GCC does not allow the %0 attribute to be written on a type">,
3904  InGroup<GccCompat>;
3905
3906// Clang-Specific Attributes
3907def warn_attribute_iboutlet : Warning<
3908  "%0 attribute can only be applied to instance variables or properties">,
3909  InGroup<IgnoredAttributes>;
3910def err_iboutletcollection_type : Error<
3911  "invalid type %0 as argument of iboutletcollection attribute">;
3912def err_iboutletcollection_builtintype : Error<
3913  "type argument of iboutletcollection attribute cannot be a builtin type">;
3914def warn_iboutlet_object_type : Warning<
3915  "%select{instance variable|property}2 with %0 attribute must "
3916  "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3917def warn_iboutletcollection_property_assign : Warning<
3918  "IBOutletCollection properties should be copy/strong and not assign">,
3919  InGroup<ObjCInvalidIBOutletProperty>;
3920
3921def err_attribute_overloadable_mismatch : Error<
3922  "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
3923def note_attribute_overloadable_prev_overload : Note<
3924  "previous %select{unmarked |}0overload of function is here">;
3925def err_attribute_overloadable_no_prototype : Error<
3926  "'overloadable' function %0 must have a prototype">;
3927def err_attribute_overloadable_multiple_unmarked_overloads : Error<
3928  "at most one overload for a given name may lack the 'overloadable' "
3929  "attribute">;
3930def warn_attribute_no_builtin_invalid_builtin_name : Warning<
3931  "'%0' is not a valid builtin name for %1">,
3932  InGroup<DiagGroup<"invalid-no-builtin-names">>;
3933def err_attribute_no_builtin_wildcard_or_builtin_name : Error<
3934  "empty %0 cannot be composed with named ones">;
3935def err_attribute_no_builtin_on_non_definition : Error<
3936  "%0 attribute is permitted on definitions only">;
3937def err_attribute_no_builtin_on_defaulted_deleted_function : Error<
3938  "%0 attribute has no effect on defaulted or deleted functions">;
3939def warn_ns_attribute_wrong_return_type : Warning<
3940  "%0 attribute only applies to %select{functions|methods|properties}1 that "
3941  "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3942  InGroup<IgnoredAttributes>;
3943def err_ns_attribute_wrong_parameter_type : Error<
3944  "%0 attribute only applies to "
3945  "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3946def warn_ns_attribute_wrong_parameter_type : Warning<
3947  "%0 attribute only applies to "
3948  "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
3949  InGroup<IgnoredAttributes>;
3950def warn_objc_requires_super_protocol : Warning<
3951  "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3952  InGroup<DiagGroup<"requires-super-attribute">>;
3953def note_protocol_decl : Note<
3954  "protocol is declared here">;
3955def note_protocol_decl_undefined : Note<
3956  "protocol %0 has no definition">;
3957def err_attribute_preferred_name_arg_invalid : Error<
3958  "argument %0 to 'preferred_name' attribute is not a typedef for "
3959  "a specialization of %1">;
3960
3961// called-once attribute diagnostics.
3962def err_called_once_attribute_wrong_type : Error<
3963  "'called_once' attribute only applies to function-like parameters">;
3964
3965def warn_completion_handler_never_called : Warning<
3966  "%select{|captured }1completion handler is never called">,
3967  InGroup<CompletionHandler>, DefaultIgnore;
3968def warn_called_once_never_called : Warning<
3969  "%select{|captured }1%0 parameter marked 'called_once' is never called">,
3970  InGroup<CalledOnceParameter>;
3971
3972def warn_completion_handler_never_called_when : Warning<
3973  "completion handler is never %select{used|called}1 when "
3974  "%select{taking true branch|taking false branch|"
3975  "handling this case|none of the cases applies|"
3976  "entering the loop|skipping the loop|taking one of the branches}2">,
3977  InGroup<CompletionHandler>, DefaultIgnore;
3978def warn_called_once_never_called_when : Warning<
3979  "%0 parameter marked 'called_once' is never %select{used|called}1 when "
3980  "%select{taking true branch|taking false branch|"
3981  "handling this case|none of the cases applies|"
3982  "entering the loop|skipping the loop|taking one of the branches}2">,
3983  InGroup<CalledOnceParameter>;
3984
3985def warn_completion_handler_called_twice : Warning<
3986  "completion handler is called twice">,
3987  InGroup<CompletionHandler>, DefaultIgnore;
3988def warn_called_once_gets_called_twice : Warning<
3989  "%0 parameter marked 'called_once' is called twice">,
3990  InGroup<CalledOnceParameter>;
3991def note_called_once_gets_called_twice : Note<
3992  "previous call is here%select{; set to nil to indicate "
3993  "it cannot be called afterwards|}0">;
3994
3995// objc_designated_initializer attribute diagnostics.
3996def warn_objc_designated_init_missing_super_call : Warning<
3997  "designated initializer missing a 'super' call to a designated initializer of the super class">,
3998  InGroup<ObjCDesignatedInit>;
3999def note_objc_designated_init_marked_here : Note<
4000  "method marked as designated initializer of the class here">;
4001def warn_objc_designated_init_non_super_designated_init_call : Warning<
4002  "designated initializer should only invoke a designated initializer on 'super'">,
4003  InGroup<ObjCDesignatedInit>;
4004def warn_objc_designated_init_non_designated_init_call : Warning<
4005  "designated initializer invoked a non-designated initializer">,
4006  InGroup<ObjCDesignatedInit>;
4007def warn_objc_secondary_init_super_init_call : Warning<
4008  "convenience initializer should not invoke an initializer on 'super'">,
4009  InGroup<ObjCDesignatedInit>;
4010def warn_objc_secondary_init_missing_init_call : Warning<
4011  "convenience initializer missing a 'self' call to another initializer">,
4012  InGroup<ObjCDesignatedInit>;
4013def warn_objc_implementation_missing_designated_init_override : Warning<
4014  "method override for the designated initializer of the superclass %objcinstance0 not found">,
4015  InGroup<ObjCDesignatedInit>;
4016def err_designated_init_attr_non_init : Error<
4017  "'objc_designated_initializer' attribute only applies to init methods "
4018  "of interface or class extension declarations">;
4019
4020// objc_bridge attribute diagnostics.
4021def err_objc_attr_not_id : Error<
4022  "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
4023def err_objc_attr_typedef_not_id : Error<
4024  "parameter of %0 attribute must be 'id' when used on a typedef">;
4025def err_objc_attr_typedef_not_void_pointer : Error<
4026  "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
4027def err_objc_cf_bridged_not_interface : Error<
4028  "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
4029def err_objc_ns_bridged_invalid_cfobject : Error<
4030  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
4031def warn_objc_invalid_bridge : Warning<
4032  "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
4033def warn_objc_invalid_bridge_to_cf : Warning<
4034  "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
4035
4036// objc_bridge_related attribute diagnostics.
4037def err_objc_bridged_related_invalid_class : Error<
4038  "could not find Objective-C class %0 to convert %1 to %2">;
4039def err_objc_bridged_related_invalid_class_name : Error<
4040  "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
4041def err_objc_bridged_related_known_method : Error<
4042 "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
4043 "method for this conversion">;
4044
4045def err_objc_attr_protocol_requires_definition : Error<
4046  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
4047
4048// Swift attributes.
4049def warn_attr_swift_name_function
4050  : Warning<"%0 attribute argument must be a string literal specifying a Swift function name">,
4051    InGroup<SwiftNameAttribute>;
4052def warn_attr_swift_name_invalid_identifier
4053  : Warning<"%0 attribute has invalid identifier for the %select{base|context|parameter}1 name">,
4054    InGroup<SwiftNameAttribute>;
4055def warn_attr_swift_name_decl_kind
4056  : Warning<"%0 attribute cannot be applied to this declaration">,
4057    InGroup<SwiftNameAttribute>;
4058def warn_attr_swift_name_subscript_invalid_parameter
4059  : Warning<"%0 attribute for 'subscript' must %select{be a getter or setter|"
4060        "have at least one parameter|"
4061        "have a 'self:' parameter}1">,
4062    InGroup<SwiftNameAttribute>;
4063def warn_attr_swift_name_missing_parameters
4064  : Warning<"%0 attribute is missing parameter label clause">,
4065    InGroup<SwiftNameAttribute>;
4066def warn_attr_swift_name_setter_parameters
4067  : Warning<"%0 attribute for setter must have one parameter for new value">,
4068    InGroup<SwiftNameAttribute>;
4069def warn_attr_swift_name_multiple_selfs
4070  : Warning<"%0 attribute cannot specify more than one 'self:' parameter">,
4071    InGroup<SwiftNameAttribute>;
4072def warn_attr_swift_name_getter_parameters
4073  : Warning<"%0 attribute for getter must not have any parameters besides 'self:'">,
4074    InGroup<SwiftNameAttribute>;
4075def warn_attr_swift_name_subscript_setter_no_newValue
4076  : Warning<"%0 attribute for 'subscript' setter must have a 'newValue:' parameter">,
4077    InGroup<SwiftNameAttribute>;
4078def warn_attr_swift_name_subscript_setter_multiple_newValues
4079  : Warning<"%0 attribute for 'subscript' setter cannot have multiple 'newValue:' parameters">,
4080    InGroup<SwiftNameAttribute>;
4081def warn_attr_swift_name_subscript_getter_newValue
4082  : Warning<"%0 attribute for 'subscript' getter cannot have a 'newValue:' parameter">,
4083    InGroup<SwiftNameAttribute>;
4084def warn_attr_swift_name_num_params
4085  : Warning<"too %select{few|many}0 parameters in the signature specified by "
4086            "the %1 attribute (expected %2; got %3)">,
4087    InGroup<SwiftNameAttribute>;
4088def warn_attr_swift_name_decl_missing_params
4089  : Warning<"%0 attribute cannot be applied to a %select{function|method}1 "
4090            "with no parameters">,
4091    InGroup<SwiftNameAttribute>;
4092
4093def err_attr_swift_error_no_error_parameter : Error<
4094  "%0 attribute can only be applied to a %select{function|method}1 with an "
4095  "error parameter">;
4096def err_attr_swift_error_return_type : Error<
4097  "%0 attribute with '%1' convention can only be applied to a "
4098  "%select{function|method}2 returning %select{an integral type|a pointer}3">;
4099
4100def err_swift_async_no_access : Error<
4101  "first argument to 'swift_async' must be either 'none', 'swift_private', or "
4102  "'not_swift_private'">;
4103def err_swift_async_bad_block_type : Error<
4104  "'swift_async' completion handler parameter must have block type returning"
4105  " 'void', type here is %0">;
4106
4107def warn_ignored_objc_externally_retained : Warning<
4108  "'objc_externally_retained' can only be applied to local variables "
4109  "%select{of retainable type|with strong ownership}0">,
4110  InGroup<IgnoredAttributes>;
4111
4112// Function Parameter Semantic Analysis.
4113def err_param_with_void_type : Error<"argument may not have 'void' type">;
4114def err_void_only_param : Error<
4115  "'void' must be the first and only parameter if specified">;
4116def err_void_param_qualified : Error<
4117  "'void' as parameter must not have type qualifiers">;
4118def err_ident_list_in_fn_declaration : Error<
4119  "a parameter list without types is only allowed in a function definition">;
4120def ext_param_not_declared : Extension<
4121  "parameter %0 was not declared, defaulting to type 'int'">;
4122def err_param_default_argument : Error<
4123  "C does not support default arguments">;
4124def err_param_default_argument_redefinition : Error<
4125  "redefinition of default argument">;
4126def ext_param_default_argument_redefinition : ExtWarn<
4127  err_param_default_argument_redefinition.Text>,
4128  InGroup<MicrosoftDefaultArgRedefinition>;
4129def err_param_default_argument_missing : Error<
4130  "missing default argument on parameter">;
4131def err_param_default_argument_missing_name : Error<
4132  "missing default argument on parameter %0">;
4133def err_param_default_argument_references_param : Error<
4134  "default argument references parameter %0">;
4135def err_param_default_argument_references_local : Error<
4136  "default argument references local variable %0 of enclosing function">;
4137def err_param_default_argument_references_this : Error<
4138  "default argument references 'this'">;
4139def err_param_default_argument_nonfunc : Error<
4140  "default arguments can only be specified for parameters in a function "
4141  "declaration">;
4142def err_param_default_argument_template_redecl : Error<
4143  "default arguments cannot be added to a function template that has already "
4144  "been declared">;
4145def err_param_default_argument_member_template_redecl : Error<
4146  "default arguments cannot be added to an out-of-line definition of a member "
4147  "of a %select{class template|class template partial specialization|nested "
4148  "class in a template}0">;
4149def err_param_default_argument_on_parameter_pack : Error<
4150  "parameter pack cannot have a default argument">;
4151def err_uninitialized_member_for_assign : Error<
4152  "cannot define the implicit copy assignment operator for %0, because "
4153  "non-static %select{reference|const}1 member %2 cannot use copy "
4154  "assignment operator">;
4155def err_uninitialized_member_in_ctor : Error<
4156  "%select{constructor for %1|"
4157  "implicit default constructor for %1|"
4158  "cannot use constructor inherited from %1:}0 must explicitly "
4159  "initialize the %select{reference|const}2 member %3">;
4160def err_default_arg_makes_ctor_special : Error<
4161  "addition of default argument on redeclaration makes this constructor a "
4162  "%select{default|copy|move}0 constructor">;
4163
4164def err_use_of_default_argument_to_function_declared_later : Error<
4165  "use of default argument to function %0 that is declared later in class %1">;
4166def note_default_argument_declared_here : Note<
4167  "default argument declared here">;
4168def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
4169def note_recursive_default_argument_used_here : Note<
4170  "default argument used here">;
4171
4172def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
4173  "%diff{promoted type $ of K&R function parameter is not compatible with the "
4174  "parameter type $|promoted type of K&R function parameter is not compatible "
4175  "with parameter type}0,1 declared in a previous prototype">,
4176  InGroup<KNRPromotedParameter>;
4177
4178
4179// C++ Overloading Semantic Analysis.
4180def err_ovl_diff_return_type : Error<
4181  "functions that differ only in their return type cannot be overloaded">;
4182def err_ovl_static_nonstatic_member : Error<
4183  "static and non-static member functions with the same parameter types "
4184  "cannot be overloaded">;
4185
4186let Deferrable = 1 in {
4187
4188def err_ovl_no_viable_function_in_call : Error<
4189  "no matching function for call to %0">;
4190def err_ovl_no_viable_member_function_in_call : Error<
4191  "no matching member function for call to %0">;
4192def err_ovl_ambiguous_call : Error<
4193  "call to %0 is ambiguous">;
4194def err_ovl_deleted_call : Error<"call to deleted function %0">;
4195def err_ovl_ambiguous_member_call : Error<
4196  "call to member function %0 is ambiguous">;
4197def err_ovl_deleted_member_call : Error<
4198  "call to deleted member function %0">;
4199def note_ovl_too_many_candidates : Note<
4200    "remaining %0 candidate%s0 omitted; "
4201    "pass -fshow-overloads=all to show them">;
4202
4203def select_ovl_candidate_kind : TextSubstitution<
4204  "%select{function|function|function (with reversed parameter order)|"
4205    "constructor|"
4206    "constructor (the implicit default constructor)|"
4207    "constructor (the implicit copy constructor)|"
4208    "constructor (the implicit move constructor)|"
4209    "function (the implicit copy assignment operator)|"
4210    "function (the implicit move assignment operator)|"
4211    "function (the implicit 'operator==' for this 'operator<=>)'|"
4212    "inherited constructor}0%select{| template| %2}1">;
4213
4214def note_ovl_candidate : Note<
4215    "candidate %sub{select_ovl_candidate_kind}0,1,3"
4216    "%select{| has different class%diff{ (expected $ but has $)|}5,6"
4217    "| has different number of parameters (expected %5 but has %6)"
4218    "| has type mismatch at %ordinal5 parameter"
4219    "%diff{ (expected $ but has $)|}6,7"
4220    "| has different return type%diff{ ($ expected but has $)|}5,6"
4221    "| has different qualifiers (expected %5 but found %6)"
4222    "| has different exception specification}4">;
4223
4224def note_ovl_candidate_explicit : Note<
4225    "explicit %select{constructor|conversion function|deduction guide}0 "
4226    "is not a candidate%select{| (explicit specifier evaluates to true)}1">;
4227def note_ovl_candidate_inherited_constructor : Note<
4228    "constructor from base class %0 inherited here">;
4229def note_ovl_candidate_inherited_constructor_slice : Note<
4230    "candidate %select{constructor|template}0 ignored: "
4231    "inherited constructor cannot be used to %select{copy|move}1 object">;
4232def note_ovl_candidate_illegal_constructor : Note<
4233    "candidate %select{constructor|template}0 ignored: "
4234    "instantiation %select{takes|would take}0 its own class type by value">;
4235def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
4236    "candidate constructor ignored: cannot be used to construct an object "
4237    "in address space %0">;
4238def note_ovl_candidate_bad_deduction : Note<
4239    "candidate template ignored: failed template argument deduction">;
4240def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
4241    "couldn't infer template argument %0">;
4242def note_ovl_candidate_incomplete_deduction_pack : Note<
4243    "candidate template ignored: "
4244    "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
4245    "expanded parameter in deduced argument pack %2">;
4246def note_ovl_candidate_inconsistent_deduction : Note<
4247    "candidate template ignored: deduced %select{conflicting types|"
4248    "conflicting values|conflicting templates|packs of different lengths}0 "
4249    "for parameter %1%diff{ ($ vs. $)|}2,3">;
4250def note_ovl_candidate_inconsistent_deduction_types : Note<
4251    "candidate template ignored: deduced values %diff{"
4252    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
4253    "%1 and %3 of conflicting types for parameter %0}2,4">;
4254def note_ovl_candidate_explicit_arg_mismatch_named : Note<
4255    "candidate template ignored: invalid explicitly-specified argument "
4256    "for template parameter %0">;
4257def note_ovl_candidate_unsatisfied_constraints : Note<
4258    "candidate template ignored: constraints not satisfied%0">;
4259def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
4260    "candidate template ignored: invalid explicitly-specified argument "
4261    "for %ordinal0 template parameter">;
4262def note_ovl_candidate_instantiation_depth : Note<
4263    "candidate template ignored: substitution exceeded maximum template "
4264    "instantiation depth">;
4265def note_ovl_candidate_underqualified : Note<
4266    "candidate template ignored: cannot deduce a type for %0 that would "
4267    "make %2 equal %1">;
4268def note_ovl_candidate_substitution_failure : Note<
4269    "candidate template ignored: substitution failure%0%1">;
4270def note_ovl_candidate_disabled_by_enable_if : Note<
4271    "candidate template ignored: disabled by %0%1">;
4272def note_ovl_candidate_disabled_by_requirement : Note<
4273    "candidate template ignored: requirement '%0' was not satisfied%1">;
4274def note_ovl_candidate_has_pass_object_size_params: Note<
4275    "candidate address cannot be taken because parameter %0 has "
4276    "pass_object_size attribute">;
4277def err_diagnose_if_succeeded : Error<"%0">;
4278def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
4279    ShowInSystemHeader;
4280def note_ovl_candidate_disabled_by_function_cond_attr : Note<
4281    "candidate disabled: %0">;
4282def note_ovl_candidate_disabled_by_extension : Note<
4283    "candidate unavailable as it requires OpenCL extension '%0' to be enabled">;
4284def err_addrof_function_disabled_by_enable_if_attr : Error<
4285    "cannot take address of function %0 because it has one or more "
4286    "non-tautological enable_if conditions">;
4287def err_addrof_function_constraints_not_satisfied : Error<
4288    "cannot take address of function %0 because its constraints are not "
4289    "satisfied">;
4290def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
4291    "candidate function made ineligible by enable_if">;
4292def note_ovl_candidate_deduced_mismatch : Note<
4293    "candidate template ignored: deduced type "
4294    "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
4295    "adjusted type $ of %select{|element of }4argument"
4296    "|of %select{|element of }4%ordinal0 parameter does not match "
4297    "adjusted type of %select{|element of }4argument}1,2%3">;
4298def note_ovl_candidate_non_deduced_mismatch : Note<
4299    "candidate template ignored: could not match %diff{$ against $|types}0,1">;
4300// This note is needed because the above note would sometimes print two
4301// different types with the same name.  Remove this note when the above note
4302// can handle that case properly.
4303def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
4304    "candidate template ignored: could not match %q0 against %q1">;
4305
4306// Note that we don't treat templates differently for this diagnostic.
4307def note_ovl_candidate_arity : Note<"candidate "
4308    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4309    "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
4310    "%plural{1:was|:were}5 provided">;
4311
4312def note_ovl_candidate_arity_one : Note<"candidate "
4313    "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
4314    "%select{requires at least|allows at most single|requires single}3 "
4315    "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
4316
4317def note_ovl_candidate_deleted : Note<
4318    "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
4319    "%select{explicitly made unavailable|explicitly deleted|"
4320    "implicitly deleted}3">;
4321
4322// Giving the index of the bad argument really clutters this message, and
4323// it's relatively unimportant because 1) it's generally obvious which
4324// argument(s) are of the given object type and 2) the fix is usually
4325// to complete the type, which doesn't involve changes to the call line
4326// anyway.  If people complain, we can change it.
4327def note_ovl_candidate_bad_conv_incomplete : Note<
4328    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4329    "cannot convert argument of incomplete type "
4330    "%diff{$ to $|to parameter type}3,4 for "
4331    "%select{%ordinal6 argument|object argument}5"
4332    "%select{|; dereference the argument with *|"
4333    "; take the address of the argument with &|"
4334    "; remove *|"
4335    "; remove &}7">;
4336def note_ovl_candidate_bad_list_argument : Note<
4337    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4338    "cannot convert initializer list argument to %4">;
4339def note_ovl_candidate_bad_overload : Note<
4340    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4341    "no overload of %4 matching %3 for %ordinal5 argument">;
4342def note_ovl_candidate_bad_conv : Note<
4343    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4344    "no known conversion "
4345    "%diff{from $ to $|from argument type to parameter type}3,4 for "
4346    "%select{%ordinal6 argument|object argument}5"
4347    "%select{|; dereference the argument with *|"
4348    "; take the address of the argument with &|"
4349    "; remove *|"
4350    "; remove &}7">;
4351def note_ovl_candidate_bad_arc_conv : Note<
4352    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4353    "cannot implicitly convert argument "
4354    "%diff{of type $ to $|type to parameter type}3,4 for "
4355    "%select{%ordinal6 argument|object argument}5 under ARC">;
4356def note_ovl_candidate_bad_value_category : Note<
4357    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4358    "expects an %select{lvalue|rvalue}5 for "
4359    "%select{%ordinal4 argument|object argument}3">;
4360def note_ovl_candidate_bad_addrspace : Note<
4361    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4362    "cannot %select{pass pointer to|bind reference in}5 %3 "
4363    "%select{as a pointer to|to object in}5 %4 in %ordinal6 "
4364    "argument">;
4365def note_ovl_candidate_bad_addrspace_this : Note<
4366    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4367    "'this' object is in %3, but method expects object in %4">;
4368def note_ovl_candidate_bad_gc : Note<
4369    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4370    "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
4371    "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
4372def note_ovl_candidate_bad_ownership : Note<
4373    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4374    "%select{%ordinal7|'this'}6 argument (%3) has "
4375    "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
4376    " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
4377    "__autoreleasing}5 ownership">;
4378def note_ovl_candidate_bad_cvr_this : Note<
4379    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4380    "'this' argument has type %3, but method is not marked "
4381    "%select{const|restrict|const or restrict|volatile|const or volatile|"
4382    "volatile or restrict|const, volatile, or restrict}4">;
4383def note_ovl_candidate_bad_cvr : Note<
4384    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4385    "%ordinal5 argument (%3) would lose "
4386    "%select{const|restrict|const and restrict|volatile|const and volatile|"
4387    "volatile and restrict|const, volatile, and restrict}4 qualifier"
4388    "%select{||s||s|s|s}4">;
4389def note_ovl_candidate_bad_unaligned : Note<
4390    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4391    "%ordinal5 argument (%3) would lose __unaligned qualifier">;
4392def note_ovl_candidate_bad_base_to_derived_conv : Note<
4393    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4394    "cannot %select{convert from|convert from|bind}3 "
4395    "%select{base class pointer|superclass|base class object of type}3 %4 to "
4396    "%select{derived class pointer|subclass|derived class reference}3 %5 for "
4397    "%ordinal6 argument">;
4398def note_ovl_candidate_bad_target : Note<
4399    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
4400    "call to "
4401    "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
4402    " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
4403def note_ovl_candidate_constraints_not_satisfied : Note<
4404    "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: constraints "
4405    "not satisfied">;
4406def note_implicit_member_target_infer_collision : Note<
4407    "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
4408    "%select{__device__|__global__|__host__|__host__ __device__}1 and "
4409    "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
4410
4411def note_ambiguous_type_conversion: Note<
4412    "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
4413def note_ovl_builtin_candidate : Note<"built-in candidate %0">;
4414def err_ovl_no_viable_function_in_init : Error<
4415  "no matching constructor for initialization of %0">;
4416def err_ovl_no_conversion_in_cast : Error<
4417  "cannot convert %1 to %2 without a conversion operator">;
4418def err_ovl_no_viable_conversion_in_cast : Error<
4419  "no matching conversion for %select{|static_cast|reinterpret_cast|"
4420  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4421def err_ovl_ambiguous_conversion_in_cast : Error<
4422  "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
4423  "dynamic_cast|C-style cast|functional-style cast|}0 from %1 to %2">;
4424def err_ovl_deleted_conversion_in_cast : Error<
4425  "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4426  "functional-style cast|}0 from %1 to %2 uses deleted function">;
4427def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
4428def err_ref_init_ambiguous : Error<
4429  "reference initialization of type %0 with initializer of type %1 is ambiguous">;
4430def err_ovl_deleted_init : Error<
4431  "call to deleted constructor of %0">;
4432def err_ovl_deleted_special_init : Error<
4433  "call to implicitly-deleted %select{default constructor|copy constructor|"
4434  "move constructor|copy assignment operator|move assignment operator|"
4435  "destructor|function}0 of %1">;
4436def err_ovl_ambiguous_oper_unary : Error<
4437  "use of overloaded operator '%0' is ambiguous (operand type %1)">;
4438def err_ovl_ambiguous_oper_binary : Error<
4439  "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
4440def ext_ovl_ambiguous_oper_binary_reversed : ExtWarn<
4441  "ISO C++20 considers use of overloaded operator '%0' (with operand types %1 "
4442  "and %2) to be ambiguous despite there being a unique best viable function"
4443  "%select{ with non-reversed arguments|}3">,
4444  InGroup<DiagGroup<"ambiguous-reversed-operator">>, SFINAEFailure;
4445def note_ovl_ambiguous_oper_binary_reversed_self : Note<
4446  "ambiguity is between a regular call to this operator and a call with the "
4447  "argument order reversed">;
4448def note_ovl_ambiguous_oper_binary_selected_candidate : Note<
4449  "candidate function with non-reversed arguments">;
4450def note_ovl_ambiguous_oper_binary_reversed_candidate : Note<
4451  "ambiguous candidate function with reversed arguments">;
4452def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
4453def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
4454def err_ovl_deleted_oper : Error<
4455  "overload resolution selected deleted operator '%0'">;
4456def err_ovl_deleted_special_oper : Error<
4457  "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
4458  "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is "
4459  "implicitly deleted">;
4460def err_ovl_deleted_comparison : Error<
4461  "object of type %0 cannot be compared because its %1 is implicitly deleted">;
4462def err_ovl_rewrite_equalequal_not_bool : Error<
4463  "return type %0 of selected 'operator==' function for rewritten "
4464  "'%1' comparison is not 'bool'">;
4465def ext_ovl_rewrite_equalequal_not_bool : ExtWarn<
4466  "ISO C++20 requires return type of selected 'operator==' function for "
4467  "rewritten '%1' comparison to be 'bool', not %0">,
4468  InGroup<DiagGroup<"rewrite-not-bool">>, SFINAEFailure;
4469def err_ovl_no_viable_subscript :
4470    Error<"no viable overloaded operator[] for type %0">;
4471def err_ovl_no_oper :
4472    Error<"type %0 does not provide a %select{subscript|call}1 operator">;
4473def err_ovl_unresolvable : Error<
4474  "reference to %select{overloaded|multiversioned}1 function could not be "
4475  "resolved; did you mean to call it%select{| with no arguments}0?">;
4476def err_bound_member_function : Error<
4477  "reference to non-static member function must be called"
4478  "%select{|; did you mean to call it with no arguments?}0">;
4479def note_possible_target_of_call : Note<"possible target for call">;
4480
4481def err_ovl_no_viable_object_call : Error<
4482  "no matching function for call to object of type %0">;
4483def err_ovl_ambiguous_object_call : Error<
4484  "call to object of type %0 is ambiguous">;
4485def err_ovl_deleted_object_call : Error<
4486  "call to deleted function call operator in type %0">;
4487def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
4488def err_member_call_without_object : Error<
4489  "call to non-static member function without an object argument">;
4490
4491// C++ Address of Overloaded Function
4492def err_addr_ovl_no_viable : Error<
4493  "address of overloaded function %0 does not match required type %1">;
4494def err_addr_ovl_ambiguous : Error<
4495  "address of overloaded function %0 is ambiguous">;
4496def err_addr_ovl_not_func_ptrref : Error<
4497  "address of overloaded function %0 cannot be converted to type %1">;
4498def err_addr_ovl_no_qualifier : Error<
4499  "cannot form member pointer of type %0 without '&' and class name">;
4500
4501} // let Deferrable
4502
4503// C++11 Literal Operators
4504def err_ovl_no_viable_literal_operator : Error<
4505  "no matching literal operator for call to %0"
4506  "%select{| with argument of type %2| with arguments of types %2 and %3}1"
4507  "%select{| or 'const char *'}4"
4508  "%select{|, and no matching literal operator template}5">;
4509
4510// C++ Template Declarations
4511def err_template_param_shadow : Error<
4512  "declaration of %0 shadows template parameter">;
4513def ext_template_param_shadow : ExtWarn<
4514  err_template_param_shadow.Text>, InGroup<MicrosoftTemplateShadow>;
4515def note_template_param_here : Note<"template parameter is declared here">;
4516def warn_template_export_unsupported : Warning<
4517  "exported templates are unsupported">;
4518def err_template_outside_namespace_or_class_scope : Error<
4519  "templates can only be declared in namespace or class scope">;
4520def err_template_inside_local_class : Error<
4521  "templates cannot be declared inside of a local class">;
4522def err_template_linkage : Error<"templates must have C++ linkage">;
4523def err_template_typedef : Error<"a typedef cannot be a template">;
4524def err_template_unnamed_class : Error<
4525  "cannot declare a class template with no name">;
4526def err_template_param_list_different_arity : Error<
4527  "%select{too few|too many}0 template parameters in template "
4528  "%select{|template parameter }1redeclaration">;
4529def note_template_param_list_different_arity : Note<
4530  "%select{too few|too many}0 template parameters in template template "
4531  "argument">;
4532def note_template_prev_declaration : Note<
4533  "previous template %select{declaration|template parameter}0 is here">;
4534def err_template_param_different_kind : Error<
4535  "template parameter has a different kind in template "
4536  "%select{|template parameter }0redeclaration">;
4537def note_template_param_different_kind : Note<
4538  "template parameter has a different kind in template argument">;
4539
4540def err_invalid_decl_specifier_in_nontype_parm : Error<
4541  "invalid declaration specifier in template non-type parameter">;
4542
4543def err_template_nontype_parm_different_type : Error<
4544  "template non-type parameter has a different type %0 in template "
4545  "%select{|template parameter }1redeclaration">;
4546
4547def note_template_nontype_parm_different_type : Note<
4548  "template non-type parameter has a different type %0 in template argument">;
4549def note_template_nontype_parm_prev_declaration : Note<
4550  "previous non-type template parameter with type %0 is here">;
4551def err_template_nontype_parm_bad_type : Error<
4552  "a non-type template parameter cannot have type %0">;
4553def err_template_nontype_parm_bad_structural_type : Error<
4554  "a non-type template parameter cannot have type %0 before C++20">;
4555def err_template_nontype_parm_incomplete : Error<
4556  "non-type template parameter has incomplete type %0">;
4557def err_template_nontype_parm_not_literal : Error<
4558  "non-type template parameter has non-literal type %0">;
4559def err_template_nontype_parm_rvalue_ref : Error<
4560  "non-type template parameter has rvalue reference type %0">;
4561def err_template_nontype_parm_not_structural : Error<
4562  "type %0 of non-type template parameter is not a structural type">;
4563def note_not_structural_non_public : Note<
4564  "%0 is not a structural type because it has a "
4565  "%select{non-static data member|base class}1 that is not public">;
4566def note_not_structural_mutable_field : Note<
4567  "%0 is not a structural type because it has a mutable "
4568  "non-static data member">;
4569def note_not_structural_rvalue_ref_field : Note<
4570  "%0 is not a structural type because it has a non-static data member "
4571  "of rvalue reference type">;
4572def note_not_structural_subobject : Note<
4573  "%0 is not a structural type because it has a "
4574  "%select{non-static data member|base class}1 of non-structural type %2">;
4575def warn_cxx17_compat_template_nontype_parm_type : Warning<
4576  "non-type template parameter of type %0 is incompatible with "
4577  "C++ standards before C++20">,
4578  DefaultIgnore, InGroup<CXXPre20Compat>;
4579def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
4580  "non-type template parameters declared with %0 are incompatible with C++ "
4581  "standards before C++17">,
4582  DefaultIgnore, InGroup<CXXPre17Compat>;
4583def err_template_param_default_arg_redefinition : Error<
4584  "template parameter redefines default argument">;
4585def note_template_param_prev_default_arg : Note<
4586  "previous default template argument defined here">;
4587def err_template_param_default_arg_missing : Error<
4588  "template parameter missing a default argument">;
4589def ext_template_parameter_default_in_function_template : ExtWarn<
4590  "default template arguments for a function template are a C++11 extension">,
4591  InGroup<CXX11>;
4592def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
4593  "default template arguments for a function template are incompatible with C++98">,
4594  InGroup<CXX98Compat>, DefaultIgnore;
4595def err_template_parameter_default_template_member : Error<
4596  "cannot add a default template argument to the definition of a member of a "
4597  "class template">;
4598def err_template_parameter_default_friend_template : Error<
4599  "default template argument not permitted on a friend template">;
4600def err_template_template_parm_no_parms : Error<
4601  "template template parameter must have its own template parameters">;
4602
4603def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4604  InGroup<CXX14>;
4605def warn_cxx11_compat_variable_template : Warning<
4606  "variable templates are incompatible with C++ standards before C++14">,
4607  InGroup<CXXPre14Compat>, DefaultIgnore;
4608def err_template_variable_noparams : Error<
4609  "extraneous 'template<>' in declaration of variable %0">;
4610def err_template_member : Error<"member %0 declared as a template">;
4611def err_template_member_noparams : Error<
4612  "extraneous 'template<>' in declaration of member %0">;
4613def err_template_tag_noparams : Error<
4614  "extraneous 'template<>' in declaration of %0 %1">;
4615
4616def warn_cxx17_compat_adl_only_template_id : Warning<
4617  "use of function template name with no prior function template "
4618  "declaration in function call with explicit template arguments "
4619  "is incompatible with C++ standards before C++20">,
4620  InGroup<CXXPre20Compat>, DefaultIgnore;
4621def ext_adl_only_template_id : ExtWarn<
4622  "use of function template name with no prior declaration in function call "
4623  "with explicit template arguments is a C++20 extension">, InGroup<CXX20>;
4624
4625// C++ Template Argument Lists
4626def err_template_missing_args : Error<
4627  "use of "
4628  "%select{class template|function template|variable template|alias template|"
4629  "template template parameter|concept|template}0 %1 requires template "
4630  "arguments">;
4631def err_template_arg_list_different_arity : Error<
4632  "%select{too few|too many}0 template arguments for "
4633  "%select{class template|function template|variable template|alias template|"
4634  "template template parameter|concept|template}1 %2">;
4635def note_template_decl_here : Note<"template is declared here">;
4636def err_template_arg_must_be_type : Error<
4637  "template argument for template type parameter must be a type">;
4638def err_template_arg_must_be_type_suggest : Error<
4639  "template argument for template type parameter must be a type; "
4640  "did you forget 'typename'?">;
4641def ext_ms_template_type_arg_missing_typename : ExtWarn<
4642  "template argument for template type parameter must be a type; "
4643  "omitted 'typename' is a Microsoft extension">,
4644  InGroup<MicrosoftTemplate>;
4645def err_template_arg_must_be_expr : Error<
4646  "template argument for non-type template parameter must be an expression">;
4647def err_template_arg_nontype_ambig : Error<
4648  "template argument for non-type template parameter is treated as function type %0">;
4649def err_template_arg_must_be_template : Error<
4650  "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4651def ext_template_arg_local_type : ExtWarn<
4652  "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4653def ext_template_arg_unnamed_type : ExtWarn<
4654  "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4655def warn_cxx98_compat_template_arg_local_type : Warning<
4656  "local type %0 as template argument is incompatible with C++98">,
4657  InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4658def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4659  "unnamed type as template argument is incompatible with C++98">,
4660  InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4661def note_template_unnamed_type_here : Note<
4662  "unnamed type used in template argument was declared here">;
4663def err_template_arg_overload_type : Error<
4664  "template argument is the type of an unresolved overloaded function">;
4665def err_template_arg_not_valid_template : Error<
4666  "template argument does not refer to a class or alias template, or template "
4667  "template parameter">;
4668def note_template_arg_refers_here_func : Note<
4669  "template argument refers to function template %0, here">;
4670def err_template_arg_template_params_mismatch : Error<
4671  "template template argument has different template parameters than its "
4672  "corresponding template template parameter">;
4673def err_template_arg_not_integral_or_enumeral : Error<
4674  "non-type template argument of type %0 must have an integral or enumeration"
4675  " type">;
4676def err_template_arg_not_ice : Error<
4677  "non-type template argument of type %0 is not an integral constant "
4678  "expression">;
4679def err_template_arg_not_address_constant : Error<
4680  "non-type template argument of type %0 is not a constant expression">;
4681def warn_cxx98_compat_template_arg_null : Warning<
4682  "use of null pointer as non-type template argument is incompatible with "
4683  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4684def err_template_arg_untyped_null_constant : Error<
4685  "null non-type template argument must be cast to template parameter type %0">;
4686def err_template_arg_wrongtype_null_constant : Error<
4687  "null non-type template argument of type %0 does not match template parameter "
4688  "of type %1">;
4689def err_non_type_template_parm_type_deduction_failure : Error<
4690  "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4691def err_deduced_non_type_template_arg_type_mismatch : Error<
4692  "deduced non-type template argument does not have the same type as the "
4693  "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4694def err_non_type_template_arg_subobject : Error<
4695  "non-type template argument refers to subobject '%0'">;
4696def err_non_type_template_arg_addr_label_diff : Error<
4697  "template argument / label address difference / what did you expect?">;
4698def err_non_type_template_arg_unsupported : Error<
4699  "sorry, non-type template argument of type %0 is not yet supported">;
4700def err_template_arg_not_convertible : Error<
4701  "non-type template argument of type %0 cannot be converted to a value "
4702  "of type %1">;
4703def warn_template_arg_negative : Warning<
4704  "non-type template argument with value '%0' converted to '%1' for unsigned "
4705  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4706def warn_template_arg_too_large : Warning<
4707  "non-type template argument value '%0' truncated to '%1' for "
4708  "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4709def err_template_arg_no_ref_bind : Error<
4710  "non-type template parameter of reference type "
4711  "%diff{$ cannot bind to template argument of type $"
4712  "|cannot bind to template of incompatible argument type}0,1">;
4713def err_template_arg_ref_bind_ignores_quals : Error<
4714  "reference binding of non-type template parameter "
4715  "%diff{of type $ to template argument of type $|to template argument}0,1 "
4716  "ignores qualifiers">;
4717def err_template_arg_not_decl_ref : Error<
4718  "non-type template argument does not refer to any declaration">;
4719def err_template_arg_not_address_of : Error<
4720  "non-type template argument for template parameter of pointer type %0 must "
4721  "have its address taken">;
4722def err_template_arg_address_of_non_pointer : Error<
4723  "address taken in non-type template argument for template parameter of "
4724  "reference type %0">;
4725def err_template_arg_reference_var : Error<
4726  "non-type template argument of reference type %0 is not an object">;
4727def err_template_arg_field : Error<
4728  "non-type template argument refers to non-static data member %0">;
4729def err_template_arg_method : Error<
4730  "non-type template argument refers to non-static member function %0">;
4731def err_template_arg_object_no_linkage : Error<
4732  "non-type template argument refers to %select{function|object}0 %1 that "
4733  "does not have linkage">;
4734def warn_cxx98_compat_template_arg_object_internal : Warning<
4735  "non-type template argument referring to %select{function|object}0 %1 with "
4736  "internal linkage is incompatible with C++98">,
4737  InGroup<CXX98Compat>, DefaultIgnore;
4738def ext_template_arg_object_internal : ExtWarn<
4739  "non-type template argument referring to %select{function|object}0 %1 with "
4740  "internal linkage is a C++11 extension">, InGroup<CXX11>;
4741def err_template_arg_thread_local : Error<
4742  "non-type template argument refers to thread-local object">;
4743def note_template_arg_internal_object : Note<
4744  "non-type template argument refers to %select{function|object}0 here">;
4745def note_template_arg_refers_here : Note<
4746  "non-type template argument refers here">;
4747def err_template_arg_not_object_or_func : Error<
4748  "non-type template argument does not refer to an object or function">;
4749def err_template_arg_not_pointer_to_member_form : Error<
4750  "non-type template argument is not a pointer to member constant">;
4751def err_template_arg_member_ptr_base_derived_not_supported : Error<
4752  "sorry, non-type template argument of pointer-to-member type %1 that refers "
4753  "to member %q0 of a different class is not supported yet">;
4754def ext_template_arg_extra_parens : ExtWarn<
4755  "address non-type template argument cannot be surrounded by parentheses">;
4756def warn_cxx98_compat_template_arg_extra_parens : Warning<
4757  "redundant parentheses surrounding address non-type template argument are "
4758  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4759def err_pointer_to_member_type : Error<
4760  "invalid use of pointer to member type after %select{.*|->*}0">;
4761def err_pointer_to_member_call_drops_quals : Error<
4762  "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4763def err_pointer_to_member_oper_value_classify: Error<
4764  "pointer-to-member function type %0 can only be called on an "
4765  "%select{rvalue|lvalue}1">;
4766def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4767  "invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension">,
4768  InGroup<CXX20>, SFINAEFailure;
4769def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4770  "invoking a pointer to a 'const &' member function on an rvalue is "
4771  "incompatible with C++ standards before C++20">,
4772  InGroup<CXXPre20CompatPedantic>, DefaultIgnore;
4773def ext_ms_deref_template_argument: ExtWarn<
4774  "non-type template argument containing a dereference operation is a "
4775  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4776def ext_ms_delayed_template_argument: ExtWarn<
4777  "using the undeclared type %0 as a default template argument is a "
4778  "Microsoft extension">, InGroup<MicrosoftTemplate>;
4779def err_template_arg_deduced_incomplete_pack : Error<
4780  "deduced incomplete pack %0 for template parameter %1">;
4781
4782// C++ template specialization
4783def err_template_spec_unknown_kind : Error<
4784  "can only provide an explicit specialization for a class template, function "
4785  "template, variable template, or a member function, static data member, "
4786  "%select{or member class|member class, or member enumeration}0 of a "
4787  "class template">;
4788def note_specialized_entity : Note<
4789  "explicitly specialized declaration is here">;
4790def note_explicit_specialization_declared_here : Note<
4791  "explicit specialization declared here">;
4792def err_template_spec_decl_function_scope : Error<
4793  "explicit specialization of %0 in function scope">;
4794def err_template_spec_decl_friend : Error<
4795  "cannot declare an explicit specialization in a friend">;
4796def err_template_spec_redecl_out_of_scope : Error<
4797  "%select{class template|class template partial|variable template|"
4798  "variable template partial|function template|member "
4799  "function|static data member|member class|member enumeration}0 "
4800  "specialization of %1 not in %select{a namespace enclosing %2|"
4801  "class %2 or an enclosing namespace}3">;
4802def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4803  "%select{class template|class template partial|variable template|"
4804  "variable template partial|function template|member "
4805  "function|static data member|member class|member enumeration}0 "
4806  "specialization of %1 not in %select{a namespace enclosing %2|"
4807  "class %2 or an enclosing namespace}3 "
4808  "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4809def err_template_spec_redecl_global_scope : Error<
4810  "%select{class template|class template partial|variable template|"
4811  "variable template partial|function template|member "
4812  "function|static data member|member class|member enumeration}0 "
4813  "specialization of %1 must occur at global scope">;
4814def err_spec_member_not_instantiated : Error<
4815  "specialization of member %q0 does not specialize an instantiated member">;
4816def note_specialized_decl : Note<"attempt to specialize declaration here">;
4817def err_specialization_after_instantiation : Error<
4818  "explicit specialization of %0 after instantiation">;
4819def note_instantiation_required_here : Note<
4820  "%select{implicit|explicit}0 instantiation first required here">;
4821def err_template_spec_friend : Error<
4822  "template specialization declaration cannot be a friend">;
4823def err_template_spec_default_arg : Error<
4824  "default argument not permitted on an explicit "
4825  "%select{instantiation|specialization}0 of function %1">;
4826def err_not_class_template_specialization : Error<
4827  "cannot specialize a %select{dependent template|template template "
4828  "parameter}0">;
4829def ext_explicit_specialization_storage_class : ExtWarn<
4830  "explicit specialization cannot have a storage class">;
4831def err_explicit_specialization_inconsistent_storage_class : Error<
4832  "explicit specialization has extraneous, inconsistent storage class "
4833  "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4834def err_dependent_function_template_spec_no_match : Error<
4835  "no candidate function template was found for dependent"
4836  " friend function template specialization">;
4837def note_dependent_function_template_spec_discard_reason : Note<
4838  "candidate ignored: %select{not a function template"
4839  "|not a member of the enclosing namespace;"
4840  " did you mean to explicitly qualify the specialization?}0">;
4841
4842// C++ class template specializations and out-of-line definitions
4843def err_template_spec_needs_header : Error<
4844  "template specialization requires 'template<>'">;
4845def err_template_spec_needs_template_parameters : Error<
4846  "template specialization or definition requires a template parameter list "
4847  "corresponding to the nested type %0">;
4848def err_template_param_list_matches_nontemplate : Error<
4849  "template parameter list matching the non-templated nested type %0 should "
4850  "be empty ('template<>')">;
4851def err_alias_template_extra_headers : Error<
4852  "extraneous template parameter list in alias template declaration">;
4853def err_template_spec_extra_headers : Error<
4854  "extraneous template parameter list in template specialization or "
4855  "out-of-line template definition">;
4856def warn_template_spec_extra_headers : Warning<
4857  "extraneous template parameter list in template specialization">;
4858def note_explicit_template_spec_does_not_need_header : Note<
4859  "'template<>' header not required for explicitly-specialized class %0 "
4860  "declared here">;
4861def err_template_qualified_declarator_no_match : Error<
4862  "nested name specifier '%0' for declaration does not refer into a class, "
4863  "class template or class template partial specialization">;
4864def err_specialize_member_of_template : Error<
4865  "cannot specialize %select{|(with 'template<>') }0a member of an "
4866  "unspecialized template">;
4867
4868// C++ Class Template Partial Specialization
4869def err_default_arg_in_partial_spec : Error<
4870    "default template argument in a class template partial specialization">;
4871def err_dependent_non_type_arg_in_partial_spec : Error<
4872    "type of specialized non-type template argument depends on a template "
4873    "parameter of the partial specialization">;
4874def note_dependent_non_type_default_arg_in_partial_spec : Note<
4875    "template parameter is used in default argument declared here">;
4876def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4877    "non-type template argument specializes a template parameter with "
4878    "dependent type %0">;
4879def err_partial_spec_args_match_primary_template : Error<
4880    "%select{class|variable}0 template partial specialization does not "
4881    "specialize any template argument; to %select{declare|define}1 the "
4882    "primary template, remove the template argument list">;
4883def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4884    "%select{class|variable}0 template partial specialization is not "
4885    "more specialized than the primary template">, DefaultError,
4886    InGroup<DiagGroup<"invalid-partial-specialization">>;
4887def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4888def ext_partial_specs_not_deducible : ExtWarn<
4889    "%select{class|variable}0 template partial specialization contains "
4890    "%select{a template parameter|template parameters}1 that cannot be "
4891    "deduced; this partial specialization will never be used">,
4892    DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4893def note_non_deducible_parameter : Note<
4894    "non-deducible template parameter %0">;
4895def err_partial_spec_ordering_ambiguous : Error<
4896    "ambiguous partial specializations of %0">;
4897def note_partial_spec_match : Note<"partial specialization matches %0">;
4898def err_partial_spec_redeclared : Error<
4899  "class template partial specialization %0 cannot be redeclared">;
4900def note_partial_specialization_declared_here : Note<
4901  "explicit specialization declared here">;
4902def note_prev_partial_spec_here : Note<
4903  "previous declaration of class template partial specialization %0 is here">;
4904def err_partial_spec_fully_specialized : Error<
4905  "partial specialization of %0 does not use any of its template parameters">;
4906
4907// C++ Variable Template Partial Specialization
4908def err_var_partial_spec_redeclared : Error<
4909  "variable template partial specialization %0 cannot be redefined">;
4910def note_var_prev_partial_spec_here : Note<
4911  "previous declaration of variable template partial specialization is here">;
4912def err_var_spec_no_template : Error<
4913  "no variable template matches%select{| partial}0 specialization">;
4914def err_var_spec_no_template_but_method : Error<
4915  "no variable template matches specialization; "
4916  "did you mean to use %0 as function template instead?">;
4917
4918// C++ Function template specializations
4919def err_function_template_spec_no_match : Error<
4920    "no function template matches function template specialization %0">;
4921def err_function_template_spec_ambiguous : Error<
4922    "function template specialization %0 ambiguously refers to more than one "
4923    "function template; explicitly specify%select{| additional}1 template "
4924    "arguments to identify a particular function template">;
4925def note_function_template_spec_matched : Note<
4926    "function template %q0 matches specialization %1">;
4927def err_function_template_partial_spec : Error<
4928    "function template partial specialization is not allowed">;
4929
4930// C++ Template Instantiation
4931def err_template_recursion_depth_exceeded : Error<
4932  "recursive template instantiation exceeded maximum depth of %0">,
4933  DefaultFatal, NoSFINAE;
4934def note_template_recursion_depth : Note<
4935  "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4936
4937def err_template_instantiate_within_definition : Error<
4938  "%select{implicit|explicit}0 instantiation of template %1 within its"
4939  " own definition">;
4940def err_template_instantiate_undefined : Error<
4941  "%select{implicit|explicit}0 instantiation of undefined template %1">;
4942def err_implicit_instantiate_member_undefined : Error<
4943  "implicit instantiation of undefined member %0">;
4944def note_template_class_instantiation_was_here : Note<
4945  "class template %0 was instantiated here">;
4946def note_template_class_explicit_specialization_was_here : Note<
4947  "class template %0 was explicitly specialized here">;
4948def note_template_class_instantiation_here : Note<
4949  "in instantiation of template class %q0 requested here">;
4950def note_template_member_class_here : Note<
4951  "in instantiation of member class %q0 requested here">;
4952def note_template_member_function_here : Note<
4953  "in instantiation of member function %q0 requested here">;
4954def note_function_template_spec_here : Note<
4955  "in instantiation of function template specialization %q0 requested here">;
4956def note_template_static_data_member_def_here : Note<
4957  "in instantiation of static data member %q0 requested here">;
4958def note_template_variable_def_here : Note<
4959  "in instantiation of variable template specialization %q0 requested here">;
4960def note_template_enum_def_here : Note<
4961  "in instantiation of enumeration %q0 requested here">;
4962def note_template_nsdmi_here : Note<
4963  "in instantiation of default member initializer %q0 requested here">;
4964def note_template_type_alias_instantiation_here : Note<
4965  "in instantiation of template type alias %0 requested here">;
4966def note_template_exception_spec_instantiation_here : Note<
4967  "in instantiation of exception specification for %0 requested here">;
4968def note_template_requirement_instantiation_here : Note<
4969  "in instantiation of requirement here">;
4970def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4971  "required here, but no definition is available">,
4972  InGroup<UndefinedVarTemplate>;
4973def warn_func_template_missing : Warning<"instantiation of function %q0 "
4974  "required here, but no definition is available">,
4975  InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4976def note_forward_template_decl : Note<
4977  "forward declaration of template entity is here">;
4978def note_inst_declaration_hint : Note<"add an explicit instantiation "
4979  "declaration to suppress this warning if %q0 is explicitly instantiated in "
4980  "another translation unit">;
4981def note_evaluating_exception_spec_here : Note<
4982  "in evaluation of exception specification for %q0 needed here">;
4983
4984def note_default_arg_instantiation_here : Note<
4985  "in instantiation of default argument for '%0' required here">;
4986def note_default_function_arg_instantiation_here : Note<
4987  "in instantiation of default function argument expression "
4988  "for '%0' required here">;
4989def note_explicit_template_arg_substitution_here : Note<
4990  "while substituting explicitly-specified template arguments into function "
4991  "template %0 %1">;
4992def note_function_template_deduction_instantiation_here : Note<
4993  "while substituting deduced template arguments into function template %0 "
4994  "%1">;
4995def note_deduced_template_arg_substitution_here : Note<
4996  "during template argument deduction for %select{class|variable}0 template "
4997  "%select{partial specialization |}1%2 %3">;
4998def note_prior_template_arg_substitution : Note<
4999  "while substituting prior template arguments into %select{non-type|template}0"
5000  " template parameter%1 %2">;
5001def note_template_default_arg_checking : Note<
5002  "while checking a default template argument used here">;
5003def note_concept_specialization_here : Note<
5004  "while checking the satisfaction of concept '%0' requested here">;
5005def note_nested_requirement_here : Note<
5006  "while checking the satisfaction of nested requirement requested here">;
5007def note_checking_constraints_for_template_id_here : Note<
5008  "while checking constraint satisfaction for template '%0' required here">;
5009def note_checking_constraints_for_var_spec_id_here : Note<
5010  "while checking constraint satisfaction for variable template "
5011  "partial specialization '%0' required here">;
5012def note_checking_constraints_for_class_spec_id_here : Note<
5013  "while checking constraint satisfaction for class template partial "
5014  "specialization '%0' required here">;
5015def note_checking_constraints_for_function_here : Note<
5016  "while checking constraint satisfaction for function '%0' required here">;
5017def note_constraint_substitution_here : Note<
5018  "while substituting template arguments into constraint expression here">;
5019def note_constraint_normalization_here : Note<
5020  "while calculating associated constraint of template '%0' here">;
5021def note_parameter_mapping_substitution_here : Note<
5022  "while substituting into concept arguments here; substitution failures not "
5023  "allowed in concept arguments">;
5024def note_instantiation_contexts_suppressed : Note<
5025  "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
5026  "see all)">;
5027
5028def err_field_instantiates_to_function : Error<
5029  "data member instantiated with function type %0">;
5030def err_variable_instantiates_to_function : Error<
5031  "%select{variable|static data member}0 instantiated with function type %1">;
5032def err_nested_name_spec_non_tag : Error<
5033  "type %0 cannot be used prior to '::' because it has no members">;
5034
5035def err_using_pack_expansion_empty : Error<
5036  "%select{|member}0 using declaration %1 instantiates to an empty pack">;
5037
5038// C++ Explicit Instantiation
5039def err_explicit_instantiation_duplicate : Error<
5040    "duplicate explicit instantiation of %0">;
5041def ext_explicit_instantiation_duplicate : ExtWarn<
5042    "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
5043    InGroup<MicrosoftTemplate>;
5044def note_previous_explicit_instantiation : Note<
5045    "previous explicit instantiation is here">;
5046def warn_explicit_instantiation_after_specialization : Warning<
5047  "explicit instantiation of %0 that occurs after an explicit "
5048  "specialization has no effect">,
5049  InGroup<DiagGroup<"instantiation-after-specialization">>;
5050def note_previous_template_specialization : Note<
5051    "previous template specialization is here">;
5052def err_explicit_instantiation_nontemplate_type : Error<
5053    "explicit instantiation of non-templated type %0">;
5054def note_nontemplate_decl_here : Note<
5055    "non-templated declaration is here">;
5056def err_explicit_instantiation_in_class : Error<
5057  "explicit instantiation of %0 in class scope">;
5058def err_explicit_instantiation_out_of_scope : Error<
5059  "explicit instantiation of %0 not in a namespace enclosing %1">;
5060def err_explicit_instantiation_must_be_global : Error<
5061  "explicit instantiation of %0 must occur at global scope">;
5062def warn_explicit_instantiation_out_of_scope_0x : Warning<
5063  "explicit instantiation of %0 not in a namespace enclosing %1">,
5064  InGroup<CXX11Compat>, DefaultIgnore;
5065def warn_explicit_instantiation_must_be_global_0x : Warning<
5066  "explicit instantiation of %0 must occur at global scope">,
5067  InGroup<CXX11Compat>, DefaultIgnore;
5068
5069def err_explicit_instantiation_requires_name : Error<
5070  "explicit instantiation declaration requires a name">;
5071def err_explicit_instantiation_of_typedef : Error<
5072  "explicit instantiation of typedef %0">;
5073def err_explicit_instantiation_storage_class : Error<
5074  "explicit instantiation cannot have a storage class">;
5075def err_explicit_instantiation_internal_linkage : Error<
5076  "explicit instantiation declaration of %0 with internal linkage">;
5077def err_explicit_instantiation_not_known : Error<
5078  "explicit instantiation of %0 does not refer to a function template, "
5079  "variable template, member function, member class, or static data member">;
5080def note_explicit_instantiation_here : Note<
5081  "explicit instantiation refers here">;
5082def err_explicit_instantiation_data_member_not_instantiated : Error<
5083  "explicit instantiation refers to static data member %q0 that is not an "
5084  "instantiation">;
5085def err_explicit_instantiation_member_function_not_instantiated : Error<
5086  "explicit instantiation refers to member function %q0 that is not an "
5087  "instantiation">;
5088def err_explicit_instantiation_ambiguous : Error<
5089  "partial ordering for explicit instantiation of %0 is ambiguous">;
5090def note_explicit_instantiation_candidate : Note<
5091  "explicit instantiation candidate function %q0 template here %1">;
5092def err_explicit_instantiation_inline : Error<
5093  "explicit instantiation cannot be 'inline'">;
5094def warn_explicit_instantiation_inline_0x : Warning<
5095  "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
5096  DefaultIgnore;
5097def err_explicit_instantiation_constexpr : Error<
5098  "explicit instantiation cannot be 'constexpr'">;
5099def ext_explicit_instantiation_without_qualified_id : Extension<
5100  "qualifier in explicit instantiation of %q0 requires a template-id "
5101  "(a typedef is not permitted)">;
5102def err_explicit_instantiation_without_template_id : Error<
5103  "explicit instantiation of %q0 must specify a template argument list">;
5104def err_explicit_instantiation_unqualified_wrong_namespace : Error<
5105  "explicit instantiation of %q0 must occur in namespace %1">;
5106def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
5107  "explicit instantiation of %q0 must occur in namespace %1">,
5108  InGroup<CXX11Compat>, DefaultIgnore;
5109def err_explicit_instantiation_undefined_member : Error<
5110  "explicit instantiation of undefined %select{member class|member function|"
5111  "static data member}0 %1 of class template %2">;
5112def err_explicit_instantiation_undefined_func_template : Error<
5113  "explicit instantiation of undefined function template %0">;
5114def err_explicit_instantiation_undefined_var_template : Error<
5115  "explicit instantiation of undefined variable template %q0">;
5116def err_explicit_instantiation_declaration_after_definition : Error<
5117  "explicit instantiation declaration (with 'extern') follows explicit "
5118  "instantiation definition (without 'extern')">;
5119def note_explicit_instantiation_definition_here : Note<
5120  "explicit instantiation definition is here">;
5121def err_invalid_var_template_spec_type : Error<"type %2 "
5122  "of %select{explicit instantiation|explicit specialization|"
5123  "partial specialization|redeclaration}0 of %1 does not match"
5124  " expected type %3">;
5125def err_mismatched_exception_spec_explicit_instantiation : Error<
5126  "exception specification in explicit instantiation does not match "
5127  "instantiated one">;
5128def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
5129  err_mismatched_exception_spec_explicit_instantiation.Text>,
5130  InGroup<MicrosoftExceptionSpec>;
5131def err_explicit_instantiation_dependent : Error<
5132  "explicit instantiation has dependent template arguments">;
5133
5134// C++ typename-specifiers
5135def err_typename_nested_not_found : Error<"no type named %0 in %1">;
5136def err_typename_nested_not_found_enable_if : Error<
5137  "no type named 'type' in %0; 'enable_if' cannot be used to disable "
5138  "this declaration">;
5139def err_typename_nested_not_found_requirement : Error<
5140  "failed requirement '%0'; 'enable_if' cannot be used to disable this "
5141  "declaration">;
5142def err_typename_nested_not_type : Error<
5143    "typename specifier refers to non-type member %0 in %1">;
5144def err_typename_not_type : Error<
5145    "typename specifier refers to non-type %0">;
5146def note_typename_member_refers_here : Note<
5147    "referenced member %0 is declared here">;
5148def note_typename_refers_here : Note<
5149    "referenced %0 is declared here">;
5150def err_typename_missing : Error<
5151  "missing 'typename' prior to dependent type name '%0%1'">;
5152def err_typename_missing_template : Error<
5153  "missing 'typename' prior to dependent type template name '%0%1'">;
5154def ext_typename_missing : ExtWarn<
5155  "missing 'typename' prior to dependent type name '%0%1'">,
5156  InGroup<DiagGroup<"typename-missing">>;
5157def ext_typename_outside_of_template : ExtWarn<
5158  "'typename' occurs outside of a template">, InGroup<CXX11>;
5159def warn_cxx98_compat_typename_outside_of_template : Warning<
5160  "use of 'typename' outside of a template is incompatible with C++98">,
5161  InGroup<CXX98Compat>, DefaultIgnore;
5162def err_typename_refers_to_using_value_decl : Error<
5163  "typename specifier refers to a dependent using declaration for a value "
5164  "%0 in %1">;
5165def note_using_value_decl_missing_typename : Note<
5166  "add 'typename' to treat this using declaration as a type">;
5167
5168def err_template_kw_refers_to_non_template : Error<
5169  "%0%select{| following the 'template' keyword}1 "
5170  "does not refer to a template">;
5171def note_template_kw_refers_to_non_template : Note<
5172  "declared as a non-template here">;
5173def err_template_kw_refers_to_dependent_non_template : Error<
5174  "%0%select{| following the 'template' keyword}1 "
5175  "cannot refer to a dependent template">;
5176def err_template_kw_refers_to_class_template : Error<
5177  "'%0%1' instantiated to a class template, not a function template">;
5178def note_referenced_class_template : Note<
5179  "class template declared here">;
5180def err_template_kw_missing : Error<
5181  "missing 'template' keyword prior to dependent template name '%0%1'">;
5182def ext_template_outside_of_template : ExtWarn<
5183  "'template' keyword outside of a template">, InGroup<CXX11>;
5184def warn_cxx98_compat_template_outside_of_template : Warning<
5185  "use of 'template' keyword outside of a template is incompatible with C++98">,
5186  InGroup<CXX98Compat>, DefaultIgnore;
5187
5188def err_non_type_template_in_nested_name_specifier : Error<
5189  "qualified name refers into a specialization of %select{function|variable}0 "
5190  "template %1">;
5191def err_template_id_not_a_type : Error<
5192  "template name refers to non-type template %0">;
5193def note_template_declared_here : Note<
5194  "%select{function template|class template|variable template"
5195  "|type alias template|template template parameter}0 "
5196  "%1 declared here">;
5197def err_template_expansion_into_fixed_list : Error<
5198  "pack expansion used as argument for non-pack parameter of %select{alias "
5199  "template|concept}0">;
5200def note_parameter_type : Note<
5201  "parameter of type %0 is declared here">;
5202
5203// C++11 Variadic Templates
5204def err_template_param_pack_default_arg : Error<
5205  "template parameter pack cannot have a default argument">;
5206def err_template_param_pack_must_be_last_template_parameter : Error<
5207  "template parameter pack must be the last template parameter">;
5208
5209def err_template_parameter_pack_non_pack : Error<
5210  "%select{template type|non-type template|template template}0 parameter"
5211  "%select{| pack}1 conflicts with previous %select{template type|"
5212  "non-type template|template template}0 parameter%select{ pack|}1">;
5213def note_template_parameter_pack_non_pack : Note<
5214  "%select{template type|non-type template|template template}0 parameter"
5215  "%select{| pack}1 does not match %select{template type|non-type template"
5216  "|template template}0 parameter%select{ pack|}1 in template argument">;
5217def note_template_parameter_pack_here : Note<
5218  "previous %select{template type|non-type template|template template}0 "
5219  "parameter%select{| pack}1 declared here">;
5220
5221def err_unexpanded_parameter_pack : Error<
5222  "%select{expression|base type|declaration type|data member type|bit-field "
5223  "size|static assertion|fixed underlying type|enumerator value|"
5224  "using declaration|friend declaration|qualifier|initializer|default argument|"
5225  "non-type template parameter type|exception type|partial specialization|"
5226  "__if_exists name|__if_not_exists name|lambda|block|type constraint|"
5227  "requirement|requires clause}0 "
5228  "contains%plural{0: an|:}1 unexpanded parameter pack"
5229  "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
5230
5231def err_pack_expansion_without_parameter_packs : Error<
5232  "pack expansion does not contain any unexpanded parameter packs">;
5233def err_pack_expansion_length_conflict : Error<
5234  "pack expansion contains parameter packs %0 and %1 that have different "
5235  "lengths (%2 vs. %3)">;
5236def err_pack_expansion_length_conflict_multilevel : Error<
5237  "pack expansion contains parameter pack %0 that has a different "
5238  "length (%1 vs. %2) from outer parameter packs">;
5239def err_pack_expansion_length_conflict_partial : Error<
5240  "pack expansion contains parameter pack %0 that has a different "
5241  "length (at least %1 vs. %2) from outer parameter packs">;
5242def err_pack_expansion_member_init : Error<
5243  "pack expansion for initialization of member %0">;
5244
5245def err_function_parameter_pack_without_parameter_packs : Error<
5246  "type %0 of function parameter pack does not contain any unexpanded "
5247  "parameter packs">;
5248def err_ellipsis_in_declarator_not_parameter : Error<
5249  "only function and template parameters can be parameter packs">;
5250
5251def err_sizeof_pack_no_pack_name : Error<
5252  "%0 does not refer to the name of a parameter pack">;
5253
5254def err_fold_expression_packs_both_sides : Error<
5255  "binary fold expression has unexpanded parameter packs in both operands">;
5256def err_fold_expression_empty : Error<
5257  "unary fold expression has empty expansion for operator '%0' "
5258  "with no fallback value">;
5259def err_fold_expression_bad_operand : Error<
5260  "expression not permitted as operand of fold expression">;
5261def err_fold_expression_limit_exceeded: Error<
5262  "instantiating fold expression with %0 arguments exceeded expression nesting "
5263  "limit of %1">, DefaultFatal, NoSFINAE;
5264
5265def err_unexpected_typedef : Error<
5266  "unexpected type name %0: expected expression">;
5267def err_unexpected_namespace : Error<
5268  "unexpected namespace name %0: expected expression">;
5269def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
5270def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
5271  "use of undeclared identifier %0; "
5272  "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
5273  InGroup<MicrosoftTemplate>;
5274def err_found_in_dependent_base : Error<
5275  "explicit qualification required to use member %0 from dependent base class">;
5276def ext_found_in_dependent_base : ExtWarn<"use of member %0 "
5277  "found via unqualified lookup into dependent bases of class templates is a "
5278  "Microsoft extension">, InGroup<MicrosoftTemplate>;
5279def err_found_later_in_class : Error<"member %0 used before its declaration">;
5280def ext_found_later_in_class : ExtWarn<
5281  "use of member %0 before its declaration is a Microsoft extension">,
5282  InGroup<MicrosoftTemplate>;
5283def note_dependent_member_use : Note<
5284  "must qualify identifier to find this declaration in dependent base class">;
5285def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
5286    "visible in the template definition nor found by argument-dependent lookup">;
5287def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
5288    "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
5289def err_undeclared_use : Error<"use of undeclared %0">;
5290def warn_deprecated : Warning<"%0 is deprecated">,
5291    InGroup<DeprecatedDeclarations>;
5292def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
5293def warn_property_method_deprecated :
5294    Warning<"property access is using %0 method which is deprecated">,
5295    InGroup<DeprecatedDeclarations>;
5296def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
5297    InGroup<DeprecatedDeclarations>;
5298def warn_deprecated_anonymous_namespace : Warning<
5299  "'deprecated' attribute on anonymous namespace ignored">,
5300  InGroup<IgnoredAttributes>;
5301def warn_deprecated_fwdclass_message : Warning<
5302    "%0 may be deprecated because the receiver type is unknown">,
5303    InGroup<DeprecatedDeclarations>;
5304def warn_deprecated_def : Warning<
5305  "implementing deprecated %select{method|class|category}0">,
5306  InGroup<DeprecatedImplementations>, DefaultIgnore;
5307def warn_unavailable_def : Warning<
5308  "implementing unavailable method">,
5309  InGroup<DeprecatedImplementations>, DefaultIgnore;
5310def err_unavailable : Error<"%0 is unavailable">;
5311def err_property_method_unavailable :
5312    Error<"property access is using %0 method which is unavailable">;
5313def err_unavailable_message : Error<"%0 is unavailable: %1">;
5314def warn_unavailable_fwdclass_message : Warning<
5315    "%0 may be unavailable because the receiver type is unknown">,
5316    InGroup<UnavailableDeclarations>;
5317def note_availability_specified_here : Note<
5318  "%0 has been explicitly marked "
5319  "%select{unavailable|deleted|deprecated}1 here">;
5320def note_partial_availability_specified_here : Note<
5321  "%0 has been marked as being introduced in %1 %2 here, "
5322  "but the deployment target is %1 %3">;
5323def note_implicitly_deleted : Note<
5324  "explicitly defaulted function was implicitly deleted here">;
5325def warn_not_enough_argument : Warning<
5326  "not enough variable arguments in %0 declaration to fit a sentinel">,
5327  InGroup<Sentinel>;
5328def warn_missing_sentinel : Warning <
5329  "missing sentinel in %select{function call|method dispatch|block call}0">,
5330  InGroup<Sentinel>;
5331def note_sentinel_here : Note<
5332  "%select{function|method|block}0 has been explicitly marked sentinel here">;
5333def warn_missing_prototype : Warning<
5334  "no previous prototype for function %0">,
5335  InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
5336def note_declaration_not_a_prototype : Note<
5337  "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
5338  "to make it %select{a prototype for a zero-parameter function|one}0">;
5339def warn_strict_prototypes : Warning<
5340  "this %select{function declaration is not|block declaration is not|"
5341  "old-style function definition is not preceded by}0 a prototype">,
5342  InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
5343def warn_missing_variable_declarations : Warning<
5344  "no previous extern declaration for non-static variable %0">,
5345  InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
5346def note_static_for_internal_linkage : Note<
5347  "declare 'static' if the %select{variable|function}0 is not intended to be "
5348  "used outside of this translation unit">;
5349def err_static_data_member_reinitialization :
5350  Error<"static data member %0 already has an initializer">;
5351def err_redefinition : Error<"redefinition of %0">;
5352def err_alias_after_tentative :
5353  Error<"alias definition of %0 after tentative definition">;
5354def err_alias_is_definition :
5355  Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
5356def err_definition_of_implicitly_declared_member : Error<
5357  "definition of implicitly declared %select{default constructor|copy "
5358  "constructor|move constructor|copy assignment operator|move assignment "
5359  "operator|destructor|function}1">;
5360def err_definition_of_explicitly_defaulted_member : Error<
5361  "definition of explicitly defaulted %select{default constructor|copy "
5362  "constructor|move constructor|copy assignment operator|move assignment "
5363  "operator|destructor|function}0">;
5364def err_redefinition_extern_inline : Error<
5365  "redefinition of a 'extern inline' function %0 is not supported in "
5366  "%select{C99 mode|C++}1">;
5367def warn_attr_abi_tag_namespace : Warning<
5368  "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
5369  InGroup<IgnoredAttributes>;
5370def err_abi_tag_on_redeclaration : Error<
5371  "cannot add 'abi_tag' attribute in a redeclaration">;
5372def err_new_abi_tag_on_redeclaration : Error<
5373  "'abi_tag' %0 missing in original declaration">;
5374def note_use_ifdef_guards : Note<
5375  "unguarded header; consider using #ifdef guards or #pragma once">;
5376
5377def note_deleted_dtor_no_operator_delete : Note<
5378  "virtual destructor requires an unambiguous, accessible 'operator delete'">;
5379def note_deleted_special_member_class_subobject : Note<
5380  "%select{default constructor of|copy constructor of|move constructor of|"
5381  "copy assignment operator of|move assignment operator of|destructor of|"
5382  "constructor inherited by}0 "
5383  "%1 is implicitly deleted because "
5384  "%select{base class %3|%select{||||variant }4field %3}2 "
5385  "%select{has "
5386  "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
5387  "%select{%select{default constructor|copy constructor|move constructor|copy "
5388  "assignment operator|move assignment operator|destructor|"
5389  "%select{default|corresponding|default|default|default}4 constructor}0|"
5390  "destructor}5"
5391  "%select{||s||}4"
5392  "|is an ObjC pointer}6">;
5393def note_deleted_default_ctor_uninit_field : Note<
5394  "%select{default constructor of|constructor inherited by}0 "
5395  "%1 is implicitly deleted because field %2 of "
5396  "%select{reference|const-qualified}4 type %3 would not be initialized">;
5397def note_deleted_default_ctor_all_const : Note<
5398  "%select{default constructor of|constructor inherited by}0 "
5399  "%1 is implicitly deleted because all "
5400  "%select{data members|data members of an anonymous union member}2"
5401  " are const-qualified">;
5402def note_deleted_copy_ctor_rvalue_reference : Note<
5403  "copy constructor of %0 is implicitly deleted because field %1 is of "
5404  "rvalue reference type %2">;
5405def note_deleted_copy_user_declared_move : Note<
5406  "copy %select{constructor|assignment operator}0 is implicitly deleted because"
5407  " %1 has a user-declared move %select{constructor|assignment operator}2">;
5408def note_deleted_assign_field : Note<
5409  "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
5410  "because field %2 is of %select{reference|const-qualified}4 type %3">;
5411
5412// These should be errors.
5413def warn_undefined_internal : Warning<
5414  "%select{function|variable}0 %q1 has internal linkage but is not defined">,
5415  InGroup<DiagGroup<"undefined-internal">>;
5416def err_undefined_internal_type : Error<
5417  "%select{function|variable}0 %q1 is used but not defined in this "
5418  "translation unit, and cannot be defined in any other translation unit "
5419  "because its type does not have linkage">;
5420def ext_undefined_internal_type : Extension<
5421  "ISO C++ requires a definition in this translation unit for "
5422  "%select{function|variable}0 %q1 because its type does not have linkage">,
5423  InGroup<DiagGroup<"undefined-internal-type">>;
5424def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
5425  InGroup<DiagGroup<"undefined-inline">>;
5426def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
5427def note_used_here : Note<"used here">;
5428
5429def err_internal_linkage_redeclaration : Error<
5430  "'internal_linkage' attribute does not appear on the first declaration of %0">;
5431def warn_internal_linkage_local_storage : Warning<
5432  "'internal_linkage' attribute on a non-static local variable is ignored">,
5433  InGroup<IgnoredAttributes>;
5434
5435def ext_internal_in_extern_inline : ExtWarn<
5436  "static %select{function|variable}0 %1 is used in an inline function with "
5437  "external linkage">, InGroup<StaticInInline>;
5438def ext_internal_in_extern_inline_quiet : Extension<
5439  "static %select{function|variable}0 %1 is used in an inline function with "
5440  "external linkage">, InGroup<StaticInInline>;
5441def warn_static_local_in_extern_inline : Warning<
5442  "non-constant static local variable in inline function may be different "
5443  "in different files">, InGroup<StaticLocalInInline>;
5444def note_convert_inline_to_static : Note<
5445  "use 'static' to give inline function %0 internal linkage">;
5446
5447def ext_redefinition_of_typedef : ExtWarn<
5448  "redefinition of typedef %0 is a C11 feature">,
5449  InGroup<DiagGroup<"typedef-redefinition"> >;
5450def err_redefinition_variably_modified_typedef : Error<
5451  "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
5452
5453def err_inline_decl_follows_def : Error<
5454  "inline declaration of %0 follows non-inline definition">;
5455def err_inline_declaration_block_scope : Error<
5456  "inline declaration of %0 not allowed in block scope">;
5457def err_static_non_static : Error<
5458  "static declaration of %0 follows non-static declaration">;
5459def err_different_language_linkage : Error<
5460  "declaration of %0 has a different language linkage">;
5461def ext_retained_language_linkage : Extension<
5462  "friend function %0 retaining previous language linkage is an extension">,
5463  InGroup<DiagGroup<"retained-language-linkage">>;
5464def err_extern_c_global_conflict : Error<
5465  "declaration of %1 %select{with C language linkage|in global scope}0 "
5466  "conflicts with declaration %select{in global scope|with C language linkage}0">;
5467def note_extern_c_global_conflict : Note<
5468  "declared %select{in global scope|with C language linkage}0 here">;
5469def note_extern_c_begins_here : Note<
5470  "extern \"C\" language linkage specification begins here">;
5471def warn_weak_import : Warning <
5472  "an already-declared variable is made a weak_import declaration %0">;
5473def ext_static_non_static : Extension<
5474  "redeclaring non-static %0 as static is a Microsoft extension">,
5475  InGroup<MicrosoftRedeclareStatic>;
5476def err_non_static_static : Error<
5477  "non-static declaration of %0 follows static declaration">;
5478def err_extern_non_extern : Error<
5479  "extern declaration of %0 follows non-extern declaration">;
5480def err_non_extern_extern : Error<
5481  "non-extern declaration of %0 follows extern declaration">;
5482def err_non_thread_thread : Error<
5483  "non-thread-local declaration of %0 follows thread-local declaration">;
5484def err_thread_non_thread : Error<
5485  "thread-local declaration of %0 follows non-thread-local declaration">;
5486def err_thread_thread_different_kind : Error<
5487  "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
5488  "follows declaration with %select{dynamic|static}1 initialization">;
5489def err_mismatched_owning_module : Error<
5490  "declaration of %0 in %select{the global module|module %2}1 follows "
5491  "declaration in %select{the global module|module %4}3">;
5492def err_redefinition_different_type : Error<
5493  "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
5494def err_redefinition_different_kind : Error<
5495  "redefinition of %0 as different kind of symbol">;
5496def err_redefinition_different_namespace_alias : Error<
5497  "redefinition of %0 as an alias for a different namespace">;
5498def note_previous_namespace_alias : Note<
5499  "previously defined as an alias for %0">;
5500def warn_forward_class_redefinition : Warning<
5501  "redefinition of forward class %0 of a typedef name of an object type is ignored">,
5502  InGroup<DiagGroup<"objc-forward-class-redefinition">>;
5503def err_redefinition_different_typedef : Error<
5504  "%select{typedef|type alias|type alias template}0 "
5505  "redefinition with different types%diff{ ($ vs $)|}1,2">;
5506def err_tag_reference_non_tag : Error<
5507  "%select{non-struct type|non-class type|non-union type|non-enum "
5508  "type|typedef|type alias|template|type alias template|template "
5509  "template argument}1 %0 cannot be referenced with a "
5510  "%select{struct|interface|union|class|enum}2 specifier">;
5511def err_tag_reference_conflict : Error<
5512  "implicit declaration introduced by elaborated type conflicts with a "
5513  "%select{non-struct type|non-class type|non-union type|non-enum "
5514  "type|typedef|type alias|template|type alias template|template "
5515  "template argument}0 of the same name">;
5516def err_dependent_tag_decl : Error<
5517  "%select{declaration|definition}0 of "
5518  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
5519def err_tag_definition_of_typedef : Error<
5520  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
5521def err_conflicting_types : Error<"conflicting types for %0">;
5522def err_different_pass_object_size_params : Error<
5523  "conflicting pass_object_size attributes on parameters">;
5524def err_late_asm_label_name : Error<
5525  "cannot apply asm label to %select{variable|function}0 after its first use">;
5526def err_different_asm_label : Error<"conflicting asm label">;
5527def err_nested_redefinition : Error<"nested redefinition of %0">;
5528def err_use_with_wrong_tag : Error<
5529  "use of %0 with tag type that does not match previous declaration">;
5530def warn_struct_class_tag_mismatch : Warning<
5531  "%select{struct|interface|class}0%select{| template}1 %2 was previously "
5532  "declared as a %select{struct|interface|class}3%select{| template}1; "
5533  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5534  InGroup<MismatchedTags>, DefaultIgnore;
5535def warn_struct_class_previous_tag_mismatch : Warning<
5536  "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
5537  "here but previously declared as "
5538  "%select{a struct|an interface|a class}3%select{| template}1; "
5539  "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
5540  InGroup<MismatchedTags>, DefaultIgnore;
5541def note_struct_class_suggestion : Note<
5542  "did you mean %select{struct|interface|class}0 here?">;
5543def ext_forward_ref_enum : Extension<
5544  "ISO C forbids forward references to 'enum' types">;
5545def err_forward_ref_enum : Error<
5546  "ISO C++ forbids forward references to 'enum' types">;
5547def ext_ms_forward_ref_enum : ExtWarn<
5548  "forward references to 'enum' types are a Microsoft extension">,
5549  InGroup<MicrosoftEnumForwardReference>;
5550def ext_forward_ref_enum_def : Extension<
5551  "redeclaration of already-defined enum %0 is a GNU extension">,
5552  InGroup<GNURedeclaredEnum>;
5553
5554def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
5555def err_duplicate_member : Error<"duplicate member %0">;
5556def err_misplaced_ivar : Error<
5557  "instance variables may not be placed in %select{categories|class extension}0">;
5558def warn_ivars_in_interface : Warning<
5559  "declaration of instance variables in the interface is deprecated">,
5560  InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
5561def ext_enum_value_not_int : Extension<
5562  "ISO C restricts enumerator values to range of 'int' (%0 is too "
5563  "%select{small|large}1)">;
5564def ext_enum_too_large : ExtWarn<
5565  "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
5566def ext_enumerator_increment_too_large : ExtWarn<
5567  "incremented enumerator value %0 is not representable in the "
5568  "largest integer type">, InGroup<EnumTooLarge>;
5569def warn_flag_enum_constant_out_of_range : Warning<
5570  "enumeration value %0 is out of range of flags in enumeration type %1">,
5571  InGroup<FlagEnum>;
5572
5573def err_vm_decl_in_file_scope : Error<
5574  "variably modified type declaration not allowed at file scope">;
5575def err_vm_decl_has_extern_linkage : Error<
5576  "variably modified type declaration cannot have 'extern' linkage">;
5577def err_typecheck_field_variable_size : Error<
5578  "fields must have a constant size: 'variable length array in structure' "
5579  "extension will never be supported">;
5580def err_vm_func_decl : Error<
5581  "function declaration cannot have variably modified type">;
5582def err_array_too_large : Error<
5583  "array is too large (%0 elements)">;
5584
5585def err_typecheck_negative_array_size : Error<"array size is negative">;
5586def warn_typecheck_function_qualifiers_ignored : Warning<
5587  "'%0' qualifier on function type %1 has no effect">,
5588  InGroup<IgnoredQualifiers>;
5589def warn_typecheck_function_qualifiers_unspecified : Warning<
5590  "'%0' qualifier on function type %1 has unspecified behavior">;
5591def warn_typecheck_reference_qualifiers : Warning<
5592  "'%0' qualifier on reference type %1 has no effect">,
5593  InGroup<IgnoredQualifiers>;
5594def err_typecheck_invalid_restrict_not_pointer : Error<
5595  "restrict requires a pointer or reference (%0 is invalid)">;
5596def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
5597  "restrict requires a pointer or reference">;
5598def err_typecheck_invalid_restrict_invalid_pointee : Error<
5599  "pointer to function type %0 may not be 'restrict' qualified">;
5600def ext_typecheck_zero_array_size : Extension<
5601  "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
5602def err_typecheck_zero_array_size : Error<
5603  "zero-length arrays are not permitted in C++">;
5604def err_array_size_non_int : Error<"size of array has non-integer type %0">;
5605def err_init_element_not_constant : Error<
5606  "initializer element is not a compile-time constant">;
5607def ext_aggregate_init_not_constant : Extension<
5608  "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
5609def err_local_cant_init : Error<
5610  "'__local' variable cannot have an initializer">;
5611def err_loader_uninitialized_cant_init
5612    : Error<"variable with 'loader_uninitialized' attribute cannot have an "
5613            "initializer">;
5614def err_loader_uninitialized_trivial_ctor
5615    : Error<"variable with 'loader_uninitialized' attribute must have a "
5616            "trivial default constructor">;
5617def err_loader_uninitialized_redeclaration
5618    : Error<"redeclaration cannot add 'loader_uninitialized' attribute">;
5619def err_loader_uninitialized_extern_decl
5620    : Error<"variable %0 cannot be declared both 'extern' and with the "
5621            "'loader_uninitialized' attribute">;
5622def err_block_extern_cant_init : Error<
5623  "'extern' variable cannot have an initializer">;
5624def warn_extern_init : Warning<"'extern' variable has an initializer">,
5625  InGroup<DiagGroup<"extern-initializer">>;
5626def err_variable_object_no_init : Error<
5627  "variable-sized object may not be initialized">;
5628def err_excess_initializers : Error<
5629  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
5630def ext_excess_initializers : ExtWarn<
5631  "excess elements in %select{array|vector|scalar|union|struct}0 initializer">,
5632  InGroup<ExcessInitializers>;
5633def err_excess_initializers_for_sizeless_type : Error<
5634  "excess elements in initializer for indivisible sizeless type %0">;
5635def ext_excess_initializers_for_sizeless_type : ExtWarn<
5636  "excess elements in initializer for indivisible sizeless type %0">,
5637  InGroup<ExcessInitializers>;
5638def err_excess_initializers_in_char_array_initializer : Error<
5639  "excess elements in char array initializer">;
5640def ext_excess_initializers_in_char_array_initializer : ExtWarn<
5641  "excess elements in char array initializer">,
5642  InGroup<ExcessInitializers>;
5643def err_initializer_string_for_char_array_too_long : Error<
5644  "initializer-string for char array is too long">;
5645def ext_initializer_string_for_char_array_too_long : ExtWarn<
5646  "initializer-string for char array is too long">,
5647  InGroup<ExcessInitializers>;
5648def warn_missing_field_initializers : Warning<
5649  "missing field %0 initializer">,
5650  InGroup<MissingFieldInitializers>, DefaultIgnore;
5651def warn_braces_around_init : Warning<
5652  "braces around %select{scalar |}0initializer">,
5653  InGroup<DiagGroup<"braced-scalar-init">>;
5654def ext_many_braces_around_init : ExtWarn<
5655  "too many braces around %select{scalar |}0initializer">,
5656  InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5657def ext_complex_component_init : Extension<
5658  "complex initialization specifying real and imaginary components "
5659  "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5660def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5661def err_empty_sizeless_initializer : Error<
5662  "initializer for sizeless type %0 cannot be empty">;
5663def warn_cxx98_compat_empty_scalar_initializer : Warning<
5664  "scalar initialized from empty initializer list is incompatible with C++98">,
5665  InGroup<CXX98Compat>, DefaultIgnore;
5666def warn_cxx98_compat_empty_sizeless_initializer : Warning<
5667  "initializing %0 from an empty initializer list is incompatible with C++98">,
5668  InGroup<CXX98Compat>, DefaultIgnore;
5669def warn_cxx98_compat_reference_list_init : Warning<
5670  "reference initialized from initializer list is incompatible with C++98">,
5671  InGroup<CXX98Compat>, DefaultIgnore;
5672def warn_cxx98_compat_initializer_list_init : Warning<
5673  "initialization of initializer_list object is incompatible with C++98">,
5674  InGroup<CXX98Compat>, DefaultIgnore;
5675def warn_cxx98_compat_ctor_list_init : Warning<
5676  "constructor call from initializer list is incompatible with C++98">,
5677  InGroup<CXX98Compat>, DefaultIgnore;
5678def err_illegal_initializer : Error<
5679  "illegal initializer (only variables can be initialized)">;
5680def err_illegal_initializer_type : Error<"illegal initializer type %0">;
5681def ext_init_list_type_narrowing : ExtWarn<
5682  "type %0 cannot be narrowed to %1 in initializer list">,
5683  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5684def ext_init_list_variable_narrowing : ExtWarn<
5685  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5686  "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5687def ext_init_list_constant_narrowing : ExtWarn<
5688  "constant expression evaluates to %0 which cannot be narrowed to type %1">,
5689  InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5690def warn_init_list_type_narrowing : Warning<
5691  "type %0 cannot be narrowed to %1 in initializer list in C++11">,
5692  InGroup<CXX11Narrowing>, DefaultIgnore;
5693def warn_init_list_variable_narrowing : Warning<
5694  "non-constant-expression cannot be narrowed from type %0 to %1 in "
5695  "initializer list in C++11">,
5696  InGroup<CXX11Narrowing>, DefaultIgnore;
5697def warn_init_list_constant_narrowing : Warning<
5698  "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
5699  "C++11">,
5700  InGroup<CXX11Narrowing>, DefaultIgnore;
5701def note_init_list_narrowing_silence : Note<
5702  "insert an explicit cast to silence this issue">;
5703def err_init_objc_class : Error<
5704  "cannot initialize Objective-C class type %0">;
5705def err_implicit_empty_initializer : Error<
5706  "initializer for aggregate with no elements requires explicit braces">;
5707def err_bitfield_has_negative_width : Error<
5708  "bit-field %0 has negative width (%1)">;
5709def err_anon_bitfield_has_negative_width : Error<
5710  "anonymous bit-field has negative width (%0)">;
5711def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
5712def err_bitfield_width_exceeds_type_width : Error<
5713  "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
5714  "of its type (%3 bit%s3)">;
5715def err_anon_bitfield_width_exceeds_type_width : Error<
5716  "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
5717  "of its type (%2 bit%s2)">;
5718def err_incorrect_number_of_vector_initializers : Error<
5719  "number of elements must be either one or match the size of the vector">;
5720
5721// Used by C++ which allows bit-fields that are wider than the type.
5722def warn_bitfield_width_exceeds_type_width: Warning<
5723  "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
5724  "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
5725def err_bitfield_too_wide : Error<
5726  "%select{bit-field %1|anonymous bit-field}0 is too wide (%2 bits)">;
5727def warn_bitfield_too_small_for_enum : Warning<
5728  "bit-field %0 is not wide enough to store all enumerators of %1">,
5729  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5730def note_widen_bitfield : Note<
5731  "widen this field to %0 bits to store all values of %1">;
5732def warn_unsigned_bitfield_assigned_signed_enum : Warning<
5733  "assigning value of signed enum type %1 to unsigned bit-field %0; "
5734  "negative enumerators of enum %1 will be converted to positive values">,
5735  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5736def warn_signed_bitfield_enum_conversion : Warning<
5737  "signed bit-field %0 needs an extra bit to represent the largest positive "
5738  "enumerators of %1">,
5739  InGroup<BitFieldEnumConversion>, DefaultIgnore;
5740def note_change_bitfield_sign : Note<
5741  "consider making the bitfield type %select{unsigned|signed}0">;
5742
5743def warn_missing_braces : Warning<
5744  "suggest braces around initialization of subobject">,
5745  InGroup<MissingBraces>, DefaultIgnore;
5746
5747def err_redefinition_of_label : Error<"redefinition of label %0">;
5748def err_undeclared_label_use : Error<"use of undeclared label %0">;
5749def err_goto_ms_asm_label : Error<
5750  "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5751def note_goto_ms_asm_label : Note<
5752  "inline assembly label %0 declared here">;
5753def warn_unused_label : Warning<"unused label %0">,
5754  InGroup<UnusedLabel>, DefaultIgnore;
5755
5756def err_goto_into_protected_scope : Error<
5757  "cannot jump from this goto statement to its label">;
5758def ext_goto_into_protected_scope : ExtWarn<
5759  "jump from this goto statement to its label is a Microsoft extension">,
5760  InGroup<MicrosoftGoto>;
5761def warn_cxx98_compat_goto_into_protected_scope : Warning<
5762  "jump from this goto statement to its label is incompatible with C++98">,
5763  InGroup<CXX98Compat>, DefaultIgnore;
5764def err_switch_into_protected_scope : Error<
5765  "cannot jump from switch statement to this case label">;
5766def warn_cxx98_compat_switch_into_protected_scope : Warning<
5767  "jump from switch statement to this case label is incompatible with C++98">,
5768  InGroup<CXX98Compat>, DefaultIgnore;
5769def err_indirect_goto_without_addrlabel : Error<
5770  "indirect goto in function with no address-of-label expressions">;
5771def err_indirect_goto_in_protected_scope : Error<
5772  "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
5773def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5774  "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
5775  "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5776def note_indirect_goto_target : Note<
5777  "possible target of %select{indirect|asm}0 goto statement">;
5778def note_protected_by_variable_init : Note<
5779  "jump bypasses variable initialization">;
5780def note_protected_by_variable_nontriv_destructor : Note<
5781  "jump bypasses variable with a non-trivial destructor">;
5782def note_protected_by_variable_non_pod : Note<
5783  "jump bypasses initialization of non-POD variable">;
5784def note_protected_by_cleanup : Note<
5785  "jump bypasses initialization of variable with __attribute__((cleanup))">;
5786def note_protected_by_vla_typedef : Note<
5787  "jump bypasses initialization of VLA typedef">;
5788def note_protected_by_vla_type_alias : Note<
5789  "jump bypasses initialization of VLA type alias">;
5790def note_protected_by_constexpr_if : Note<
5791  "jump enters controlled statement of constexpr if">;
5792def note_protected_by_if_available : Note<
5793  "jump enters controlled statement of if available">;
5794def note_protected_by_vla : Note<
5795  "jump bypasses initialization of variable length array">;
5796def note_protected_by_objc_fast_enumeration : Note<
5797  "jump enters Objective-C fast enumeration loop">;
5798def note_protected_by_objc_try : Note<
5799  "jump bypasses initialization of @try block">;
5800def note_protected_by_objc_catch : Note<
5801  "jump bypasses initialization of @catch block">;
5802def note_protected_by_objc_finally : Note<
5803  "jump bypasses initialization of @finally block">;
5804def note_protected_by_objc_synchronized : Note<
5805  "jump bypasses initialization of @synchronized block">;
5806def note_protected_by_objc_autoreleasepool : Note<
5807  "jump bypasses auto release push of @autoreleasepool block">;
5808def note_protected_by_cxx_try : Note<
5809  "jump bypasses initialization of try block">;
5810def note_protected_by_cxx_catch : Note<
5811  "jump bypasses initialization of catch block">;
5812def note_protected_by_seh_try : Note<
5813  "jump bypasses initialization of __try block">;
5814def note_protected_by_seh_except : Note<
5815  "jump bypasses initialization of __except block">;
5816def note_protected_by_seh_finally : Note<
5817  "jump bypasses initialization of __finally block">;
5818def note_protected_by___block : Note<
5819  "jump bypasses setup of __block variable">;
5820def note_protected_by_objc_strong_init : Note<
5821  "jump bypasses initialization of __strong variable">;
5822def note_protected_by_objc_weak_init : Note<
5823  "jump bypasses initialization of __weak variable">;
5824def note_protected_by_non_trivial_c_struct_init : Note<
5825  "jump bypasses initialization of variable of non-trivial C struct type">;
5826def note_enters_block_captures_cxx_obj : Note<
5827  "jump enters lifetime of block which captures a destructible C++ object">;
5828def note_enters_block_captures_strong : Note<
5829  "jump enters lifetime of block which strongly captures a variable">;
5830def note_enters_block_captures_weak : Note<
5831  "jump enters lifetime of block which weakly captures a variable">;
5832def note_enters_block_captures_non_trivial_c_struct : Note<
5833  "jump enters lifetime of block which captures a C struct that is non-trivial "
5834  "to destroy">;
5835def note_enters_compound_literal_scope : Note<
5836  "jump enters lifetime of a compound literal that is non-trivial to destruct">;
5837
5838def note_exits_cleanup : Note<
5839  "jump exits scope of variable with __attribute__((cleanup))">;
5840def note_exits_dtor : Note<
5841  "jump exits scope of variable with non-trivial destructor">;
5842def note_exits_temporary_dtor : Note<
5843  "jump exits scope of lifetime-extended temporary with non-trivial "
5844  "destructor">;
5845def note_exits___block : Note<
5846  "jump exits scope of __block variable">;
5847def note_exits_objc_try : Note<
5848  "jump exits @try block">;
5849def note_exits_objc_catch : Note<
5850  "jump exits @catch block">;
5851def note_exits_objc_finally : Note<
5852  "jump exits @finally block">;
5853def note_exits_objc_synchronized : Note<
5854  "jump exits @synchronized block">;
5855def note_exits_cxx_try : Note<
5856  "jump exits try block">;
5857def note_exits_cxx_catch : Note<
5858  "jump exits catch block">;
5859def note_exits_seh_try : Note<
5860  "jump exits __try block">;
5861def note_exits_seh_except : Note<
5862  "jump exits __except block">;
5863def note_exits_seh_finally : Note<
5864  "jump exits __finally block">;
5865def note_exits_objc_autoreleasepool : Note<
5866  "jump exits autoreleasepool block">;
5867def note_exits_objc_strong : Note<
5868  "jump exits scope of __strong variable">;
5869def note_exits_objc_weak : Note<
5870  "jump exits scope of __weak variable">;
5871def note_exits_block_captures_cxx_obj : Note<
5872  "jump exits lifetime of block which captures a destructible C++ object">;
5873def note_exits_block_captures_strong : Note<
5874  "jump exits lifetime of block which strongly captures a variable">;
5875def note_exits_block_captures_weak : Note<
5876  "jump exits lifetime of block which weakly captures a variable">;
5877def note_exits_block_captures_non_trivial_c_struct : Note<
5878  "jump exits lifetime of block which captures a C struct that is non-trivial "
5879  "to destroy">;
5880def note_exits_compound_literal_scope : Note<
5881  "jump exits lifetime of a compound literal that is non-trivial to destruct">;
5882
5883def err_func_returning_qualified_void : ExtWarn<
5884  "function cannot return qualified void type %0">,
5885  InGroup<DiagGroup<"qualified-void-return-type">>;
5886def err_func_returning_array_function : Error<
5887  "function cannot return %select{array|function}0 type %1">;
5888def err_field_declared_as_function : Error<"field %0 declared as a function">;
5889def err_field_incomplete_or_sizeless : Error<
5890  "field has %select{incomplete|sizeless}0 type %1">;
5891def ext_variable_sized_type_in_struct : ExtWarn<
5892  "field %0 with variable sized type %1 not at the end of a struct or class is"
5893  " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5894
5895def ext_c99_flexible_array_member : Extension<
5896  "flexible array members are a C99 feature">, InGroup<C99>;
5897def err_flexible_array_virtual_base : Error<
5898  "flexible array member %0 not allowed in "
5899  "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5900def err_flexible_array_empty_aggregate : Error<
5901  "flexible array member %0 not allowed in otherwise empty "
5902  "%select{struct|interface|union|class|enum}1">;
5903def err_flexible_array_has_nontrivial_dtor : Error<
5904  "flexible array member %0 of type %1 with non-trivial destruction">;
5905def ext_flexible_array_in_struct : Extension<
5906  "%0 may not be nested in a struct due to flexible array member">,
5907  InGroup<FlexibleArrayExtensions>;
5908def ext_flexible_array_in_array : Extension<
5909  "%0 may not be used as an array element due to flexible array member">,
5910  InGroup<FlexibleArrayExtensions>;
5911def err_flexible_array_init : Error<
5912  "initialization of flexible array member is not allowed">;
5913def ext_flexible_array_empty_aggregate_ms : Extension<
5914  "flexible array member %0 in otherwise empty "
5915  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5916  InGroup<MicrosoftFlexibleArray>;
5917def err_flexible_array_union : Error<
5918  "flexible array member %0 in a union is not allowed">;
5919def ext_flexible_array_union_ms : Extension<
5920  "flexible array member %0 in a union is a Microsoft extension">,
5921  InGroup<MicrosoftFlexibleArray>;
5922def ext_flexible_array_empty_aggregate_gnu : Extension<
5923  "flexible array member %0 in otherwise empty "
5924  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5925  InGroup<GNUEmptyStruct>;
5926def ext_flexible_array_union_gnu : Extension<
5927  "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5928
5929def err_flexible_array_not_at_end : Error<
5930  "flexible array member %0 with type %1 is not at the end of"
5931  " %select{struct|interface|union|class|enum}2">;
5932def err_objc_variable_sized_type_not_at_end : Error<
5933  "field %0 with variable sized type %1 is not at the end of class">;
5934def note_next_field_declaration : Note<
5935  "next field declaration is here">;
5936def note_next_ivar_declaration : Note<
5937  "next %select{instance variable declaration|synthesized instance variable}0"
5938  " is here">;
5939def err_synthesize_variable_sized_ivar : Error<
5940  "synthesized property with variable size type %0"
5941  " requires an existing instance variable">;
5942def err_flexible_array_arc_retainable : Error<
5943  "ARC forbids flexible array members with retainable object type">;
5944def warn_variable_sized_ivar_visibility : Warning<
5945  "field %0 with variable sized type %1 is not visible to subclasses and"
5946  " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
5947def warn_superclass_variable_sized_type_not_at_end : Warning<
5948  "field %0 can overwrite instance variable %1 with variable sized type %2"
5949  " in superclass %3">, InGroup<ObjCFlexibleArray>;
5950
5951let CategoryName = "ARC Semantic Issue" in {
5952
5953// ARC-mode diagnostics.
5954
5955let CategoryName = "ARC Weak References" in {
5956
5957def err_arc_weak_no_runtime : Error<
5958  "cannot create __weak reference because the current deployment target "
5959  "does not support weak references">;
5960def err_arc_weak_disabled : Error<
5961  "cannot create __weak reference in file using manual reference counting">;
5962def err_synthesizing_arc_weak_property_disabled : Error<
5963  "cannot synthesize weak property in file using manual reference counting">;
5964def err_synthesizing_arc_weak_property_no_runtime : Error<
5965  "cannot synthesize weak property because the current deployment target "
5966  "does not support weak references">;
5967def err_arc_unsupported_weak_class : Error<
5968  "class is incompatible with __weak references">;
5969def err_arc_weak_unavailable_assign : Error<
5970  "assignment of a weak-unavailable object to a __weak object">;
5971def err_arc_weak_unavailable_property : Error<
5972  "synthesizing __weak instance variable of type %0, which does not "
5973  "support weak references">;
5974def note_implemented_by_class : Note<
5975  "when implemented by class %0">;
5976def err_arc_convesion_of_weak_unavailable : Error<
5977  "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5978  " a __weak object of type %2">;
5979
5980} // end "ARC Weak References" category
5981
5982let CategoryName = "ARC Restrictions" in {
5983
5984def err_unavailable_in_arc : Error<
5985  "%0 is unavailable in ARC">;
5986def note_arc_forbidden_type : Note<
5987  "declaration uses type that is ill-formed in ARC">;
5988def note_performs_forbidden_arc_conversion : Note<
5989  "inline function performs a conversion which is forbidden in ARC">;
5990def note_arc_init_returns_unrelated : Note<
5991  "init method must return a type related to its receiver type">;
5992def note_arc_weak_disabled : Note<
5993  "declaration uses __weak, but ARC is disabled">;
5994def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5995  "the current deployment target does not support">;
5996def note_arc_field_with_ownership : Note<
5997  "field has non-trivial ownership qualification">;
5998
5999def err_arc_illegal_explicit_message : Error<
6000  "ARC forbids explicit message send of %0">;
6001def err_arc_unused_init_message : Error<
6002  "the result of a delegate init call must be immediately returned "
6003  "or assigned to 'self'">;
6004def err_arc_mismatched_cast : Error<
6005  "%select{implicit conversion|cast}0 of "
6006  "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
6007  "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
6008  " to %3 is disallowed with ARC">;
6009def err_arc_nolifetime_behavior : Error<
6010  "explicit ownership qualifier on cast result has no effect">;
6011def err_arc_objc_property_default_assign_on_object : Error<
6012  "ARC forbids synthesizing a property of an Objective-C object "
6013  "with unspecified ownership or storage attribute">;
6014def err_arc_illegal_selector : Error<
6015  "ARC forbids use of %0 in a @selector">;
6016def err_arc_illegal_method_def : Error<
6017  "ARC forbids %select{implementation|synthesis}0 of %1">;
6018def warn_arc_strong_pointer_objc_pointer : Warning<
6019  "method parameter of type %0 with no explicit ownership">,
6020  InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
6021
6022} // end "ARC Restrictions" category
6023
6024def err_arc_lost_method_convention : Error<
6025  "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
6026  "method, but its implementation doesn't match because %select{"
6027  "its result type is not an object pointer|"
6028  "its result type is unrelated to its receiver type}1">;
6029def note_arc_lost_method_convention : Note<"declaration in interface">;
6030def err_arc_gained_method_convention : Error<
6031  "method implementation does not match its declaration">;
6032def note_arc_gained_method_convention : Note<
6033  "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
6034  "family because %select{its result type is not an object pointer|"
6035  "its result type is unrelated to its receiver type}1">;
6036def err_typecheck_arc_assign_self : Error<
6037  "cannot assign to 'self' outside of a method in the init family">;
6038def err_typecheck_arc_assign_self_class_method : Error<
6039  "cannot assign to 'self' in a class method">;
6040def err_typecheck_arr_assign_enumeration : Error<
6041  "fast enumeration variables cannot be modified in ARC by default; "
6042  "declare the variable __strong to allow this">;
6043def err_typecheck_arc_assign_externally_retained : Error<
6044  "variable declared with 'objc_externally_retained' "
6045  "cannot be modified in ARC">;
6046def warn_arc_retained_assign : Warning<
6047  "assigning retained object to %select{weak|unsafe_unretained}0 "
6048  "%select{property|variable}1"
6049  "; object will be released after assignment">,
6050  InGroup<ARCUnsafeRetainedAssign>;
6051def warn_arc_retained_property_assign : Warning<
6052  "assigning retained object to unsafe property"
6053  "; object will be released after assignment">,
6054  InGroup<ARCUnsafeRetainedAssign>;
6055def warn_arc_literal_assign : Warning<
6056  "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
6057  " to a weak %select{property|variable}1"
6058  "; object will be released after assignment">,
6059  InGroup<ARCUnsafeRetainedAssign>;
6060def err_arc_new_array_without_ownership : Error<
6061  "'new' cannot allocate an array of %0 with no explicit ownership">;
6062def err_arc_autoreleasing_var : Error<
6063  "%select{__block variables|global variables|fields|instance variables}0 cannot have "
6064  "__autoreleasing ownership">;
6065def err_arc_autoreleasing_capture : Error<
6066  "cannot capture __autoreleasing variable in a "
6067  "%select{block|lambda by copy}0">;
6068def err_arc_thread_ownership : Error<
6069  "thread-local variable has non-trivial ownership: type is %0">;
6070def err_arc_indirect_no_ownership : Error<
6071  "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
6072def err_arc_array_param_no_ownership : Error<
6073  "must explicitly describe intended ownership of an object array parameter">;
6074def err_arc_pseudo_dtor_inconstant_quals : Error<
6075  "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
6076  "type %1">;
6077def err_arc_init_method_unrelated_result_type : Error<
6078  "init methods must return a type related to the receiver type">;
6079def err_arc_nonlocal_writeback : Error<
6080  "passing address of %select{non-local|non-scalar}0 object to "
6081  "__autoreleasing parameter for write-back">;
6082def err_arc_method_not_found : Error<
6083  "no known %select{instance|class}1 method for selector %0">;
6084def err_arc_receiver_forward_class : Error<
6085  "receiver %0 for class message is a forward declaration">;
6086def err_arc_may_not_respond : Error<
6087  "no visible @interface for %0 declares the selector %1">;
6088def err_arc_receiver_forward_instance : Error<
6089  "receiver type %0 for instance message is a forward declaration">;
6090def warn_receiver_forward_instance : Warning<
6091  "receiver type %0 for instance message is a forward declaration">,
6092  InGroup<ForwardClassReceiver>, DefaultIgnore;
6093def err_arc_collection_forward : Error<
6094  "collection expression type %0 is a forward declaration">;
6095def err_arc_multiple_method_decl : Error<
6096  "multiple methods named %0 found with mismatched result, "
6097  "parameter type or attributes">;
6098def warn_arc_lifetime_result_type : Warning<
6099  "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
6100  "lifetime qualifier on return type is ignored">,
6101  InGroup<IgnoredQualifiers>;
6102
6103let CategoryName = "ARC Retain Cycle" in {
6104
6105def warn_arc_retain_cycle : Warning<
6106  "capturing %0 strongly in this block is likely to lead to a retain cycle">,
6107  InGroup<ARCRetainCycles>;
6108def note_arc_retain_cycle_owner : Note<
6109  "block will be retained by %select{the captured object|an object strongly "
6110  "retained by the captured object}0">;
6111
6112} // end "ARC Retain Cycle" category
6113
6114def warn_arc_object_memaccess : Warning<
6115  "%select{destination for|source of}0 this %1 call is a pointer to "
6116  "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
6117
6118let CategoryName = "ARC and @properties" in {
6119
6120def err_arc_strong_property_ownership : Error<
6121  "existing instance variable %1 for strong property %0 may not be "
6122  "%select{|__unsafe_unretained||__weak}2">;
6123def err_arc_assign_property_ownership : Error<
6124  "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
6125  "attribute must be __unsafe_unretained">;
6126def err_arc_inconsistent_property_ownership : Error<
6127  "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
6128  "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
6129
6130} // end "ARC and @properties" category
6131
6132def warn_block_capture_autoreleasing : Warning<
6133  "block captures an autoreleasing out-parameter, which may result in "
6134  "use-after-free bugs">,
6135  InGroup<BlockCaptureAutoReleasing>;
6136def note_declare_parameter_strong : Note<
6137  "declare the parameter __strong or capture a __block __strong variable to "
6138  "keep values alive across autorelease pools">;
6139
6140def err_arc_atomic_ownership : Error<
6141  "cannot perform atomic operation on a pointer to type %0: type has "
6142  "non-trivial ownership">;
6143
6144let CategoryName = "ARC Casting Rules" in {
6145
6146def err_arc_bridge_cast_incompatible : Error<
6147  "incompatible types casting %0 to %1 with a %select{__bridge|"
6148  "__bridge_transfer|__bridge_retained}2 cast">;
6149def err_arc_bridge_cast_wrong_kind : Error<
6150  "cast of %select{Objective-C|block|C}0 pointer type %1 to "
6151  "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
6152  "__bridge_transfer|__bridge_retained}4">;
6153def err_arc_cast_requires_bridge : Error<
6154  "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
6155  "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
6156  "requires a bridged cast">;
6157def note_arc_bridge : Note<
6158  "use __bridge to convert directly (no change in ownership)">;
6159def note_arc_cstyle_bridge : Note<
6160  "use __bridge with C-style cast to convert directly (no change in ownership)">;
6161def note_arc_bridge_transfer : Note<
6162  "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
6163  "ownership of a +1 %0 into ARC">;
6164def note_arc_cstyle_bridge_transfer : Note<
6165  "use __bridge_transfer with C-style cast to transfer "
6166  "ownership of a +1 %0 into ARC">;
6167def note_arc_bridge_retained : Note<
6168  "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
6169  "ARC object available as a +1 %0">;
6170def note_arc_cstyle_bridge_retained : Note<
6171  "use __bridge_retained with C-style cast to make an "
6172  "ARC object available as a +1 %0">;
6173
6174} // ARC Casting category
6175
6176} // ARC category name
6177
6178def err_flexible_array_init_needs_braces : Error<
6179  "flexible array requires brace-enclosed initializer">;
6180def err_illegal_decl_array_of_functions : Error<
6181  "'%0' declared as array of functions of type %1">;
6182def err_array_incomplete_or_sizeless_type : Error<
6183  "array has %select{incomplete|sizeless}0 element type %1">;
6184def err_illegal_message_expr_incomplete_type : Error<
6185  "Objective-C message has incomplete result type %0">;
6186def err_illegal_decl_array_of_references : Error<
6187  "'%0' declared as array of references of type %1">;
6188def err_decl_negative_array_size : Error<
6189  "'%0' declared as an array with a negative size">;
6190def err_array_static_outside_prototype : Error<
6191  "%0 used in array declarator outside of function prototype">;
6192def err_array_static_not_outermost : Error<
6193  "%0 used in non-outermost array type derivation">;
6194def err_array_star_outside_prototype : Error<
6195  "star modifier used outside of function prototype">;
6196def err_illegal_decl_pointer_to_reference : Error<
6197  "'%0' declared as a pointer to a reference of type %1">;
6198def err_illegal_decl_mempointer_to_reference : Error<
6199  "'%0' declared as a member pointer to a reference of type %1">;
6200def err_illegal_decl_mempointer_to_void : Error<
6201  "'%0' declared as a member pointer to void">;
6202def err_illegal_decl_mempointer_in_nonclass : Error<
6203  "'%0' does not point into a class">;
6204def err_mempointer_in_nonclass_type : Error<
6205  "member pointer refers into non-class type %0">;
6206def err_reference_to_void : Error<"cannot form a reference to 'void'">;
6207def err_nonfunction_block_type : Error<
6208  "block pointer to non-function type is invalid">;
6209def err_return_block_has_expr : Error<"void block should not return a value">;
6210def err_block_return_missing_expr : Error<
6211  "non-void block should return a value">;
6212def err_func_def_incomplete_result : Error<
6213  "incomplete result type %0 in function definition">;
6214def err_atomic_specifier_bad_type
6215    : Error<"_Atomic cannot be applied to "
6216            "%select{incomplete |array |function |reference |atomic |qualified "
6217            "|sizeless ||integer }0type "
6218            "%1 %select{|||||||which is not trivially copyable|}0">;
6219
6220// Expressions.
6221def ext_sizeof_alignof_function_type : Extension<
6222  "invalid application of '%0' to a function type">, InGroup<PointerArith>;
6223def ext_sizeof_alignof_void_type : Extension<
6224  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
6225def err_opencl_sizeof_alignof_type : Error<
6226  "invalid application of '%0' to a void type">;
6227def err_sizeof_alignof_incomplete_or_sizeless_type : Error<
6228  "invalid application of '%0' to %select{an incomplete|sizeless}1 type %2">;
6229def err_sizeof_alignof_function_type : Error<
6230  "invalid application of '%0' to a function type">;
6231def err_openmp_default_simd_align_expr : Error<
6232  "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
6233def err_sizeof_alignof_typeof_bitfield : Error<
6234  "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
6235def err_alignof_member_of_incomplete_type : Error<
6236  "invalid application of 'alignof' to a field of a class still being defined">;
6237def err_vecstep_non_scalar_vector_type : Error<
6238  "'vec_step' requires built-in scalar or vector type, %0 invalid">;
6239def err_offsetof_incomplete_type : Error<
6240  "offsetof of incomplete type %0">;
6241def err_offsetof_record_type : Error<
6242  "offsetof requires struct, union, or class type, %0 invalid">;
6243def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
6244def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
6245  InGroup<InvalidOffsetof>;
6246def ext_offsetof_non_standardlayout_type : ExtWarn<
6247  "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
6248def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
6249def err_offsetof_field_of_virtual_base : Error<
6250  "invalid application of 'offsetof' to a field of a virtual base">;
6251def warn_sub_ptr_zero_size_types : Warning<
6252  "subtraction of pointers to type %0 of zero size has undefined behavior">,
6253  InGroup<PointerArith>;
6254def warn_pointer_arith_null_ptr : Warning<
6255  "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
6256  InGroup<NullPointerArithmetic>, DefaultIgnore;
6257def warn_gnu_null_ptr_arith : Warning<
6258  "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
6259  InGroup<NullPointerArithmetic>, DefaultIgnore;
6260
6261def warn_floatingpoint_eq : Warning<
6262  "comparing floating point with == or != is unsafe">,
6263  InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
6264
6265def warn_remainder_division_by_zero : Warning<
6266  "%select{remainder|division}0 by zero is undefined">,
6267  InGroup<DivZero>;
6268def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
6269  InGroup<DiagGroup<"shift-negative-value">>;
6270def warn_shift_negative : Warning<"shift count is negative">,
6271  InGroup<DiagGroup<"shift-count-negative">>;
6272def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
6273  InGroup<DiagGroup<"shift-count-overflow">>;
6274def warn_shift_result_gt_typewidth : Warning<
6275  "signed shift result (%0) requires %1 bits to represent, but %2 only has "
6276  "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
6277def warn_shift_result_sets_sign_bit : Warning<
6278  "signed shift result (%0) sets the sign bit of the shift expression's "
6279  "type (%1) and becomes negative">,
6280  InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
6281
6282def warn_precedence_bitwise_rel : Warning<
6283  "%0 has lower precedence than %1; %1 will be evaluated first">,
6284  InGroup<Parentheses>;
6285def note_precedence_bitwise_first : Note<
6286  "place parentheses around the %0 expression to evaluate it first">;
6287def note_precedence_silence : Note<
6288  "place parentheses around the '%0' expression to silence this warning">;
6289
6290def warn_precedence_conditional : Warning<
6291  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6292  InGroup<Parentheses>;
6293def warn_precedence_bitwise_conditional : Warning<
6294  "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
6295  InGroup<BitwiseConditionalParentheses>;
6296def note_precedence_conditional_first : Note<
6297  "place parentheses around the '?:' expression to evaluate it first">;
6298
6299def warn_enum_constant_in_bool_context : Warning<
6300  "converting the enum constant to a boolean">,
6301  InGroup<IntInBoolContext>, DefaultIgnore;
6302def warn_left_shift_in_bool_context : Warning<
6303  "converting the result of '<<' to a boolean; did you mean '(%0) != 0'?">,
6304  InGroup<IntInBoolContext>, DefaultIgnore;
6305def warn_logical_instead_of_bitwise : Warning<
6306  "use of logical '%0' with constant operand">,
6307  InGroup<DiagGroup<"constant-logical-operand">>;
6308def note_logical_instead_of_bitwise_change_operator : Note<
6309  "use '%0' for a bitwise operation">;
6310def note_logical_instead_of_bitwise_remove_constant : Note<
6311  "remove constant to silence this warning">;
6312
6313def warn_bitwise_op_in_bitwise_op : Warning<
6314  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
6315
6316def warn_logical_and_in_logical_or : Warning<
6317  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
6318
6319def warn_overloaded_shift_in_comparison :Warning<
6320  "overloaded operator %select{>>|<<}0 has higher precedence than "
6321  "comparison operator">,
6322  InGroup<OverloadedShiftOpParentheses>;
6323def note_evaluate_comparison_first :Note<
6324  "place parentheses around comparison expression to evaluate it first">;
6325
6326def note_concatenated_string_literal_silence :Note<
6327  "place parentheses around the string literal to silence warning">;
6328
6329def warn_addition_in_bitshift : Warning<
6330  "operator '%0' has lower precedence than '%1'; "
6331  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
6332
6333def warn_self_assignment_builtin : Warning<
6334  "explicitly assigning value of variable of type %0 to itself">,
6335  InGroup<SelfAssignment>, DefaultIgnore;
6336def warn_self_assignment_overloaded : Warning<
6337  "explicitly assigning value of variable of type %0 to itself">,
6338  InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
6339def warn_self_move : Warning<
6340  "explicitly moving variable of type %0 to itself">,
6341  InGroup<SelfMove>, DefaultIgnore;
6342
6343def warn_redundant_move_on_return : Warning<
6344  "redundant move in return statement">,
6345  InGroup<RedundantMove>, DefaultIgnore;
6346def warn_pessimizing_move_on_return : Warning<
6347  "moving a local object in a return statement prevents copy elision">,
6348  InGroup<PessimizingMove>, DefaultIgnore;
6349def warn_pessimizing_move_on_initialization : Warning<
6350  "moving a temporary object prevents copy elision">,
6351  InGroup<PessimizingMove>, DefaultIgnore;
6352def note_remove_move : Note<"remove std::move call here">;
6353
6354def warn_return_std_move : Warning<
6355  "local variable %0 will be copied despite being %select{returned|thrown}1 by name">,
6356  InGroup<ReturnStdMove>, DefaultIgnore;
6357def note_add_std_move : Note<
6358  "call 'std::move' explicitly to avoid copying">;
6359def warn_return_std_move_in_cxx11 : Warning<
6360  "prior to the resolution of a defect report against ISO C++11, "
6361  "local variable %0 would have been copied despite being returned by name, "
6362  "due to its not matching the function return type%diff{ ($ vs $)|}1,2">,
6363  InGroup<ReturnStdMoveInCXX11>, DefaultIgnore;
6364def note_add_std_move_in_cxx11 : Note<
6365  "call 'std::move' explicitly to avoid copying on older compilers">;
6366
6367def warn_string_plus_int : Warning<
6368  "adding %0 to a string does not append to the string">,
6369  InGroup<StringPlusInt>;
6370def warn_string_plus_char : Warning<
6371  "adding %0 to a string pointer does not append to the string">,
6372  InGroup<StringPlusChar>;
6373def note_string_plus_scalar_silence : Note<
6374  "use array indexing to silence this warning">;
6375
6376def warn_sizeof_array_param : Warning<
6377  "sizeof on array function parameter will return size of %0 instead of %1">,
6378  InGroup<SizeofArrayArgument>;
6379
6380def warn_sizeof_array_decay : Warning<
6381  "sizeof on pointer operation will return size of %0 instead of %1">,
6382  InGroup<SizeofArrayDecay>;
6383
6384def err_sizeof_nonfragile_interface : Error<
6385  "application of '%select{alignof|sizeof}1' to interface %0 is "
6386  "not supported on this architecture and platform">;
6387def err_atdef_nonfragile_interface : Error<
6388  "use of @defs is not supported on this architecture and platform">;
6389def err_subscript_nonfragile_interface : Error<
6390  "subscript requires size of interface %0, which is not constant for "
6391  "this architecture and platform">;
6392
6393def err_arithmetic_nonfragile_interface : Error<
6394  "arithmetic on pointer to interface %0, which is not a constant size for "
6395  "this architecture and platform">;
6396
6397def warn_deprecated_comma_subscript : Warning<
6398  "top-level comma expression in array subscript is deprecated">,
6399  InGroup<DeprecatedCommaSubscript>;
6400
6401def ext_subscript_non_lvalue : Extension<
6402  "ISO C90 does not allow subscripting non-lvalue array">;
6403def err_typecheck_subscript_value : Error<
6404  "subscripted value is not an array, pointer, or vector">;
6405def err_typecheck_subscript_not_integer : Error<
6406  "array subscript is not an integer">;
6407def err_subscript_function_type : Error<
6408  "subscript of pointer to function type %0">;
6409def err_subscript_incomplete_or_sizeless_type : Error<
6410  "subscript of pointer to %select{incomplete|sizeless}0 type %1">;
6411def err_dereference_incomplete_type : Error<
6412  "dereference of pointer to incomplete type %0">;
6413def ext_gnu_subscript_void_type : Extension<
6414  "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
6415def err_typecheck_member_reference_struct_union : Error<
6416  "member reference base type %0 is not a structure or union">;
6417def err_typecheck_member_reference_ivar : Error<
6418  "%0 does not have a member named %1">;
6419def err_arc_weak_ivar_access : Error<
6420  "dereferencing a __weak pointer is not allowed due to possible "
6421  "null value caused by race condition, assign it to strong variable first">;
6422def err_typecheck_member_reference_arrow : Error<
6423  "member reference type %0 is not a pointer">;
6424def err_typecheck_member_reference_suggestion : Error<
6425  "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
6426def note_typecheck_member_reference_suggestion : Note<
6427  "did you mean to use '.' instead?">;
6428def note_member_reference_arrow_from_operator_arrow : Note<
6429  "'->' applied to return value of the operator->() declared here">;
6430def err_typecheck_member_reference_type : Error<
6431  "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
6432def err_typecheck_member_reference_unknown : Error<
6433  "cannot refer to member %0 in %1 with '%select{.|->}2'">;
6434def err_member_reference_needs_call : Error<
6435  "base of member reference is a function; perhaps you meant to call "
6436  "it%select{| with no arguments}0?">;
6437def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
6438  InGroup<CharSubscript>, DefaultIgnore;
6439
6440def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
6441def err_no_member : Error<"no member named %0 in %1">;
6442def err_no_member_overloaded_arrow : Error<
6443  "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
6444
6445def err_member_not_yet_instantiated : Error<
6446  "no member %0 in %1; it has not yet been instantiated">;
6447def note_non_instantiated_member_here : Note<
6448  "not-yet-instantiated member is declared here">;
6449
6450def err_enumerator_does_not_exist : Error<
6451  "enumerator %0 does not exist in instantiation of %1">;
6452def note_enum_specialized_here : Note<
6453  "enum %0 was explicitly specialized here">;
6454
6455def err_specialization_not_primary_template : Error<
6456  "cannot reference member of primary template because deduced class "
6457  "template specialization %0 is %select{instantiated from a partial|"
6458  "an explicit}1 specialization">;
6459
6460def err_member_redeclared : Error<"class member cannot be redeclared">;
6461def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
6462  InGroup<RedeclaredClassMember>;
6463def err_member_redeclared_in_instantiation : Error<
6464  "multiple overloads of %0 instantiate to the same signature %1">;
6465def err_member_name_of_class : Error<"member %0 has the same name as its class">;
6466def err_member_def_undefined_record : Error<
6467  "out-of-line definition of %0 from class %1 without definition">;
6468def err_member_decl_does_not_match : Error<
6469  "out-of-line %select{declaration|definition}2 of %0 "
6470  "does not match any declaration in %1">;
6471def err_friend_decl_with_def_arg_must_be_def : Error<
6472  "friend declaration specifying a default argument must be a definition">;
6473def err_friend_decl_with_def_arg_redeclared : Error<
6474  "friend declaration specifying a default argument must be the only declaration">;
6475def err_friend_decl_does_not_match : Error<
6476  "friend declaration of %0 does not match any declaration in %1">;
6477def err_member_decl_does_not_match_suggest : Error<
6478  "out-of-line %select{declaration|definition}2 of %0 "
6479  "does not match any declaration in %1; did you mean %3?">;
6480def err_member_def_does_not_match_ret_type : Error<
6481  "return type of out-of-line definition of %q0 differs from "
6482  "that in the declaration">;
6483def err_nonstatic_member_out_of_line : Error<
6484  "non-static data member defined out-of-line">;
6485def err_qualified_typedef_declarator : Error<
6486  "typedef declarator cannot be qualified">;
6487def err_qualified_param_declarator : Error<
6488  "parameter declarator cannot be qualified">;
6489def ext_out_of_line_declaration : ExtWarn<
6490  "out-of-line declaration of a member must be a definition">,
6491  InGroup<OutOfLineDeclaration>, DefaultError;
6492def err_member_extra_qualification : Error<
6493  "extra qualification on member %0">;
6494def warn_member_extra_qualification : Warning<
6495  err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
6496def warn_namespace_member_extra_qualification : Warning<
6497  "extra qualification on member %0">,
6498  InGroup<DiagGroup<"extra-qualification">>;
6499def err_member_qualification : Error<
6500  "non-friend class member %0 cannot have a qualified name">;
6501def note_member_def_close_match : Note<"member declaration nearly matches">;
6502def note_member_def_close_const_match : Note<
6503  "member declaration does not match because "
6504  "it %select{is|is not}0 const qualified">;
6505def note_member_def_close_param_match : Note<
6506  "type of %ordinal0 parameter of member declaration does not match definition"
6507  "%diff{ ($ vs $)|}1,2">;
6508def note_local_decl_close_match : Note<"local declaration nearly matches">;
6509def note_local_decl_close_param_match : Note<
6510  "type of %ordinal0 parameter of local declaration does not match definition"
6511  "%diff{ ($ vs $)|}1,2">;
6512def err_typecheck_ivar_variable_size : Error<
6513  "instance variables must have a constant size">;
6514def err_ivar_reference_type : Error<
6515  "instance variables cannot be of reference type">;
6516def err_typecheck_illegal_increment_decrement : Error<
6517  "cannot %select{decrement|increment}1 value of type %0">;
6518def err_typecheck_expect_int : Error<
6519  "used type %0 where integer is required">;
6520def err_typecheck_arithmetic_incomplete_or_sizeless_type : Error<
6521  "arithmetic on a pointer to %select{an incomplete|sizeless}0 type %1">;
6522def err_typecheck_pointer_arith_function_type : Error<
6523  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
6524  "function type%select{|s}2 %1%select{| and %3}2">;
6525def err_typecheck_pointer_arith_void_type : Error<
6526  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
6527def err_typecheck_decl_incomplete_type : Error<
6528  "variable has incomplete type %0">;
6529def ext_typecheck_decl_incomplete_type : ExtWarn<
6530  "tentative definition of variable with internal linkage has incomplete non-array type %0">,
6531  InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
6532def err_tentative_def_incomplete_type : Error<
6533  "tentative definition has type %0 that is never completed">;
6534def warn_tentative_incomplete_array : Warning<
6535  "tentative array definition assumed to have one element">;
6536def err_typecheck_incomplete_array_needs_initializer : Error<
6537  "definition of variable with array type needs an explicit size "
6538  "or an initializer">;
6539def err_array_init_not_init_list : Error<
6540  "array initializer must be an initializer "
6541  "list%select{| or string literal| or wide string literal}0">;
6542def err_array_init_narrow_string_into_wchar : Error<
6543  "initializing wide char array with non-wide string literal">;
6544def err_array_init_wide_string_into_char : Error<
6545  "initializing char array with wide string literal">;
6546def err_array_init_incompat_wide_string_into_wchar : Error<
6547  "initializing wide char array with incompatible wide string literal">;
6548def err_array_init_plain_string_into_char8_t : Error<
6549  "initializing 'char8_t' array with plain string literal">;
6550def note_array_init_plain_string_into_char8_t : Note<
6551  "add 'u8' prefix to form a 'char8_t' string literal">;
6552def err_array_init_utf8_string_into_char : Error<
6553  "%select{|ISO C++20 does not permit }0initialization of char array with "
6554  "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">;
6555def warn_cxx20_compat_utf8_string : Warning<
6556  "type of UTF-8 string literal will change from array of const char to "
6557  "array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
6558def note_cxx20_compat_utf8_string_remove_u8 : Note<
6559  "remove 'u8' prefix to avoid a change of behavior; "
6560  "Clang encodes unprefixed narrow string literals as UTF-8">;
6561def err_array_init_different_type : Error<
6562  "cannot initialize array %diff{of type $ with array of type $|"
6563  "with different type of array}0,1">;
6564def err_array_init_non_constant_array : Error<
6565  "cannot initialize array %diff{of type $ with non-constant array of type $|"
6566  "with different type of array}0,1">;
6567def ext_array_init_copy : Extension<
6568  "initialization of an array "
6569  "%diff{of type $ from a compound literal of type $|"
6570  "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
6571// This is intentionally not disabled by -Wno-gnu.
6572def ext_array_init_parens : ExtWarn<
6573  "parenthesized initialization of a member array is a GNU extension">,
6574  InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
6575def warn_deprecated_string_literal_conversion : Warning<
6576  "conversion from string literal to %0 is deprecated">,
6577  InGroup<CXX11CompatDeprecatedWritableStr>;
6578def ext_deprecated_string_literal_conversion : ExtWarn<
6579  "ISO C++11 does not allow conversion from string literal to %0">,
6580  InGroup<WritableStrings>, SFINAEFailure;
6581def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
6582def err_typecheck_sclass_fscope : Error<
6583  "illegal storage class on file-scoped variable">;
6584def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
6585  InGroup<MissingDeclarations>;
6586def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
6587  "of a type">, InGroup<MissingDeclarations>;
6588def err_standalone_class_nested_name_specifier : Error<
6589  "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
6590  "have a nested name specifier">;
6591def err_typecheck_sclass_func : Error<"illegal storage class on function">;
6592def err_static_block_func : Error<
6593  "function declared in block scope cannot have 'static' storage class">;
6594def err_typecheck_address_of : Error<"address of %select{bit-field"
6595  "|vector element|property expression|register variable|matrix element}0 requested">;
6596def ext_typecheck_addrof_void : Extension<
6597  "ISO C forbids taking the address of an expression of type 'void'">;
6598def err_unqualified_pointer_member_function : Error<
6599  "must explicitly qualify name of member function when taking its address">;
6600def err_invalid_form_pointer_member_function : Error<
6601  "cannot create a non-constant pointer to member function">;
6602def err_address_of_function_with_pass_object_size_params: Error<
6603  "cannot take address of function %0 because parameter %1 has "
6604  "pass_object_size attribute">;
6605def err_parens_pointer_member_function : Error<
6606  "cannot parenthesize the name of a method when forming a member pointer">;
6607def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
6608  "extra '&' taking address of overloaded function">;
6609def err_typecheck_invalid_lvalue_addrof : Error<
6610  "cannot take the address of an rvalue of type %0">;
6611def ext_typecheck_addrof_temporary : ExtWarn<
6612  "taking the address of a temporary object of type %0">,
6613  InGroup<AddressOfTemporary>, DefaultError;
6614def err_typecheck_addrof_temporary : Error<
6615  "taking the address of a temporary object of type %0">;
6616def err_typecheck_addrof_dtor : Error<
6617  "taking the address of a destructor">;
6618def err_typecheck_unary_expr : Error<
6619  "invalid argument type %0 to unary expression">;
6620def err_typecheck_indirection_requires_pointer : Error<
6621  "indirection requires pointer operand (%0 invalid)">;
6622def ext_typecheck_indirection_through_void_pointer : ExtWarn<
6623  "ISO C++ does not allow indirection on operand of type %0">,
6624  InGroup<DiagGroup<"void-ptr-dereference">>;
6625def warn_indirection_through_null : Warning<
6626  "indirection of non-volatile null pointer will be deleted, not trap">,
6627  InGroup<NullDereference>;
6628def warn_binding_null_to_reference : Warning<
6629  "binding dereferenced null pointer to reference has undefined behavior">,
6630  InGroup<NullDereference>;
6631def note_indirection_through_null : Note<
6632  "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
6633def warn_pointer_indirection_from_incompatible_type : Warning<
6634  "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
6635  "behavior">,
6636  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6637def warn_taking_address_of_packed_member : Warning<
6638  "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
6639  InGroup<DiagGroup<"address-of-packed-member">>;
6640
6641def err_objc_object_assignment : Error<
6642  "cannot assign to class object (%0 invalid)">;
6643def err_typecheck_invalid_operands : Error<
6644  "invalid operands to binary expression (%0 and %1)">;
6645def note_typecheck_invalid_operands_converted : Note<
6646  "%select{first|second}0 operand was implicitly converted to type %1">;
6647def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
6648  "logical expression with vector %select{type %1 and non-vector type %2|types"
6649  " %1 and %2}0 is only supported in C++">;
6650def err_typecheck_sub_ptr_compatible : Error<
6651  "%diff{$ and $ are not pointers to compatible types|"
6652  "pointers to incompatible types}0,1">;
6653def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
6654  "ordered comparison between pointer and integer (%0 and %1)">;
6655def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
6656  "ordered comparison between pointer and zero (%0 and %1) is an extension">;
6657def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
6658  "ordered comparison between pointer and zero (%0 and %1)">;
6659def err_typecheck_three_way_comparison_of_pointer_and_zero : Error<
6660  "three-way comparison between pointer and zero">;
6661def ext_typecheck_compare_complete_incomplete_pointers : Extension<
6662  "pointer comparisons before C11 "
6663  "need to be between two complete or two incomplete types; "
6664  "%0 is %select{|in}2complete and "
6665  "%1 is %select{|in}3complete">,
6666  InGroup<C11>;
6667def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
6668  "ordered comparison of function pointers (%0 and %1)">,
6669  InGroup<DiagGroup<"ordered-compare-function-pointers">>;
6670def ext_typecheck_comparison_of_fptr_to_void : Extension<
6671  "equality comparison between function pointer and void pointer (%0 and %1)">;
6672def err_typecheck_comparison_of_fptr_to_void : Error<
6673  "equality comparison between function pointer and void pointer (%0 and %1)">;
6674def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
6675  "comparison between pointer and integer (%0 and %1)">,
6676  InGroup<DiagGroup<"pointer-integer-compare">>;
6677def err_typecheck_comparison_of_pointer_integer : Error<
6678  "comparison between pointer and integer (%0 and %1)">;
6679def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
6680  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
6681  InGroup<CompareDistinctPointerType>;
6682def ext_typecheck_cond_incompatible_operands : ExtWarn<
6683  "incompatible operand types (%0 and %1)">;
6684def err_cond_voidptr_arc : Error <
6685  "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
6686  "in ARC mode">;
6687def err_typecheck_comparison_of_distinct_pointers : Error<
6688  "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
6689def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
6690  "%select{comparison between %diff{ ($ and $)|}0,1"
6691  "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
6692  "|conditional operator with the second and third operands of type "
6693  "%diff{ ($ and $)|}0,1}2"
6694  " which are pointers to non-overlapping address spaces">;
6695
6696def select_arith_conv_kind : TextSubstitution<
6697  "%select{arithmetic between|bitwise operation between|comparison of|"
6698  "conditional expression between|compound assignment of}0">;
6699def warn_arith_conv_enum_float : Warning<
6700  "%sub{select_arith_conv_kind}0 "
6701  "%select{floating-point|enumeration}1 type %2 "
6702  "%plural{2:with|4:from|:and}0 "
6703  "%select{enumeration|floating-point}1 type %3">,
6704  InGroup<EnumFloatConversion>, DefaultIgnore;
6705def warn_arith_conv_enum_float_cxx20 : Warning<
6706  "%sub{select_arith_conv_kind}0 "
6707  "%select{floating-point|enumeration}1 type %2 "
6708  "%plural{2:with|4:from|:and}0 "
6709  "%select{enumeration|floating-point}1 type %3 is deprecated">,
6710  InGroup<DeprecatedEnumFloatConversion>;
6711def warn_arith_conv_mixed_enum_types : Warning<
6712  "%sub{select_arith_conv_kind}0 "
6713  "different enumeration types%diff{ ($ and $)|}1,2">,
6714  InGroup<EnumEnumConversion>, DefaultIgnore;
6715def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
6716  "%sub{select_arith_conv_kind}0 "
6717  "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
6718  InGroup<DeprecatedEnumEnumConversion>;
6719def warn_arith_conv_mixed_anon_enum_types : Warning<
6720  warn_arith_conv_mixed_enum_types.Text>,
6721  InGroup<AnonEnumEnumConversion>, DefaultIgnore;
6722def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
6723  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6724  InGroup<DeprecatedAnonEnumEnumConversion>;
6725def warn_conditional_mixed_enum_types : Warning<
6726  warn_arith_conv_mixed_enum_types.Text>,
6727  InGroup<EnumCompareConditional>, DefaultIgnore;
6728def warn_conditional_mixed_enum_types_cxx20 : Warning<
6729  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6730  InGroup<DeprecatedEnumCompareConditional>;
6731def warn_comparison_mixed_enum_types : Warning<
6732  warn_arith_conv_mixed_enum_types.Text>,
6733  InGroup<EnumCompare>;
6734def warn_comparison_mixed_enum_types_cxx20 : Warning<
6735  warn_arith_conv_mixed_enum_types_cxx20.Text>,
6736  InGroup<DeprecatedEnumCompare>;
6737def warn_comparison_of_mixed_enum_types_switch : Warning<
6738  "comparison of different enumeration types in switch statement"
6739  "%diff{ ($ and $)|}0,1">,
6740  InGroup<EnumCompareSwitch>;
6741
6742def err_typecheck_assign_const : Error<
6743  "%select{"
6744  "cannot assign to return value because function %1 returns a const value|"
6745  "cannot assign to variable %1 with const-qualified type %2|"
6746  "cannot assign to %select{non-|}1static data member %2 "
6747  "with const-qualified type %3|"
6748  "cannot assign to non-static data member within const member function %1|"
6749  "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
6750  "with %select{|nested }3const-qualified data member %4|"
6751  "read-only variable is not assignable}0">;
6752
6753def note_typecheck_assign_const : Note<
6754  "%select{"
6755  "function %1 which returns const-qualified type %2 declared here|"
6756  "variable %1 declared const here|"
6757  "%select{non-|}1static data member %2 declared const here|"
6758  "member function %q1 is declared const here|"
6759  "%select{|nested }1data member %2 declared const here}0">;
6760
6761def warn_unsigned_always_true_comparison : Warning<
6762  "result of comparison of %select{%3|unsigned expression}0 %2 "
6763  "%select{unsigned expression|%3}0 is always %4">,
6764  InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
6765def warn_unsigned_enum_always_true_comparison : Warning<
6766  "result of comparison of %select{%3|unsigned enum expression}0 %2 "
6767  "%select{unsigned enum expression|%3}0 is always %4">,
6768  InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
6769def warn_tautological_constant_compare : Warning<
6770  "result of comparison %select{%3|%1}0 %2 "
6771  "%select{%1|%3}0 is always %4">,
6772  InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
6773def warn_tautological_compare_objc_bool : Warning<
6774  "result of comparison of constant %0 with expression of type 'BOOL'"
6775  " is always %1, as the only well defined values for 'BOOL' are YES and NO">,
6776  InGroup<TautologicalObjCBoolCompare>;
6777def subst_int_range : TextSubstitution<"%0-bit %select{signed|unsigned}1 value">;
6778def warn_tautological_compare_value_range : Warning<
6779  "result of comparison of "
6780  "%select{%4|%sub{subst_int_range}1,2}0 %3 "
6781  "%select{%sub{subst_int_range}1,2|%4}0 is always %5">,
6782  InGroup<TautologicalValueRangeCompare>, DefaultIgnore;
6783
6784def warn_mixed_sign_comparison : Warning<
6785  "comparison of integers of different signs: %0 and %1">,
6786  InGroup<SignCompare>, DefaultIgnore;
6787def warn_out_of_range_compare : Warning<
6788  "result of comparison of %select{constant %0|true|false}1 with "
6789  "%select{expression of type %2|boolean expression}3 is always %4">,
6790  InGroup<TautologicalOutOfRangeCompare>;
6791def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
6792  InGroup<TautologicalConstantCompare>;
6793def warn_integer_constants_in_conditional_always_true : Warning<
6794  "converting the result of '?:' with integer constants to a boolean always "
6795  "evaluates to 'true'">,
6796  InGroup<TautologicalConstantCompare>;
6797def warn_left_shift_always : Warning<
6798  "converting the result of '<<' to a boolean always evaluates "
6799  "to %select{false|true}0">,
6800  InGroup<TautologicalConstantCompare>;
6801def warn_null_in_arithmetic_operation : Warning<
6802  "use of NULL in arithmetic operation">,
6803  InGroup<NullArithmetic>;
6804def warn_null_in_comparison_operation : Warning<
6805  "comparison between NULL and non-pointer "
6806  "%select{(%1 and NULL)|(NULL and %1)}0">,
6807  InGroup<NullArithmetic>;
6808def err_shift_rhs_only_vector : Error<
6809  "requested shift is a vector of type %0 but the first operand is not a "
6810  "vector (%1)">;
6811
6812def warn_logical_not_on_lhs_of_check : Warning<
6813  "logical not is only applied to the left hand side of this "
6814  "%select{comparison|bitwise operator}0">,
6815  InGroup<LogicalNotParentheses>;
6816def note_logical_not_fix : Note<
6817  "add parentheses after the '!' to evaluate the "
6818  "%select{comparison|bitwise operator}0 first">;
6819def note_logical_not_silence_with_parens : Note<
6820  "add parentheses around left hand side expression to silence this warning">;
6821
6822def err_invalid_this_use : Error<
6823  "invalid use of 'this' outside of a non-static member function">;
6824def err_this_static_member_func : Error<
6825  "'this' cannot be%select{| implicitly}0 used in a static member function "
6826  "declaration">;
6827def err_invalid_member_use_in_static_method : Error<
6828  "invalid use of member %0 in static member function">;
6829def err_invalid_qualified_function_type : Error<
6830  "%select{non-member function|static member function|deduction guide}0 "
6831  "%select{of type %2 |}1cannot have '%3' qualifier">;
6832def err_compound_qualified_function_type : Error<
6833  "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
6834  "cannot have '%3' qualifier">;
6835def err_qualified_function_typeid : Error<
6836  "type operand %0 of 'typeid' cannot have '%1' qualifier">;
6837
6838def err_ref_qualifier_overload : Error<
6839  "cannot overload a member function %select{without a ref-qualifier|with "
6840  "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
6841  "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
6842
6843def err_invalid_non_static_member_use : Error<
6844  "invalid use of non-static data member %0">;
6845def err_nested_non_static_member_use : Error<
6846  "%select{call to non-static member function|use of non-static data member}0 "
6847  "%2 of %1 from nested type %3">;
6848def warn_cxx98_compat_non_static_member_use : Warning<
6849  "use of non-static data member %0 in an unevaluated context is "
6850  "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6851def err_invalid_incomplete_type_use : Error<
6852  "invalid use of incomplete type %0">;
6853def err_builtin_func_cast_more_than_one_arg : Error<
6854  "function-style cast to a builtin type can only take one argument">;
6855def err_value_init_for_array_type : Error<
6856  "array types cannot be value-initialized">;
6857def err_init_for_function_type : Error<
6858  "cannot create object of function type %0">;
6859def warn_format_nonliteral_noargs : Warning<
6860  "format string is not a string literal (potentially insecure)">,
6861  InGroup<FormatSecurity>;
6862def warn_format_nonliteral : Warning<
6863  "format string is not a string literal">,
6864  InGroup<FormatNonLiteral>, DefaultIgnore;
6865
6866def err_unexpected_interface : Error<
6867  "unexpected interface name %0: expected expression">;
6868def err_ref_non_value : Error<"%0 does not refer to a value">;
6869def err_ref_vm_type : Error<
6870  "cannot refer to declaration with a variably modified type inside block">;
6871def err_ref_flexarray_type : Error<
6872  "cannot refer to declaration of structure variable with flexible array member "
6873  "inside block">;
6874def err_ref_array_type : Error<
6875  "cannot refer to declaration with an array type inside block">;
6876def err_property_not_found : Error<
6877  "property %0 not found on object of type %1">;
6878def err_invalid_property_name : Error<
6879  "%0 is not a valid property name (accessing an object of type %1)">;
6880def err_getter_not_found : Error<
6881  "no getter method for read from property">;
6882def err_objc_subscript_method_not_found : Error<
6883  "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
6884  "found on object of type %0">;
6885def err_objc_subscript_index_type : Error<
6886  "method index parameter type %0 is not integral type">;
6887def err_objc_subscript_key_type : Error<
6888  "method key parameter type %0 is not object type">;
6889def err_objc_subscript_dic_object_type : Error<
6890  "method object parameter type %0 is not object type">;
6891def err_objc_subscript_object_type : Error<
6892  "cannot assign to this %select{dictionary|array}1 because assigning method's "
6893  "2nd parameter of type %0 is not an Objective-C pointer type">;
6894def err_objc_subscript_base_type : Error<
6895  "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
6896def err_objc_multiple_subscript_type_conversion : Error<
6897  "indexing expression is invalid because subscript type %0 has "
6898  "multiple type conversion functions">;
6899def err_objc_subscript_type_conversion : Error<
6900  "indexing expression is invalid because subscript type %0 is not an integral"
6901  " or Objective-C pointer type">;
6902def err_objc_subscript_pointer : Error<
6903  "indexing expression is invalid because subscript type %0 is not an"
6904  " Objective-C pointer">;
6905def err_objc_indexing_method_result_type : Error<
6906  "method for accessing %select{dictionary|array}1 element must have Objective-C"
6907  " object return type instead of %0">;
6908def err_objc_index_incomplete_class_type : Error<
6909  "Objective-C index expression has incomplete class type %0">;
6910def err_illegal_container_subscripting_op : Error<
6911  "illegal operation on Objective-C container subscripting">;
6912def err_property_not_found_forward_class : Error<
6913  "property %0 cannot be found in forward class object %1">;
6914def err_property_not_as_forward_class : Error<
6915  "property %0 refers to an incomplete Objective-C class %1 "
6916  "(with no @interface available)">;
6917def note_forward_class : Note<
6918  "forward declaration of class here">;
6919def err_duplicate_property : Error<
6920  "property has a previous declaration">;
6921def ext_gnu_void_ptr : Extension<
6922  "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
6923  InGroup<PointerArith>;
6924def ext_gnu_ptr_func_arith : Extension<
6925  "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
6926  "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
6927  InGroup<PointerArith>;
6928def err_readonly_message_assignment : Error<
6929  "assigning to 'readonly' return result of an Objective-C message not allowed">;
6930def ext_integer_increment_complex : Extension<
6931  "ISO C does not support '++'/'--' on complex integer type %0">;
6932def ext_integer_complement_complex : Extension<
6933  "ISO C does not support '~' for complex conjugation of %0">;
6934def err_nosetter_property_assignment : Error<
6935  "%select{assignment to readonly property|"
6936  "no setter method %1 for assignment to property}0">;
6937def err_nosetter_property_incdec : Error<
6938  "%select{%select{increment|decrement}1 of readonly property|"
6939  "no setter method %2 for %select{increment|decrement}1 of property}0">;
6940def err_nogetter_property_compound_assignment : Error<
6941  "a getter method is needed to perform a compound assignment on a property">;
6942def err_nogetter_property_incdec : Error<
6943  "no getter method %1 for %select{increment|decrement}0 of property">;
6944def err_no_subobject_property_setting : Error<
6945  "expression is not assignable">;
6946def err_qualified_objc_access : Error<
6947  "%select{property|instance variable}0 access cannot be qualified with '%1'">;
6948
6949def ext_freestanding_complex : Extension<
6950  "complex numbers are an extension in a freestanding C99 implementation">;
6951
6952// FIXME: Remove when we support imaginary.
6953def err_imaginary_not_supported : Error<"imaginary types are not supported">;
6954
6955// Obj-c expressions
6956def warn_root_inst_method_not_found : Warning<
6957  "instance method %0 is being used on 'Class' which is not in the root class">,
6958  InGroup<MethodAccess>;
6959def warn_class_method_not_found : Warning<
6960  "class method %objcclass0 not found (return type defaults to 'id')">,
6961  InGroup<MethodAccess>;
6962def warn_instance_method_on_class_found : Warning<
6963  "instance method %0 found instead of class method %1">,
6964  InGroup<MethodAccess>;
6965def warn_inst_method_not_found : Warning<
6966  "instance method %objcinstance0 not found (return type defaults to 'id')">,
6967  InGroup<MethodAccess>;
6968def warn_instance_method_not_found_with_typo : Warning<
6969  "instance method %objcinstance0 not found (return type defaults to 'id')"
6970  "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6971def warn_class_method_not_found_with_typo : Warning<
6972  "class method %objcclass0 not found (return type defaults to 'id')"
6973  "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6974def err_method_not_found_with_typo : Error<
6975  "%select{instance|class}1 method %0 not found "
6976  "; did you mean %2?">;
6977def err_no_super_class_message : Error<
6978  "no @interface declaration found in class messaging of %0">;
6979def err_root_class_cannot_use_super : Error<
6980  "%0 cannot use 'super' because it is a root class">;
6981def err_invalid_receiver_to_message_super : Error<
6982  "'super' is only valid in a method body">;
6983def err_invalid_receiver_class_message : Error<
6984  "receiver type %0 is not an Objective-C class">;
6985def err_missing_open_square_message_send : Error<
6986  "missing '[' at start of message send expression">;
6987def warn_bad_receiver_type : Warning<
6988  "receiver type %0 is not 'id' or interface pointer, consider "
6989  "casting it to 'id'">,InGroup<ObjCReceiver>;
6990def err_bad_receiver_type : Error<"bad receiver type %0">;
6991def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6992def err_unknown_receiver_suggest : Error<
6993  "unknown receiver %0; did you mean %1?">;
6994def err_objc_throw_expects_object : Error<
6995  "@throw requires an Objective-C object type (%0 invalid)">;
6996def err_objc_synchronized_expects_object : Error<
6997  "@synchronized requires an Objective-C object type (%0 invalid)">;
6998def err_rethrow_used_outside_catch : Error<
6999  "@throw (rethrow) used outside of a @catch block">;
7000def err_attribute_multiple_objc_gc : Error<
7001  "multiple garbage collection attributes specified for type">;
7002def err_catch_param_not_objc_type : Error<
7003  "@catch parameter is not a pointer to an interface type">;
7004def err_illegal_qualifiers_on_catch_parm : Error<
7005  "illegal qualifiers on @catch parameter">;
7006def err_storage_spec_on_catch_parm : Error<
7007  "@catch parameter cannot have storage specifier '%0'">;
7008def warn_register_objc_catch_parm : Warning<
7009  "'register' storage specifier on @catch parameter will be ignored">;
7010def err_qualified_objc_catch_parm : Error<
7011  "@catch parameter declarator cannot be qualified">;
7012def warn_objc_pointer_cxx_catch_fragile : Warning<
7013  "cannot catch an exception thrown with @throw in C++ in the non-unified "
7014  "exception model">, InGroup<ObjCNonUnifiedException>;
7015def err_objc_object_catch : Error<
7016  "cannot catch an Objective-C object by value">;
7017def err_incomplete_type_objc_at_encode : Error<
7018  "'@encode' of incomplete type %0">;
7019def warn_objc_circular_container : Warning<
7020  "adding %0 to %1 might cause circular dependency in container">,
7021  InGroup<DiagGroup<"objc-circular-container">>;
7022def note_objc_circular_container_declared_here : Note<"%0 declared here">;
7023def warn_objc_unsafe_perform_selector : Warning<
7024  "%0 is incompatible with selectors that return a "
7025  "%select{struct|union|vector}1 type">,
7026  InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
7027def note_objc_unsafe_perform_selector_method_declared_here :  Note<
7028  "method %0 that returns %1 declared here">;
7029def err_attribute_arm_builtin_alias : Error<
7030  "'__clang_arm_builtin_alias' attribute can only be applied to an ARM builtin">;
7031def err_attribute_arm_mve_polymorphism : Error<
7032  "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">;
7033
7034def warn_setter_getter_impl_required : Warning<
7035  "property %0 requires method %1 to be defined - "
7036  "use @synthesize, @dynamic or provide a method implementation "
7037  "in this class implementation">,
7038  InGroup<ObjCPropertyImpl>;
7039def warn_setter_getter_impl_required_in_category : Warning<
7040  "property %0 requires method %1 to be defined - "
7041  "use @dynamic or provide a method implementation in this category">,
7042  InGroup<ObjCPropertyImpl>;
7043def note_parameter_named_here : Note<
7044  "passing argument to parameter %0 here">;
7045def note_parameter_here : Note<
7046  "passing argument to parameter here">;
7047def note_method_return_type_change : Note<
7048  "compiler has implicitly changed method %0 return type">;
7049
7050def warn_impl_required_for_class_property : Warning<
7051  "class property %0 requires method %1 to be defined - "
7052  "use @dynamic or provide a method implementation "
7053  "in this class implementation">,
7054  InGroup<ObjCPropertyImpl>;
7055def warn_impl_required_in_category_for_class_property : Warning<
7056  "class property %0 requires method %1 to be defined - "
7057  "use @dynamic or provide a method implementation in this category">,
7058  InGroup<ObjCPropertyImpl>;
7059
7060// C++ casts
7061// These messages adhere to the TryCast pattern: %0 is an int specifying the
7062// cast type, %1 is the source type, %2 is the destination type.
7063def err_bad_reinterpret_cast_overload : Error<
7064  "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
7065
7066def warn_reinterpret_different_from_static : Warning<
7067  "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
7068  "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
7069  "'static_cast'">, InGroup<ReinterpretBaseClass>;
7070def note_reinterpret_updowncast_use_static: Note<
7071  "use 'static_cast' to adjust the pointer correctly while "
7072  "%select{upcasting|downcasting}0">;
7073
7074def err_bad_static_cast_overload : Error<
7075  "address of overloaded function %0 cannot be static_cast to type %1">;
7076
7077def err_bad_cstyle_cast_overload : Error<
7078  "address of overloaded function %0 cannot be cast to type %1">;
7079
7080
7081def err_bad_cxx_cast_generic : Error<
7082  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7083  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 is not allowed">;
7084def err_bad_cxx_cast_unrelated_class : Error<
7085  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7086  "functional-style cast|}0 from %1 to %2, which are not related by "
7087  "inheritance, is not allowed">;
7088def note_type_incomplete : Note<"%0 is incomplete">;
7089def err_bad_cxx_cast_rvalue : Error<
7090  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7091  "functional-style cast|addrspace_cast}0 from rvalue to reference type %2">;
7092def err_bad_cxx_cast_bitfield : Error<
7093  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7094  "functional-style cast|}0 from bit-field lvalue to reference type %2">;
7095def err_bad_cxx_cast_qualifiers_away : Error<
7096  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7097  "functional-style cast|}0 from %1 to %2 casts away qualifiers">;
7098def err_bad_cxx_cast_addr_space_mismatch : Error<
7099  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|"
7100  "C-style cast|functional-style cast|addrspace_cast}0 from %1 to %2 converts between mismatching address"
7101  " spaces">;
7102def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
7103  "ISO C++ does not allow "
7104  "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
7105  "functional-style cast|}0 from %1 to %2 because it casts away qualifiers, "
7106  "even though the source and destination types are unrelated">,
7107  SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
7108def err_bad_const_cast_dest : Error<
7109  "%select{const_cast||||C-style cast|functional-style cast|}0 to %2, "
7110  "which is not a reference, pointer-to-object, or pointer-to-data-member">;
7111def ext_cast_fn_obj : Extension<
7112  "cast between pointer-to-function and pointer-to-object is an extension">;
7113def ext_ms_cast_fn_obj : ExtWarn<
7114  "static_cast between pointer-to-function and pointer-to-object is a "
7115  "Microsoft extension">, InGroup<MicrosoftCast>;
7116def warn_cxx98_compat_cast_fn_obj : Warning<
7117  "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
7118  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7119def err_bad_reinterpret_cast_small_int : Error<
7120  "cast from pointer to smaller type %2 loses information">;
7121def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
7122  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7123  "to scalar %2 of different size">;
7124def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
7125  "%select{||reinterpret_cast||C-style cast||}0 from scalar %1 "
7126  "to vector %2 of different size">;
7127def err_bad_cxx_cast_vector_to_vector_different_size : Error<
7128  "%select{||reinterpret_cast||C-style cast||}0 from vector %1 "
7129  "to vector %2 of different size">;
7130def warn_bad_cxx_cast_nested_pointer_addr_space : Warning<
7131  "%select{reinterpret_cast|C-style cast}0 from %1 to %2 "
7132  "changes address space of nested pointers">,
7133  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7134def err_bad_lvalue_to_rvalue_cast : Error<
7135  "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
7136  "not compatible">;
7137def err_bad_rvalue_to_rvalue_cast : Error<
7138  "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
7139  "not compatible">;
7140def err_bad_static_cast_pointer_nonpointer : Error<
7141  "cannot cast from type %1 to pointer type %2">;
7142def err_bad_static_cast_member_pointer_nonmp : Error<
7143  "cannot cast from type %1 to member pointer type %2">;
7144def err_bad_cxx_cast_member_pointer_size : Error<
7145  "cannot %select{||reinterpret_cast||C-style cast||}0 from member pointer "
7146  "type %1 to member pointer type %2 of different size">;
7147def err_bad_reinterpret_cast_reference : Error<
7148  "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
7149def warn_undefined_reinterpret_cast : Warning<
7150  "reinterpret_cast from %0 to %1 has undefined behavior">,
7151  InGroup<UndefinedReinterpretCast>, DefaultIgnore;
7152
7153// These messages don't adhere to the pattern.
7154// FIXME: Display the path somehow better.
7155def err_ambiguous_base_to_derived_cast : Error<
7156  "ambiguous cast from base %0 to derived %1:%2">;
7157def err_static_downcast_via_virtual : Error<
7158  "cannot cast %0 to %1 via virtual base %2">;
7159def err_downcast_from_inaccessible_base : Error<
7160  "cannot cast %select{private|protected}2 base class %1 to %0">;
7161def err_upcast_to_inaccessible_base : Error<
7162  "cannot cast %0 to its %select{private|protected}2 base class %1">;
7163def err_bad_dynamic_cast_not_ref_or_ptr : Error<
7164  "invalid target type %0 for dynamic_cast; target type must be a reference or pointer type to a defined class">;
7165def err_bad_dynamic_cast_not_class : Error<"%0 is not a class type">;
7166def err_bad_cast_incomplete : Error<"%0 is an incomplete type">;
7167def err_bad_dynamic_cast_not_ptr : Error<"cannot use dynamic_cast to convert from %0 to %1">;
7168def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
7169
7170// Other C++ expressions
7171def err_need_header_before_typeid : Error<
7172  "you need to include <typeinfo> before using the 'typeid' operator">;
7173def err_need_header_before_ms_uuidof : Error<
7174  "you need to include <guiddef.h> before using the '__uuidof' operator">;
7175def err_ms___leave_not_in___try : Error<
7176  "'__leave' statement not in __try block">;
7177def err_uuidof_without_guid : Error<
7178  "cannot call operator __uuidof on a type with no GUID">;
7179def err_uuidof_with_multiple_guids : Error<
7180  "cannot call operator __uuidof on a type with multiple GUIDs">;
7181def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
7182def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
7183def err_static_illegal_in_new : Error<
7184  "the 'static' modifier for the array size is not legal in new expressions">;
7185def err_array_new_needs_size : Error<
7186  "array size must be specified in new expression with no initializer">;
7187def err_bad_new_type : Error<
7188  "cannot allocate %select{function|reference}1 type %0 with new">;
7189def err_new_incomplete_or_sizeless_type : Error<
7190  "allocation of %select{incomplete|sizeless}0 type %1">;
7191def err_new_array_nonconst : Error<
7192  "only the first dimension of an allocated array may have dynamic size">;
7193def err_new_array_size_unknown_from_init : Error<
7194  "cannot determine allocated array size from initializer">;
7195def err_new_array_init_args : Error<
7196  "array 'new' cannot have initialization arguments">;
7197def ext_new_paren_array_nonconst : ExtWarn<
7198  "when type is in parentheses, array cannot have dynamic size">;
7199def err_placement_new_non_placement_delete : Error<
7200  "'new' expression with placement arguments refers to non-placement "
7201  "'operator delete'">;
7202def err_array_size_not_integral : Error<
7203  "array size expression must have integral or %select{|unscoped }0"
7204  "enumeration type, not %1">;
7205def err_array_size_incomplete_type : Error<
7206  "array size expression has incomplete class type %0">;
7207def err_array_size_explicit_conversion : Error<
7208  "array size expression of type %0 requires explicit conversion to type %1">;
7209def note_array_size_conversion : Note<
7210  "conversion to %select{integral|enumeration}0 type %1 declared here">;
7211def err_array_size_ambiguous_conversion : Error<
7212  "ambiguous conversion of array size expression of type %0 to an integral or "
7213  "enumeration type">;
7214def ext_array_size_conversion : Extension<
7215  "implicit conversion from array size expression of type %0 to "
7216  "%select{integral|enumeration}1 type %2 is a C++11 extension">,
7217  InGroup<CXX11>;
7218def warn_cxx98_compat_array_size_conversion : Warning<
7219  "implicit conversion from array size expression of type %0 to "
7220  "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
7221  InGroup<CXX98CompatPedantic>, DefaultIgnore;
7222def err_address_space_qualified_new : Error<
7223  "'new' cannot allocate objects of type %0 in address space '%1'">;
7224def err_address_space_qualified_delete : Error<
7225  "'delete' cannot delete objects of type %0 in address space '%1'">;
7226
7227def err_default_init_const : Error<
7228  "default initialization of an object of const type %0"
7229  "%select{| without a user-provided default constructor}1">;
7230def ext_default_init_const : ExtWarn<
7231  "default initialization of an object of const type %0"
7232  "%select{| without a user-provided default constructor}1 "
7233  "is a Microsoft extension">,
7234  InGroup<MicrosoftConstInit>;
7235def err_delete_operand : Error<"cannot delete expression of type %0">;
7236def ext_delete_void_ptr_operand : ExtWarn<
7237  "cannot delete expression with pointer-to-'void' type %0">,
7238  InGroup<DeleteIncomplete>;
7239def err_ambiguous_delete_operand : Error<
7240  "ambiguous conversion of delete expression of type %0 to a pointer">;
7241def warn_delete_incomplete : Warning<
7242  "deleting pointer to incomplete type %0 may cause undefined behavior">,
7243  InGroup<DeleteIncomplete>;
7244def err_delete_incomplete_class_type : Error<
7245  "deleting incomplete class type %0; no conversions to pointer type">;
7246def err_delete_explicit_conversion : Error<
7247  "converting delete expression from type %0 to type %1 invokes an explicit "
7248  "conversion function">;
7249def note_delete_conversion : Note<"conversion to pointer type %0">;
7250def warn_delete_array_type : Warning<
7251  "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
7252def warn_mismatched_delete_new : Warning<
7253  "'delete%select{|[]}0' applied to a pointer that was allocated with "
7254  "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
7255  InGroup<DiagGroup<"mismatched-new-delete">>;
7256def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
7257def err_no_suitable_delete_member_function_found : Error<
7258  "no suitable member %0 in %1">;
7259def err_ambiguous_suitable_delete_member_function_found : Error<
7260  "multiple suitable %0 functions in %1">;
7261def warn_ambiguous_suitable_delete_function_found : Warning<
7262  "multiple suitable %0 functions for %1; no 'operator delete' function "
7263  "will be invoked if initialization throws an exception">,
7264  InGroup<DiagGroup<"ambiguous-delete">>;
7265def note_member_declared_here : Note<
7266  "member %0 declared here">;
7267def note_member_first_declared_here : Note<
7268  "member %0 first declared here">;
7269def warn_bitwise_negation_bool : Warning<
7270  "bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
7271  "did you mean logical negation?">,
7272  InGroup<DiagGroup<"bool-operation">>;
7273def err_decrement_bool : Error<"cannot decrement expression of type bool">;
7274def warn_increment_bool : Warning<
7275  "incrementing expression of type bool is deprecated and "
7276  "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
7277def ext_increment_bool : ExtWarn<
7278  "ISO C++17 does not allow incrementing expression of type bool">,
7279  DefaultError, InGroup<IncrementBool>;
7280def err_increment_decrement_enum : Error<
7281  "cannot %select{decrement|increment}0 expression of enum type %1">;
7282
7283def warn_deprecated_increment_decrement_volatile : Warning<
7284  "%select{decrement|increment}0 of object of volatile-qualified type %1 "
7285  "is deprecated">, InGroup<DeprecatedVolatile>;
7286def warn_deprecated_simple_assign_volatile : Warning<
7287  "use of result of assignment to object of volatile-qualified type %0 "
7288  "is deprecated">, InGroup<DeprecatedVolatile>;
7289def warn_deprecated_compound_assign_volatile : Warning<
7290  "compound assignment to object of volatile-qualified type %0 is deprecated">,
7291  InGroup<DeprecatedVolatile>;
7292def warn_deprecated_volatile_return : Warning<
7293  "volatile-qualified return type %0 is deprecated">,
7294  InGroup<DeprecatedVolatile>;
7295def warn_deprecated_volatile_param : Warning<
7296  "volatile-qualified parameter type %0 is deprecated">,
7297  InGroup<DeprecatedVolatile>;
7298def warn_deprecated_volatile_structured_binding : Warning<
7299  "volatile qualifier in structured binding declaration is deprecated">,
7300  InGroup<DeprecatedVolatile>;
7301
7302def err_catch_incomplete_ptr : Error<
7303  "cannot catch pointer to incomplete type %0">;
7304def err_catch_incomplete_ref : Error<
7305  "cannot catch reference to incomplete type %0">;
7306def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
7307def err_catch_sizeless : Error<
7308  "cannot catch %select{|reference to }0sizeless type %1">;
7309def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
7310def err_catch_variably_modified : Error<
7311  "cannot catch variably modified type %0">;
7312def err_qualified_catch_declarator : Error<
7313  "exception declarator cannot be qualified">;
7314def err_early_catch_all : Error<"catch-all handler must come last">;
7315def err_bad_memptr_rhs : Error<
7316  "right hand operand to %0 has non-pointer-to-member type %1">;
7317def err_bad_memptr_lhs : Error<
7318  "left hand operand to %0 must be a %select{|pointer to }1class "
7319  "compatible with the right hand operand, but is %2">;
7320def err_memptr_incomplete : Error<
7321  "member pointer has incomplete base type %0">;
7322def warn_exception_caught_by_earlier_handler : Warning<
7323  "exception of type %0 will be caught by earlier handler">,
7324  InGroup<Exceptions>;
7325def note_previous_exception_handler : Note<"for type %0">;
7326def err_exceptions_disabled : Error<
7327  "cannot use '%0' with exceptions disabled">;
7328def err_objc_exceptions_disabled : Error<
7329  "cannot use '%0' with Objective-C exceptions disabled">;
7330def warn_throw_in_noexcept_func : Warning<
7331  "%0 has a non-throwing exception specification but can still throw">,
7332  InGroup<Exceptions>;
7333def note_throw_in_dtor : Note<
7334  "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
7335  "non-throwing}1 exception specification">;
7336def note_throw_in_function : Note<"function declared non-throwing here">;
7337def err_seh_try_outside_functions : Error<
7338  "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
7339def err_mixing_cxx_try_seh_try : Error<
7340  "cannot use C++ 'try' in the same function as SEH '__try'">;
7341def err_seh_try_unsupported : Error<
7342  "SEH '__try' is not supported on this target">;
7343def note_conflicting_try_here : Note<
7344  "conflicting %0 here">;
7345def warn_jump_out_of_seh_finally : Warning<
7346  "jump out of __finally block has undefined behavior">,
7347  InGroup<DiagGroup<"jump-seh-finally">>;
7348def warn_non_virtual_dtor : Warning<
7349  "%0 has virtual functions but non-virtual destructor">,
7350  InGroup<NonVirtualDtor>, DefaultIgnore;
7351def warn_delete_non_virtual_dtor : Warning<
7352  "%select{delete|destructor}0 called on non-final %1 that has "
7353  "virtual functions but non-virtual destructor">,
7354  InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
7355def note_delete_non_virtual : Note<
7356  "qualify call to silence this warning">;
7357def warn_delete_abstract_non_virtual_dtor : Warning<
7358  "%select{delete|destructor}0 called on %1 that is abstract but has "
7359  "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
7360def warn_overloaded_virtual : Warning<
7361  "%q0 hides overloaded virtual %select{function|functions}1">,
7362  InGroup<OverloadedVirtual>, DefaultIgnore;
7363def note_hidden_overloaded_virtual_declared_here : Note<
7364  "hidden overloaded virtual function %q0 declared here"
7365  "%select{|: different classes%diff{ ($ vs $)|}2,3"
7366  "|: different number of parameters (%2 vs %3)"
7367  "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
7368  "|: different return type%diff{ ($ vs $)|}2,3"
7369  "|: different qualifiers (%2 vs %3)"
7370  "|: different exception specifications}1">;
7371def warn_using_directive_in_header : Warning<
7372  "using namespace directive in global context in header">,
7373  InGroup<HeaderHygiene>, DefaultIgnore;
7374def warn_overaligned_type : Warning<
7375  "type %0 requires %1 bytes of alignment and the default allocator only "
7376  "guarantees %2 bytes">,
7377  InGroup<OveralignedType>, DefaultIgnore;
7378def err_aligned_allocation_unavailable : Error<
7379  "aligned %select{allocation|deallocation}0 function of type '%1' is "
7380  "%select{only|not}4 available on %2%select{ %3 or newer|}4">;
7381def note_silence_aligned_allocation_unavailable : Note<
7382  "if you supply your own aligned allocation functions, use "
7383  "-faligned-allocation to silence this diagnostic">;
7384
7385def err_conditional_void_nonvoid : Error<
7386  "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
7387  "is of type %0">;
7388def err_conditional_ambiguous : Error<
7389  "conditional expression is ambiguous; "
7390  "%diff{$ can be converted to $ and vice versa|"
7391  "types can be convert to each other}0,1">;
7392def err_conditional_ambiguous_ovl : Error<
7393  "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
7394  "can be converted to several common types">;
7395def err_conditional_vector_size : Error<
7396  "vector condition type %0 and result type %1 do not have the same number "
7397  "of elements">;
7398def err_conditional_vector_element_size : Error<
7399  "vector condition type %0 and result type %1 do not have elements of the "
7400  "same size">;
7401def err_conditional_vector_has_void : Error<
7402  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
7403def err_conditional_vector_operand_type
7404    : Error<"%select{enumeration|extended vector}0 type %1 is not allowed in a "
7405            "vector conditional">;
7406def err_conditional_vector_mismatched_vectors
7407    : Error<"vector operands to the vector conditional must be the same type "
7408            "%diff{($ and $)|}0,1}">;
7409
7410def err_throw_incomplete : Error<
7411  "cannot throw object of incomplete type %0">;
7412def err_throw_incomplete_ptr : Error<
7413  "cannot throw pointer to object of incomplete type %0">;
7414def err_throw_sizeless : Error<
7415  "cannot throw object of sizeless type %0">;
7416def warn_throw_underaligned_obj : Warning<
7417  "underaligned exception object thrown">,
7418  InGroup<UnderalignedExceptionObject>;
7419def note_throw_underaligned_obj : Note<
7420  "required alignment of type %0 (%1 bytes) is larger than the supported "
7421  "alignment of C++ exception objects on this target (%2 bytes)">;
7422def err_return_in_constructor_handler : Error<
7423  "return in the catch of a function try block of a constructor is illegal">;
7424def warn_cdtor_function_try_handler_mem_expr : Warning<
7425  "cannot refer to a non-static member from the handler of a "
7426  "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
7427
7428let CategoryName = "Lambda Issue" in {
7429  def err_capture_more_than_once : Error<
7430    "%0 can appear only once in a capture list">;
7431  def err_reference_capture_with_reference_default : Error<
7432    "'&' cannot precede a capture when the capture default is '&'">;
7433  def err_copy_capture_with_copy_default : Error<
7434    "'&' must precede a capture when the capture default is '='">;
7435  def err_capture_does_not_name_variable : Error<
7436    "%0 in capture list does not name a variable">;
7437  def err_capture_non_automatic_variable : Error<
7438    "%0 cannot be captured because it does not have automatic storage "
7439    "duration">;
7440  def err_this_capture : Error<
7441    "'this' cannot be %select{implicitly |}0captured in this context">;
7442  def err_lambda_capture_anonymous_var : Error<
7443    "unnamed variable cannot be implicitly captured in a lambda expression">;
7444  def err_lambda_capture_flexarray_type : Error<
7445    "variable %0 with flexible array member cannot be captured in "
7446    "a lambda expression">;
7447  def err_lambda_impcap : Error<
7448    "variable %0 cannot be implicitly captured in a lambda with no "
7449    "capture-default specified">;
7450  def note_lambda_decl : Note<"lambda expression begins here">;
7451  def err_lambda_unevaluated_operand : Error<
7452    "lambda expression in an unevaluated operand">;
7453  def err_lambda_in_constant_expression : Error<
7454    "a lambda expression may not appear inside of a constant expression">;
7455  def err_lambda_in_invalid_context : Error<
7456    "a lambda expression cannot appear in this context">;
7457  def err_lambda_return_init_list : Error<
7458    "cannot deduce lambda return type from initializer list">;
7459  def err_lambda_capture_default_arg : Error<
7460    "lambda expression in default argument cannot capture any entity">;
7461  def err_lambda_incomplete_result : Error<
7462    "incomplete result type %0 in lambda expression">;
7463  def err_noreturn_lambda_has_return_expr : Error<
7464    "lambda declared 'noreturn' should not return">;
7465  def warn_maybe_falloff_nonvoid_lambda : Warning<
7466    "non-void lambda does not return a value in all control paths">,
7467    InGroup<ReturnType>;
7468  def warn_falloff_nonvoid_lambda : Warning<
7469    "non-void lambda does not return a value">,
7470    InGroup<ReturnType>;
7471  def err_access_lambda_capture : Error<
7472    // The ERRORs represent other special members that aren't constructors, in
7473    // hopes that someone will bother noticing and reporting if they appear
7474    "capture of variable '%0' as type %1 calls %select{private|protected}3 "
7475    "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
7476    AccessControl;
7477  def note_lambda_to_block_conv : Note<
7478    "implicit capture of lambda object due to conversion to block pointer "
7479    "here">;
7480  def note_var_explicitly_captured_here : Note<"variable %0 is"
7481    "%select{| explicitly}1 captured here">;
7482
7483  // C++14 lambda init-captures.
7484  def warn_cxx11_compat_init_capture : Warning<
7485    "initialized lambda captures are incompatible with C++ standards "
7486    "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
7487  def ext_init_capture : ExtWarn<
7488    "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
7489  def err_init_capture_no_expression : Error<
7490    "initializer missing for lambda capture %0">;
7491  def err_init_capture_multiple_expressions : Error<
7492    "initializer for lambda capture %0 contains multiple expressions">;
7493  def err_init_capture_paren_braces : Error<
7494    "cannot deduce type for lambda capture %1 from "
7495    "%select{parenthesized|nested}0 initializer list">;
7496  def err_init_capture_deduction_failure : Error<
7497    "cannot deduce type for lambda capture %0 from initializer of type %2">;
7498  def err_init_capture_deduction_failure_from_init_list : Error<
7499    "cannot deduce type for lambda capture %0 from initializer list">;
7500  def warn_cxx17_compat_init_capture_pack : Warning<
7501    "initialized lambda capture packs are incompatible with C++ standards "
7502    "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7503  def ext_init_capture_pack : ExtWarn<
7504    "initialized lambda pack captures are a C++20 extension">, InGroup<CXX20>;
7505
7506  // C++14 generic lambdas.
7507  def warn_cxx11_compat_generic_lambda : Warning<
7508    "generic lambdas are incompatible with C++11">,
7509    InGroup<CXXPre14Compat>, DefaultIgnore;
7510
7511  // C++17 '*this' captures.
7512  def warn_cxx14_compat_star_this_lambda_capture : Warning<
7513    "by value capture of '*this' is incompatible with C++ standards before C++17">,
7514     InGroup<CXXPre17Compat>, DefaultIgnore;
7515  def ext_star_this_lambda_capture_cxx17 : ExtWarn<
7516    "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
7517
7518  // C++17 parameter shadows capture
7519  def err_parameter_shadow_capture : Error<
7520    "a lambda parameter cannot shadow an explicitly captured entity">;
7521
7522  // C++20 [=, this] captures.
7523  def warn_cxx17_compat_equals_this_lambda_capture : Warning<
7524    "explicit capture of 'this' with a capture default of '=' is incompatible "
7525    "with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7526  def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
7527    "explicit capture of 'this' with a capture default of '=' "
7528    "is a C++20 extension">, InGroup<CXX20>;
7529  def warn_deprecated_this_capture : Warning<
7530    "implicit capture of 'this' with a capture default of '=' is deprecated">,
7531    InGroup<DeprecatedThisCapture>, DefaultIgnore;
7532  def note_deprecated_this_capture : Note<
7533    "add an explicit capture of 'this' to capture '*this' by reference">;
7534
7535  // C++20 default constructible / assignable lambdas.
7536  def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
7537    "%select{default construction|assignment}0 of lambda is incompatible with "
7538    "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
7539}
7540
7541def err_return_in_captured_stmt : Error<
7542  "cannot return from %0">;
7543def err_capture_block_variable : Error<
7544  "__block variable %0 cannot be captured in a "
7545  "%select{lambda expression|captured statement}1">;
7546
7547def err_operator_arrow_circular : Error<
7548  "circular pointer delegation detected">;
7549def err_operator_arrow_depth_exceeded : Error<
7550  "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
7551  "'operator->' calls">;
7552def note_operator_arrow_here : Note<
7553  "'operator->' declared here produces an object of type %0">;
7554def note_operator_arrows_suppressed : Note<
7555  "(skipping %0 'operator->'%s0 in backtrace)">;
7556def note_operator_arrow_depth : Note<
7557  "use -foperator-arrow-depth=N to increase 'operator->' limit">;
7558
7559def err_pseudo_dtor_base_not_scalar : Error<
7560  "object expression of non-scalar type %0 cannot be used in a "
7561  "pseudo-destructor expression">;
7562def ext_pseudo_dtor_on_void : ExtWarn<
7563  "pseudo-destructors on type void are a Microsoft extension">,
7564  InGroup<MicrosoftVoidPseudoDtor>;
7565def err_pseudo_dtor_type_mismatch : Error<
7566  "the type of object expression "
7567  "%diff{($) does not match the type being destroyed ($)|"
7568  "does not match the type being destroyed}0,1 "
7569  "in pseudo-destructor expression">;
7570def err_pseudo_dtor_call_with_args : Error<
7571  "call to pseudo-destructor cannot have any arguments">;
7572def err_dtor_expr_without_call : Error<
7573  "reference to %select{destructor|pseudo-destructor}0 must be called"
7574  "%select{|; did you mean to call it with no arguments?}1">;
7575def err_pseudo_dtor_destructor_non_type : Error<
7576  "%0 does not refer to a type name in pseudo-destructor expression; expected "
7577  "the name of type %1">;
7578def err_invalid_use_of_function_type : Error<
7579  "a function type is not allowed here">;
7580def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
7581def err_typecheck_bool_condition : Error<
7582  "value of type %0 is not contextually convertible to 'bool'">;
7583def err_typecheck_ambiguous_condition : Error<
7584  "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
7585def err_typecheck_nonviable_condition : Error<
7586  "no viable conversion%select{%diff{ from $ to $|}1,2|"
7587  "%diff{ from returned value of type $ to function return type $|}1,2}0">;
7588def err_typecheck_nonviable_condition_incomplete : Error<
7589  "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
7590def err_typecheck_deleted_function : Error<
7591  "conversion function %diff{from $ to $|between types}0,1 "
7592  "invokes a deleted function">;
7593
7594def err_expected_class_or_namespace : Error<"%0 is not a class"
7595  "%select{ or namespace|, namespace, or enumeration}1">;
7596def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
7597  "because namespace %1 does not enclose namespace %2">;
7598def err_invalid_declarator_global_scope : Error<
7599  "definition or redeclaration of %0 cannot name the global scope">;
7600def err_invalid_declarator_in_function : Error<
7601  "definition or redeclaration of %0 not allowed inside a function">;
7602def err_invalid_declarator_in_block : Error<
7603  "definition or redeclaration of %0 not allowed inside a block">;
7604def err_not_tag_in_scope : Error<
7605  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
7606
7607def err_no_typeid_with_fno_rtti : Error<
7608  "use of typeid requires -frtti">;
7609def err_no_dynamic_cast_with_fno_rtti : Error<
7610  "use of dynamic_cast requires -frtti">;
7611def warn_no_dynamic_cast_with_rtti_disabled: Warning<
7612  "dynamic_cast will not work since RTTI data is disabled by "
7613  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7614def warn_no_typeid_with_rtti_disabled: Warning<
7615  "typeid will not work since RTTI data is disabled by "
7616  "%select{-fno-rtti-data|/GR-}0">, InGroup<RTTI>;
7617
7618def err_cannot_form_pointer_to_member_of_reference_type : Error<
7619  "cannot form a pointer-to-member to member %0 of reference type %1">;
7620def err_incomplete_object_call : Error<
7621  "incomplete type in call to object of type %0">;
7622
7623def warn_condition_is_assignment : Warning<"using the result of an "
7624  "assignment as a condition without parentheses">,
7625  InGroup<Parentheses>;
7626def warn_free_nonheap_object
7627  : Warning<"attempt to call %0 on non-heap object %1">,
7628    InGroup<FreeNonHeapObject>;
7629
7630// Completely identical except off by default.
7631def warn_condition_is_idiomatic_assignment : Warning<"using the result "
7632  "of an assignment as a condition without parentheses">,
7633  InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
7634def note_condition_assign_to_comparison : Note<
7635  "use '==' to turn this assignment into an equality comparison">;
7636def note_condition_or_assign_to_comparison : Note<
7637  "use '!=' to turn this compound assignment into an inequality comparison">;
7638def note_condition_assign_silence : Note<
7639  "place parentheses around the assignment to silence this warning">;
7640
7641def warn_equality_with_extra_parens : Warning<"equality comparison with "
7642  "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
7643def note_equality_comparison_to_assign : Note<
7644  "use '=' to turn this equality comparison into an assignment">;
7645def note_equality_comparison_silence : Note<
7646  "remove extraneous parentheses around the comparison to silence this warning">;
7647
7648// assignment related diagnostics (also for argument passing, returning, etc).
7649// In most of these diagnostics the %2 is a value from the
7650// Sema::AssignmentAction enumeration
7651def err_typecheck_convert_incompatible : Error<
7652  "%select{%diff{assigning to $ from incompatible type $|"
7653  "assigning to type from incompatible type}0,1"
7654  "|%diff{passing $ to parameter of incompatible type $|"
7655  "passing type to parameter of incompatible type}0,1"
7656  "|%diff{returning $ from a function with incompatible result type $|"
7657  "returning type from a function with incompatible result type}0,1"
7658  "|%diff{converting $ to incompatible type $|"
7659  "converting type to incompatible type}0,1"
7660  "|%diff{initializing $ with an expression of incompatible type $|"
7661  "initializing type with an expression of incompatible type}0,1"
7662  "|%diff{sending $ to parameter of incompatible type $|"
7663  "sending type to parameter of incompatible type}0,1"
7664  "|%diff{casting $ to incompatible type $|"
7665  "casting type to incompatible type}0,1}2"
7666  "%select{|; dereference with *|"
7667  "; take the address with &|"
7668  "; remove *|"
7669  "; remove &}3"
7670  "%select{|: different classes%diff{ ($ vs $)|}5,6"
7671  "|: different number of parameters (%5 vs %6)"
7672  "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
7673  "|: different return type%diff{ ($ vs $)|}5,6"
7674  "|: different qualifiers (%5 vs %6)"
7675  "|: different exception specifications}4">;
7676def err_typecheck_missing_return_type_incompatible : Error<
7677  "%diff{return type $ must match previous return type $|"
7678  "return type must match previous return type}0,1 when %select{block "
7679  "literal|lambda expression}2 has unspecified explicit return type">;
7680
7681def note_incomplete_class_and_qualified_id : Note<
7682  "conformance of forward class %0 to protocol %1 can not be confirmed">;
7683def warn_incompatible_qualified_id : Warning<
7684  "%select{%diff{assigning to $ from incompatible type $|"
7685  "assigning to type from incompatible type}0,1"
7686  "|%diff{passing $ to parameter of incompatible type $|"
7687  "passing type to parameter of incompatible type}0,1"
7688  "|%diff{returning $ from a function with incompatible result type $|"
7689  "returning type from a function with incompatible result type}0,1"
7690  "|%diff{converting $ to incompatible type $|"
7691  "converting type to incompatible type}0,1"
7692  "|%diff{initializing $ with an expression of incompatible type $|"
7693  "initializing type with an expression of incompatible type}0,1"
7694  "|%diff{sending $ to parameter of incompatible type $|"
7695  "sending type to parameter of incompatible type}0,1"
7696  "|%diff{casting $ to incompatible type $|"
7697  "casting type to incompatible type}0,1}2">;
7698def err_incompatible_qualified_id : Error<
7699  "%select{%diff{assigning to $ from incompatible type $|"
7700  "assigning to type from incompatible type}0,1"
7701  "|%diff{passing $ to parameter of incompatible type $|"
7702  "passing type to parameter of incompatible type}0,1"
7703  "|%diff{returning $ from a function with incompatible result type $|"
7704  "returning type from a function with incompatible result type}0,1"
7705  "|%diff{converting $ to incompatible type $|"
7706  "converting type to incompatible type}0,1"
7707  "|%diff{initializing $ with an expression of incompatible type $|"
7708  "initializing type with an expression of incompatible type}0,1"
7709  "|%diff{sending $ to parameter of incompatible type $|"
7710  "sending type to parameter of incompatible type}0,1"
7711  "|%diff{casting $ to incompatible type $|"
7712  "casting type to incompatible type}0,1}2">;
7713def ext_typecheck_convert_pointer_int : ExtWarn<
7714  "incompatible pointer to integer conversion "
7715  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7716  "|%diff{passing $ to parameter of type $|"
7717  "passing to parameter of different type}0,1"
7718  "|%diff{returning $ from a function with result type $|"
7719  "returning from function with different return type}0,1"
7720  "|%diff{converting $ to type $|converting between types}0,1"
7721  "|%diff{initializing $ with an expression of type $|"
7722  "initializing with expression of different type}0,1"
7723  "|%diff{sending $ to parameter of type $|"
7724  "sending to parameter of different type}0,1"
7725  "|%diff{casting $ to type $|casting between types}0,1}2"
7726  "%select{|; dereference with *|"
7727  "; take the address with &|"
7728  "; remove *|"
7729  "; remove &}3">,
7730  InGroup<IntConversion>;
7731def err_typecheck_convert_pointer_int : Error<
7732  "incompatible pointer to integer conversion "
7733  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7734  "|%diff{passing $ to parameter of type $|"
7735  "passing to parameter of different type}0,1"
7736  "|%diff{returning $ from a function with result type $|"
7737  "returning from function with different return type}0,1"
7738  "|%diff{converting $ to type $|converting between types}0,1"
7739  "|%diff{initializing $ with an expression of type $|"
7740  "initializing with expression of different type}0,1"
7741  "|%diff{sending $ to parameter of type $|"
7742  "sending to parameter of different type}0,1"
7743  "|%diff{casting $ to type $|casting between types}0,1}2"
7744  "%select{|; dereference with *|"
7745  "; take the address with &|"
7746  "; remove *|"
7747  "; remove &}3">;
7748def ext_typecheck_convert_int_pointer : ExtWarn<
7749  "incompatible integer to pointer conversion "
7750  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7751  "|%diff{passing $ to parameter of type $|"
7752  "passing to parameter of different type}0,1"
7753  "|%diff{returning $ from a function with result type $|"
7754  "returning from function with different return type}0,1"
7755  "|%diff{converting $ to type $|converting between types}0,1"
7756  "|%diff{initializing $ with an expression of type $|"
7757  "initializing with expression of different type}0,1"
7758  "|%diff{sending $ to parameter of type $|"
7759  "sending to parameter of different type}0,1"
7760  "|%diff{casting $ to type $|casting between types}0,1}2"
7761  "%select{|; dereference with *|"
7762  "; take the address with &|"
7763  "; remove *|"
7764  "; remove &}3">,
7765  InGroup<IntConversion>, SFINAEFailure;
7766def err_typecheck_convert_int_pointer : Error<
7767  "incompatible integer to pointer conversion "
7768  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7769  "|%diff{passing $ to parameter of type $|"
7770  "passing to parameter of different type}0,1"
7771  "|%diff{returning $ from a function with result type $|"
7772  "returning from function with different return type}0,1"
7773  "|%diff{converting $ to type $|converting between types}0,1"
7774  "|%diff{initializing $ with an expression of type $|"
7775  "initializing with expression of different type}0,1"
7776  "|%diff{sending $ to parameter of type $|"
7777  "sending to parameter of different type}0,1"
7778  "|%diff{casting $ to type $|casting between types}0,1}2"
7779  "%select{|; dereference with *|"
7780  "; take the address with &|"
7781  "; remove *|"
7782  "; remove &}3">;
7783def ext_typecheck_convert_pointer_void_func : Extension<
7784  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7785  "|%diff{passing $ to parameter of type $|"
7786  "passing to parameter of different type}0,1"
7787  "|%diff{returning $ from a function with result type $|"
7788  "returning from function with different return type}0,1"
7789  "|%diff{converting $ to type $|converting between types}0,1"
7790  "|%diff{initializing $ with an expression of type $|"
7791  "initializing with expression of different type}0,1"
7792  "|%diff{sending $ to parameter of type $|"
7793  "sending to parameter of different type}0,1"
7794  "|%diff{casting $ to type $|casting between types}0,1}2"
7795  " converts between void pointer and function pointer">;
7796def err_typecheck_convert_pointer_void_func : Error<
7797  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7798  "|%diff{passing $ to parameter of type $|"
7799  "passing to parameter of different type}0,1"
7800  "|%diff{returning $ from a function with result type $|"
7801  "returning from function with different return type}0,1"
7802  "|%diff{converting $ to type $|converting between types}0,1"
7803  "|%diff{initializing $ with an expression of type $|"
7804  "initializing with expression of different type}0,1"
7805  "|%diff{sending $ to parameter of type $|"
7806  "sending to parameter of different type}0,1"
7807  "|%diff{casting $ to type $|casting between types}0,1}2"
7808  " converts between void pointer and function pointer">;
7809def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
7810  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7811  "|%diff{passing $ to parameter of type $|"
7812  "passing to parameter of different type}0,1"
7813  "|%diff{returning $ from a function with result type $|"
7814  "returning from function with different return type}0,1"
7815  "|%diff{converting $ to type $|converting between types}0,1"
7816  "|%diff{initializing $ with an expression of type $|"
7817  "initializing with expression of different type}0,1"
7818  "|%diff{sending $ to parameter of type $|"
7819  "sending to parameter of different type}0,1"
7820  "|%diff{casting $ to type $|casting between types}0,1}2"
7821  " converts between pointers to integer types %select{with different sign|"
7822  "where one is of the unique plain 'char' type and the other is not}3">,
7823  InGroup<DiagGroup<"pointer-sign">>;
7824def err_typecheck_convert_incompatible_pointer_sign :
7825  Error<ext_typecheck_convert_incompatible_pointer_sign.Text>;
7826def ext_typecheck_convert_incompatible_pointer : ExtWarn<
7827  "incompatible pointer types "
7828  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7829  "|%diff{passing $ to parameter of type $|"
7830  "passing to parameter of different type}0,1"
7831  "|%diff{returning $ from a function with result type $|"
7832  "returning from function with different return type}0,1"
7833  "|%diff{converting $ to type $|converting between types}0,1"
7834  "|%diff{initializing $ with an expression of type $|"
7835  "initializing with expression of different type}0,1"
7836  "|%diff{sending $ to parameter of type $|"
7837  "sending to parameter of different type}0,1"
7838  "|%diff{casting $ to type $|casting between types}0,1}2"
7839  "%select{|; dereference with *|"
7840  "; take the address with &|"
7841  "; remove *|"
7842  "; remove &}3">,
7843  InGroup<IncompatiblePointerTypes>;
7844def err_typecheck_convert_incompatible_pointer : Error<
7845  "incompatible pointer types "
7846  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7847  "|%diff{passing $ to parameter of type $|"
7848  "passing to parameter of different type}0,1"
7849  "|%diff{returning $ from a function with result type $|"
7850  "returning from function with different return type}0,1"
7851  "|%diff{converting $ to type $|converting between types}0,1"
7852  "|%diff{initializing $ with an expression of type $|"
7853  "initializing with expression of different type}0,1"
7854  "|%diff{sending $ to parameter of type $|"
7855  "sending to parameter of different type}0,1"
7856  "|%diff{casting $ to type $|casting between types}0,1}2"
7857  "%select{|; dereference with *|"
7858  "; take the address with &|"
7859  "; remove *|"
7860  "; remove &}3">;
7861def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
7862  "incompatible function pointer types "
7863  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7864  "|%diff{passing $ to parameter of type $|"
7865  "passing to parameter of different type}0,1"
7866  "|%diff{returning $ from a function with result type $|"
7867  "returning from function with different return type}0,1"
7868  "|%diff{converting $ to type $|converting between types}0,1"
7869  "|%diff{initializing $ with an expression of type $|"
7870  "initializing with expression of different type}0,1"
7871  "|%diff{sending $ to parameter of type $|"
7872  "sending to parameter of different type}0,1"
7873  "|%diff{casting $ to type $|casting between types}0,1}2"
7874  "%select{|; dereference with *|"
7875  "; take the address with &|"
7876  "; remove *|"
7877  "; remove &}3">,
7878  InGroup<IncompatibleFunctionPointerTypes>;
7879def err_typecheck_convert_incompatible_function_pointer : Error<
7880  "incompatible function pointer types "
7881  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7882  "|%diff{passing $ to parameter of type $|"
7883  "passing to parameter of different type}0,1"
7884  "|%diff{returning $ from a function with result type $|"
7885  "returning from function with different return type}0,1"
7886  "|%diff{converting $ to type $|converting between types}0,1"
7887  "|%diff{initializing $ with an expression of type $|"
7888  "initializing with expression of different type}0,1"
7889  "|%diff{sending $ to parameter of type $|"
7890  "sending to parameter of different type}0,1"
7891  "|%diff{casting $ to type $|casting between types}0,1}2"
7892  "%select{|; dereference with *|"
7893  "; take the address with &|"
7894  "; remove *|"
7895  "; remove &}3">;
7896def ext_typecheck_convert_discards_qualifiers : ExtWarn<
7897  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7898  "|%diff{passing $ to parameter of type $|"
7899  "passing to parameter of different type}0,1"
7900  "|%diff{returning $ from a function with result type $|"
7901  "returning from function with different return type}0,1"
7902  "|%diff{converting $ to type $|converting between types}0,1"
7903  "|%diff{initializing $ with an expression of type $|"
7904  "initializing with expression of different type}0,1"
7905  "|%diff{sending $ to parameter of type $|"
7906  "sending to parameter of different type}0,1"
7907  "|%diff{casting $ to type $|casting between types}0,1}2"
7908  " discards qualifiers">,
7909  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7910def err_typecheck_convert_discards_qualifiers : Error<
7911  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7912  "|%diff{passing $ to parameter of type $|"
7913  "passing to parameter of different type}0,1"
7914  "|%diff{returning $ from a function with result type $|"
7915  "returning from function with different return type}0,1"
7916  "|%diff{converting $ to type $|converting between types}0,1"
7917  "|%diff{initializing $ with an expression of type $|"
7918  "initializing with expression of different type}0,1"
7919  "|%diff{sending $ to parameter of type $|"
7920  "sending to parameter of different type}0,1"
7921  "|%diff{casting $ to type $|casting between types}0,1}2"
7922  " discards qualifiers">;
7923def ext_nested_pointer_qualifier_mismatch : ExtWarn<
7924  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7925  "|%diff{passing $ to parameter of type $|"
7926  "passing to parameter of different type}0,1"
7927  "|%diff{returning $ from a function with result type $|"
7928  "returning from function with different return type}0,1"
7929  "|%diff{converting $ to type $|converting between types}0,1"
7930  "|%diff{initializing $ with an expression of type $|"
7931  "initializing with expression of different type}0,1"
7932  "|%diff{sending $ to parameter of type $|"
7933  "sending to parameter of different type}0,1"
7934  "|%diff{casting $ to type $|casting between types}0,1}2"
7935  " discards qualifiers in nested pointer types">,
7936  InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7937def err_nested_pointer_qualifier_mismatch : Error<
7938  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7939  "|%diff{passing $ to parameter of type $|"
7940  "passing to parameter of different type}0,1"
7941  "|%diff{returning $ from a function with result type $|"
7942  "returning from function with different return type}0,1"
7943  "|%diff{converting $ to type $|converting between types}0,1"
7944  "|%diff{initializing $ with an expression of type $|"
7945  "initializing with expression of different type}0,1"
7946  "|%diff{sending $ to parameter of type $|"
7947  "sending to parameter of different type}0,1"
7948  "|%diff{casting $ to type $|casting between types}0,1}2"
7949  " discards qualifiers in nested pointer types">;
7950def warn_incompatible_vectors : Warning<
7951  "incompatible vector types "
7952  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7953  "|%diff{passing $ to parameter of type $|"
7954  "passing to parameter of different type}0,1"
7955  "|%diff{returning $ from a function with result type $|"
7956  "returning from function with different return type}0,1"
7957  "|%diff{converting $ to type $|converting between types}0,1"
7958  "|%diff{initializing $ with an expression of type $|"
7959  "initializing with expression of different type}0,1"
7960  "|%diff{sending $ to parameter of type $|"
7961  "sending to parameter of different type}0,1"
7962  "|%diff{casting $ to type $|casting between types}0,1}2">,
7963  InGroup<VectorConversion>, DefaultIgnore;
7964def err_incompatible_vectors : Error<
7965  "incompatible vector types "
7966  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7967  "|%diff{passing $ to parameter of type $|"
7968  "passing to parameter of different type}0,1"
7969  "|%diff{returning $ from a function with result type $|"
7970  "returning from function with different return type}0,1"
7971  "|%diff{converting $ to type $|converting between types}0,1"
7972  "|%diff{initializing $ with an expression of type $|"
7973  "initializing with expression of different type}0,1"
7974  "|%diff{sending $ to parameter of type $|"
7975  "sending to parameter of different type}0,1"
7976  "|%diff{casting $ to type $|casting between types}0,1}2">;
7977def err_int_to_block_pointer : Error<
7978  "invalid block pointer conversion "
7979  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7980  "|%diff{passing $ to parameter of type $|"
7981  "passing to parameter of different type}0,1"
7982  "|%diff{returning $ from a function with result type $|"
7983  "returning from function with different return type}0,1"
7984  "|%diff{converting $ to type $|converting between types}0,1"
7985  "|%diff{initializing $ with an expression of type $|"
7986  "initializing with expression of different type}0,1"
7987  "|%diff{sending $ to parameter of type $|"
7988  "sending to parameter of different type}0,1"
7989  "|%diff{casting $ to type $|casting between types}0,1}2">;
7990def err_typecheck_convert_incompatible_block_pointer : Error<
7991  "incompatible block pointer types "
7992  "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7993  "|%diff{passing $ to parameter of type $|"
7994  "passing to parameter of different type}0,1"
7995  "|%diff{returning $ from a function with result type $|"
7996  "returning from function with different return type}0,1"
7997  "|%diff{converting $ to type $|converting between types}0,1"
7998  "|%diff{initializing $ with an expression of type $|"
7999  "initializing with expression of different type}0,1"
8000  "|%diff{sending $ to parameter of type $|"
8001  "sending to parameter of different type}0,1"
8002  "|%diff{casting $ to type $|casting between types}0,1}2">;
8003def err_typecheck_incompatible_address_space : Error<
8004  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8005  "|%diff{passing $ to parameter of type $|"
8006  "passing to parameter of different type}0,1"
8007  "|%diff{returning $ from a function with result type $|"
8008  "returning from function with different return type}0,1"
8009  "|%diff{converting $ to type $|converting between types}0,1"
8010  "|%diff{initializing $ with an expression of type $|"
8011  "initializing with expression of different type}0,1"
8012  "|%diff{sending $ to parameter of type $|"
8013  "sending to parameter of different type}0,1"
8014  "|%diff{casting $ to type $|casting between types}0,1}2"
8015  " changes address space of pointer">;
8016def err_typecheck_incompatible_nested_address_space : Error<
8017  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8018  "|%diff{passing $ to parameter of type $|"
8019  "passing to parameter of different type}0,1"
8020  "|%diff{returning $ from a function with result type $|"
8021  "returning from function with different return type}0,1"
8022  "|%diff{converting $ to type $|converting between types}0,1"
8023  "|%diff{initializing $ with an expression of type $|"
8024  "initializing with expression of different type}0,1"
8025  "|%diff{sending $ to parameter of type $|"
8026  "sending to parameter of different type}0,1"
8027  "|%diff{casting $ to type $|casting between types}0,1}2"
8028  " changes address space of nested pointer">;
8029def err_typecheck_incompatible_ownership : Error<
8030  "%select{%diff{assigning $ to $|assigning to different types}1,0"
8031  "|%diff{passing $ to parameter of type $|"
8032  "passing to parameter of different type}0,1"
8033  "|%diff{returning $ from a function with result type $|"
8034  "returning from function with different return type}0,1"
8035  "|%diff{converting $ to type $|converting between types}0,1"
8036  "|%diff{initializing $ with an expression of type $|"
8037  "initializing with expression of different type}0,1"
8038  "|%diff{sending $ to parameter of type $|"
8039  "sending to parameter of different type}0,1"
8040  "|%diff{casting $ to type $|casting between types}0,1}2"
8041  " changes retain/release properties of pointer">;
8042def err_typecheck_comparison_of_distinct_blocks : Error<
8043  "comparison of distinct block types%diff{ ($ and $)|}0,1">;
8044
8045def err_typecheck_array_not_modifiable_lvalue : Error<
8046  "array type %0 is not assignable">;
8047def err_typecheck_non_object_not_modifiable_lvalue : Error<
8048  "non-object type %0 is not assignable">;
8049def err_typecheck_expression_not_modifiable_lvalue : Error<
8050  "expression is not assignable">;
8051def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
8052  "incomplete type %0 is not assignable">;
8053def err_typecheck_lvalue_casts_not_supported : Error<
8054  "assignment to cast is illegal, lvalue casts are not supported">;
8055
8056def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
8057  "vector is not assignable (contains duplicate components)">;
8058def err_block_decl_ref_not_modifiable_lvalue : Error<
8059  "variable is not assignable (missing __block type specifier)">;
8060def err_lambda_decl_ref_not_modifiable_lvalue : Error<
8061  "cannot assign to a variable captured by copy in a non-mutable lambda">;
8062def err_typecheck_call_not_function : Error<
8063  "called object type %0 is not a function or function pointer">;
8064def err_call_incomplete_return : Error<
8065  "calling function with incomplete return type %0">;
8066def err_call_function_incomplete_return : Error<
8067  "calling %0 with incomplete return type %1">;
8068def err_call_incomplete_argument : Error<
8069  "argument type %0 is incomplete">;
8070def err_typecheck_call_too_few_args : Error<
8071  "too few %select{|||execution configuration }0arguments to "
8072  "%select{function|block|method|kernel function}0 call, "
8073  "expected %1, have %2">;
8074def err_typecheck_call_too_few_args_one : Error<
8075  "too few %select{|||execution configuration }0arguments to "
8076  "%select{function|block|method|kernel function}0 call, "
8077  "single argument %1 was not specified">;
8078def err_typecheck_call_too_few_args_at_least : Error<
8079  "too few %select{|||execution configuration }0arguments to "
8080  "%select{function|block|method|kernel function}0 call, "
8081  "expected at least %1, have %2">;
8082def err_typecheck_call_too_few_args_at_least_one : Error<
8083  "too few %select{|||execution configuration }0arguments to "
8084  "%select{function|block|method|kernel function}0 call, "
8085  "at least argument %1 must be specified">;
8086def err_typecheck_call_too_few_args_suggest : Error<
8087  "too few %select{|||execution configuration }0arguments to "
8088  "%select{function|block|method|kernel function}0 call, "
8089  "expected %1, have %2; did you mean %3?">;
8090def err_typecheck_call_too_few_args_at_least_suggest : Error<
8091  "too few %select{|||execution configuration }0arguments to "
8092  "%select{function|block|method|kernel function}0 call, "
8093  "expected at least %1, have %2; did you mean %3?">;
8094def err_typecheck_call_too_many_args : Error<
8095  "too many %select{|||execution configuration }0arguments to "
8096  "%select{function|block|method|kernel function}0 call, "
8097  "expected %1, have %2">;
8098def err_typecheck_call_too_many_args_one : Error<
8099  "too many %select{|||execution configuration }0arguments to "
8100  "%select{function|block|method|kernel function}0 call, "
8101  "expected single argument %1, have %2 arguments">;
8102def err_typecheck_call_too_many_args_at_most : Error<
8103  "too many %select{|||execution configuration }0arguments to "
8104  "%select{function|block|method|kernel function}0 call, "
8105  "expected at most %1, have %2">;
8106def err_typecheck_call_too_many_args_at_most_one : Error<
8107  "too many %select{|||execution configuration }0arguments to "
8108  "%select{function|block|method|kernel function}0 call, "
8109  "expected at most single argument %1, have %2 arguments">;
8110def err_typecheck_call_too_many_args_suggest : Error<
8111  "too many %select{|||execution configuration }0arguments to "
8112  "%select{function|block|method|kernel function}0 call, "
8113  "expected %1, have %2; did you mean %3?">;
8114def err_typecheck_call_too_many_args_at_most_suggest : Error<
8115  "too many %select{|||execution configuration }0arguments to "
8116  "%select{function|block|method|kernel function}0 call, "
8117  "expected at most %1, have %2; did you mean %3?">;
8118
8119def err_arc_typecheck_convert_incompatible_pointer : Error<
8120  "incompatible pointer types passing retainable parameter of type %0"
8121  "to a CF function expecting %1 type">;
8122
8123def err_builtin_fn_use : Error<"builtin functions must be directly called">;
8124
8125def warn_call_wrong_number_of_arguments : Warning<
8126  "too %select{few|many}0 arguments in call to %1">;
8127def err_atomic_builtin_must_be_pointer : Error<
8128  "address argument to atomic builtin must be a pointer (%0 invalid)">;
8129def err_atomic_builtin_must_be_pointer_intptr : Error<
8130  "address argument to atomic builtin must be a pointer to integer or pointer"
8131  " (%0 invalid)">;
8132def err_atomic_builtin_cannot_be_const : Error<
8133  "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
8134def err_atomic_builtin_must_be_pointer_intfltptr : Error<
8135  "address argument to atomic builtin must be a pointer to integer,"
8136  " floating-point or pointer (%0 invalid)">;
8137def err_atomic_builtin_pointer_size : Error<
8138  "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
8139  "type (%0 invalid)">;
8140def err_atomic_exclusive_builtin_pointer_size : Error<
8141  "address argument to load or store exclusive builtin must be a pointer to"
8142  " 1,2,4 or 8 byte type (%0 invalid)">;
8143def err_atomic_builtin_ext_int_size : Error<
8144  "Atomic memory operand must have a power-of-two size">;
8145def err_atomic_builtin_ext_int_prohibit : Error<
8146  "argument to atomic builtin of type '_ExtInt' is not supported">;
8147def err_atomic_op_needs_atomic : Error<
8148  "address argument to atomic operation must be a pointer to _Atomic "
8149  "type (%0 invalid)">;
8150def err_atomic_op_needs_non_const_atomic : Error<
8151  "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
8152  "type (%1 invalid)">;
8153def err_atomic_op_needs_non_const_pointer : Error<
8154  "address argument to atomic operation must be a pointer to non-const "
8155  "type (%0 invalid)">;
8156def err_atomic_op_needs_trivial_copy : Error<
8157  "address argument to atomic operation must be a pointer to a "
8158  "trivially-copyable type (%0 invalid)">;
8159def err_atomic_op_needs_atomic_int_or_ptr : Error<
8160  "address argument to atomic operation must be a pointer to %select{|atomic }0"
8161  "integer or pointer (%1 invalid)">;
8162def err_atomic_op_needs_atomic_int : Error<
8163  "address argument to atomic operation must be a pointer to "
8164  "%select{|atomic }0integer (%1 invalid)">;
8165def warn_atomic_op_has_invalid_memory_order : Warning<
8166  "memory order argument to atomic operation is invalid">,
8167  InGroup<DiagGroup<"atomic-memory-ordering">>;
8168def err_atomic_op_has_invalid_synch_scope : Error<
8169  "synchronization scope argument to atomic operation is invalid">;
8170def warn_atomic_implicit_seq_cst : Warning<
8171  "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
8172  InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
8173
8174def err_overflow_builtin_must_be_int : Error<
8175  "operand argument to overflow builtin must be an integer (%0 invalid)">;
8176def err_overflow_builtin_must_be_ptr_int : Error<
8177  "result argument to overflow builtin must be a pointer "
8178  "to a non-const integer (%0 invalid)">;
8179def err_overflow_builtin_ext_int_max_size : Error<
8180  "__builtin_mul_overflow does not support signed _ExtInt operands of more "
8181  "than %0 bits">;
8182
8183def err_atomic_load_store_uses_lib : Error<
8184  "atomic %select{load|store}0 requires runtime support that is not "
8185  "available for this target">;
8186
8187def err_nontemporal_builtin_must_be_pointer : Error<
8188  "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
8189def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
8190  "address argument to nontemporal builtin must be a pointer to integer, float, "
8191  "pointer, or a vector of such types (%0 invalid)">;
8192
8193def err_deleted_function_use : Error<"attempt to use a deleted function">;
8194def err_deleted_inherited_ctor_use : Error<
8195  "constructor inherited by %0 from base class %1 is implicitly deleted">;
8196
8197def note_called_by : Note<"called by %0">;
8198def err_kern_type_not_void_return : Error<
8199  "kernel function type %0 must have void return type">;
8200def err_kern_is_nonstatic_method : Error<
8201  "kernel function %0 must be a free function or static member function">;
8202def err_config_scalar_return : Error<
8203  "CUDA special function '%0' must have scalar return type">;
8204def err_kern_call_not_global_function : Error<
8205  "kernel call to non-global function %0">;
8206def err_global_call_not_config : Error<
8207  "call to global function %0 not configured">;
8208def err_ref_bad_target : Error<
8209  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8210  "%select{function|variable}1 %2 in %select{__device__|__global__|__host__|__host__ __device__}3 function">;
8211def err_ref_bad_target_global_initializer : Error<
8212  "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
8213  "function %1 in global initializer">;
8214def err_capture_bad_target : Error<
8215  "capture host variable %0 by reference in device or host device lambda function">;
8216def err_capture_bad_target_this_ptr : Error<
8217  "capture host side class data member by this pointer in device or host device lambda function">;
8218def warn_kern_is_method : Extension<
8219  "kernel function %0 is a member function; this may not be accepted by nvcc">,
8220  InGroup<CudaCompat>;
8221def warn_kern_is_inline : Warning<
8222  "ignored 'inline' attribute on kernel function %0">,
8223  InGroup<CudaCompat>;
8224def err_variadic_device_fn : Error<
8225  "CUDA device code does not support variadic functions">;
8226def err_va_arg_in_device : Error<
8227  "CUDA device code does not support va_arg">;
8228def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
8229def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
8230  "constexpr function %0 without __host__ or __device__ attributes cannot "
8231  "overload __device__ function with same signature.  Add a __host__ "
8232  "attribute, or build with -fno-cuda-host-device-constexpr.">;
8233def note_cuda_conflicting_device_function_declared_here : Note<
8234  "conflicting __device__ function declared here">;
8235def err_cuda_device_exceptions : Error<
8236  "cannot use '%0' in "
8237  "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
8238def err_dynamic_var_init : Error<
8239    "dynamic initialization is not supported for "
8240    "__device__, __constant__, __shared__, and __managed__ variables.">;
8241def err_shared_var_init : Error<
8242    "initialization is not supported for __shared__ variables.">;
8243def err_cuda_vla : Error<
8244    "cannot use variable-length arrays in "
8245    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8246def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
8247def err_cuda_host_shared : Error<
8248    "__shared__ local variables not allowed in "
8249    "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
8250def err_cuda_nonstatic_constdev: Error<"__constant__, __device__, and "
8251    "__managed__ are not allowed on non-static local variables">;
8252def err_cuda_ovl_target : Error<
8253  "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
8254  "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
8255def note_cuda_ovl_candidate_target_mismatch : Note<
8256    "candidate template ignored: target attributes do not match">;
8257
8258def err_cuda_device_builtin_surftex_cls_template : Error<
8259    "illegal device builtin %select{surface|texture}0 reference "
8260    "class template %1 declared here">;
8261def note_cuda_device_builtin_surftex_cls_should_have_n_args : Note<
8262    "%0 needs to have exactly %1 template parameters">;
8263def note_cuda_device_builtin_surftex_cls_should_have_match_arg : Note<
8264    "the %select{1st|2nd|3rd}1 template parameter of %0 needs to be "
8265    "%select{a type|an integer or enum value}2">;
8266
8267def err_cuda_device_builtin_surftex_ref_decl : Error<
8268    "illegal device builtin %select{surface|texture}0 reference "
8269    "type %1 declared here">;
8270def note_cuda_device_builtin_surftex_should_be_template_class : Note<
8271    "%0 needs to be instantiated from a class template with proper "
8272    "template arguments">;
8273
8274def warn_non_pod_vararg_with_format_string : Warning<
8275  "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
8276  "%select{function|block|method|constructor}2; expected type from format "
8277  "string was %3">, InGroup<NonPODVarargs>, DefaultError;
8278// The arguments to this diagnostic should match the warning above.
8279def err_cannot_pass_objc_interface_to_vararg_format : Error<
8280  "cannot pass object with interface type %1 by value to variadic "
8281  "%select{function|block|method|constructor}2; expected type from format "
8282  "string was %3">;
8283def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
8284  "cannot pass non-trivial C object of type %0 by value to variadic "
8285  "%select{function|block|method|constructor}1">;
8286
8287
8288def err_cannot_pass_objc_interface_to_vararg : Error<
8289  "cannot pass object with interface type %0 by value through variadic "
8290  "%select{function|block|method|constructor}1">;
8291def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
8292  "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
8293  " %select{function|block|method|constructor}2; call will abort at runtime">,
8294  InGroup<NonPODVarargs>, DefaultError;
8295def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
8296  "passing object of trivial but non-POD type %0 through variadic"
8297  " %select{function|block|method|constructor}1 is incompatible with C++98">,
8298  InGroup<CXX98Compat>, DefaultIgnore;
8299def warn_pass_class_arg_to_vararg : Warning<
8300  "passing object of class type %0 through variadic "
8301  "%select{function|block|method|constructor}1"
8302  "%select{|; did you mean to call '%3'?}2">,
8303  InGroup<ClassVarargs>, DefaultIgnore;
8304def err_cannot_pass_to_vararg : Error<
8305  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8306  "%select{function|block|method|constructor}2">;
8307def err_cannot_pass_to_vararg_format : Error<
8308  "cannot pass %select{expression of type %1|initializer list}0 to variadic "
8309  "%select{function|block|method|constructor}2; expected type from format "
8310  "string was %3">;
8311
8312def err_typecheck_call_invalid_ordered_compare : Error<
8313  "ordered compare requires two args of floating point type"
8314  "%diff{ ($ and $)|}0,1">;
8315def err_typecheck_call_invalid_unary_fp : Error<
8316  "floating point classification requires argument of floating point type "
8317  "(passed in %0)">;
8318def err_typecheck_cond_expect_int_float : Error<
8319  "used type %0 where integer or floating point type is required">;
8320def err_typecheck_cond_expect_scalar : Error<
8321  "used type %0 where arithmetic or pointer type is required">;
8322def err_typecheck_cond_expect_nonfloat : Error<
8323  "used type %0 where floating point type is not allowed">;
8324def ext_typecheck_cond_one_void : Extension<
8325  "C99 forbids conditional expressions with only one void side">;
8326def err_typecheck_cast_to_incomplete : Error<
8327  "cast to incomplete type %0">;
8328def ext_typecheck_cast_nonscalar : Extension<
8329  "C99 forbids casting nonscalar type %0 to the same type">;
8330def ext_typecheck_cast_to_union : Extension<
8331  "cast to union type is a GNU extension">,
8332  InGroup<GNUUnionCast>;
8333def err_typecheck_cast_to_union_no_type : Error<
8334  "cast to union type from type %0 not present in union">;
8335def err_cast_pointer_from_non_pointer_int : Error<
8336  "operand of type %0 cannot be cast to a pointer type">;
8337def warn_cast_pointer_from_sel : Warning<
8338  "cast of type %0 to %1 is deprecated; use sel_getName instead">,
8339  InGroup<SelTypeCast>;
8340def warn_function_def_in_objc_container : Warning<
8341  "function definition inside an Objective-C container is deprecated">,
8342  InGroup<FunctionDefInObjCContainer>;
8343def err_typecheck_call_requires_real_fp : Error<
8344  "argument type %0 is not a real floating point type">;
8345def err_typecheck_call_different_arg_types : Error<
8346  "arguments are of different types%diff{ ($ vs $)|}0,1">;
8347
8348def warn_cast_calling_conv : Warning<
8349  "cast between incompatible calling conventions '%0' and '%1'; "
8350  "calls through this pointer may abort at runtime">,
8351  InGroup<DiagGroup<"cast-calling-convention">>;
8352def note_change_calling_conv_fixit : Note<
8353  "consider defining %0 with the '%1' calling convention">;
8354def warn_bad_function_cast : Warning<
8355  "cast from function call of type %0 to non-matching type %1">,
8356  InGroup<BadFunctionCast>, DefaultIgnore;
8357def err_cast_pointer_to_non_pointer_int : Error<
8358  "pointer cannot be cast to type %0">;
8359def err_cast_to_bfloat16 : Error<"cannot type-cast to __bf16">;
8360def err_cast_from_bfloat16 : Error<"cannot type-cast from __bf16">;
8361def err_typecheck_expect_scalar_operand : Error<
8362  "operand of type %0 where arithmetic or pointer type is required">;
8363def err_typecheck_cond_incompatible_operands : Error<
8364  "incompatible operand types%diff{ ($ and $)|}0,1">;
8365def err_cast_selector_expr : Error<
8366  "cannot type cast @selector expression">;
8367def ext_typecheck_cond_incompatible_pointers : ExtWarn<
8368  "pointer type mismatch%diff{ ($ and $)|}0,1">,
8369  InGroup<DiagGroup<"pointer-type-mismatch">>;
8370def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
8371  "pointer/integer type mismatch in conditional expression"
8372  "%diff{ ($ and $)|}0,1">,
8373  InGroup<DiagGroup<"conditional-type-mismatch">>;
8374def err_typecheck_choose_expr_requires_constant : Error<
8375  "'__builtin_choose_expr' requires a constant expression">;
8376def warn_unused_expr : Warning<"expression result unused">,
8377  InGroup<UnusedValue>;
8378def warn_unused_voidptr : Warning<
8379  "expression result unused; should this cast be to 'void'?">,
8380  InGroup<UnusedValue>;
8381def warn_unused_property_expr : Warning<
8382 "property access result unused - getters should not be used for side effects">,
8383  InGroup<UnusedGetterReturnValue>;
8384def warn_unused_container_subscript_expr : Warning<
8385 "container access result unused - container access should not be used for side effects">,
8386  InGroup<UnusedValue>;
8387def warn_unused_call : Warning<
8388  "ignoring return value of function declared with %0 attribute">,
8389  InGroup<UnusedValue>;
8390def warn_unused_constructor : Warning<
8391  "ignoring temporary created by a constructor declared with %0 attribute">,
8392  InGroup<UnusedValue>;
8393def warn_unused_constructor_msg : Warning<
8394  "ignoring temporary created by a constructor declared with %0 attribute: %1">,
8395  InGroup<UnusedValue>;
8396def warn_side_effects_unevaluated_context : Warning<
8397  "expression with side effects has no effect in an unevaluated context">,
8398  InGroup<UnevaluatedExpression>;
8399def warn_side_effects_typeid : Warning<
8400  "expression with side effects will be evaluated despite being used as an "
8401  "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
8402def warn_unused_result : Warning<
8403  "ignoring return value of function declared with %0 attribute">,
8404  InGroup<UnusedResult>;
8405def warn_unused_result_msg : Warning<
8406  "ignoring return value of function declared with %0 attribute: %1">,
8407  InGroup<UnusedResult>;
8408def warn_unused_volatile : Warning<
8409  "expression result unused; assign into a variable to force a volatile load">,
8410  InGroup<DiagGroup<"unused-volatile-lvalue">>;
8411
8412def ext_cxx14_attr : Extension<
8413  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
8414def ext_cxx17_attr : Extension<
8415  "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
8416def ext_cxx20_attr : Extension<
8417  "use of the %0 attribute is a C++20 extension">, InGroup<CXX20>;
8418
8419def warn_unused_comparison : Warning<
8420  "%select{equality|inequality|relational|three-way}0 comparison result unused">,
8421  InGroup<UnusedComparison>;
8422def note_inequality_comparison_to_or_assign : Note<
8423  "use '|=' to turn this inequality comparison into an or-assignment">;
8424
8425def err_incomplete_type_used_in_type_trait_expr : Error<
8426  "incomplete type %0 used in type trait expression">;
8427
8428// C++20 constinit and require_constant_initialization attribute
8429def warn_cxx20_compat_constinit : Warning<
8430  "'constinit' specifier is incompatible with C++ standards before C++20">,
8431  InGroup<CXX20Compat>, DefaultIgnore;
8432def err_constinit_local_variable : Error<
8433  "local variable cannot be declared 'constinit'">;
8434def err_require_constant_init_failed : Error<
8435  "variable does not have a constant initializer">;
8436def note_declared_required_constant_init_here : Note<
8437  "required by %select{'require_constant_initialization' attribute|"
8438  "'constinit' specifier}0 here">;
8439def ext_constinit_missing : ExtWarn<
8440  "'constinit' specifier missing on initializing declaration of %0">,
8441  InGroup<DiagGroup<"missing-constinit">>;
8442def note_constinit_specified_here : Note<"variable declared constinit here">;
8443def err_constinit_added_too_late : Error<
8444  "'constinit' specifier added after initialization of variable">;
8445def warn_require_const_init_added_too_late : Warning<
8446  "'require_constant_initialization' attribute added after initialization "
8447  "of variable">, InGroup<IgnoredAttributes>;
8448def note_constinit_missing_here : Note<
8449  "add the "
8450  "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
8451  "to the initializing declaration here">;
8452
8453def err_dimension_expr_not_constant_integer : Error<
8454  "dimension expression does not evaluate to a constant unsigned int">;
8455
8456def err_typecheck_cond_incompatible_operands_null : Error<
8457  "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
8458def ext_empty_struct_union : Extension<
8459  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
8460def ext_no_named_members_in_struct_union : Extension<
8461  "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
8462def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
8463  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8464  InGroup<CXXCompat>, DefaultIgnore;
8465def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
8466  "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
8467  InGroup<ExternCCompat>;
8468def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
8469  "volatile qualifiers|const qualifier|volatile qualifier}2">,
8470  InGroup<CastQual>, DefaultIgnore;
8471def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
8472  "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
8473def warn_redefine_extname_not_applied : Warning<
8474  "#pragma redefine_extname is applicable to external C declarations only; "
8475  "not applied to %select{function|variable}0 %1">,
8476  InGroup<Pragmas>;
8477} // End of general sema category.
8478
8479// inline asm.
8480let CategoryName = "Inline Assembly Issue" in {
8481  def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
8482  def err_asm_invalid_output_constraint : Error<
8483    "invalid output constraint '%0' in asm">;
8484  def err_asm_invalid_lvalue_in_input : Error<
8485    "invalid lvalue in asm input for constraint '%0'">;
8486  def err_asm_invalid_input_constraint : Error<
8487    "invalid input constraint '%0' in asm">;
8488  def err_asm_tying_incompatible_types : Error<
8489    "unsupported inline asm: input with type "
8490    "%diff{$ matching output with type $|}0,1">;
8491  def err_asm_unexpected_constraint_alternatives : Error<
8492    "asm constraint has an unexpected number of alternatives: %0 vs %1">;
8493  def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
8494  def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
8495  def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
8496    "global register variables on this target">;
8497  def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
8498    "match variable size">;
8499  def err_asm_bad_register_type : Error<"bad type for named register variable">;
8500  def err_asm_invalid_input_size : Error<
8501    "invalid input size for constraint '%0'">;
8502  def err_asm_invalid_output_size : Error<
8503    "invalid output size for constraint '%0'">;
8504  def err_invalid_asm_cast_lvalue : Error<
8505    "invalid use of a cast in a inline asm context requiring an lvalue: "
8506    "remove the cast or build with -fheinous-gnu-extensions">;
8507  def err_invalid_asm_value_for_constraint
8508      : Error <"value '%0' out of range for constraint '%1'">;
8509  def err_asm_non_addr_value_in_memory_constraint : Error <
8510    "reference to a %select{bit-field|vector element|global register variable}0"
8511    " in asm %select{input|output}1 with a memory constraint '%2'">;
8512  def err_asm_input_duplicate_match : Error<
8513    "more than one input constraint matches the same output '%0'">;
8514
8515  def warn_asm_label_on_auto_decl : Warning<
8516    "ignored asm label '%0' on automatic variable">;
8517  def warn_invalid_asm_cast_lvalue : Warning<
8518    "invalid use of a cast in an inline asm context requiring an lvalue: "
8519    "accepted due to -fheinous-gnu-extensions, but clang may remove support "
8520    "for this in the future">;
8521  def warn_asm_mismatched_size_modifier : Warning<
8522    "value size does not match register size specified by the constraint "
8523    "and modifier">,
8524    InGroup<ASMOperandWidths>;
8525
8526  def note_asm_missing_constraint_modifier : Note<
8527    "use constraint modifier \"%0\"">;
8528  def note_asm_input_duplicate_first : Note<
8529    "constraint '%0' is already present here">;
8530 def error_duplicate_asm_operand_name : Error<
8531    "duplicate use of asm operand name \"%0\"">;
8532 def note_duplicate_asm_operand_name : Note<
8533    "asm operand name \"%0\" first referenced here">;
8534}
8535
8536  def error_inoutput_conflict_with_clobber : Error<
8537    "asm-specifier for input or output variable conflicts with asm"
8538    " clobber list">;
8539
8540let CategoryName = "Semantic Issue" in {
8541
8542def err_invalid_conversion_between_vectors : Error<
8543  "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
8544  "size">;
8545def err_invalid_conversion_between_vector_and_integer : Error<
8546  "invalid conversion between vector type %0 and integer type %1 "
8547  "of different size">;
8548
8549def err_opencl_function_pointer : Error<
8550  "pointers to functions are not allowed">;
8551
8552def err_opencl_taking_address_capture : Error<
8553  "taking address of a capture is not allowed">;
8554
8555def err_invalid_conversion_between_vector_and_scalar : Error<
8556  "invalid conversion between vector type %0 and scalar type %1">;
8557
8558// C++ member initializers.
8559def err_only_constructors_take_base_inits : Error<
8560  "only constructors take base initializers">;
8561
8562def err_multiple_mem_initialization : Error <
8563  "multiple initializations given for non-static member %0">;
8564def err_multiple_mem_union_initialization : Error <
8565  "initializing multiple members of union">;
8566def err_multiple_base_initialization : Error <
8567  "multiple initializations given for base %0">;
8568
8569def err_mem_init_not_member_or_class : Error<
8570  "member initializer %0 does not name a non-static data member or base "
8571  "class">;
8572
8573def warn_initializer_out_of_order : Warning<
8574  "%select{field|base class}0 %1 will be initialized after "
8575  "%select{field|base}2 %3">,
8576  InGroup<ReorderCtor>, DefaultIgnore;
8577def warn_abstract_vbase_init_ignored : Warning<
8578  "initializer for virtual base class %0 of abstract class %1 "
8579  "will never be used">,
8580  InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
8581
8582def err_base_init_does_not_name_class : Error<
8583  "constructor initializer %0 does not name a class">;
8584def err_base_init_direct_and_virtual : Error<
8585  "base class initializer %0 names both a direct base class and an "
8586  "inherited virtual base class">;
8587def err_not_direct_base_or_virtual : Error<
8588  "type %0 is not a direct or virtual base of %1">;
8589
8590def err_in_class_initializer_non_const : Error<
8591  "non-const static data member must be initialized out of line">;
8592def err_in_class_initializer_volatile : Error<
8593  "static const volatile data member must be initialized out of line">;
8594def err_in_class_initializer_bad_type : Error<
8595  "static data member of type %0 must be initialized out of line">;
8596def ext_in_class_initializer_float_type : ExtWarn<
8597  "in-class initializer for static data member of type %0 is a GNU extension">,
8598  InGroup<GNUStaticFloatInit>;
8599def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
8600  "in-class initializer for static data member of type %0 requires "
8601  "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
8602def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
8603def err_in_class_initializer_literal_type : Error<
8604  "in-class initializer for static data member of type %0 requires "
8605  "'constexpr' specifier">;
8606def err_in_class_initializer_non_constant : Error<
8607  "in-class initializer for static data member is not a constant expression">;
8608def err_default_member_initializer_not_yet_parsed : Error<
8609  "default member initializer for %1 needed within definition of enclosing "
8610  "class %0 outside of member functions">;
8611def note_default_member_initializer_not_yet_parsed : Note<
8612  "default member initializer declared here">;
8613def err_default_member_initializer_cycle
8614    : Error<"default member initializer for %0 uses itself">;
8615
8616def ext_in_class_initializer_non_constant : Extension<
8617  "in-class initializer for static data member is not a constant expression; "
8618  "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
8619
8620def err_thread_dynamic_init : Error<
8621  "initializer for thread-local variable must be a constant expression">;
8622def err_thread_nontrivial_dtor : Error<
8623  "type of thread-local variable has non-trivial destruction">;
8624def note_use_thread_local : Note<
8625  "use 'thread_local' to allow this">;
8626
8627// C++ anonymous unions and GNU anonymous structs/unions
8628def ext_anonymous_union : Extension<
8629  "anonymous unions are a C11 extension">, InGroup<C11>;
8630def ext_gnu_anonymous_struct : Extension<
8631  "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
8632def ext_c11_anonymous_struct : Extension<
8633  "anonymous structs are a C11 extension">, InGroup<C11>;
8634def err_anonymous_union_not_static : Error<
8635  "anonymous unions at namespace or global scope must be declared 'static'">;
8636def err_anonymous_union_with_storage_spec : Error<
8637  "anonymous union at class scope must not have a storage specifier">;
8638def err_anonymous_struct_not_member : Error<
8639  "anonymous %select{structs|structs and classes}0 must be "
8640  "%select{struct or union|class}0 members">;
8641def err_anonymous_record_member_redecl : Error<
8642  "member of anonymous %select{struct|union}0 redeclares %1">;
8643def err_anonymous_record_with_type : Error<
8644  "types cannot be declared in an anonymous %select{struct|union}0">;
8645def ext_anonymous_record_with_type : Extension<
8646  "types declared in an anonymous %select{struct|union}0 are a Microsoft "
8647  "extension">, InGroup<MicrosoftAnonTag>;
8648def ext_anonymous_record_with_anonymous_type : Extension<
8649  "anonymous types declared in an anonymous %select{struct|union}0 "
8650  "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
8651def err_anonymous_record_with_function : Error<
8652  "functions cannot be declared in an anonymous %select{struct|union}0">;
8653def err_anonymous_record_with_static : Error<
8654  "static members cannot be declared in an anonymous %select{struct|union}0">;
8655def err_anonymous_record_bad_member : Error<
8656  "anonymous %select{struct|union}0 can only contain non-static data members">;
8657def err_anonymous_record_nonpublic_member : Error<
8658  "anonymous %select{struct|union}0 cannot contain a "
8659  "%select{private|protected}1 data member">;
8660def ext_ms_anonymous_record : ExtWarn<
8661  "anonymous %select{structs|unions}0 are a Microsoft extension">,
8662  InGroup<MicrosoftAnonTag>;
8663
8664// C++ local classes
8665def err_reference_to_local_in_enclosing_context : Error<
8666  "reference to local %select{variable|binding}1 %0 declared in enclosing "
8667  "%select{%3|block literal|lambda expression|context}2">;
8668
8669def err_static_data_member_not_allowed_in_local_class : Error<
8670  "static data member %0 not allowed in local %sub{select_tag_type_kind}2 %1">;
8671
8672// C++ derived classes
8673def err_base_clause_on_union : Error<"unions cannot have base classes">;
8674def err_base_must_be_class : Error<"base specifier must name a class">;
8675def err_union_as_base_class : Error<"unions cannot be base classes">;
8676def err_circular_inheritance : Error<
8677  "circular inheritance between %0 and %1">;
8678def err_base_class_has_flexible_array_member : Error<
8679  "base class %0 has a flexible array member">;
8680def err_incomplete_base_class : Error<"base class has incomplete type">;
8681def err_duplicate_base_class : Error<
8682  "base class %0 specified more than once as a direct base class">;
8683def warn_inaccessible_base_class : Warning<
8684  "direct base %0 is inaccessible due to ambiguity:%1">,
8685  InGroup<DiagGroup<"inaccessible-base">>;
8686// FIXME: better way to display derivation?  Pass entire thing into diagclient?
8687def err_ambiguous_derived_to_base_conv : Error<
8688  "ambiguous conversion from derived class %0 to base class %1:%2">;
8689def err_ambiguous_memptr_conv : Error<
8690  "ambiguous conversion from pointer to member of %select{base|derived}0 "
8691  "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
8692def ext_ms_ambiguous_direct_base : ExtWarn<
8693  "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
8694  InGroup<MicrosoftInaccessibleBase>;
8695
8696def err_memptr_conv_via_virtual : Error<
8697  "conversion from pointer to member of class %0 to pointer to member "
8698  "of class %1 via virtual base %2 is not allowed">;
8699
8700// C++ member name lookup
8701def err_ambiguous_member_multiple_subobjects : Error<
8702  "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
8703def err_ambiguous_member_multiple_subobject_types : Error<
8704  "member %0 found in multiple base classes of different types">;
8705def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
8706def note_ambiguous_member_type_found : Note<
8707  "member type %0 found by ambiguous name lookup">;
8708def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
8709def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
8710def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
8711  "declaration in a different namespace">;
8712def note_hidden_tag : Note<"type declaration hidden">;
8713def note_hiding_object : Note<"declaration hides type">;
8714
8715// C++ operator overloading
8716def err_operator_overload_needs_class_or_enum : Error<
8717  "overloaded %0 must have at least one parameter of class "
8718  "or enumeration type">;
8719
8720def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
8721def err_operator_overload_static : Error<
8722  "overloaded %0 cannot be a static member function">;
8723def err_operator_overload_default_arg : Error<
8724  "parameter of overloaded %0 cannot have a default argument">;
8725def err_operator_overload_must_be : Error<
8726  "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
8727  "(has %1 parameter%s1)">;
8728
8729def err_operator_overload_must_be_member : Error<
8730  "overloaded %0 must be a non-static member function">;
8731def err_operator_overload_post_incdec_must_be_int : Error<
8732  "parameter of overloaded post-%select{increment|decrement}1 operator must "
8733  "have type 'int' (not %0)">;
8734
8735// C++ allocation and deallocation functions.
8736def err_operator_new_delete_declared_in_namespace : Error<
8737  "%0 cannot be declared inside a namespace">;
8738def err_operator_new_delete_declared_static : Error<
8739  "%0 cannot be declared static in global scope">;
8740def ext_operator_new_delete_declared_inline : ExtWarn<
8741  "replacement function %0 cannot be declared 'inline'">,
8742  InGroup<DiagGroup<"inline-new-delete">>;
8743def err_operator_new_delete_invalid_result_type : Error<
8744  "%0 must return type %1">;
8745def err_operator_new_delete_dependent_result_type : Error<
8746  "%0 cannot have a dependent return type; use %1 instead">;
8747def err_operator_new_delete_too_few_parameters : Error<
8748  "%0 must have at least one parameter">;
8749def err_operator_new_delete_template_too_few_parameters : Error<
8750  "%0 template must have at least two parameters">;
8751def warn_operator_new_returns_null : Warning<
8752  "%0 should not return a null pointer unless it is declared 'throw()'"
8753  "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
8754
8755def err_operator_new_dependent_param_type : Error<
8756  "%0 cannot take a dependent type as first parameter; "
8757  "use size_t (%1) instead">;
8758def err_operator_new_param_type : Error<
8759  "%0 takes type size_t (%1) as first parameter">;
8760def err_operator_new_default_arg: Error<
8761  "parameter of %0 cannot have a default argument">;
8762def err_operator_delete_dependent_param_type : Error<
8763  "%0 cannot take a dependent type as first parameter; use %1 instead">;
8764def err_operator_delete_param_type : Error<
8765  "first parameter of %0 must have type %1">;
8766def err_destroying_operator_delete_not_usual : Error<
8767  "destroying operator delete can have only an optional size and optional "
8768  "alignment parameter">;
8769def note_implicit_delete_this_in_destructor_here : Note<
8770  "while checking implicit 'delete this' for virtual destructor">;
8771def err_builtin_operator_new_delete_not_usual : Error<
8772  "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
8773  "selects non-usual %select{allocation|deallocation}0 function">;
8774def note_non_usual_function_declared_here : Note<
8775  "non-usual %0 declared here">;
8776
8777// C++ literal operators
8778def err_literal_operator_outside_namespace : Error<
8779  "literal operator %0 must be in a namespace or global scope">;
8780def err_literal_operator_id_outside_namespace : Error<
8781  "non-namespace scope '%0' cannot have a literal operator member">;
8782def err_literal_operator_default_argument : Error<
8783  "literal operator cannot have a default argument">;
8784def err_literal_operator_bad_param_count : Error<
8785  "non-template literal operator must have one or two parameters">;
8786def err_literal_operator_invalid_param : Error<
8787  "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
8788def err_literal_operator_param : Error<
8789  "invalid literal operator parameter type %0, did you mean %1?">;
8790def err_literal_operator_template_with_params : Error<
8791  "literal operator template cannot have any parameters">;
8792def err_literal_operator_template : Error<
8793  "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
8794def err_literal_operator_extern_c : Error<
8795  "literal operator must have C++ linkage">;
8796def ext_string_literal_operator_template : ExtWarn<
8797  "string literal operator templates are a GNU extension">,
8798  InGroup<GNUStringLiteralOperatorTemplate>;
8799def warn_user_literal_reserved : Warning<
8800  "user-defined literal suffixes not starting with '_' are reserved"
8801  "%select{; no literal will invoke this operator|}0">,
8802  InGroup<UserDefinedLiterals>;
8803
8804// C++ conversion functions
8805def err_conv_function_not_member : Error<
8806  "conversion function must be a non-static member function">;
8807def err_conv_function_return_type : Error<
8808  "conversion function cannot have a return type">;
8809def err_conv_function_with_params : Error<
8810  "conversion function cannot have any parameters">;
8811def err_conv_function_variadic : Error<
8812  "conversion function cannot be variadic">;
8813def err_conv_function_to_array : Error<
8814  "conversion function cannot convert to an array type">;
8815def err_conv_function_to_function : Error<
8816  "conversion function cannot convert to a function type">;
8817def err_conv_function_with_complex_decl : Error<
8818  "cannot specify any part of a return type in the "
8819  "declaration of a conversion function"
8820  "%select{"
8821  "; put the complete type after 'operator'|"
8822  "; use a typedef to declare a conversion to %1|"
8823  "; use an alias template to declare a conversion to %1|"
8824  "}0">;
8825def err_conv_function_redeclared : Error<
8826  "conversion function cannot be redeclared">;
8827def warn_conv_to_self_not_used : Warning<
8828  "conversion function converting %0 to itself will never be used">,
8829  InGroup<ClassConversion>;
8830def warn_conv_to_base_not_used : Warning<
8831  "conversion function converting %0 to its base class %1 will never be used">,
8832  InGroup<ClassConversion>;
8833def warn_conv_to_void_not_used : Warning<
8834  "conversion function converting %0 to %1 will never be used">,
8835  InGroup<ClassConversion>;
8836
8837def warn_not_compound_assign : Warning<
8838  "use of unary operator that may be intended as compound assignment (%0=)">;
8839
8840// C++11 explicit conversion operators
8841def ext_explicit_conversion_functions : ExtWarn<
8842  "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
8843def warn_cxx98_compat_explicit_conversion_functions : Warning<
8844  "explicit conversion functions are incompatible with C++98">,
8845  InGroup<CXX98Compat>, DefaultIgnore;
8846
8847// C++11 defaulted functions
8848def err_defaulted_special_member_params : Error<
8849  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
8850  "have default arguments">;
8851def err_defaulted_special_member_variadic : Error<
8852  "an explicitly-defaulted %select{|copy |move }0constructor cannot "
8853  "be variadic">;
8854def err_defaulted_special_member_return_type : Error<
8855  "explicitly-defaulted %select{copy|move}0 assignment operator must "
8856  "return %1">;
8857def err_defaulted_special_member_quals : Error<
8858  "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
8859  "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
8860def err_defaulted_special_member_volatile_param : Error<
8861  "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
8862  "may not be volatile">;
8863def err_defaulted_special_member_move_const_param : Error<
8864  "the parameter for an explicitly-defaulted move "
8865  "%select{constructor|assignment operator}0 may not be const">;
8866def err_defaulted_special_member_copy_const_param : Error<
8867  "the parameter for this explicitly-defaulted copy "
8868  "%select{constructor|assignment operator}0 is const, but a member or base "
8869  "requires it to be non-const">;
8870def err_defaulted_copy_assign_not_ref : Error<
8871  "the parameter for an explicitly-defaulted copy assignment operator must be an "
8872  "lvalue reference type">;
8873def err_incorrect_defaulted_constexpr : Error<
8874  "defaulted definition of %sub{select_special_member_kind}0 "
8875  "is not constexpr">;
8876def err_incorrect_defaulted_consteval : Error<
8877  "defaulted declaration of %sub{select_special_member_kind}0 "
8878  "cannot be consteval because implicit definition is not constexpr">;
8879def warn_defaulted_method_deleted : Warning<
8880  "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
8881  "deleted">, InGroup<DefaultedFunctionDeleted>;
8882def err_out_of_line_default_deletes : Error<
8883  "defaulting this %sub{select_special_member_kind}0 "
8884  "would delete it after its first declaration">;
8885def note_deleted_type_mismatch : Note<
8886  "function is implicitly deleted because its declared type does not match "
8887  "the type of an implicit %sub{select_special_member_kind}0">;
8888def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
8889  "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
8890  "different from the implicit type is incompatible with C++ standards before "
8891  "C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8892def warn_vbase_moved_multiple_times : Warning<
8893  "defaulted move assignment operator of %0 will move assign virtual base "
8894  "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
8895def note_vbase_moved_here : Note<
8896  "%select{%1 is a virtual base class of base class %2 declared here|"
8897  "virtual base class %1 declared here}0">;
8898
8899// C++20 defaulted comparisons
8900// This corresponds to values of Sema::DefaultedComparisonKind.
8901def select_defaulted_comparison_kind : TextSubstitution<
8902  "%select{<ERROR>|equality|three-way|equality|relational}0 comparison "
8903  "operator">;
8904def ext_defaulted_comparison : ExtWarn<
8905  "defaulted comparison operators are a C++20 extension">, InGroup<CXX20>;
8906def warn_cxx17_compat_defaulted_comparison : Warning<
8907  "defaulted comparison operators are incompatible with C++ standards "
8908  "before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
8909def err_defaulted_comparison_template : Error<
8910  "comparison operator template cannot be defaulted">;
8911def err_defaulted_comparison_out_of_class : Error<
8912  "%sub{select_defaulted_comparison_kind}0 can only be defaulted in a class "
8913  "definition">;
8914def err_defaulted_comparison_param : Error<
8915  "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0"
8916  "; found %1, expected %2%select{| or %4}3">;
8917def err_defaulted_comparison_param_mismatch : Error<
8918  "parameters for defaulted %sub{select_defaulted_comparison_kind}0 "
8919  "must have the same type%diff{ (found $ vs $)|}1,2">;
8920def err_defaulted_comparison_non_const : Error<
8921  "defaulted member %sub{select_defaulted_comparison_kind}0 must be "
8922  "const-qualified">;
8923def err_defaulted_comparison_return_type_not_bool : Error<
8924  "return type for defaulted %sub{select_defaulted_comparison_kind}0 "
8925  "must be 'bool', not %1">;
8926def err_defaulted_comparison_deduced_return_type_not_auto : Error<
8927  "deduced return type for defaulted %sub{select_defaulted_comparison_kind}0 "
8928  "must be 'auto', not %1">;
8929def warn_defaulted_comparison_deleted : Warning<
8930  "explicitly defaulted %sub{select_defaulted_comparison_kind}0 is implicitly "
8931  "deleted">, InGroup<DefaultedFunctionDeleted>;
8932def err_non_first_default_compare_deletes : Error<
8933  "defaulting %select{this %sub{select_defaulted_comparison_kind}1|"
8934  "the corresponding implicit 'operator==' for this defaulted 'operator<=>'}0 "
8935  "would delete it after its first declaration">;
8936def note_defaulted_comparison_union : Note<
8937  "defaulted %0 is implicitly deleted because "
8938  "%2 is a %select{union-like class|union}1 with variant members">;
8939def note_defaulted_comparison_reference_member : Note<
8940  "defaulted %0 is implicitly deleted because "
8941  "class %1 has a reference member">;
8942def note_defaulted_comparison_ambiguous : Note<
8943  "defaulted %0 is implicitly deleted because implied %select{|'==' |'<' }1"
8944  "comparison %select{|for member %3 |for base class %3 }2is ambiguous">;
8945def note_defaulted_comparison_inaccessible : Note<
8946  "defaulted %0 is implicitly deleted because it would invoke a "
8947  "%select{private|protected}3 %4%select{ member of %6|"
8948  " member of %6 to compare member %2| to compare base class %2}1">;
8949def note_defaulted_comparison_calls_deleted : Note<
8950  "defaulted %0 is implicitly deleted because it would invoke a deleted "
8951  "comparison function%select{| for member %2| for base class %2}1">;
8952def note_defaulted_comparison_no_viable_function : Note<
8953  "defaulted %0 is implicitly deleted because there is no viable comparison "
8954  "function%select{| for member %2| for base class %2}1">;
8955def note_defaulted_comparison_no_viable_function_synthesized : Note<
8956  "three-way comparison cannot be synthesized because there is no viable "
8957  "function for %select{'=='|'<'}0 comparison">;
8958def note_defaulted_comparison_not_rewritten_callee : Note<
8959  "defaulted %0 is implicitly deleted because this non-rewritten comparison "
8960  "function would be the best match for the comparison">;
8961def note_defaulted_comparison_cannot_deduce : Note<
8962  "return type of defaulted 'operator<=>' cannot be deduced because "
8963  "return type %2 of three-way comparison for %select{|member|base class}0 %1 "
8964  "is not a standard comparison category type">;
8965def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error<
8966  "return type of defaulted 'operator<=>' cannot be deduced because "
8967  "three-way comparison for %select{|member|base class}0 %1 "
8968  "has a deduced return type and is not yet defined">;
8969def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
8970  "%select{|member|base class}0 %1 declared here">;
8971def note_defaulted_comparison_cannot_deduce_callee : Note<
8972  "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
8973def err_incorrect_defaulted_comparison_constexpr : Error<
8974  "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
8975  "three-way comparison operator}0 "
8976  "cannot be declared %select{constexpr|consteval}2 because "
8977  "%select{it|the corresponding implicit 'operator=='}0 "
8978  "invokes a non-constexpr comparison function">;
8979def note_defaulted_comparison_not_constexpr : Note<
8980  "non-constexpr comparison function would be used to compare "
8981  "%select{|member %1|base class %1}0">;
8982def note_defaulted_comparison_not_constexpr_here : Note<
8983  "non-constexpr comparison function declared here">;
8984def note_in_declaration_of_implicit_equality_comparison : Note<
8985  "while declaring the corresponding implicit 'operator==' "
8986  "for this defaulted 'operator<=>'">;
8987
8988def ext_implicit_exception_spec_mismatch : ExtWarn<
8989  "function previously declared with an %select{explicit|implicit}0 exception "
8990  "specification redeclared with an %select{implicit|explicit}0 exception "
8991  "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
8992
8993def warn_ptr_arith_precedes_bounds : Warning<
8994  "the pointer decremented by %0 refers before the beginning of the array">,
8995  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
8996def warn_ptr_arith_exceeds_bounds : Warning<
8997  "the pointer incremented by %0 refers past the end of the array (that "
8998  "contains %1 element%s2)">,
8999  InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
9000def warn_array_index_precedes_bounds : Warning<
9001  "array index %0 is before the beginning of the array">,
9002  InGroup<ArrayBounds>;
9003def warn_array_index_exceeds_bounds : Warning<
9004  "array index %0 is past the end of the array (which contains %1 "
9005  "element%s2)">, InGroup<ArrayBounds>;
9006def note_array_declared_here : Note<
9007  "array %0 declared here">;
9008
9009def warn_printf_insufficient_data_args : Warning<
9010  "more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
9011def warn_printf_data_arg_not_used : Warning<
9012  "data argument not used by format string">, InGroup<FormatExtraArgs>;
9013def warn_format_invalid_conversion : Warning<
9014  "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
9015def warn_printf_incomplete_specifier : Warning<
9016  "incomplete format specifier">, InGroup<Format>;
9017def warn_missing_format_string : Warning<
9018  "format string missing">, InGroup<Format>;
9019def warn_scanf_nonzero_width : Warning<
9020  "zero field width in scanf format string is unused">,
9021  InGroup<Format>;
9022def warn_format_conversion_argument_type_mismatch : Warning<
9023  "format specifies type %0 but the argument has "
9024  "%select{type|underlying type}2 %1">,
9025  InGroup<Format>;
9026def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
9027  warn_format_conversion_argument_type_mismatch.Text>,
9028  InGroup<FormatPedantic>;
9029def warn_format_conversion_argument_type_mismatch_confusion : Warning<
9030  warn_format_conversion_argument_type_mismatch.Text>,
9031  InGroup<FormatTypeConfusion>, DefaultIgnore;
9032def warn_format_argument_needs_cast : Warning<
9033  "%select{values of type|enum values with underlying type}2 '%0' should not "
9034  "be used as format arguments; add an explicit cast to %1 instead">,
9035  InGroup<Format>;
9036def warn_format_argument_needs_cast_pedantic : Warning<
9037  warn_format_argument_needs_cast.Text>,
9038  InGroup<FormatPedantic>, DefaultIgnore;
9039def warn_printf_positional_arg_exceeds_data_args : Warning <
9040  "data argument position '%0' exceeds the number of data arguments (%1)">,
9041  InGroup<Format>;
9042def warn_format_zero_positional_specifier : Warning<
9043  "position arguments in format strings start counting at 1 (not 0)">,
9044  InGroup<Format>;
9045def warn_format_invalid_positional_specifier : Warning<
9046  "invalid position specified for %select{field width|field precision}0">,
9047  InGroup<Format>;
9048def warn_format_mix_positional_nonpositional_args : Warning<
9049  "cannot mix positional and non-positional arguments in format string">,
9050  InGroup<Format>;
9051def warn_static_array_too_small : Warning<
9052  "array argument is too small; %select{contains %0 elements|is of size %0}2,"
9053  " callee requires at least %1">,
9054  InGroup<ArrayBounds>;
9055def note_callee_static_array : Note<
9056  "callee declares array parameter as static here">;
9057def warn_empty_format_string : Warning<
9058  "format string is empty">, InGroup<FormatZeroLength>;
9059def warn_format_string_is_wide_literal : Warning<
9060  "format string should not be a wide string">, InGroup<Format>;
9061def warn_printf_format_string_contains_null_char : Warning<
9062  "format string contains '\\0' within the string body">, InGroup<Format>;
9063def warn_printf_format_string_not_null_terminated : Warning<
9064  "format string is not null-terminated">, InGroup<Format>;
9065def warn_printf_asterisk_missing_arg : Warning<
9066  "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
9067  InGroup<Format>;
9068def warn_printf_asterisk_wrong_type : Warning<
9069  "field %select{width|precision}0 should have type %1, but argument has type %2">,
9070  InGroup<Format>;
9071def warn_printf_nonsensical_optional_amount: Warning<
9072  "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
9073  InGroup<Format>;
9074def warn_printf_nonsensical_flag: Warning<
9075  "flag '%0' results in undefined behavior with '%1' conversion specifier">,
9076  InGroup<Format>;
9077def warn_format_nonsensical_length: Warning<
9078  "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
9079  InGroup<Format>;
9080def warn_format_non_standard_positional_arg: Warning<
9081  "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
9082def warn_format_non_standard: Warning<
9083  "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
9084  InGroup<FormatNonStandard>, DefaultIgnore;
9085def warn_format_non_standard_conversion_spec: Warning<
9086  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
9087  InGroup<FormatNonStandard>, DefaultIgnore;
9088def err_invalid_mask_type_size : Error<
9089  "mask type size must be between 1-byte and 8-bytes">;
9090def warn_format_invalid_annotation : Warning<
9091  "using '%0' format specifier annotation outside of os_log()/os_trace()">,
9092  InGroup<Format>;
9093def warn_format_P_no_precision : Warning<
9094  "using '%%P' format specifier without precision">,
9095  InGroup<Format>;
9096def warn_printf_ignored_flag: Warning<
9097  "flag '%0' is ignored when flag '%1' is present">,
9098  InGroup<Format>;
9099def warn_printf_empty_objc_flag: Warning<
9100  "missing object format flag">,
9101  InGroup<Format>;
9102def warn_printf_ObjCflags_without_ObjCConversion: Warning<
9103  "object format flags cannot be used with '%0' conversion specifier">,
9104  InGroup<Format>;
9105def warn_printf_invalid_objc_flag: Warning<
9106    "'%0' is not a valid object format flag">,
9107    InGroup<Format>;
9108def warn_scanf_scanlist_incomplete : Warning<
9109  "no closing ']' for '%%[' in scanf format string">,
9110  InGroup<Format>;
9111def warn_format_bool_as_character : Warning<
9112  "using '%0' format specifier, but argument has boolean value">,
9113  InGroup<Format>;
9114def note_format_string_defined : Note<"format string is defined here">;
9115def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
9116def note_printf_c_str: Note<"did you mean to call the %0 method?">;
9117def note_format_security_fixit: Note<
9118  "treat the string as an argument to avoid this">;
9119
9120def warn_null_arg : Warning<
9121  "null passed to a callee that requires a non-null argument">,
9122  InGroup<NonNull>;
9123def warn_null_ret : Warning<
9124  "null returned from %select{function|method}0 that requires a non-null return value">,
9125  InGroup<NonNull>;
9126
9127def err_lifetimebound_no_object_param : Error<
9128  "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
9129  "function has no implicit object parameter">;
9130def err_lifetimebound_ctor_dtor : Error<
9131  "'lifetimebound' attribute cannot be applied to a "
9132  "%select{constructor|destructor}0">;
9133
9134// CHECK: returning address/reference of stack memory
9135def warn_ret_stack_addr_ref : Warning<
9136  "%select{address of|reference to}0 stack memory associated with "
9137  "%select{local variable|parameter}2 %1 returned">,
9138  InGroup<ReturnStackAddress>;
9139def warn_ret_local_temp_addr_ref : Warning<
9140  "returning %select{address of|reference to}0 local temporary object">,
9141  InGroup<ReturnStackAddress>;
9142def warn_ret_addr_label : Warning<
9143  "returning address of label, which is local">,
9144  InGroup<ReturnStackAddress>;
9145def err_ret_local_block : Error<
9146  "returning block that lives on the local stack">;
9147def note_local_var_initializer : Note<
9148  "%select{via initialization of|binding reference}0 variable "
9149  "%select{%2 |}1here">;
9150def note_lambda_capture_initializer : Note<
9151  "%select{implicitly |}2captured%select{| by reference}3"
9152  "%select{%select{ due to use|}2 here|"
9153  " via initialization of lambda capture %0}1">;
9154def note_init_with_default_member_initalizer : Note<
9155  "initializing field %0 with default member initializer">;
9156
9157// Check for initializing a member variable with the address or a reference to
9158// a constructor parameter.
9159def warn_bind_ref_member_to_parameter : Warning<
9160  "binding reference member %0 to stack allocated "
9161  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9162def warn_init_ptr_member_to_parameter_addr : Warning<
9163  "initializing pointer member %0 with the stack address of "
9164  "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
9165def note_ref_or_ptr_member_declared_here : Note<
9166  "%select{reference|pointer}0 member declared here">;
9167
9168def err_dangling_member : Error<
9169  "%select{reference|backing array for 'std::initializer_list'}2 "
9170  "%select{|subobject of }1member %0 "
9171  "%select{binds to|is}2 a temporary object "
9172  "whose lifetime would be shorter than the lifetime of "
9173  "the constructed object">;
9174def warn_dangling_member : Warning<
9175  "%select{reference|backing array for 'std::initializer_list'}2 "
9176  "%select{|subobject of }1member %0 "
9177  "%select{binds to|is}2 a temporary object "
9178  "whose lifetime is shorter than the lifetime of the constructed object">,
9179  InGroup<DanglingField>;
9180def warn_dangling_lifetime_pointer_member : Warning<
9181  "initializing pointer member %0 to point to a temporary object "
9182  "whose lifetime is shorter than the lifetime of the constructed object">,
9183  InGroup<DanglingGsl>;
9184def note_lifetime_extending_member_declared_here : Note<
9185  "%select{%select{reference|'std::initializer_list'}0 member|"
9186  "member with %select{reference|'std::initializer_list'}0 subobject}1 "
9187  "declared here">;
9188def warn_dangling_variable : Warning<
9189  "%select{temporary %select{whose address is used as value of|"
9190  "%select{|implicitly }2bound to}4 "
9191  "%select{%select{|reference }4member of local variable|"
9192  "local %select{variable|reference}4}1|"
9193  "array backing "
9194  "%select{initializer list subobject of local variable|"
9195  "local initializer list}1}0 "
9196  "%select{%3 |}2will be destroyed at the end of the full-expression">,
9197  InGroup<Dangling>;
9198def warn_new_dangling_reference : Warning<
9199  "temporary bound to reference member of allocated object "
9200  "will be destroyed at the end of the full-expression">,
9201  InGroup<DanglingField>;
9202def warn_dangling_lifetime_pointer : Warning<
9203  "object backing the pointer "
9204  "will be destroyed at the end of the full-expression">,
9205  InGroup<DanglingGsl>;
9206def warn_new_dangling_initializer_list : Warning<
9207  "array backing "
9208  "%select{initializer list subobject of the allocated object|"
9209  "the allocated initializer list}0 "
9210  "will be destroyed at the end of the full-expression">,
9211  InGroup<DanglingInitializerList>;
9212def warn_unsupported_lifetime_extension : Warning<
9213  "sorry, lifetime extension of "
9214  "%select{temporary|backing array of initializer list}0 created "
9215  "by aggregate initialization using default member initializer "
9216  "is not supported; lifetime of %select{temporary|backing array}0 "
9217  "will end at the end of the full-expression">, InGroup<Dangling>;
9218
9219// For non-floating point, expressions of the form x == x or x != x
9220// should result in a warning, since these always evaluate to a constant.
9221// Array comparisons have similar warnings
9222def warn_comparison_always : Warning<
9223  "%select{self-|array }0comparison always evaluates to "
9224  "%select{a constant|true|false|'std::strong_ordering::equal'}1">,
9225  InGroup<TautologicalCompare>;
9226def warn_comparison_bitwise_always : Warning<
9227  "bitwise comparison always evaluates to %select{false|true}0">,
9228  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9229def warn_comparison_bitwise_or : Warning<
9230  "bitwise or with non-zero value always evaluates to true">,
9231  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
9232def warn_tautological_overlap_comparison : Warning<
9233  "overlapping comparisons always evaluate to %select{false|true}0">,
9234  InGroup<TautologicalOverlapCompare>, DefaultIgnore;
9235def warn_depr_array_comparison : Warning<
9236  "comparison between two arrays is deprecated; "
9237  "to compare array addresses, use unary '+' to decay operands to pointers">,
9238  InGroup<DeprecatedArrayCompare>;
9239
9240def warn_stringcompare : Warning<
9241  "result of comparison against %select{a string literal|@encode}0 is "
9242  "unspecified (use an explicit string comparison function instead)">,
9243  InGroup<StringCompare>;
9244
9245def warn_identity_field_assign : Warning<
9246  "assigning %select{field|instance variable}0 to itself">,
9247  InGroup<SelfAssignmentField>;
9248
9249// Type safety attributes
9250def err_type_tag_for_datatype_not_ice : Error<
9251  "'type_tag_for_datatype' attribute requires the initializer to be "
9252  "an %select{integer|integral}0 constant expression">;
9253def err_type_tag_for_datatype_too_large : Error<
9254  "'type_tag_for_datatype' attribute requires the initializer to be "
9255  "an %select{integer|integral}0 constant expression "
9256  "that can be represented by a 64 bit integer">;
9257def err_tag_index_out_of_range : Error<
9258  "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
9259def warn_type_tag_for_datatype_wrong_kind : Warning<
9260  "this type tag was not designed to be used with this function">,
9261  InGroup<TypeSafety>;
9262def warn_type_safety_type_mismatch : Warning<
9263  "argument type %0 doesn't match specified %1 type tag "
9264  "%select{that requires %3|}2">, InGroup<TypeSafety>;
9265def warn_type_safety_null_pointer_required : Warning<
9266  "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
9267
9268// Generic selections.
9269def err_assoc_type_incomplete : Error<
9270  "type %0 in generic association incomplete">;
9271def err_assoc_type_nonobject : Error<
9272  "type %0 in generic association not an object type">;
9273def err_assoc_type_variably_modified : Error<
9274  "type %0 in generic association is a variably modified type">;
9275def err_assoc_compatible_types : Error<
9276  "type %0 in generic association compatible with previously specified type %1">;
9277def note_compat_assoc : Note<
9278  "compatible type %0 specified here">;
9279def err_generic_sel_no_match : Error<
9280  "controlling expression type %0 not compatible with any generic association type">;
9281def err_generic_sel_multi_match : Error<
9282  "controlling expression type %0 compatible with %1 generic association types">;
9283
9284
9285// Blocks
9286def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
9287  " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">;
9288def err_block_returning_array_function : Error<
9289  "block cannot return %select{array|function}0 type %1">;
9290
9291// Builtin annotation
9292def err_builtin_annotation_first_arg : Error<
9293  "first argument to __builtin_annotation must be an integer">;
9294def err_builtin_annotation_second_arg : Error<
9295  "second argument to __builtin_annotation must be a non-wide string constant">;
9296def err_msvc_annotation_wide_str : Error<
9297  "arguments to __annotation must be wide string constants">;
9298
9299// CFString checking
9300def err_cfstring_literal_not_string_constant : Error<
9301  "CFString literal is not a string constant">;
9302def warn_cfstring_truncated : Warning<
9303  "input conversion stopped due to an input byte that does not "
9304  "belong to the input codeset UTF-8">,
9305  InGroup<DiagGroup<"CFString-literal">>;
9306
9307// os_log checking
9308// TODO: separate diagnostic for os_trace()
9309def err_os_log_format_not_string_constant : Error<
9310  "os_log() format argument is not a string constant">;
9311def err_os_log_argument_too_big : Error<
9312  "os_log() argument %0 is too big (%1 bytes, max %2)">;
9313def warn_os_log_format_narg : Error<
9314 "os_log() '%%n' format specifier is not allowed">, DefaultError;
9315
9316// Statements.
9317def err_continue_not_in_loop : Error<
9318  "'continue' statement not in loop statement">;
9319def err_break_not_in_loop_or_switch : Error<
9320  "'break' statement not in loop or switch statement">;
9321def warn_loop_ctrl_binds_to_inner : Warning<
9322  "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
9323  InGroup<GccCompat>;
9324def warn_break_binds_to_switch : Warning<
9325  "'break' is bound to loop, GCC binds it to switch">,
9326  InGroup<GccCompat>;
9327def err_default_not_in_switch : Error<
9328  "'default' statement not in switch statement">;
9329def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
9330def warn_bool_switch_condition : Warning<
9331  "switch condition has boolean value">, InGroup<SwitchBool>;
9332def warn_case_value_overflow : Warning<
9333  "overflow converting case value to switch condition type (%0 to %1)">,
9334  InGroup<Switch>;
9335def err_duplicate_case : Error<"duplicate case value '%0'">;
9336def err_duplicate_case_differing_expr : Error<
9337  "duplicate case value: '%0' and '%1' both equal '%2'">;
9338def warn_case_empty_range : Warning<"empty case range specified">;
9339def warn_missing_case_for_condition :
9340  Warning<"no case matching constant switch condition '%0'">;
9341
9342def warn_def_missing_case : Warning<"%plural{"
9343  "1:enumeration value %1 not explicitly handled in switch|"
9344  "2:enumeration values %1 and %2 not explicitly handled in switch|"
9345  "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
9346  ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
9347  InGroup<SwitchEnum>, DefaultIgnore;
9348
9349def warn_missing_case : Warning<"%plural{"
9350  "1:enumeration value %1 not handled in switch|"
9351  "2:enumeration values %1 and %2 not handled in switch|"
9352  "3:enumeration values %1, %2, and %3 not handled in switch|"
9353  ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
9354  InGroup<Switch>;
9355
9356def warn_unannotated_fallthrough : Warning<
9357  "unannotated fall-through between switch labels">,
9358  InGroup<ImplicitFallthrough>, DefaultIgnore;
9359def warn_unannotated_fallthrough_per_function : Warning<
9360  "unannotated fall-through between switch labels in partly-annotated "
9361  "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
9362def note_insert_fallthrough_fixit : Note<
9363  "insert '%0;' to silence this warning">;
9364def note_insert_break_fixit : Note<
9365  "insert 'break;' to avoid fall-through">;
9366def err_fallthrough_attr_wrong_target : Error<
9367  "%0 attribute is only allowed on empty statements">;
9368def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
9369def err_fallthrough_attr_outside_switch : Error<
9370  "fallthrough annotation is outside switch statement">;
9371def err_fallthrough_attr_invalid_placement : Error<
9372  "fallthrough annotation does not directly precede switch label">;
9373def warn_fallthrough_attr_unreachable : Warning<
9374  "fallthrough annotation in unreachable code">,
9375  InGroup<ImplicitFallthrough>, DefaultIgnore;
9376
9377def warn_unreachable_default : Warning<
9378  "default label in switch which covers all enumeration values">,
9379  InGroup<CoveredSwitchDefault>, DefaultIgnore;
9380def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
9381  InGroup<Switch>;
9382def warn_not_in_enum_assignment : Warning<"integer constant not in range "
9383  "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
9384def err_typecheck_statement_requires_scalar : Error<
9385  "statement requires expression of scalar type (%0 invalid)">;
9386def err_typecheck_statement_requires_integer : Error<
9387  "statement requires expression of integer type (%0 invalid)">;
9388def err_multiple_default_labels_defined : Error<
9389  "multiple default labels in one switch">;
9390def err_switch_multiple_conversions : Error<
9391  "multiple conversions from switch condition type %0 to an integral or "
9392  "enumeration type">;
9393def note_switch_conversion : Note<
9394  "conversion to %select{integral|enumeration}0 type %1">;
9395def err_switch_explicit_conversion : Error<
9396  "switch condition type %0 requires explicit conversion to %1">;
9397def err_switch_incomplete_class_type : Error<
9398  "switch condition has incomplete class type %0">;
9399
9400def warn_empty_if_body : Warning<
9401  "if statement has empty body">, InGroup<EmptyBody>;
9402def warn_empty_for_body : Warning<
9403  "for loop has empty body">, InGroup<EmptyBody>;
9404def warn_empty_range_based_for_body : Warning<
9405  "range-based for loop has empty body">, InGroup<EmptyBody>;
9406def warn_empty_while_body : Warning<
9407  "while loop has empty body">, InGroup<EmptyBody>;
9408def warn_empty_switch_body : Warning<
9409  "switch statement has empty body">, InGroup<EmptyBody>;
9410def note_empty_body_on_separate_line : Note<
9411  "put the semicolon on a separate line to silence this warning">;
9412
9413def err_va_start_captured_stmt : Error<
9414  "'va_start' cannot be used in a captured statement">;
9415def err_va_start_outside_function : Error<
9416  "'va_start' cannot be used outside a function">;
9417def err_va_start_fixed_function : Error<
9418  "'va_start' used in function with fixed args">;
9419def err_va_start_used_in_wrong_abi_function : Error<
9420  "'va_start' used in %select{System V|Win64}0 ABI function">;
9421def err_ms_va_start_used_in_sysv_function : Error<
9422  "'__builtin_ms_va_start' used in System V ABI function">;
9423def warn_second_arg_of_va_start_not_last_named_param : Warning<
9424  "second argument to 'va_start' is not the last named parameter">,
9425  InGroup<Varargs>;
9426def warn_va_start_type_is_undefined : Warning<
9427  "passing %select{an object that undergoes default argument promotion|"
9428  "an object of reference type|a parameter declared with the 'register' "
9429  "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
9430def err_first_argument_to_va_arg_not_of_type_va_list : Error<
9431  "first argument to 'va_arg' is of type %0 and not 'va_list'">;
9432def err_second_parameter_to_va_arg_incomplete: Error<
9433  "second argument to 'va_arg' is of incomplete type %0">;
9434def err_second_parameter_to_va_arg_abstract: Error<
9435  "second argument to 'va_arg' is of abstract type %0">;
9436def warn_second_parameter_to_va_arg_not_pod : Warning<
9437  "second argument to 'va_arg' is of non-POD type %0">,
9438  InGroup<NonPODVarargs>, DefaultError;
9439def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
9440  "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
9441  InGroup<NonPODVarargs>, DefaultError;
9442def warn_second_parameter_to_va_arg_never_compatible : Warning<
9443  "second argument to 'va_arg' is of promotable type %0; this va_arg has "
9444  "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
9445
9446def warn_return_missing_expr : Warning<
9447  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9448  InGroup<ReturnType>;
9449def ext_return_missing_expr : ExtWarn<
9450  "non-void %select{function|method}1 %0 should return a value">, DefaultError,
9451  InGroup<ReturnType>;
9452def ext_return_has_expr : ExtWarn<
9453  "%select{void function|void method|constructor|destructor}1 %0 "
9454  "should not return a value">,
9455  DefaultError, InGroup<ReturnType>;
9456def ext_return_has_void_expr : Extension<
9457  "void %select{function|method|block}1 %0 should not return void expression">;
9458def err_return_init_list : Error<
9459  "%select{void function|void method|constructor|destructor}1 %0 "
9460  "must not return a value">;
9461def err_ctor_dtor_returns_void : Error<
9462  "%select{constructor|destructor}1 %0 must not return void expression">;
9463def warn_noreturn_function_has_return_expr : Warning<
9464  "function %0 declared 'noreturn' should not return">,
9465  InGroup<InvalidNoreturn>;
9466def warn_falloff_noreturn_function : Warning<
9467  "function declared 'noreturn' should not return">,
9468  InGroup<InvalidNoreturn>;
9469def err_noreturn_block_has_return_expr : Error<
9470  "block declared 'noreturn' should not return">;
9471def err_noreturn_missing_on_first_decl : Error<
9472  "function declared '[[noreturn]]' after its first declaration">;
9473def note_noreturn_missing_first_decl : Note<
9474  "declaration missing '[[noreturn]]' attribute is here">;
9475def err_carries_dependency_missing_on_first_decl : Error<
9476  "%select{function|parameter}0 declared '[[carries_dependency]]' "
9477  "after its first declaration">;
9478def note_carries_dependency_missing_first_decl : Note<
9479  "declaration missing '[[carries_dependency]]' attribute is here">;
9480def err_carries_dependency_param_not_function_decl : Error<
9481  "'[[carries_dependency]]' attribute only allowed on parameter in a function "
9482  "declaration or lambda">;
9483def err_block_on_nonlocal : Error<
9484  "__block attribute not allowed, only allowed on local variables">;
9485def err_block_on_vm : Error<
9486  "__block attribute not allowed on declaration with a variably modified type">;
9487def err_sizeless_nonlocal : Error<
9488  "non-local variable with sizeless type %0">;
9489
9490def err_vec_builtin_non_vector : Error<
9491 "first two arguments to %0 must be vectors">;
9492def err_vec_builtin_incompatible_vector : Error<
9493  "first two arguments to %0 must have the same type">;
9494def err_vsx_builtin_nonconstant_argument : Error<
9495  "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
9496
9497def err_shufflevector_nonconstant_argument : Error<
9498  "index for __builtin_shufflevector must be a constant integer">;
9499def err_shufflevector_argument_too_large : Error<
9500  "index for __builtin_shufflevector must be less than the total number "
9501  "of vector elements">;
9502
9503def err_convertvector_non_vector : Error<
9504  "first argument to __builtin_convertvector must be a vector">;
9505def err_convertvector_non_vector_type : Error<
9506  "second argument to __builtin_convertvector must be a vector type">;
9507def err_convertvector_incompatible_vector : Error<
9508  "first two arguments to __builtin_convertvector must have the same number of elements">;
9509
9510def err_first_argument_to_cwsc_not_call : Error<
9511  "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
9512def err_first_argument_to_cwsc_block_call : Error<
9513  "first argument to __builtin_call_with_static_chain must not be a block call">;
9514def err_first_argument_to_cwsc_builtin_call : Error<
9515  "first argument to __builtin_call_with_static_chain must not be a builtin call">;
9516def err_first_argument_to_cwsc_pdtor_call : Error<
9517  "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
9518def err_second_argument_to_cwsc_not_pointer : Error<
9519  "second argument to __builtin_call_with_static_chain must be of pointer type">;
9520
9521def err_vector_incorrect_num_initializers : Error<
9522  "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
9523def err_altivec_empty_initializer : Error<"expected initializer">;
9524
9525def err_invalid_neon_type_code : Error<
9526  "incompatible constant for this __builtin_neon function">;
9527def err_argument_invalid_range : Error<
9528  "argument value %0 is outside the valid range [%1, %2]">;
9529def warn_argument_invalid_range : Warning<
9530  "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
9531  InGroup<DiagGroup<"argument-outside-range">>;
9532def err_argument_not_multiple : Error<
9533  "argument should be a multiple of %0">;
9534def err_argument_not_power_of_2 : Error<
9535  "argument should be a power of 2">;
9536def err_argument_not_shifted_byte : Error<
9537  "argument should be an 8-bit value shifted by a multiple of 8 bits">;
9538def err_argument_not_shifted_byte_or_xxff : Error<
9539  "argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9540def err_rotation_argument_to_cadd
9541    : Error<"argument should be the value 90 or 270">;
9542def err_rotation_argument_to_cmla
9543    : Error<"argument should be the value 0, 90, 180 or 270">;
9544def warn_neon_vector_initializer_non_portable : Warning<
9545  "vector initializers are not compatible with NEON intrinsics in big endian "
9546  "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
9547def note_neon_vector_initializer_non_portable : Note<
9548  "consider using vld1_%0%1() to initialize a vector from memory, or "
9549  "vcreate_%0%1() to initialize from an integer constant">;
9550def note_neon_vector_initializer_non_portable_q : Note<
9551  "consider using vld1q_%0%1() to initialize a vector from memory, or "
9552  "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
9553  "constants">;
9554def err_systemz_invalid_tabort_code : Error<
9555  "invalid transaction abort code">;
9556def err_64_bit_builtin_32_bit_tgt : Error<
9557  "this builtin is only available on 64-bit targets">;
9558def err_32_bit_builtin_64_bit_tgt : Error<
9559  "this builtin is only available on 32-bit targets">;
9560def err_builtin_x64_aarch64_only : Error<
9561  "this builtin is only available on x86-64 and aarch64 targets">;
9562def err_mips_builtin_requires_dsp : Error<
9563  "this builtin requires 'dsp' ASE, please use -mdsp">;
9564def err_mips_builtin_requires_dspr2 : Error<
9565  "this builtin requires 'dsp r2' ASE, please use -mdspr2">;
9566def err_mips_builtin_requires_msa : Error<
9567  "this builtin requires 'msa' ASE, please use -mmsa">;
9568def err_ppc_builtin_only_on_pwr7 : Error<
9569  "this builtin is only valid on POWER7 or later CPUs">;
9570def err_ppc_invalid_use_mma_type : Error<
9571  "invalid use of PPC MMA type">;
9572def err_x86_builtin_invalid_rounding : Error<
9573  "invalid rounding argument">;
9574def err_x86_builtin_invalid_scale : Error<
9575  "scale argument must be 1, 2, 4, or 8">;
9576def err_x86_builtin_tile_arg_duplicate : Error<
9577  "tile arguments must refer to different tiles">;
9578
9579def err_builtin_target_unsupported : Error<
9580  "builtin is not supported on this target">;
9581def err_builtin_longjmp_unsupported : Error<
9582  "__builtin_longjmp is not supported for the current target">;
9583def err_builtin_setjmp_unsupported : Error<
9584  "__builtin_setjmp is not supported for the current target">;
9585
9586def err_builtin_longjmp_invalid_val : Error<
9587  "argument to __builtin_longjmp must be a constant 1">;
9588def err_builtin_requires_language : Error<"'%0' is only available in %1">;
9589
9590def err_constant_integer_arg_type : Error<
9591  "argument to %0 must be a constant integer">;
9592
9593def ext_mixed_decls_code : Extension<
9594  "ISO C90 forbids mixing declarations and code">,
9595  InGroup<DiagGroup<"declaration-after-statement">>;
9596
9597def err_non_local_variable_decl_in_for : Error<
9598  "declaration of non-local variable in 'for' loop">;
9599def err_non_variable_decl_in_for : Error<
9600  "non-variable declaration in 'for' loop">;
9601def err_toomany_element_decls : Error<
9602  "only one element declaration is allowed">;
9603def err_selector_element_not_lvalue : Error<
9604  "selector element is not a valid lvalue">;
9605def err_selector_element_type : Error<
9606  "selector element type %0 is not a valid object">;
9607def err_selector_element_const_type : Error<
9608  "selector element of type %0 cannot be a constant lvalue expression">;
9609def err_collection_expr_type : Error<
9610  "the type %0 is not a pointer to a fast-enumerable object">;
9611def warn_collection_expr_type : Warning<
9612  "collection expression type %0 may not respond to %1">;
9613
9614def err_invalid_conversion_between_ext_vectors : Error<
9615  "invalid conversion between ext-vector type %0 and %1">;
9616
9617def warn_duplicate_attribute_exact : Warning<
9618  "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
9619
9620def warn_duplicate_attribute : Warning<
9621  "attribute %0 is already applied with different parameters">,
9622  InGroup<IgnoredAttributes>;
9623
9624def warn_sync_fetch_and_nand_semantics_change : Warning<
9625  "the semantics of this intrinsic changed with GCC "
9626  "version 4.4 - the newer semantics are provided here">,
9627  InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
9628
9629// Type
9630def ext_wchar_t_sign_spec : ExtWarn<"'%0' cannot be signed or unsigned">,
9631  InGroup<DiagGroup<"signed-unsigned-wchar">>, DefaultError;
9632def warn_receiver_forward_class : Warning<
9633  "receiver %0 is a forward class and corresponding @interface may not exist">,
9634  InGroup<ForwardClassReceiver>;
9635def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
9636def ext_missing_declspec : ExtWarn<
9637  "declaration specifier missing, defaulting to 'int'">;
9638def ext_missing_type_specifier : ExtWarn<
9639  "type specifier missing, defaults to 'int'">,
9640  InGroup<ImplicitInt>;
9641def err_decimal_unsupported : Error<
9642  "GNU decimal type extension not supported">;
9643def err_missing_type_specifier : Error<
9644  "C++ requires a type specifier for all declarations">;
9645def err_objc_array_of_interfaces : Error<
9646  "array of interface %0 is invalid (probably should be an array of pointers)">;
9647def ext_c99_array_usage : Extension<
9648  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9649  "feature">, InGroup<C99>;
9650def err_c99_array_usage_cxx : Error<
9651  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
9652  "feature, not permitted in C++">;
9653def err_type_unsupported : Error<
9654  "%0 is not supported on this target">;
9655def err_nsconsumed_attribute_mismatch : Error<
9656  "overriding method has mismatched ns_consumed attribute on its"
9657  " parameter">;
9658def err_nsreturns_retained_attribute_mismatch : Error<
9659  "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
9660  " attributes">;
9661def err_nserrordomain_invalid_decl : Error<
9662  "domain argument %select{|%1 }0does not refer to global constant">;
9663def err_nserrordomain_wrong_type : Error<
9664  "domain argument %0 does not point to an NSString or CFString constant">;
9665
9666def warn_nsconsumed_attribute_mismatch : Warning<
9667  err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
9668def warn_nsreturns_retained_attribute_mismatch : Warning<
9669  err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
9670
9671def note_getter_unavailable : Note<
9672  "or because setter is declared here, but no getter method %0 is found">;
9673def err_invalid_protocol_qualifiers : Error<
9674  "invalid protocol qualifiers on non-ObjC type">;
9675def warn_ivar_use_hidden : Warning<
9676  "local declaration of %0 hides instance variable">,
9677   InGroup<ShadowIvar>;
9678def warn_direct_initialize_call : Warning<
9679  "explicit call to +initialize results in duplicate call to +initialize">,
9680   InGroup<ExplicitInitializeCall>;
9681def warn_direct_super_initialize_call : Warning<
9682  "explicit call to [super initialize] should only be in implementation "
9683  "of +initialize">,
9684   InGroup<ExplicitInitializeCall>;
9685def err_ivar_use_in_class_method : Error<
9686  "instance variable %0 accessed in class method">;
9687def err_private_ivar_access : Error<"instance variable %0 is private">,
9688  AccessControl;
9689def err_protected_ivar_access : Error<"instance variable %0 is protected">,
9690  AccessControl;
9691def warn_maynot_respond : Warning<"%0 may not respond to %1">;
9692def ext_typecheck_base_super : Warning<
9693  "method parameter type "
9694  "%diff{$ does not match super class method parameter type $|"
9695  "does not match super class method parameter type}0,1">,
9696   InGroup<SuperSubClassMismatch>, DefaultIgnore;
9697def warn_missing_method_return_type : Warning<
9698  "method has no return type specified; defaults to 'id'">,
9699  InGroup<MissingMethodReturnType>, DefaultIgnore;
9700def warn_direct_ivar_access : Warning<"instance variable %0 is being "
9701  "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
9702
9703// Spell-checking diagnostics
9704def err_unknown_typename : Error<
9705  "unknown type name %0">;
9706def err_unknown_type_or_class_name_suggest : Error<
9707  "unknown %select{type|class}1 name %0; did you mean %2?">;
9708def err_unknown_typename_suggest : Error<
9709  "unknown type name %0; did you mean %1?">;
9710def err_unknown_nested_typename_suggest : Error<
9711  "no type named %0 in %1; did you mean %select{|simply }2%3?">;
9712def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
9713def err_undeclared_use_suggest : Error<
9714  "use of undeclared %0; did you mean %1?">;
9715def err_undeclared_var_use_suggest : Error<
9716  "use of undeclared identifier %0; did you mean %1?">;
9717def err_no_template : Error<"no template named %0">;
9718def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
9719def err_no_member_template : Error<"no template named %0 in %1">;
9720def err_no_member_template_suggest : Error<
9721  "no template named %0 in %1; did you mean %select{|simply }2%3?">;
9722def err_non_template_in_template_id : Error<
9723  "%0 does not name a template but is followed by template arguments">;
9724def err_non_template_in_template_id_suggest : Error<
9725  "%0 does not name a template but is followed by template arguments; "
9726  "did you mean %1?">;
9727def err_non_template_in_member_template_id_suggest : Error<
9728  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
9729def note_non_template_in_template_id_found : Note<
9730  "non-template declaration found by name lookup">;
9731def err_mem_init_not_member_or_class_suggest : Error<
9732  "initializer %0 does not name a non-static data member or base "
9733  "class; did you mean the %select{base class|member}1 %2?">;
9734def err_field_designator_unknown_suggest : Error<
9735  "field designator %0 does not refer to any field in type %1; did you mean "
9736  "%2?">;
9737def err_typecheck_member_reference_ivar_suggest : Error<
9738  "%0 does not have a member named %1; did you mean %2?">;
9739def err_property_not_found_suggest : Error<
9740  "property %0 not found on object of type %1; did you mean %2?">;
9741def err_class_property_found : Error<
9742  "property %0 is a class property; did you mean to access it with class '%1'?">;
9743def err_ivar_access_using_property_syntax_suggest : Error<
9744  "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
9745def warn_property_access_suggest : Warning<
9746"property %0 not found on object of type %1; did you mean to access property %2?">,
9747InGroup<PropertyAccessDotSyntax>;
9748def err_property_found_suggest : Error<
9749  "property %0 found on object of type %1; did you mean to access "
9750  "it with the \".\" operator?">;
9751def err_undef_interface_suggest : Error<
9752  "cannot find interface declaration for %0; did you mean %1?">;
9753def warn_undef_interface_suggest : Warning<
9754  "cannot find interface declaration for %0; did you mean %1?">;
9755def err_undef_superclass_suggest : Error<
9756  "cannot find interface declaration for %0, superclass of %1; did you mean "
9757  "%2?">;
9758def err_undeclared_protocol_suggest : Error<
9759  "cannot find protocol declaration for %0; did you mean %1?">;
9760def note_base_class_specified_here : Note<
9761  "base class %0 specified here">;
9762def err_using_directive_suggest : Error<
9763  "no namespace named %0; did you mean %1?">;
9764def err_using_directive_member_suggest : Error<
9765  "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
9766def note_namespace_defined_here : Note<"namespace %0 defined here">;
9767def err_sizeof_pack_no_pack_name_suggest : Error<
9768  "%0 does not refer to the name of a parameter pack; did you mean %1?">;
9769def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
9770
9771def err_uncasted_use_of_unknown_any : Error<
9772  "%0 has unknown type; cast it to its declared type to use it">;
9773def err_uncasted_call_of_unknown_any : Error<
9774  "%0 has unknown return type; cast the call to its declared return type">;
9775def err_uncasted_send_to_unknown_any_method : Error<
9776  "no known method %select{%objcinstance1|%objcclass1}0; cast the "
9777  "message send to the method's return type">;
9778def err_unsupported_unknown_any_decl : Error<
9779  "%0 has unknown type, which is not supported for this kind of declaration">;
9780def err_unsupported_unknown_any_expr : Error<
9781  "unsupported expression with unknown type">;
9782def err_unsupported_unknown_any_call : Error<
9783  "call to unsupported expression with unknown type">;
9784def err_unknown_any_addrof : Error<
9785  "the address of a declaration with unknown type "
9786  "can only be cast to a pointer type">;
9787def err_unknown_any_addrof_call : Error<
9788  "address-of operator cannot be applied to a call to a function with "
9789  "unknown return type">;
9790def err_unknown_any_var_function_type : Error<
9791  "variable %0 with unknown type cannot be given a function type">;
9792def err_unknown_any_function : Error<
9793  "function %0 with unknown type must be given a function type">;
9794
9795def err_filter_expression_integral : Error<
9796  "filter expression has non-integral type %0">;
9797
9798def err_non_asm_stmt_in_naked_function : Error<
9799  "non-ASM statement in naked function is not supported">;
9800def err_asm_naked_this_ref : Error<
9801  "'this' pointer references not allowed in naked functions">;
9802def err_asm_naked_parm_ref : Error<
9803  "parameter references not allowed in naked functions">;
9804
9805// OpenCL warnings and errors.
9806def err_invalid_astype_of_different_size : Error<
9807  "invalid reinterpretation: sizes of %0 and %1 must match">;
9808def err_static_kernel : Error<
9809  "kernel functions cannot be declared static">;
9810def err_method_kernel : Error<
9811  "kernel functions cannot be class members">;
9812def err_template_kernel : Error<
9813  "kernel functions cannot be used in a template declaration, instantiation or specialization">;
9814def err_opencl_ptrptr_kernel_param : Error<
9815  "kernel parameter cannot be declared as a pointer to a pointer">;
9816def err_kernel_arg_address_space : Error<
9817  "pointer arguments to kernel functions must reside in '__global', "
9818  "'__constant' or '__local' address space">;
9819def err_opencl_ext_vector_component_invalid_length : Error<
9820  "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
9821def err_opencl_function_variable : Error<
9822  "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
9823def err_opencl_addrspace_scope : Error<
9824  "variables in the %0 address space can only be declared in the outermost "
9825  "scope of a kernel function">;
9826def err_static_function_scope : Error<
9827  "variables in function scope cannot be declared static">;
9828def err_opencl_bitfields : Error<
9829  "bit-fields are not supported in OpenCL">;
9830def err_opencl_vla : Error<
9831  "variable length arrays are not supported in OpenCL">;
9832def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
9833    "scalar operand type has greater rank than the type of the vector "
9834    "element. (%0 and %1)">;
9835def err_bad_kernel_param_type : Error<
9836  "%0 cannot be used as the type of a kernel parameter">;
9837def err_opencl_implicit_function_decl : Error<
9838  "implicit declaration of function %0 is invalid in OpenCL">;
9839def err_record_with_pointers_kernel_param : Error<
9840  "%select{struct|union}0 kernel parameters may not contain pointers">;
9841def note_within_field_of_type : Note<
9842  "within field of type %0 declared here">;
9843def note_illegal_field_declared_here : Note<
9844  "field of illegal %select{type|pointer type}0 %1 declared here">;
9845def err_opencl_type_struct_or_union_field : Error<
9846  "the %0 type cannot be used to declare a structure or union field">;
9847def err_event_t_addr_space_qual : Error<
9848  "the event_t type can only be used with __private address space qualifier">;
9849def err_expected_kernel_void_return_type : Error<
9850  "kernel must have void return type">;
9851def err_sampler_initializer_not_integer : Error<
9852  "sampler_t initialization requires 32-bit integer, not %0">;
9853def warn_sampler_initializer_invalid_bits : Warning<
9854  "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
9855def err_sampler_argument_required : Error<
9856  "sampler_t variable required - got %0">;
9857def err_wrong_sampler_addressspace: Error<
9858  "sampler type cannot be used with the __local and __global address space qualifiers">;
9859def err_opencl_nonconst_global_sampler : Error<
9860  "global sampler requires a const or constant address space qualifier">;
9861def err_opencl_cast_non_zero_to_event_t : Error<
9862  "cannot cast non-zero value '%0' to 'event_t'">;
9863def err_opencl_global_invalid_addr_space : Error<
9864  "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
9865def err_missing_actual_pipe_type : Error<
9866  "missing actual type specifier for pipe">;
9867def err_reference_pipe_type : Error <
9868  "pipes packet types cannot be of reference type">;
9869def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
9870def err_opencl_kernel_attr :
9871  Error<"attribute %0 can only be applied to an OpenCL kernel function">;
9872def err_opencl_return_value_with_address_space : Error<
9873  "return value cannot be qualified with address space">;
9874def err_opencl_constant_no_init : Error<
9875  "variable in constant address space must be initialized">;
9876def err_opencl_atomic_init: Error<
9877  "atomic variable can be %select{assigned|initialized}0 to a variable only "
9878  "in global address space">;
9879def err_opencl_implicit_vector_conversion : Error<
9880  "implicit conversions between vector types (%0 and %1) are not permitted">;
9881def err_opencl_invalid_type_array : Error<
9882  "array of %0 type is invalid in OpenCL">;
9883def err_opencl_ternary_with_block : Error<
9884  "block type cannot be used as expression in ternary expression in OpenCL">;
9885def err_opencl_pointer_to_type : Error<
9886  "pointer to type %0 is invalid in OpenCL">;
9887def err_opencl_type_can_only_be_used_as_function_parameter : Error <
9888  "type %0 can only be used as a function parameter in OpenCL">;
9889def warn_opencl_attr_deprecated_ignored : Warning <
9890  "%0 attribute is deprecated and ignored in OpenCL version %1">,
9891  InGroup<IgnoredAttributes>;
9892def err_opencl_variadic_function : Error<
9893  "invalid prototype, variadic arguments are not allowed in OpenCL">;
9894def err_opencl_requires_extension : Error<
9895  "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">;
9896def warn_opencl_generic_address_space_arg : Warning<
9897  "passing non-generic address space pointer to %0"
9898  " may cause dynamic conversion affecting performance">,
9899  InGroup<Conversion>, DefaultIgnore;
9900
9901// OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
9902def err_opencl_builtin_pipe_first_arg : Error<
9903  "first argument to %0 must be a pipe type">;
9904def err_opencl_builtin_pipe_arg_num : Error<
9905  "invalid number of arguments to function: %0">;
9906def err_opencl_builtin_pipe_invalid_arg : Error<
9907  "invalid argument type to function %0 (expecting %1 having %2)">;
9908def err_opencl_builtin_pipe_invalid_access_modifier : Error<
9909  "invalid pipe access modifier (expecting %0)">;
9910
9911// OpenCL access qualifier
9912def err_opencl_invalid_access_qualifier : Error<
9913  "access qualifier can only be used for pipe and image type">;
9914def err_opencl_invalid_read_write : Error<
9915  "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
9916def err_opencl_multiple_access_qualifiers : Error<
9917  "multiple access qualifiers">;
9918def note_opencl_typedef_access_qualifier : Note<
9919  "previously declared '%0' here">;
9920
9921// OpenCL v2.0 s6.12.5 Blocks restrictions
9922def err_opencl_block_storage_type : Error<
9923  "the __block storage type is not permitted">;
9924def err_opencl_invalid_block_declaration : Error<
9925  "invalid block variable declaration - must be %select{const qualified|initialized}0">;
9926def err_opencl_extern_block_declaration : Error<
9927  "invalid block variable declaration - using 'extern' storage class is disallowed">;
9928def err_opencl_block_ref_block : Error<
9929  "cannot refer to a block inside block">;
9930
9931// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
9932def err_opencl_builtin_to_addr_invalid_arg : Error<
9933  "invalid argument %0 to function: %1, expecting a generic pointer argument">;
9934
9935// OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
9936def err_opencl_enqueue_kernel_incorrect_args : Error<
9937  "illegal call to enqueue_kernel, incorrect argument types">;
9938def err_opencl_enqueue_kernel_local_size_args : Error<
9939  "mismatch in number of block parameters and local size arguments passed">;
9940def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
9941  "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
9942def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
9943  "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
9944def err_opencl_enqueue_kernel_blocks_no_args : Error<
9945  "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
9946
9947def err_opencl_builtin_expected_type : Error<
9948  "illegal call to %0, expected %1 argument type">;
9949
9950// OpenCL v2.2 s2.1.2.3 - Vector Component Access
9951def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
9952  "vector component name '%0' is an OpenCL version 2.2 feature">,
9953  InGroup<OpenCLUnsupportedRGBA>;
9954
9955def err_openclcxx_placement_new : Error<
9956  "use of placement new requires explicit declaration">;
9957
9958// MIG routine annotations.
9959def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
9960  "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
9961  InGroup<IgnoredAttributes>;
9962} // end of sema category
9963
9964let CategoryName = "OpenMP Issue" in {
9965// OpenMP support.
9966def err_omp_expected_var_arg : Error<
9967  "%0 is not a global variable, static local variable or static data member">;
9968def err_omp_expected_var_arg_suggest : Error<
9969  "%0 is not a global variable, static local variable or static data member; "
9970  "did you mean %1">;
9971def err_omp_global_var_arg : Error<
9972  "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
9973def err_omp_ref_type_arg : Error<
9974  "arguments of '#pragma omp %0' cannot be of reference type %1">;
9975def err_omp_region_not_file_context : Error<
9976  "directive must be at file or namespace scope">;
9977def err_omp_var_scope : Error<
9978  "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
9979def err_omp_var_used : Error<
9980  "'#pragma omp %0' must precede all references to variable %q1">;
9981def err_omp_var_thread_local : Error<
9982  "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
9983def err_omp_private_incomplete_type : Error<
9984  "a private variable with incomplete type %0">;
9985def err_omp_firstprivate_incomplete_type : Error<
9986  "a firstprivate variable with incomplete type %0">;
9987def err_omp_lastprivate_incomplete_type : Error<
9988  "a lastprivate variable with incomplete type %0">;
9989def err_omp_reduction_incomplete_type : Error<
9990  "a reduction list item with incomplete type %0">;
9991def err_omp_unexpected_clause_value : Error<
9992  "expected %0 in OpenMP clause '%1'">;
9993def err_omp_expected_var_name_member_expr : Error<
9994  "expected variable name%select{| or data member of current class}0">;
9995def err_omp_expected_var_name_member_expr_or_array_item : Error<
9996  "expected variable name%select{|, data member of current class}0, array element or array section">;
9997def err_omp_expected_addressable_lvalue_or_array_item : Error<
9998  "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">;
9999def err_omp_expected_named_var_member_or_array_expression: Error<
10000  "expected expression containing only member accesses and/or array sections based on named variables">;
10001def err_omp_bit_fields_forbidden_in_clause : Error<
10002  "bit fields cannot be used to specify storage in a '%0' clause">;
10003def err_array_section_does_not_specify_contiguous_storage : Error<
10004  "array section does not specify contiguous storage">;
10005def err_array_section_does_not_specify_length : Error<
10006  "array section does not specify length for outermost dimension">;
10007def err_omp_union_type_not_allowed : Error<
10008  "mapping of union members is not allowed">;
10009def err_omp_expected_access_to_data_field : Error<
10010  "expected access to data field">;
10011def err_omp_multiple_array_items_in_map_clause : Error<
10012  "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
10013def err_omp_duplicate_map_type_modifier : Error<
10014  "same map type modifier has been specified more than once">;
10015def err_omp_duplicate_motion_modifier : Error<
10016  "same motion modifier has been specified more than once">;
10017def err_omp_pointer_mapped_along_with_derived_section : Error<
10018  "pointer cannot be mapped along with a section derived from itself">;
10019def err_omp_original_storage_is_shared_and_does_not_contain : Error<
10020  "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
10021def err_omp_same_pointer_dereferenced : Error<
10022  "same pointer dereferenced in multiple different ways in map clause expressions">;
10023def note_omp_task_predetermined_firstprivate_here : Note<
10024  "predetermined as a firstprivate in a task construct here">;
10025def err_omp_threadprivate_incomplete_type : Error<
10026  "threadprivate variable with incomplete type %0">;
10027def err_omp_no_dsa_for_variable : Error<
10028  "variable %0 must have explicitly specified data sharing attributes">;
10029def err_omp_defaultmap_no_attr_for_variable : Error<
10030  "variable %0 must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause">;
10031def note_omp_default_dsa_none : Note<
10032  "explicit data sharing attribute requested here">;
10033def note_omp_defaultmap_attr_none : Note<
10034  "explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here">;
10035def err_omp_wrong_dsa : Error<
10036  "%0 variable cannot be %1">;
10037def err_omp_variably_modified_type_not_supported : Error<
10038  "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
10039def note_omp_explicit_dsa : Note<
10040  "defined as %0">;
10041def note_omp_predetermined_dsa : Note<
10042  "%select{static data member is predetermined as shared|"
10043  "variable with static storage duration is predetermined as shared|"
10044  "loop iteration variable is predetermined as private|"
10045  "loop iteration variable is predetermined as linear|"
10046  "loop iteration variable is predetermined as lastprivate|"
10047  "constant variable is predetermined as shared|"
10048  "global variable is predetermined as shared|"
10049  "non-shared variable in a task construct is predetermined as firstprivate|"
10050  "variable with automatic storage duration is predetermined as private}0"
10051  "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
10052def note_omp_implicit_dsa : Note<
10053  "implicitly determined as %0">;
10054def err_omp_loop_var_dsa : Error<
10055  "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
10056def err_omp_not_for : Error<
10057  "%select{statement after '#pragma omp %1' must be a for loop|"
10058  "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
10059def note_omp_collapse_ordered_expr : Note<
10060  "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
10061def err_omp_negative_expression_in_clause : Error<
10062  "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
10063def err_omp_not_integral : Error<
10064  "expression must have integral or unscoped enumeration "
10065  "type, not %0">;
10066def err_omp_threadprivate_in_target : Error<
10067  "threadprivate variables cannot be used in target constructs">;
10068def err_omp_incomplete_type : Error<
10069  "expression has incomplete class type %0">;
10070def err_omp_explicit_conversion : Error<
10071  "expression requires explicit conversion from %0 to %1">;
10072def note_omp_conversion_here : Note<
10073  "conversion to %select{integral|enumeration}0 type %1 declared here">;
10074def err_omp_ambiguous_conversion : Error<
10075  "ambiguous conversion from type %0 to an integral or unscoped "
10076  "enumeration type">;
10077def err_omp_iterator_not_integral_or_pointer : Error<
10078  "expected integral or pointer type as the iterator-type, not %0">;
10079def err_omp_iterator_step_not_integral : Error<
10080  "iterator step expression %0 is not the integral expression">;
10081def err_omp_iterator_step_constant_zero : Error<
10082  "iterator step expression %0 evaluates to 0">;
10083def err_omp_required_access : Error<
10084  "%0 variable must be %1">;
10085def err_omp_const_variable : Error<
10086  "const-qualified variable cannot be %0">;
10087def err_omp_const_not_mutable_variable : Error<
10088  "const-qualified variable without mutable fields cannot be %0">;
10089def err_omp_const_list_item : Error<
10090  "const-qualified list item cannot be %0">;
10091def err_omp_linear_incomplete_type : Error<
10092  "a linear variable with incomplete type %0">;
10093def err_omp_linear_expected_int_or_ptr : Error<
10094  "argument of a linear clause should be of integral or pointer "
10095  "type, not %0">;
10096def warn_omp_linear_step_zero : Warning<
10097  "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
10098  InGroup<OpenMPClauses>;
10099def warn_omp_alignment_not_power_of_two : Warning<
10100  "aligned clause will be ignored because the requested alignment is not a power of 2">,
10101  InGroup<OpenMPClauses>;
10102def err_omp_invalid_target_decl : Error<
10103  "%0 used in declare target directive is not a variable or a function name">;
10104def err_omp_declare_target_multiple : Error<
10105  "%0 appears multiple times in clauses on the same declare target directive">;
10106def err_omp_declare_target_to_and_link : Error<
10107  "%0 must not appear in both clauses 'to' and 'link'">;
10108def warn_omp_not_in_target_context : Warning<
10109  "declaration is not declared in any declare target region">,
10110  InGroup<OpenMPTarget>;
10111def err_omp_function_in_link_clause : Error<
10112  "function name is not allowed in 'link' clause">;
10113def err_omp_aligned_expected_array_or_ptr : Error<
10114  "argument of aligned clause should be array"
10115  "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
10116  ", not %0">;
10117def err_omp_used_in_clause_twice : Error<
10118  "%select{a variable|a parameter|'this'}0 cannot appear in more than one %1 clause">;
10119def err_omp_local_var_in_threadprivate_init : Error<
10120  "variable with local storage in initial value of threadprivate variable">;
10121def err_omp_loop_not_canonical_init : Error<
10122  "initialization clause of OpenMP for loop is not in canonical form "
10123  "('var = init' or 'T var = init')">;
10124def ext_omp_loop_not_canonical_init : ExtWarn<
10125  "initialization clause of OpenMP for loop is not in canonical form "
10126  "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
10127def err_omp_loop_not_canonical_cond : Error<
10128  "condition of OpenMP for loop must be a relational comparison "
10129  "('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
10130def err_omp_loop_not_canonical_incr : Error<
10131  "increment clause of OpenMP for loop must perform simple addition "
10132  "or subtraction on loop variable %0">;
10133def err_omp_loop_variable_type : Error<
10134  "variable must be of integer or %select{pointer|random access iterator}0 type">;
10135def err_omp_loop_incr_not_compatible : Error<
10136  "increment expression must cause %0 to %select{decrease|increase}1 "
10137  "on each iteration of OpenMP for loop">;
10138def note_omp_loop_cond_requres_compatible_incr : Note<
10139  "loop step is expected to be %select{negative|positive}0 due to this condition">;
10140def err_omp_loop_diff_cxx : Error<
10141  "could not calculate number of iterations calling 'operator-' with "
10142  "upper and lower loop bounds">;
10143def err_omp_loop_cannot_use_stmt : Error<
10144  "'%0' statement cannot be used in OpenMP for loop">;
10145def err_omp_simd_region_cannot_use_stmt : Error<
10146  "'%0' statement cannot be used in OpenMP simd region">;
10147def warn_omp_loop_64_bit_var : Warning<
10148  "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
10149  InGroup<OpenMPLoopForm>;
10150def err_omp_unknown_reduction_identifier : Error<
10151  "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
10152  "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
10153def err_omp_not_resolved_reduction_identifier : Error<
10154  "unable to resolve declare reduction construct for type %0">;
10155def err_omp_reduction_ref_type_arg : Error<
10156  "argument of OpenMP clause '%0' must reference the same object in all threads">;
10157def err_omp_clause_not_arithmetic_type_arg : Error<
10158  "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
10159def err_omp_clause_floating_type_arg : Error<
10160  "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
10161def err_omp_once_referenced : Error<
10162  "variable can appear only once in OpenMP '%0' clause">;
10163def err_omp_once_referenced_in_target_update : Error<
10164  "variable can appear only once in OpenMP 'target update' construct">;
10165def note_omp_referenced : Note<
10166  "previously referenced here">;
10167def err_omp_reduction_in_task : Error<
10168  "reduction variables may not be accessed in an explicit task">;
10169def err_omp_reduction_id_not_compatible : Error<
10170  "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
10171def err_omp_reduction_identifier_mismatch : Error<
10172  "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
10173def note_omp_previous_reduction_identifier : Note<
10174  "previously marked as task_reduction with different reduction operation">;
10175def err_omp_prohibited_region : Error<
10176  "region cannot be%select{| closely}0 nested inside '%1' region"
10177  "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
10178  "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
10179  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
10180  "; perhaps you forget to enclose 'omp %3' directive into a teams region?|"
10181  "; perhaps you forget to enclose 'omp %3' directive into a for, simd, for simd, parallel for, or parallel for simd region?}2">;
10182def err_omp_prohibited_region_simd : Error<
10183  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">;
10184def err_omp_prohibited_region_atomic : Error<
10185  "OpenMP constructs may not be nested inside an atomic region">;
10186def err_omp_prohibited_region_critical_same_name : Error<
10187  "cannot nest 'critical' regions having the same name %0">;
10188def note_omp_previous_critical_region : Note<
10189  "previous 'critical' region starts here">;
10190def err_omp_several_directives_in_region : Error<
10191  "exactly one '%0' directive must appear in the loop body of an enclosing directive">;
10192def note_omp_previous_directive : Note<
10193  "previous '%0' directive used here">;
10194def err_omp_sections_not_compound_stmt : Error<
10195  "the statement for '#pragma omp sections' must be a compound statement">;
10196def err_omp_parallel_sections_not_compound_stmt : Error<
10197  "the statement for '#pragma omp parallel sections' must be a compound statement">;
10198def err_omp_orphaned_section_directive : Error<
10199  "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
10200  " must be closely nested to a sections region%select{|, not a %1 region}0">;
10201def err_omp_sections_substmt_not_section : Error<
10202  "statement in 'omp sections' directive must be enclosed into a section region">;
10203def err_omp_parallel_sections_substmt_not_section : Error<
10204  "statement in 'omp parallel sections' directive must be enclosed into a section region">;
10205def err_omp_parallel_reduction_in_task_firstprivate : Error<
10206  "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
10207def err_omp_atomic_read_not_expression_statement : Error<
10208  "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
10209  " where v and x are both lvalue expressions with scalar type">;
10210def note_omp_atomic_read_write: Note<
10211  "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
10212def err_omp_atomic_write_not_expression_statement : Error<
10213  "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
10214  " where x is a lvalue expression with scalar type">;
10215def err_omp_atomic_update_not_expression_statement : Error<
10216  "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',"
10217  " where x is an lvalue expression with scalar type">;
10218def err_omp_atomic_not_expression_statement : Error<
10219  "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',"
10220  " where x is an lvalue expression with scalar type">;
10221def note_omp_atomic_update: Note<
10222  "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
10223  "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
10224  "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
10225def err_omp_atomic_capture_not_expression_statement : Error<
10226  "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',"
10227  " where x and v are both lvalue expressions with scalar type">;
10228def err_omp_atomic_capture_not_compound_statement : Error<
10229  "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
10230  " '{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;}',"
10231  " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
10232  " where x is an lvalue expression with scalar type">;
10233def note_omp_atomic_capture: Note<
10234  "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
10235def err_omp_atomic_several_clauses : Error<
10236  "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
10237def err_omp_several_mem_order_clauses : Error<
10238  "directive '#pragma omp %0' cannot contain more than one %select{'seq_cst', 'relaxed', |}1'acq_rel', 'acquire' or 'release' clause">;
10239def err_omp_atomic_incompatible_mem_order_clause : Error<
10240  "directive '#pragma omp atomic%select{ %0|}1' cannot be used with '%2' clause">;
10241def note_omp_previous_mem_order_clause : Note<
10242  "'%0' clause used here">;
10243def err_omp_target_contains_not_only_teams : Error<
10244  "target construct with nested teams region contains statements outside of the teams construct">;
10245def note_omp_nested_teams_construct_here : Note<
10246  "nested teams construct here">;
10247def note_omp_nested_statement_here : Note<
10248  "%select{statement|directive}0 outside teams construct here">;
10249def err_omp_single_copyprivate_with_nowait : Error<
10250  "the 'copyprivate' clause must not be used with the 'nowait' clause">;
10251def note_omp_nowait_clause_here : Note<
10252  "'nowait' clause is here">;
10253def err_omp_single_decl_in_declare_simd_variant : Error<
10254  "single declaration is expected after 'declare %select{simd|variant}0' directive">;
10255def err_omp_function_expected : Error<
10256  "'#pragma omp declare %select{simd|variant}0' can only be applied to functions">;
10257def err_omp_wrong_cancel_region : Error<
10258  "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
10259def err_omp_parent_cancel_region_nowait : Error<
10260  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
10261def err_omp_parent_cancel_region_ordered : Error<
10262  "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
10263def 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">;
10264def 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">;
10265def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
10266def err_omp_mapper_wrong_type : Error<
10267  "mapper type must be of struct, union or class type">;
10268def err_omp_declare_mapper_wrong_var : Error<
10269  "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
10270def err_omp_declare_mapper_redefinition : Error<
10271  "redefinition of user-defined mapper for type %0 with name %1">;
10272def err_omp_invalid_mapper: Error<
10273  "cannot find a valid user-defined mapper for type %0 with name %1">;
10274def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
10275def err_omp_array_shaping_use : Error<"OpenMP array shaping operation is not allowed here">;
10276def err_omp_iterator_use : Error<"OpenMP iterator is not allowed here">;
10277def err_omp_typecheck_section_value : Error<
10278  "subscripted value is not an array or pointer">;
10279def err_omp_typecheck_section_not_integer : Error<
10280  "array section %select{lower bound|length}0 is not an integer">;
10281def err_omp_typecheck_shaping_not_integer : Error<
10282  "array shaping operation dimension is not an integer">;
10283def err_omp_shaping_dimension_not_positive : Error<
10284  "array shaping dimension is evaluated to a non-positive value %0">;
10285def err_omp_section_function_type : Error<
10286  "section of pointer to function type %0">;
10287def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
10288  InGroup<CharSubscript>, DefaultIgnore;
10289def err_omp_section_incomplete_type : Error<
10290  "section of pointer to incomplete type %0">;
10291def err_omp_section_not_subset_of_array : Error<
10292  "array section must be a subset of the original array">;
10293def err_omp_section_length_negative : Error<
10294  "section length is evaluated to a negative value %0">;
10295def err_omp_section_stride_non_positive : Error<
10296  "section stride is evaluated to a non-positive value %0">;
10297def err_omp_section_length_undefined : Error<
10298  "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
10299def err_omp_wrong_linear_modifier : Error<
10300  "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
10301def err_omp_wrong_linear_modifier_non_reference : Error<
10302  "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
10303def err_omp_wrong_simdlen_safelen_values : Error<
10304  "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
10305def err_omp_wrong_if_directive_name_modifier : Error<
10306  "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
10307def err_omp_no_more_if_clause : Error<
10308  "no more 'if' clause is allowed">;
10309def err_omp_unnamed_if_clause : Error<
10310  "expected%select{| one of}0 %1 directive name modifier%select{|s}0">;
10311def note_omp_previous_named_if_clause : Note<
10312  "previous clause with directive name modifier specified here">;
10313def err_omp_ordered_directive_with_param : Error<
10314  "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
10315def err_omp_ordered_directive_without_param : Error<
10316  "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
10317def note_omp_ordered_param : Note<
10318  "'ordered' clause%select{| with specified parameter}0">;
10319def err_omp_expected_base_var_name : Error<
10320  "expected variable name as a base of the array %select{subscript|section}0">;
10321def err_omp_map_shared_storage : Error<
10322  "variable already marked as mapped in current construct">;
10323def err_omp_invalid_map_type_for_directive : Error<
10324  "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
10325def err_omp_no_clause_for_directive : Error<
10326  "expected at least one %0 clause for '#pragma omp %1'">;
10327def err_omp_threadprivate_in_clause : Error<
10328  "threadprivate variables are not allowed in '%0' clause">;
10329def err_omp_wrong_ordered_loop_count : Error<
10330  "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
10331def note_collapse_loop_count : Note<
10332  "parameter of the 'collapse' clause">;
10333def err_omp_clauses_mutually_exclusive : Error<
10334  "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
10335def note_omp_previous_clause : Note<
10336  "'%0' clause is specified here">;
10337def err_omp_hint_clause_no_name : Error<
10338  "the name of the construct must be specified in presence of 'hint' clause">;
10339def err_omp_critical_with_hint : Error<
10340  "constructs with the same name must have a 'hint' clause with the same value">;
10341def note_omp_critical_hint_here : Note<
10342  "%select{|previous }0'hint' clause with value '%1'">;
10343def note_omp_critical_no_hint : Note<
10344  "%select{|previous }0directive with no 'hint' clause specified">;
10345def err_omp_depend_clause_thread_simd : Error<
10346  "'depend' clauses cannot be mixed with '%0' clause">;
10347def err_omp_depend_sink_expected_loop_iteration : Error<
10348  "expected%select{| %1}0 loop iteration variable">;
10349def err_omp_depend_sink_unexpected_expr : Error<
10350  "unexpected expression: number of expressions is larger than the number of associated loops">;
10351def err_omp_depend_sink_expected_plus_minus : Error<
10352  "expected '+' or '-' operation">;
10353def err_omp_depend_sink_source_not_allowed : Error<
10354  "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
10355def err_omp_depend_zero_length_array_section_not_allowed : Error<
10356  "zero-length array section is not allowed in 'depend' clause">;
10357def err_omp_depend_sink_source_with_modifier : Error<
10358  "depend modifier cannot be used with 'sink' or 'source' depend type">;
10359def err_omp_depend_modifier_not_iterator : Error<
10360  "expected iterator specification as depend modifier">;
10361def err_omp_linear_ordered : Error<
10362  "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
10363def err_omp_unexpected_schedule_modifier : Error<
10364  "modifier '%0' cannot be used along with modifier '%1'">;
10365def err_omp_schedule_nonmonotonic_static : Error<
10366  "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
10367def err_omp_simple_clause_incompatible_with_ordered : Error<
10368  "'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
10369def err_omp_ordered_simd : Error<
10370  "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
10371def err_omp_variable_in_given_clause_and_dsa : Error<
10372  "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
10373def err_omp_param_or_this_in_clause : Error<
10374  "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
10375def err_omp_expected_uniform_param : Error<
10376  "expected a reference to a parameter specified in a 'uniform' clause">;
10377def err_omp_expected_int_param : Error<
10378  "expected a reference to an integer-typed parameter">;
10379def err_omp_at_least_one_motion_clause_required : Error<
10380  "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
10381def err_omp_usedeviceptr_not_a_pointer : Error<
10382  "expected pointer or reference to pointer in 'use_device_ptr' clause">;
10383def err_omp_argument_type_isdeviceptr : Error <
10384  "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
10385def warn_omp_nesting_simd : Warning<
10386  "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
10387  InGroup<SourceUsesOpenMP>;
10388def err_omp_orphaned_device_directive : Error<
10389  "orphaned 'omp %0' directives are prohibited"
10390  "; perhaps you forget to enclose the directive into a "
10391  "%select{|||target |teams|for, simd, for simd, parallel for, or parallel for simd }1region?">;
10392def err_omp_reduction_non_addressable_expression : Error<
10393  "expected addressable reduction item for the task-based directives">;
10394def err_omp_reduction_with_nogroup : Error<
10395  "'reduction' clause cannot be used with 'nogroup' clause">;
10396def err_omp_reduction_vla_unsupported : Error<
10397  "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
10398def err_omp_linear_distribute_var_non_loop_iteration : Error<
10399  "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
10400def warn_omp_non_trivial_type_mapped : Warning<
10401  "Type %0 is not trivially copyable and not guaranteed to be mapped correctly">,
10402  InGroup<OpenMPMapping>;
10403def err_omp_requires_clause_redeclaration : Error <
10404  "Only one %0 clause can appear on a requires directive in a single translation unit">;
10405def note_omp_requires_previous_clause : Note <
10406  "%0 clause previously used here">;
10407def err_omp_directive_before_requires : Error <
10408  "'%0' region encountered before requires directive with '%1' clause">;
10409def note_omp_requires_encountered_directive : Note <
10410  "'%0' previously encountered here">;
10411def err_omp_invalid_scope : Error <
10412  "'#pragma omp %0' directive must appear only in file scope">;
10413def note_omp_invalid_length_on_this_ptr_mapping : Note <
10414  "expected length on mapping of 'this' array section expression to be '1'">;
10415def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
10416  "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
10417def note_omp_invalid_subscript_on_this_ptr_map : Note <
10418  "expected 'this' subscript expression on map clause to be 'this[0]'">;
10419def err_omp_invalid_map_this_expr : Error <
10420  "invalid 'this' expression on 'map' clause">;
10421def err_omp_implied_type_not_found : Error<
10422  "'%0' type not found; include <omp.h>">;
10423def err_omp_expected_omp_depend_t_lvalue : Error<
10424  "expected lvalue expression%select{ of 'omp_depend_t' type, not %1|}0">;
10425def err_omp_depobj_expected : Error<
10426  "expected depobj expression">;
10427def err_omp_depobj_single_clause_expected : Error<
10428  "exactly one of 'depend', 'destroy', or 'update' clauses is expected">;
10429def err_omp_scan_single_clause_expected : Error<
10430  "exactly one of 'inclusive' or 'exclusive' clauses is expected">;
10431def err_omp_inclusive_exclusive_not_reduction : Error<
10432  "the list item must appear in 'reduction' clause with the 'inscan' modifier "
10433  "of the parent directive">;
10434def err_omp_reduction_not_inclusive_exclusive : Error<
10435  "the inscan reduction list item must appear as a list item in an 'inclusive' or"
10436  " 'exclusive' clause on an inner 'omp scan' directive">;
10437def err_omp_wrong_inscan_reduction : Error<
10438  "'inscan' modifier can be used only in 'omp for', 'omp simd', 'omp for simd',"
10439  " 'omp parallel for', or 'omp parallel for simd' directive">;
10440def err_omp_inscan_reduction_expected : Error<
10441  "expected 'reduction' clause with the 'inscan' modifier">;
10442def note_omp_previous_inscan_reduction : Note<
10443  "'reduction' clause with 'inscan' modifier is used here">;
10444def err_omp_expected_predefined_allocator : Error<
10445  "expected one of the predefined allocators for the variables with the static "
10446  "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
10447  "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
10448  "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
10449def warn_omp_used_different_allocator : Warning<
10450  "allocate directive specifies %select{default|'%1'}0 allocator while "
10451  "previously used %select{default|'%3'}2">,
10452  InGroup<OpenMPClauses>;
10453def note_omp_previous_allocator : Note<
10454  "previous allocator is specified here">;
10455def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
10456  "inside of the target region; provide an 'allocator' clause or use 'requires'"
10457  " directive with the 'dynamic_allocators' clause">;
10458def err_expected_allocator_expression : Error<"expected an allocator expression "
10459  "inside of the target region; provide an allocator expression or use 'requires'"
10460  " directive with the 'dynamic_allocators' clause">;
10461def warn_omp_allocate_thread_on_task_target_directive : Warning<
10462  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
10463  InGroup<OpenMPClauses>;
10464def err_omp_expected_private_copy_for_allocate : Error<
10465  "the referenced item is not found in any private clause on the same directive">;
10466def err_omp_stmt_depends_on_loop_counter : Error<
10467  "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
10468def err_omp_invariant_or_linear_dependency : Error<
10469  "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
10470def err_omp_wrong_dependency_iterator_type : Error<
10471  "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
10472def err_device_unsupported_type
10473    : Error<"%0 requires %select{|%2 bit size}1 %3 type support, but device "
10474            "'%4' does not support it">;
10475def err_omp_lambda_capture_in_declare_target_not_to : Error<
10476  "variable captured in declare target region must appear in a to clause">;
10477def err_omp_device_type_mismatch : Error<
10478  "'device_type(%0)' does not match previously specified 'device_type(%1)' for the same declaration">;
10479def err_omp_wrong_device_function_call : Error<
10480  "function with 'device_type(%0)' is not available on %select{device|host}1">;
10481def note_omp_marked_device_type_here : Note<"marked as 'device_type(%0)' here">;
10482def warn_omp_declare_target_after_first_use : Warning<
10483  "declaration marked as declare target after first use, it may lead to incorrect results">,
10484  InGroup<OpenMPTarget>;
10485def err_omp_declare_variant_incompat_attributes : Error<
10486  "'#pragma omp declare variant' is not compatible with any target-specific attributes">;
10487def warn_omp_declare_variant_score_not_constant
10488    : Warning<"score expressions in the OpenMP context selector need to be "
10489              "constant; %0 is not and will be ignored">,
10490      InGroup<SourceUsesOpenMP>;
10491def err_omp_declare_variant_user_condition_not_constant
10492    : Error<"the user condition in the OpenMP context selector needs to be "
10493            "constant; %0 is not">;
10494def warn_omp_declare_variant_after_used : Warning<
10495  "'#pragma omp declare variant' cannot be applied for function after first "
10496  "usage; the original function might be used">, InGroup<SourceUsesOpenMP>;
10497def warn_omp_declare_variant_after_emitted : Warning<
10498  "'#pragma omp declare variant' cannot be applied to the function that was defined already;"
10499  " the original function might be used">, InGroup<SourceUsesOpenMP>;
10500def err_omp_declare_variant_doesnt_support : Error<
10501  "'#pragma omp declare variant' does not "
10502  "support %select{function templates|virtual functions|"
10503  "deduced return types|constructors|destructors|deleted functions|"
10504  "defaulted functions|constexpr functions|consteval function}0">;
10505def err_omp_declare_variant_diff : Error<
10506  "function with '#pragma omp declare variant' has a different %select{calling convention"
10507  "|return type|constexpr specification|inline specification|storage class|"
10508  "linkage}0">;
10509def err_omp_declare_variant_incompat_types : Error<
10510  "variant in '#pragma omp declare variant' with type %0 is incompatible with type %1"
10511  >;
10512def warn_omp_declare_variant_marked_as_declare_variant : Warning<
10513  "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
10514  >, InGroup<SourceUsesOpenMP>;
10515def note_omp_marked_declare_variant_here : Note<"marked as 'declare variant' here">;
10516def err_omp_one_defaultmap_each_category: Error<
10517  "at most one defaultmap clause for each variable-category can appear on the directive">;
10518def err_omp_lastprivate_conditional_non_scalar : Error<
10519  "expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier"
10520  >;
10521def err_omp_flush_order_clause_and_list : Error<
10522  "'flush' directive with memory order clause '%0' cannot have the list">;
10523def note_omp_flush_order_clause_here : Note<
10524  "memory order clause '%0' is specified here">;
10525def err_omp_non_lvalue_in_map_or_motion_clauses: Error<
10526  "expected addressable lvalue in '%0' clause">;
10527def err_omp_var_expected : Error<
10528  "expected variable of the '%0' type%select{|, not %2}1">;
10529def warn_unknown_declare_variant_isa_trait
10530    : Warning<"isa trait '%0' is not known to the current target; verify the "
10531              "spelling or consider restricting the context selector with the "
10532              "'arch' selector further">,
10533      InGroup<SourceUsesOpenMP>;
10534def err_omp_non_pointer_type_array_shaping_base : Error<
10535  "expected expression with a pointer to a complete type as a base of an array "
10536  "shaping operation">;
10537def err_omp_reduction_task_not_parallel_or_worksharing : Error<
10538  "'reduction' clause with 'task' modifier allowed only on non-simd parallel or"
10539  " worksharing constructs">;
10540def err_omp_expected_array_alloctraits : Error<
10541  "expected constant sized array of 'omp_alloctrait_t' elements, not %0">;
10542def err_omp_predefined_allocator_with_traits : Error<
10543  "predefined allocator cannot have traits specified">;
10544def note_omp_predefined_allocator : Note<
10545  "predefined trait '%0' used here">;
10546def err_omp_nonpredefined_allocator_without_traits : Error<
10547  "non-predefined allocator must have traits specified">;
10548def err_omp_allocator_used_in_clauses : Error<
10549  "allocators used in 'uses_allocators' clause cannot appear in other "
10550  "data-sharing or data-mapping attribute clauses">;
10551def err_omp_allocator_not_in_uses_allocators : Error<
10552  "allocator must be specified in the 'uses_allocators' clause">;
10553def note_omp_protected_structured_block
10554    : Note<"jump bypasses OpenMP structured block">;
10555def note_omp_exits_structured_block
10556    : Note<"jump exits scope of OpenMP structured block">;
10557} // end of OpenMP category
10558
10559let CategoryName = "Related Result Type Issue" in {
10560// Objective-C related result type compatibility
10561def warn_related_result_type_compatibility_class : Warning<
10562  "method is expected to return an instance of its class type "
10563  "%diff{$, but is declared to return $|"
10564  ", but is declared to return different type}0,1">;
10565def warn_related_result_type_compatibility_protocol : Warning<
10566  "protocol method is expected to return an instance of the implementing "
10567  "class, but is declared to return %0">;
10568def note_related_result_type_family : Note<
10569  "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
10570  "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
10571  "self}1' method family%select{| and is expected to return an instance of its "
10572  "class type}0">;
10573def note_related_result_type_overridden : Note<
10574  "overridden method returns an instance of its class type">;
10575def note_related_result_type_inferred : Note<
10576  "%select{class|instance}0 method %1 is assumed to return an instance of "
10577  "its receiver type (%2)">;
10578def note_related_result_type_explicit : Note<
10579  "%select{overridden|current}0 method is explicitly declared 'instancetype'"
10580  "%select{| and is expected to return an instance of its class type}0">;
10581def err_invalid_type_for_program_scope_var : Error<
10582  "the %0 type cannot be used to declare a program scope variable">;
10583
10584}
10585
10586let CategoryName = "Modules Issue" in {
10587def err_module_decl_in_module_map_module : Error<
10588  "'module' declaration found while building module from module map">;
10589def err_module_decl_in_header_module : Error<
10590  "'module' declaration found while building header unit">;
10591def err_module_interface_implementation_mismatch : Error<
10592  "missing 'export' specifier in module declaration while "
10593  "building module interface">;
10594def err_current_module_name_mismatch : Error<
10595  "module name '%0' specified on command line does not match name of module">;
10596def err_module_redefinition : Error<
10597  "redefinition of module '%0'">;
10598def note_prev_module_definition : Note<"previously defined here">;
10599def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
10600def err_module_not_defined : Error<
10601  "definition of module '%0' is not available; use -fmodule-file= to specify "
10602  "path to precompiled module interface">;
10603def err_module_redeclaration : Error<
10604  "translation unit contains multiple module declarations">;
10605def note_prev_module_declaration : Note<"previous module declaration is here">;
10606def err_module_declaration_missing : Error<
10607  "missing 'export module' declaration in module interface unit">;
10608def err_module_declaration_missing_after_global_module_introducer : Error<
10609  "missing 'module' declaration at end of global module fragment "
10610  "introduced here">;
10611def err_module_private_specialization : Error<
10612  "%select{template|partial|member}0 specialization cannot be "
10613  "declared __module_private__">;
10614def err_module_private_local : Error<
10615  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
10616  "__module_private__">;
10617def err_module_private_local_class : Error<
10618  "local %select{struct|interface|union|class|enum}0 cannot be declared "
10619  "__module_private__">;
10620def err_module_unimported_use : Error<
10621  "%select{declaration|definition|default argument|"
10622  "explicit specialization|partial specialization}0 of %1 must be imported "
10623  "from module '%2' before it is required">;
10624def err_module_unimported_use_header : Error<
10625  "%select{missing '#include'|missing '#include %3'}2; "
10626  "%select{||default argument of |explicit specialization of |"
10627  "partial specialization of }0%1 must be "
10628  "%select{declared|defined|defined|declared|declared}0 "
10629  "before it is used">;
10630def err_module_unimported_use_multiple : Error<
10631  "%select{declaration|definition|default argument|"
10632  "explicit specialization|partial specialization}0 of %1 must be imported "
10633  "from one of the following modules before it is required:%2">;
10634def note_unreachable_entity : Note<
10635  "%select{declaration|definition|default argument declared|"
10636  "explicit specialization declared|partial specialization declared}0 here "
10637  "is not %select{visible|reachable|reachable|reachable|reachable|reachable}0">;
10638def ext_module_import_in_extern_c : ExtWarn<
10639  "import of C++ module '%0' appears within extern \"C\" language linkage "
10640  "specification">, DefaultError,
10641  InGroup<DiagGroup<"module-import-in-extern-c">>;
10642def err_module_import_not_at_top_level_fatal : Error<
10643  "import of module '%0' appears within %1">, DefaultFatal;
10644def ext_module_import_not_at_top_level_noop : ExtWarn<
10645  "redundant #include of module '%0' appears within %1">, DefaultError,
10646  InGroup<DiagGroup<"modules-import-nested-redundant">>;
10647def note_module_import_not_at_top_level : Note<"%0 begins here">;
10648def err_module_self_import : Error<
10649  "import of module '%0' appears within same top-level module '%1'">;
10650def err_module_import_in_implementation : Error<
10651  "@import of module '%0' in implementation of '%1'; use #import">;
10652
10653// C++ Modules
10654def err_module_decl_not_at_start : Error<
10655  "module declaration must occur at the start of the translation unit">;
10656def note_global_module_introducer_missing : Note<
10657  "add 'module;' to the start of the file to introduce a "
10658  "global module fragment">;
10659def err_export_within_anonymous_namespace : Error<
10660  "export declaration appears within anonymous namespace">;
10661def note_anonymous_namespace : Note<"anonymous namespace begins here">;
10662def ext_export_no_name_block : ExtWarn<
10663  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
10664  "to appear in an export block">, InGroup<ExportUnnamed>;
10665def ext_export_no_names : ExtWarn<
10666  "ISO C++20 does not permit a declaration that does not introduce any names "
10667  "to be exported">, InGroup<ExportUnnamed>;
10668def note_export : Note<"export block begins here">;
10669def err_export_no_name : Error<
10670  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
10671def ext_export_using_directive : ExtWarn<
10672  "ISO C++20 does not permit using directive to be exported">,
10673  InGroup<DiagGroup<"export-using-directive">>;
10674def err_export_within_export : Error<
10675  "export declaration appears within another export declaration">;
10676def err_export_internal : Error<
10677  "declaration of %0 with internal linkage cannot be exported">;
10678def err_export_using_internal : Error<
10679  "using declaration referring to %0 with internal linkage cannot be exported">;
10680def err_export_not_in_module_interface : Error<
10681  "export declaration can only be used within a module interface unit"
10682  "%select{ after the module declaration|}0">;
10683def err_export_in_private_module_fragment : Error<
10684  "export declaration cannot be used in a private module fragment">;
10685def note_private_module_fragment : Note<
10686  "private module fragment begins here">;
10687def err_private_module_fragment_not_module : Error<
10688  "private module fragment declaration with no preceding module declaration">;
10689def err_private_module_fragment_redefined : Error<
10690  "private module fragment redefined">;
10691def err_private_module_fragment_not_module_interface : Error<
10692  "private module fragment in module implementation unit">;
10693def note_not_module_interface_add_export : Note<
10694  "add 'export' here if this is intended to be a module interface unit">;
10695
10696def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
10697  "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
10698  InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
10699def note_equivalent_internal_linkage_decl : Note<
10700  "declared here%select{ in module '%1'|}0">;
10701
10702def note_redefinition_modules_same_file : Note<
10703  "'%0' included multiple times, additional include site in header from module '%1'">;
10704def note_redefinition_include_same_file : Note<
10705  "'%0' included multiple times, additional include site here">;
10706}
10707
10708let CategoryName = "Coroutines Issue" in {
10709def err_return_in_coroutine : Error<
10710  "return statement not allowed in coroutine; did you mean 'co_return'?">;
10711def note_declared_coroutine_here : Note<
10712  "function is a coroutine due to use of '%0' here">;
10713def err_coroutine_objc_method : Error<
10714  "Objective-C methods as coroutines are not yet supported">;
10715def err_coroutine_unevaluated_context : Error<
10716  "'%0' cannot be used in an unevaluated context">;
10717def err_coroutine_within_handler : Error<
10718  "'%0' cannot be used in the handler of a try block">;
10719def err_coroutine_outside_function : Error<
10720  "'%0' cannot be used outside a function">;
10721def err_coroutine_invalid_func_context : Error<
10722  "'%1' cannot be used in %select{a constructor|a destructor"
10723  "|the 'main' function|a constexpr function"
10724  "|a function with a deduced return type|a varargs function"
10725  "|a consteval function}0">;
10726def err_implied_coroutine_type_not_found : Error<
10727  "%0 type was not found; include <experimental/coroutine> before defining "
10728  "a coroutine">;
10729def err_implicit_coroutine_std_nothrow_type_not_found : Error<
10730  "std::nothrow was not found; include <new> before defining a coroutine which "
10731  "uses get_return_object_on_allocation_failure()">;
10732def err_malformed_std_nothrow : Error<
10733  "std::nothrow must be a valid variable declaration">;
10734def err_malformed_std_coroutine_handle : Error<
10735  "std::experimental::coroutine_handle must be a class template">;
10736def err_coroutine_handle_missing_member : Error<
10737  "std::experimental::coroutine_handle missing a member named '%0'">;
10738def err_malformed_std_coroutine_traits : Error<
10739  "'std::experimental::coroutine_traits' must be a class template">;
10740def err_implied_std_coroutine_traits_promise_type_not_found : Error<
10741  "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
10742def err_implied_std_coroutine_traits_promise_type_not_class : Error<
10743  "this function cannot be a coroutine: %0 is not a class">;
10744def err_coroutine_promise_type_incomplete : Error<
10745  "this function cannot be a coroutine: %0 is an incomplete type">;
10746def err_coroutine_type_missing_specialization : Error<
10747  "this function cannot be a coroutine: missing definition of "
10748  "specialization %0">;
10749def err_coroutine_promise_incompatible_return_functions : Error<
10750  "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
10751def err_coroutine_promise_requires_return_function : Error<
10752  "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
10753def note_coroutine_promise_implicit_await_transform_required_here : Note<
10754  "call to 'await_transform' implicitly required by 'co_await' here">;
10755def note_coroutine_promise_suspend_implicitly_required : Note<
10756  "call to '%select{initial_suspend|final_suspend}0' implicitly "
10757  "required by the %select{initial suspend point|final suspend point}0">;
10758def err_coroutine_promise_unhandled_exception_required : Error<
10759  "%0 is required to declare the member 'unhandled_exception()'">;
10760def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
10761  "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
10762  InGroup<CoroutineMissingUnhandledException>;
10763def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
10764  "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
10765def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
10766  "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
10767def err_coroutine_promise_new_requires_nothrow : Error<
10768  "%0 is required to have a non-throwing noexcept specification when the promise "
10769   "type declares 'get_return_object_on_allocation_failure()'">;
10770def note_coroutine_promise_call_implicitly_required : Note<
10771  "call to %0 implicitly required by coroutine function here">;
10772def err_await_suspend_invalid_return_type : Error<
10773  "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
10774>;
10775def note_await_ready_no_bool_conversion : Note<
10776  "return type of 'await_ready' is required to be contextually convertible to 'bool'"
10777>;
10778def warn_coroutine_handle_address_invalid_return_type : Warning <
10779  "return type of 'coroutine_handle<>::address should be 'void*' (have %0) in order to get capability with existing async C API.">,
10780  InGroup<Coroutine>;
10781def err_coroutine_promise_final_suspend_requires_nothrow : Error<
10782  "the expression 'co_await __promise.final_suspend()' is required to be non-throwing"
10783>;
10784def note_coroutine_function_declare_noexcept : Note<
10785  "must be declared with 'noexcept'"
10786>;
10787} // end of coroutines issue category
10788
10789let CategoryName = "Documentation Issue" in {
10790def warn_not_a_doxygen_trailing_member_comment : Warning<
10791  "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
10792} // end of documentation issue category
10793
10794let CategoryName = "Nullability Issue" in {
10795
10796def warn_mismatched_nullability_attr : Warning<
10797  "nullability specifier %0 conflicts with existing specifier %1">,
10798  InGroup<Nullability>;
10799
10800def warn_nullability_declspec : Warning<
10801  "nullability specifier %0 cannot be applied "
10802  "to non-pointer type %1; did you mean to apply the specifier to the "
10803  "%select{pointer|block pointer|member pointer|function pointer|"
10804  "member function pointer}2?">,
10805  InGroup<NullabilityDeclSpec>,
10806  DefaultError;
10807
10808def note_nullability_here : Note<"%0 specified here">;
10809
10810def err_nullability_nonpointer : Error<
10811  "nullability specifier %0 cannot be applied to non-pointer type %1">;
10812
10813def warn_nullability_lost : Warning<
10814  "implicit conversion from nullable pointer %0 to non-nullable pointer "
10815  "type %1">,
10816  InGroup<NullableToNonNullConversion>, DefaultIgnore;
10817def warn_zero_as_null_pointer_constant : Warning<
10818  "zero as null pointer constant">,
10819  InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
10820
10821def err_nullability_cs_multilevel : Error<
10822  "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
10823def note_nullability_type_specifier : Note<
10824  "use nullability type specifier %0 to affect the innermost "
10825  "pointer type of %1">;
10826
10827def warn_null_resettable_setter : Warning<
10828  "synthesized setter %0 for null_resettable property %1 does not handle nil">,
10829  InGroup<Nullability>;
10830
10831def warn_nullability_missing : Warning<
10832  "%select{pointer|block pointer|member pointer}0 is missing a nullability "
10833  "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
10834  InGroup<NullabilityCompleteness>;
10835def warn_nullability_missing_array : Warning<
10836  "array parameter is missing a nullability type specifier (_Nonnull, "
10837  "_Nullable, or _Null_unspecified)">,
10838  InGroup<NullabilityCompletenessOnArrays>;
10839def note_nullability_fix_it : Note<
10840  "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
10841  "%select{pointer|block pointer|member pointer|array parameter}1 "
10842  "%select{should never be null|may be null|should not declare nullability}0">;
10843
10844def warn_nullability_inferred_on_nested_type : Warning<
10845  "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
10846  "deprecated">,
10847  InGroup<NullabilityInferredOnNestedType>;
10848
10849def err_objc_type_arg_explicit_nullability : Error<
10850  "type argument %0 cannot explicitly specify nullability">;
10851
10852def err_objc_type_param_bound_explicit_nullability : Error<
10853  "type parameter %0 bound %1 cannot explicitly specify nullability">;
10854
10855}
10856
10857let CategoryName = "Generics Issue" in {
10858
10859def err_objc_type_param_bound_nonobject : Error<
10860  "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
10861
10862def err_objc_type_param_bound_missing_pointer : Error<
10863  "missing '*' in type bound %0 for type parameter %1">;
10864def err_objc_type_param_bound_qualified : Error<
10865  "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
10866
10867def err_objc_type_param_redecl : Error<
10868  "redeclaration of type parameter %0">;
10869
10870def err_objc_type_param_arity_mismatch : Error<
10871  "%select{forward class declaration|class definition|category|extension}0 has "
10872  "too %select{few|many}1 type parameters (expected %2, have %3)">;
10873
10874def err_objc_type_param_bound_conflict : Error<
10875  "type bound %0 for type parameter %1 conflicts with "
10876  "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
10877
10878def err_objc_type_param_variance_conflict : Error<
10879  "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
10880  "%select{in|co|contra}2variant type parameter %3">;
10881
10882def note_objc_type_param_here : Note<"type parameter %0 declared here">;
10883
10884def err_objc_type_param_bound_missing : Error<
10885  "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
10886
10887def err_objc_parameterized_category_nonclass : Error<
10888  "%select{extension|category}0 of non-parameterized class %1 cannot have type "
10889  "parameters">;
10890
10891def err_objc_parameterized_forward_class : Error<
10892  "forward declaration of non-parameterized class %0 cannot have type "
10893  "parameters">;
10894
10895def err_objc_parameterized_forward_class_first : Error<
10896  "class %0 previously declared with type parameters">;
10897
10898def err_objc_type_arg_missing_star : Error<
10899  "type argument %0 must be a pointer (requires a '*')">;
10900def err_objc_type_arg_qualified : Error<
10901  "type argument %0 cannot be qualified with '%1'">;
10902
10903def err_objc_type_arg_missing : Error<
10904  "no type or protocol named %0">;
10905
10906def err_objc_type_args_and_protocols : Error<
10907  "angle brackets contain both a %select{type|protocol}0 (%1) and a "
10908  "%select{protocol|type}0 (%2)">;
10909
10910def err_objc_type_args_non_class : Error<
10911  "type arguments cannot be applied to non-class type %0">;
10912
10913def err_objc_type_args_non_parameterized_class : Error<
10914  "type arguments cannot be applied to non-parameterized class %0">;
10915
10916def err_objc_type_args_specialized_class : Error<
10917  "type arguments cannot be applied to already-specialized class type %0">;
10918
10919def err_objc_type_args_wrong_arity : Error<
10920  "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
10921}
10922
10923def err_objc_type_arg_not_id_compatible : Error<
10924  "type argument %0 is neither an Objective-C object nor a block type">;
10925
10926def err_objc_type_arg_does_not_match_bound : Error<
10927  "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
10928
10929def warn_objc_redundant_qualified_class_type : Warning<
10930  "parameterized class %0 already conforms to the protocols listed; did you "
10931  "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
10932
10933def warn_block_literal_attributes_on_omitted_return_type : Warning<
10934  "attribute %0 ignored, because it cannot be applied to omitted return type">,
10935  InGroup<IgnoredAttributes>;
10936
10937def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
10938  "'%0' qualifier on omitted return type %1 has no effect">,
10939  InGroup<IgnoredQualifiers>;
10940
10941def warn_shadow_field : Warning<
10942  "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
10943  "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
10944def note_shadow_field : Note<"declared here">;
10945
10946def err_multiversion_required_in_redecl : Error<
10947  "function declaration is missing %select{'target'|'cpu_specific' or "
10948  "'cpu_dispatch'}0 attribute in a multiversioned function">;
10949def note_multiversioning_caused_here : Note<
10950  "function multiversioning caused by this declaration">;
10951def err_multiversion_after_used : Error<
10952  "function declaration cannot become a multiversioned function after first "
10953  "usage">;
10954def err_bad_multiversion_option : Error<
10955  "function multiversioning doesn't support %select{feature|architecture}0 "
10956  "'%1'">;
10957def err_multiversion_duplicate : Error<
10958  "multiversioned function redeclarations require identical target attributes">;
10959def err_multiversion_noproto : Error<
10960  "multiversioned function must have a prototype">;
10961def err_multiversion_disallowed_other_attr : Error<
10962  "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined"
10963  " with attribute %1">;
10964def err_multiversion_mismatched_attrs
10965    : Error<"attributes on multiversioned functions must all match, attribute "
10966            "%0 %select{is missing|has different arguments}1">;
10967def err_multiversion_diff : Error<
10968  "multiversioned function declaration has a different %select{calling convention"
10969  "|return type|constexpr specification|inline specification|storage class|"
10970  "linkage}0">;
10971def err_multiversion_doesnt_support : Error<
10972  "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not "
10973  "yet support %select{function templates|virtual functions|"
10974  "deduced return types|constructors|destructors|deleted functions|"
10975  "defaulted functions|constexpr functions|consteval function}1">;
10976def err_multiversion_not_allowed_on_main : Error<
10977  "'main' cannot be a multiversioned function">;
10978def err_multiversion_not_supported : Error<
10979 "function multiversioning is not supported on the current target">;
10980def err_multiversion_types_mixed : Error<
10981  "multiversioning attributes cannot be combined">;
10982def err_cpu_dispatch_mismatch : Error<
10983 "'cpu_dispatch' function redeclared with different CPUs">;
10984def err_cpu_specific_multiple_defs : Error<
10985 "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
10986def warn_multiversion_duplicate_entries : Warning<
10987 "CPU list contains duplicate entries; attribute ignored">,
10988  InGroup<FunctionMultiVersioning>;
10989def warn_dispatch_body_ignored : Warning<
10990  "body of cpu_dispatch function will be ignored">,
10991  InGroup<FunctionMultiVersioning>;
10992
10993// three-way comparison operator diagnostics
10994def err_implied_comparison_category_type_not_found : Error<
10995  "cannot %select{use builtin operator '<=>'|default 'operator<=>'}1 "
10996  "because type '%0' was not found; include <compare>">;
10997def err_spaceship_argument_narrowing : Error<
10998  "argument to 'operator<=>' "
10999  "%select{cannot be narrowed from type %1 to %2|"
11000  "evaluates to %1, which cannot be narrowed to type %2}0">;
11001def err_std_compare_type_not_supported : Error<
11002  "standard library implementation of %0 is not supported; "
11003   "%select{member '%2' does not have expected form|"
11004   "member '%2' is missing|"
11005   "the type is not trivially copyable|"
11006   "the type does not have the expected form}1">;
11007def note_rewriting_operator_as_spaceship : Note<
11008  "while rewriting comparison as call to 'operator<=>' declared here">;
11009def err_three_way_vector_comparison : Error<
11010  "three-way comparison between vectors is not supported">;
11011
11012// Memory Tagging Extensions (MTE) diagnostics
11013def err_memtag_arg_null_or_pointer : Error<
11014  "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
11015def err_memtag_any2arg_pointer : Error<
11016  "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
11017def err_memtag_arg_must_be_pointer : Error<
11018  "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
11019def err_memtag_arg_must_be_integer : Error<
11020  "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
11021
11022def warn_dereference_of_noderef_type : Warning<
11023  "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
11024def warn_dereference_of_noderef_type_no_decl : Warning<
11025  "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
11026def warn_noderef_on_non_pointer_or_array : Warning<
11027  "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
11028def warn_noderef_to_dereferenceable_pointer : Warning<
11029  "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
11030
11031def err_builtin_launder_invalid_arg : Error<
11032  "%select{non-pointer|function pointer|void pointer}0 argument to "
11033  "'__builtin_launder' is not allowed">;
11034
11035def err_builtin_matrix_disabled: Error<
11036  "matrix types extension is disabled. Pass -fenable-matrix to enable it">;
11037def err_matrix_index_not_integer: Error<
11038  "matrix %select{row|column}0 index is not an integer">;
11039def err_matrix_index_outside_range: Error<
11040  "matrix %select{row|column}0 index is outside the allowed range [0, %1)">;
11041def err_matrix_incomplete_index: Error<
11042  "single subscript expressions are not allowed for matrix values">;
11043def err_matrix_separate_incomplete_index: Error<
11044  "matrix row and column subscripts cannot be separated by any expression">;
11045def err_matrix_subscript_comma: Error<
11046  "comma expressions are not allowed as indices in matrix subscript expressions">;
11047def err_builtin_matrix_arg: Error<"1st argument must be a matrix">;
11048def err_builtin_matrix_scalar_unsigned_arg: Error<
11049  "%0 argument must be a constant unsigned integer expression">;
11050def err_builtin_matrix_pointer_arg: Error<
11051  "%ordinal0 argument must be a pointer to a valid matrix element type">;
11052def err_builtin_matrix_pointer_arg_mismatch: Error<
11053  "the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
11054def err_builtin_matrix_store_to_const: Error<
11055  "cannot store matrix to read-only pointer">;
11056def err_builtin_matrix_stride_too_small: Error<
11057  "stride must be greater or equal to the number of rows">;
11058def err_builtin_matrix_invalid_dimension: Error<
11059  "%0 dimension is outside the allowed range [1, %1]">;
11060
11061def warn_mismatched_import : Warning<
11062  "import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
11063  "previous declaration">,
11064  InGroup<IgnoredAttributes>;
11065def warn_import_on_definition : Warning<
11066  "import %select{module|name}0 cannot be applied to a function with a definition">,
11067  InGroup<IgnoredAttributes>;
11068
11069def err_preserve_field_info_not_field : Error<
11070  "__builtin_preserve_field_info argument %0 not a field access">;
11071def err_preserve_field_info_not_const: Error<
11072  "__builtin_preserve_field_info argument %0 not a constant">;
11073def err_btf_type_id_not_const: Error<
11074  "__builtin_btf_type_id argument %0 not a constant">;
11075def err_preserve_type_info_invalid : Error<
11076  "__builtin_preserve_type_info argument %0 invalid">;
11077def err_preserve_type_info_not_const: Error<
11078  "__builtin_preserve_type_info argument %0 not a constant">;
11079def err_preserve_enum_value_invalid : Error<
11080  "__builtin_preserve_enum_value argument %0 invalid">;
11081def err_preserve_enum_value_not_const: Error<
11082  "__builtin_preserve_enum_value argument %0 not a constant">;
11083
11084def err_bit_cast_non_trivially_copyable : Error<
11085  "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
11086def err_bit_cast_type_size_mismatch : Error<
11087  "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
11088
11089// SYCL-specific diagnostics
11090def warn_sycl_kernel_num_of_template_params : Warning<
11091  "'sycl_kernel' attribute only applies to a function template with at least"
11092  " two template parameters">, InGroup<IgnoredAttributes>;
11093def warn_sycl_kernel_invalid_template_param_type : Warning<
11094  "template parameter of a function template with the 'sycl_kernel' attribute"
11095  " cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
11096def warn_sycl_kernel_num_of_function_params : Warning<
11097  "function template with 'sycl_kernel' attribute must have a single parameter">,
11098  InGroup<IgnoredAttributes>;
11099def warn_sycl_kernel_return_type : Warning<
11100  "function template with 'sycl_kernel' attribute must have a 'void' return type">,
11101  InGroup<IgnoredAttributes>;
11102
11103def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must "
11104                                 "have a bit size of at least %select{2|1}0">;
11105def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit "
11106                                 "sizes greater than %1 not supported">;
11107
11108// errors of expect.with.probability
11109def err_probability_not_constant_float : Error<
11110   "probability argument to __builtin_expect_with_probability must be constant "
11111   "floating-point expression">;
11112def err_probability_out_of_range : Error<
11113   "probability argument to __builtin_expect_with_probability is outside the "
11114   "range [0.0, 1.0]">;
11115
11116// TCB warnings
11117def err_tcb_conflicting_attributes : Error<
11118  "attributes '%0(\"%2\")' and '%1(\"%2\")' are mutually exclusive">;
11119def warn_tcb_enforcement_violation : Warning<
11120  "calling %0 is a violation of trusted computing base '%1'">,
11121  InGroup<DiagGroup<"tcb-enforcement">>;
11122} // end of sema component.
11123