]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td
MFC r358711:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / clang / include / clang / Basic / DiagnosticSemaKinds.td
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
13 let Component = "Sema" in {
14 let CategoryName = "Semantic Issue" in {
15
16 def note_previous_decl : Note<"%0 declared here">;
17 def note_entity_declared_at : Note<"%0 declared here">;
18 def note_callee_decl : Note<"%0 declared here">;
19 def note_defined_here : Note<"%0 defined here">;
20
21 // For loop analysis
22 def warn_variables_not_in_loop_body : Warning<
23   "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
24   "used in loop condition not modified in loop body">,
25   InGroup<ForLoopAnalysis>, DefaultIgnore;
26 def warn_redundant_loop_iteration : Warning<
27   "variable %0 is %select{decremented|incremented}1 both in the loop header "
28   "and in the loop body">,
29   InGroup<ForLoopAnalysis>, DefaultIgnore;
30 def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
31
32 def warn_duplicate_enum_values : Warning<
33   "element %0 has been implicitly assigned %1 which another element has "
34   "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
35 def note_duplicate_element : Note<"element %0 also has value %1">;
36
37 // Absolute value functions
38 def warn_unsigned_abs : Warning<
39   "taking the absolute value of unsigned type %0 has no effect">,
40   InGroup<AbsoluteValue>;
41 def note_remove_abs : Note<
42   "remove the call to '%0' since unsigned values cannot be negative">;
43 def warn_abs_too_small : Warning<
44   "absolute value function %0 given an argument of type %1 but has parameter "
45   "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>;
46 def warn_wrong_absolute_value_type : Warning<
47   "using %select{integer|floating point|complex}1 absolute value function %0 "
48   "when argument is of %select{integer|floating point|complex}2 type">,
49   InGroup<AbsoluteValue>;
50 def note_replace_abs_function : Note<"use function '%0' instead">;
51 def warn_pointer_abs : Warning<
52   "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">,
53   InGroup<AbsoluteValue>;
54
55 def warn_max_unsigned_zero : Warning<
56   "taking the max of "
57   "%select{a value and unsigned zero|unsigned zero and a value}0 "
58   "is always equal to the other value">,
59   InGroup<MaxUnsignedZero>;
60 def note_remove_max_call : Note<
61   "remove call to max function and unsigned zero argument">;
62
63 def warn_infinite_recursive_function : Warning<
64   "all paths through this function will call itself">,
65   InGroup<InfiniteRecursion>, DefaultIgnore;
66
67 def warn_comma_operator : Warning<"possible misuse of comma operator here">,
68   InGroup<DiagGroup<"comma">>, DefaultIgnore;
69 def note_cast_to_void : Note<"cast expression to void to silence warning">;
70
71 // Constant expressions
72 def err_expr_not_ice : Error<
73   "expression is not an %select{integer|integral}0 constant expression">;
74 def ext_expr_not_ice : Extension<
75   "expression is not an %select{integer|integral}0 constant expression; "
76   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
77 def err_typecheck_converted_constant_expression : Error<
78   "value of type %0 is not implicitly convertible to %1">;
79 def err_typecheck_converted_constant_expression_disallowed : Error<
80   "conversion from %0 to %1 is not allowed in a converted constant expression">;
81 def err_typecheck_converted_constant_expression_indirect : Error<
82   "conversion from %0 to %1 in converted constant expression would "
83   "bind reference to a temporary">;
84 def err_expr_not_cce : Error<
85   "%select{case value|enumerator value|non-type template argument|"
86   "array size|constexpr if condition|explicit specifier argument}0 "
87   "is not a constant expression">;
88 def ext_cce_narrowing : ExtWarn<
89   "%select{case value|enumerator value|non-type template argument|"
90   "array size|constexpr if condition|explicit specifier argument}0 "
91   "%select{cannot be narrowed from type %2 to %3|"
92   "evaluates to %2, which cannot be narrowed to type %3}1">,
93   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
94 def err_ice_not_integral : Error<
95   "integral constant expression must have integral or unscoped enumeration "
96   "type, not %0">;
97 def err_ice_incomplete_type : Error<
98   "integral constant expression has incomplete class type %0">;
99 def err_ice_explicit_conversion : Error<
100   "integral constant expression requires explicit conversion from %0 to %1">;
101 def note_ice_conversion_here : Note<
102   "conversion to %select{integral|enumeration}0 type %1 declared here">;
103 def err_ice_ambiguous_conversion : Error<
104   "ambiguous conversion from type %0 to an integral or unscoped "
105   "enumeration type">;
106 def err_ice_too_large : Error<
107   "integer constant expression evaluates to value %0 that cannot be "
108   "represented in a %1-bit %select{signed|unsigned}2 integer type">;
109 def err_expr_not_string_literal : Error<"expression is not a string literal">;
110
111 // Semantic analysis of constant literals.
112 def ext_predef_outside_function : Warning<
113   "predefined identifier is only valid inside function">,
114   InGroup<DiagGroup<"predefined-identifier-outside-function">>;
115 def warn_float_overflow : Warning<
116   "magnitude of floating-point constant too large for type %0; maximum is %1">,
117    InGroup<LiteralRange>;
118 def warn_float_underflow : Warning<
119   "magnitude of floating-point constant too small for type %0; minimum is %1">,
120   InGroup<LiteralRange>;
121 def warn_double_const_requires_fp64 : Warning<
122   "double precision constant requires cl_khr_fp64, casting to single precision">;
123 def err_half_const_requires_fp16 : Error<
124   "half precision constant requires cl_khr_fp16">;
125
126 // C99 variable-length arrays
127 def ext_vla : Extension<"variable length arrays are a C99 feature">,
128   InGroup<VLAExtension>;
129 def warn_vla_used : Warning<"variable length array used">,
130   InGroup<VLA>, DefaultIgnore;
131 def err_vla_in_sfinae : Error<
132   "variable length array cannot be formed during template argument deduction">;
133 def err_array_star_in_function_definition : Error<
134   "variable length array must be bound in function definition">;
135 def err_vla_decl_in_file_scope : Error<
136   "variable length array declaration not allowed at file scope">;
137 def err_vla_decl_has_static_storage : Error<
138   "variable length array declaration cannot have 'static' storage duration">;
139 def err_vla_decl_has_extern_linkage : Error<
140   "variable length array declaration cannot have 'extern' linkage">;
141 def ext_vla_folded_to_constant : Extension<
142   "variable length array folded to constant array as an extension">, InGroup<GNUFoldingConstant>;
143 def err_vla_unsupported : Error<
144   "variable length arrays are not supported for the current target">;
145 def note_vla_unsupported : Note<
146   "variable length arrays are not supported for the current target">;
147
148 // C99 variably modified types
149 def err_variably_modified_template_arg : Error<
150   "variably modified type %0 cannot be used as a template argument">;
151 def err_variably_modified_nontype_template_param : Error<
152   "non-type template parameter of variably modified type %0">;
153 def err_variably_modified_new_type : Error<
154   "'new' cannot allocate object of variably modified type %0">;
155
156 // C99 Designated Initializers
157 def ext_designated_init : Extension<
158   "designated initializers are a C99 feature">, InGroup<C99>;
159 def err_array_designator_negative : Error<
160   "array designator value '%0' is negative">;
161 def err_array_designator_empty_range : Error<
162   "array designator range [%0, %1] is empty">;
163 def err_array_designator_non_array : Error<
164   "array designator cannot initialize non-array type %0">;
165 def err_array_designator_too_large : Error<
166   "array designator index (%0) exceeds array bounds (%1)">;
167 def err_field_designator_non_aggr : Error<
168   "field designator cannot initialize a "
169   "%select{non-struct, non-union|non-class}0 type %1">;
170 def err_field_designator_unknown : Error<
171   "field designator %0 does not refer to any field in type %1">;
172 def err_field_designator_nonfield : Error<
173   "field designator %0 does not refer to a non-static data member">;
174 def note_field_designator_found : Note<"field designator refers here">;
175 def err_designator_for_scalar_init : Error<
176   "designator in initializer for scalar type %0">;
177 def warn_subobject_initializer_overrides : Warning<
178   "subobject initialization overrides initialization of other fields "
179   "within its enclosing subobject">, InGroup<InitializerOverrides>;
180 def warn_initializer_overrides : Warning<
181   "initializer overrides prior initialization of this subobject">,
182   InGroup<InitializerOverrides>;
183 def note_previous_initializer : Note<
184   "previous initialization %select{|with side effects }0is here"
185   "%select{| (side effects may not occur at run time)}0">;
186 def err_designator_into_flexible_array_member : Error<
187   "designator into flexible array member subobject">;
188 def note_flexible_array_member : Note<
189   "initialized flexible array member %0 is here">;
190 def ext_flexible_array_init : Extension<
191   "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
192
193 // Declarations.
194 def ext_plain_complex : ExtWarn<
195   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
196 def ext_imaginary_constant : Extension<
197   "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
198 def ext_integer_complex : Extension<
199   "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
200
201 def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on "
202   "'_Fract' or '_Accum', not '%0'">;
203 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
204 def err_invalid_width_spec : Error<
205   "'%select{|short|long|long long}0 %1' is invalid">;
206 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
207
208 def ext_auto_type_specifier : ExtWarn<
209   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
210 def warn_auto_storage_class : Warning<
211   "'auto' storage class specifier is redundant and incompatible with C++11">,
212   InGroup<CXX11Compat>, DefaultIgnore;
213
214 def warn_deprecated_register : Warning<
215   "'register' storage class specifier is deprecated "
216   "and incompatible with C++17">, InGroup<DeprecatedRegister>;
217 def ext_register_storage_class : ExtWarn<
218   "ISO C++17 does not allow 'register' storage class specifier">,
219   DefaultError, InGroup<Register>;
220
221 def err_invalid_decl_spec_combination : Error<
222   "cannot combine with previous '%0' declaration specifier">;
223 def err_invalid_vector_decl_spec_combination : Error<
224   "cannot combine with previous '%0' declaration specifier. "
225   "'__vector' must be first">;
226 def err_invalid_pixel_decl_spec_combination : Error<
227   "'__pixel' must be preceded by '__vector'.  "
228   "'%0' declaration specifier not allowed here">;
229 def err_invalid_vector_bool_decl_spec : Error<
230   "cannot use '%0' with '__vector bool'">;
231 def err_invalid_vector_long_decl_spec : Error<
232   "cannot use 'long' with '__vector'">;
233 def err_invalid_vector_float_decl_spec : Error<
234   "cannot use 'float' with '__vector'">;
235 def err_invalid_vector_double_decl_spec : Error <
236   "use of 'double' with '__vector' requires VSX support to be enabled "
237   "(available on POWER7 or later)">;
238 def err_invalid_vector_long_long_decl_spec : Error <
239   "use of 'long long' with '__vector bool' requires VSX support (available on "
240   "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
241   "to be enabled">;
242 def err_invalid_vector_long_double_decl_spec : Error<
243   "cannot use 'long double' with '__vector'">;
244 def warn_vector_long_decl_spec_combination : Warning<
245   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
246
247 def err_redeclaration_different_type : Error<
248   "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
249 def err_bad_variable_name : Error<
250   "%0 cannot be the name of a variable or data member">;
251 def err_bad_parameter_name : Error<
252   "%0 cannot be the name of a parameter">;
253 def err_bad_parameter_name_template_id : Error<
254   "parameter name cannot have template arguments">;
255 def err_parameter_name_omitted : Error<"parameter name omitted">;
256 def err_anyx86_interrupt_attribute : Error<
257   "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
258   "have %select{a 'void' return type|"
259   "only a pointer parameter optionally followed by an integer parameter|"
260   "a pointer as the first parameter|a %2 type as the second parameter}1">;
261 def err_anyx86_interrupt_called : Error<
262   "interrupt service routine cannot be called directly">;
263 def warn_arm_interrupt_calling_convention : Warning<
264    "call to function without interrupt attribute could clobber interruptee's VFP registers">,
265    InGroup<Extra>;
266 def warn_interrupt_attribute_invalid : Warning<
267    "%select{MIPS|MSP430|RISC-V}0 'interrupt' attribute only applies to "
268    "functions that have %select{no parameters|a 'void' return type}1">,
269    InGroup<IgnoredAttributes>;
270 def warn_riscv_repeated_interrupt_attribute : Warning<
271   "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>;
272 def note_riscv_repeated_interrupt_attribute : Note<
273   "repeated RISC-V 'interrupt' attribute is here">;
274 def warn_unused_parameter : Warning<"unused parameter %0">,
275   InGroup<UnusedParameter>, DefaultIgnore;
276 def warn_unused_variable : Warning<"unused variable %0">,
277   InGroup<UnusedVariable>, DefaultIgnore;
278 def warn_unused_local_typedef : Warning<
279   "unused %select{typedef|type alias}0 %1">,
280   InGroup<UnusedLocalTypedef>, DefaultIgnore;
281 def warn_unused_property_backing_ivar :
282   Warning<"ivar %0 which backs the property is not "
283   "referenced in this property's accessor">,
284   InGroup<UnusedPropertyIvar>, DefaultIgnore;
285 def warn_unused_const_variable : Warning<"unused variable %0">,
286   InGroup<UnusedConstVariable>, DefaultIgnore;
287 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
288   InGroup<UnusedExceptionParameter>, DefaultIgnore;
289 def warn_decl_in_param_list : Warning<
290   "declaration of %0 will not be visible outside of this function">,
291   InGroup<Visibility>;
292 def warn_redefinition_in_param_list : Warning<
293   "redefinition of %0 will not be visible outside of this function">,
294   InGroup<Visibility>;
295 def warn_empty_parens_are_function_decl : Warning<
296   "empty parentheses interpreted as a function declaration">,
297   InGroup<VexingParse>;
298 def warn_parens_disambiguated_as_function_declaration : Warning<
299   "parentheses were disambiguated as a function declaration">,
300   InGroup<VexingParse>;
301 def warn_parens_disambiguated_as_variable_declaration : Warning<
302   "parentheses were disambiguated as redundant parentheses around declaration "
303   "of variable named %0">, InGroup<VexingParse>;
304 def warn_redundant_parens_around_declarator : Warning<
305   "redundant parentheses surrounding declarator">,
306   InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
307 def note_additional_parens_for_variable_declaration : Note<
308   "add a pair of parentheses to declare a variable">;
309 def note_raii_guard_add_name : Note<
310   "add a variable name to declare a %0 initialized with %1">;
311 def note_function_style_cast_add_parentheses : Note<
312   "add enclosing parentheses to perform a function-style cast">;
313 def note_remove_parens_for_variable_declaration : Note<
314   "remove parentheses to silence this warning">;
315 def note_empty_parens_function_call : Note<
316   "change this ',' to a ';' to call %0">;
317 def note_empty_parens_default_ctor : Note<
318   "remove parentheses to declare a variable">;
319 def note_empty_parens_zero_initialize : Note<
320   "replace parentheses with an initializer to declare a variable">;
321 def warn_unused_function : Warning<"unused function %0">,
322   InGroup<UnusedFunction>, DefaultIgnore;
323 def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
324   InGroup<UnusedTemplate>, DefaultIgnore;
325 def warn_unused_member_function : Warning<"unused member function %0">,
326   InGroup<UnusedMemberFunction>, DefaultIgnore;
327 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
328   InGroup<UsedButMarkedUnused>, DefaultIgnore;
329 def warn_unneeded_internal_decl : Warning<
330   "%select{function|variable}0 %1 is not needed and will not be emitted">,
331   InGroup<UnneededInternalDecl>, DefaultIgnore;
332 def warn_unneeded_static_internal_decl : Warning<
333   "'static' function %0 declared in header file "
334   "should be declared 'static inline'">,
335   InGroup<UnneededInternalDecl>, DefaultIgnore;
336 def warn_unneeded_member_function : Warning<
337   "member function %0 is not needed and will not be emitted">,
338   InGroup<UnneededMemberFunction>, DefaultIgnore;
339 def warn_unused_private_field: Warning<"private field %0 is not used">,
340   InGroup<UnusedPrivateField>, DefaultIgnore;
341 def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
342   "%select{used|required to be captured for this use}1">,
343   InGroup<UnusedLambdaCapture>, DefaultIgnore;
344
345 def warn_parameter_size: Warning<
346   "%0 is a large (%1 bytes) pass-by-value argument; "
347   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
348 def warn_return_value_size: Warning<
349   "return value of %0 is a large (%1 bytes) pass-by-value object; "
350   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
351 def warn_return_value_udt: Warning<
352   "%0 has C-linkage specified, but returns user-defined type %1 which is "
353   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
354 def warn_return_value_udt_incomplete: Warning<
355   "%0 has C-linkage specified, but returns incomplete type %1 which could be "
356   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
357 def warn_implicit_function_decl : Warning<
358   "implicit declaration of function %0">,
359   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
360 def ext_implicit_function_decl : ExtWarn<
361   "implicit declaration of function %0 is invalid in C99">,
362   InGroup<ImplicitFunctionDeclare>;
363 def note_function_suggestion : Note<"did you mean %0?">;
364
365 def err_ellipsis_first_param : Error<
366   "ISO C requires a named parameter before '...'">;
367 def err_declarator_need_ident : Error<"declarator requires an identifier">;
368 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
369 def err_language_linkage_spec_not_ascii : Error<
370   "string literal in language linkage specifier cannot have an "
371   "encoding-prefix">;
372 def ext_use_out_of_scope_declaration : ExtWarn<
373   "use of out-of-scope declaration of %0%select{| whose type is not "
374   "compatible with that of an implicit declaration}1">,
375   InGroup<DiagGroup<"out-of-scope-function">>;
376 def err_inline_non_function : Error<
377   "'inline' can only appear on functions%select{| and non-local variables}0">;
378 def err_noreturn_non_function : Error<
379   "'_Noreturn' can only appear on functions">;
380 def warn_qual_return_type : Warning<
381   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
382   InGroup<IgnoredQualifiers>, DefaultIgnore;
383 def warn_deprecated_redundant_constexpr_static_def : Warning<
384   "out-of-line definition of constexpr static data member is redundant "
385   "in C++17 and is deprecated">,
386   InGroup<Deprecated>, DefaultIgnore;
387
388 def warn_decl_shadow :
389   Warning<"declaration shadows a %select{"
390           "local variable|"
391           "variable in %2|"
392           "static data member of %2|"
393           "field of %2|"
394           "typedef in %2|"
395           "type alias in %2}1">,
396   InGroup<Shadow>, DefaultIgnore;
397 def warn_decl_shadow_uncaptured_local :
398   Warning<warn_decl_shadow.Text>,
399   InGroup<ShadowUncapturedLocal>, DefaultIgnore;
400 def warn_ctor_parm_shadows_field:
401   Warning<"constructor parameter %0 shadows the field %1 of %2">,
402   InGroup<ShadowFieldInConstructor>, DefaultIgnore;
403 def warn_modifying_shadowing_decl :
404   Warning<"modifying constructor parameter %0 that shadows a "
405           "field of %1">,
406   InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
407
408 // C++ decomposition declarations
409 def err_decomp_decl_context : Error<
410   "decomposition declaration not permitted in this context">;
411 def warn_cxx14_compat_decomp_decl : Warning<
412   "decomposition declarations are incompatible with "
413   "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
414 def ext_decomp_decl : ExtWarn<
415   "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
416 def ext_decomp_decl_cond : ExtWarn<
417   "ISO C++17 does not permit structured binding declaration in a condition">,
418   InGroup<DiagGroup<"binding-in-condition">>;
419 def err_decomp_decl_spec : Error<
420   "decomposition declaration cannot be declared "
421   "%plural{1:'%1'|:with '%1' specifiers}0">;
422 def ext_decomp_decl_spec : ExtWarn<
423   "decomposition declaration declared "
424   "%plural{1:'%1'|:with '%1' specifiers}0 is a C++2a extension">,
425   InGroup<CXX2a>;
426 def warn_cxx17_compat_decomp_decl_spec : Warning<
427   "decomposition declaration declared "
428   "%plural{1:'%1'|:with '%1' specifiers}0 "
429   "is incompatible with C++ standards before C++2a">,
430   InGroup<CXXPre2aCompat>, DefaultIgnore;
431 def err_decomp_decl_type : Error<
432   "decomposition declaration cannot be declared with type %0; "
433   "declared type must be 'auto' or reference to 'auto'">;
434 def err_decomp_decl_parens : Error<
435   "decomposition declaration cannot be declared with parentheses">;
436 def err_decomp_decl_template : Error<
437   "decomposition declaration template not supported">;
438 def err_decomp_decl_not_alone : Error<
439   "decomposition declaration must be the only declaration in its group">;
440 def err_decomp_decl_requires_init : Error<
441   "decomposition declaration %0 requires an initializer">;
442 def err_decomp_decl_wrong_number_bindings : Error<
443   "type %0 decomposes into %2 elements, but %select{only |}3%1 "
444   "names were provided">;
445 def err_decomp_decl_unbindable_type : Error<
446   "cannot decompose %select{union|non-class, non-array}1 type %2">;
447 def err_decomp_decl_multiple_bases_with_members : Error<
448   "cannot decompose class type %1: "
449   "%select{its base classes %2 and|both it and its base class}0 %3 "
450   "have non-static data members">;
451 def err_decomp_decl_ambiguous_base : Error<
452   "cannot decompose members of ambiguous base class %1 of %0:%2">;
453 def err_decomp_decl_inaccessible_base : Error<
454   "cannot decompose members of inaccessible base class %1 of %0">,
455   AccessControl;
456 def err_decomp_decl_inaccessible_field : Error<
457   "cannot decompose %select{private|protected}0 member %1 of %3">,
458   AccessControl;
459 def err_decomp_decl_anon_union_member : Error<
460   "cannot decompose class type %0 because it has an anonymous "
461   "%select{struct|union}1 member">;
462 def err_decomp_decl_std_tuple_element_not_specialized : Error<
463   "cannot decompose this type; 'std::tuple_element<%0>::type' "
464   "does not name a type">;
465 def err_decomp_decl_std_tuple_size_not_constant : Error<
466   "cannot decompose this type; 'std::tuple_size<%0>::value' "
467   "is not a valid integral constant expression">;
468 def note_in_binding_decl_init : Note<
469   "in implicit initialization of binding declaration %0">;
470
471 def err_std_type_trait_not_class_template : Error<
472   "unsupported standard library implementation: "
473   "'std::%0' is not a class template">;
474
475 // C++ using declarations
476 def err_using_requires_qualname : Error<
477   "using declaration requires a qualified name">;
478 def err_using_typename_non_type : Error<
479   "'typename' keyword used on a non-type">;
480 def err_using_dependent_value_is_type : Error<
481   "dependent using declaration resolved to type without 'typename'">;
482 def err_using_decl_nested_name_specifier_is_not_class : Error<
483   "using declaration in class refers into '%0', which is not a class">;
484 def err_using_decl_nested_name_specifier_is_current_class : Error<
485   "using declaration refers to its own class">;
486 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
487   "using declaration refers into '%0', which is not a base class of %1">;
488 def err_using_decl_constructor_not_in_direct_base : Error<
489   "%0 is not a direct base of %1, cannot inherit constructors">;
490 def err_using_decl_can_not_refer_to_class_member : Error<
491   "using declaration cannot refer to class member">;
492 def err_ambiguous_inherited_constructor : Error<
493   "constructor of %0 inherited from multiple base class subobjects">;
494 def note_ambiguous_inherited_constructor_using : Note<
495   "inherited from base class %0 here">;
496 def note_using_decl_class_member_workaround : Note<
497   "use %select{an alias declaration|a typedef declaration|a reference|"
498   "a const variable|a constexpr variable}0 instead">;
499 def err_using_decl_can_not_refer_to_namespace : Error<
500   "using declaration cannot refer to a namespace">;
501 def err_using_decl_can_not_refer_to_scoped_enum : Error<
502   "using declaration cannot refer to a scoped enumerator">;
503 def err_using_decl_constructor : Error<
504   "using declaration cannot refer to a constructor">;
505 def warn_cxx98_compat_using_decl_constructor : Warning<
506   "inheriting constructors are incompatible with C++98">,
507   InGroup<CXX98Compat>, DefaultIgnore;
508 def err_using_decl_destructor : Error<
509   "using declaration cannot refer to a destructor">;
510 def err_using_decl_template_id : Error<
511   "using declaration cannot refer to a template specialization">;
512 def note_using_decl_target : Note<"target of using declaration">;
513 def note_using_decl_conflict : Note<"conflicting declaration">;
514 def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
515 def err_using_decl_conflict : Error<
516   "target of using declaration conflicts with declaration already in scope">;
517 def err_using_decl_conflict_reverse : Error<
518   "declaration conflicts with target of using declaration already in scope">;
519 def note_using_decl : Note<"%select{|previous }0using declaration">;
520 def err_using_decl_redeclaration_expansion : Error<
521   "using declaration pack expansion at block scope produces multiple values">;
522
523 def warn_access_decl_deprecated : Warning<
524   "access declarations are deprecated; use using declarations instead">,
525   InGroup<Deprecated>;
526 def err_access_decl : Error<
527   "ISO C++11 does not allow access declarations; "
528   "use using declarations instead">;
529 def warn_deprecated_copy_operation : Warning<
530   "definition of implicit copy %select{constructor|assignment operator}1 "
531   "for %0 is deprecated because it has a user-declared "
532   "%select{copy %select{assignment operator|constructor}1|destructor}2">,
533   InGroup<Deprecated>, DefaultIgnore;
534 def warn_cxx17_compat_exception_spec_in_signature : Warning<
535   "mangled name of %0 will change in C++17 due to non-throwing exception "
536   "specification in function signature">, InGroup<CXX17CompatMangling>;
537
538 def warn_global_constructor : Warning<
539   "declaration requires a global constructor">,
540   InGroup<GlobalConstructors>, DefaultIgnore;
541 def warn_global_destructor : Warning<
542   "declaration requires a global destructor">,
543    InGroup<GlobalConstructors>, DefaultIgnore;
544 def warn_exit_time_destructor : Warning<
545   "declaration requires an exit-time destructor">,
546   InGroup<ExitTimeDestructors>, DefaultIgnore;
547
548 def err_invalid_thread : Error<
549   "'%0' is only allowed on variable declarations">;
550 def err_thread_non_global : Error<
551   "'%0' variables must have global storage">;
552 def err_thread_unsupported : Error<
553   "thread-local storage is not supported for the current target">;
554
555 def warn_maybe_falloff_nonvoid_function : Warning<
556   "control may reach end of non-void function">,
557   InGroup<ReturnType>;
558 def warn_falloff_nonvoid_function : Warning<
559   "control reaches end of non-void function">,
560   InGroup<ReturnType>;
561 def err_maybe_falloff_nonvoid_block : Error<
562   "control may reach end of non-void block">;
563 def err_falloff_nonvoid_block : Error<
564   "control reaches end of non-void block">;
565 def warn_maybe_falloff_nonvoid_coroutine : Warning<
566   "control may reach end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
567   InGroup<ReturnType>;
568 def warn_falloff_nonvoid_coroutine : Warning<
569   "control reaches end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
570   InGroup<ReturnType>;
571 def warn_suggest_noreturn_function : Warning<
572   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
573   InGroup<MissingNoreturn>, DefaultIgnore;
574 def warn_suggest_noreturn_block : Warning<
575   "block could be declared with attribute 'noreturn'">,
576   InGroup<MissingNoreturn>, DefaultIgnore;
577
578 // Unreachable code.
579 def warn_unreachable : Warning<
580   "code will never be executed">,
581   InGroup<UnreachableCode>, DefaultIgnore;
582 def warn_unreachable_break : Warning<
583   "'break' will never be executed">,
584   InGroup<UnreachableCodeBreak>, DefaultIgnore;
585 def warn_unreachable_return : Warning<
586   "'return' will never be executed">,
587   InGroup<UnreachableCodeReturn>, DefaultIgnore;
588 def warn_unreachable_loop_increment : Warning<
589   "loop will run at most once (loop increment never executed)">,
590   InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
591 def note_unreachable_silence : Note<
592   "silence by adding parentheses to mark code as explicitly dead">;
593
594 /// Built-in functions.
595 def ext_implicit_lib_function_decl : ExtWarn<
596   "implicitly declaring library function '%0' with type %1">,
597   InGroup<ImplicitFunctionDeclare>;
598 def note_include_header_or_declare : Note<
599   "include the header <%0> or explicitly provide a declaration for '%1'">;
600 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
601 def warn_implicit_decl_no_jmp_buf
602     : Warning<"declaration of built-in function '%0' requires the declaration"
603     " of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.">,
604       InGroup<DiagGroup<"incomplete-setjmp-declaration">>;
605 def warn_implicit_decl_requires_sysheader : Warning<
606   "declaration of built-in function '%1' requires inclusion of the header <%0>">,
607   InGroup<BuiltinRequiresHeader>;
608 def warn_redecl_library_builtin : Warning<
609   "incompatible redeclaration of library function %0">,
610   InGroup<DiagGroup<"incompatible-library-redeclaration">>;
611 def err_builtin_definition : Error<"definition of builtin function %0">;
612 def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
613 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
614 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
615 def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
616 def err_invalid_cpu_specific_dispatch_value : Error<
617 "invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">;
618 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
619   InGroup<ImplicitFunctionDeclare>, DefaultError;
620 def warn_cstruct_memaccess : Warning<
621   "%select{destination for|source of|first operand of|second operand of}0 this "
622   "%1 call is a pointer to record %2 that is not trivial to "
623   "%select{primitive-default-initialize|primitive-copy}3">,
624   InGroup<NonTrivialMemaccess>;
625 def note_nontrivial_field : Note<
626   "field is non-trivial to %select{copy|default-initialize}0">;
627 def err_non_trivial_c_union_in_invalid_context : Error<
628   "cannot %select{"
629   "use type %1 for a function/method parameter|"
630   "use type %1 for function/method return|"
631   "default-initialize an object of type %1|"
632   "declare an automatic variable of type %1|"
633   "copy-initialize an object of type %1|"
634   "assign to a variable of type %1|"
635   "construct an automatic compound literal of type %1|"
636   "capture a variable of type %1|"
637   "cannot use volatile type %1 where it causes an lvalue-to-rvalue conversion"
638   "}3 "
639   "since it %select{contains|is}2 a union that is non-trivial to "
640   "%select{default-initialize|destruct|copy}0">;
641 def note_non_trivial_c_union : Note<
642   "%select{%2 has subobjects that are|%3 has type %2 that is}0 "
643   "non-trivial to %select{default-initialize|destruct|copy}1">;
644 def warn_dyn_class_memaccess : Warning<
645   "%select{destination for|source of|first operand of|second operand of}0 this "
646   "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
647   "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
648   InGroup<DynamicClassMemaccess>;
649 def note_bad_memaccess_silence : Note<
650   "explicitly cast the pointer to silence this warning">;
651 def warn_sizeof_pointer_expr_memaccess : Warning<
652   "'%0' call operates on objects of type %1 while the size is based on a "
653   "different type %2">,
654   InGroup<SizeofPointerMemaccess>;
655 def warn_sizeof_pointer_expr_memaccess_note : Note<
656   "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
657   "it by the number of elements)|remove the addressof in the argument to "
658   "'sizeof' (and multiply it by the number of elements)|provide an explicit "
659   "length}0?">;
660 def warn_sizeof_pointer_type_memaccess : Warning<
661   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
662   "%select{destination|source}2; expected %3 or an explicit length">,
663   InGroup<SizeofPointerMemaccess>;
664 def warn_strlcpycat_wrong_size : Warning<
665   "size argument in %0 call appears to be size of the source; "
666   "expected the size of the destination">,
667   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
668 def note_strlcpycat_wrong_size : Note<
669   "change size argument to be the size of the destination">;
670 def warn_memsize_comparison : Warning<
671   "size argument in %0 call is a comparison">,
672   InGroup<DiagGroup<"memsize-comparison">>;
673 def note_memsize_comparison_paren : Note<
674   "did you mean to compare the result of %0 instead?">;
675 def note_memsize_comparison_cast_silence : Note<
676   "explicitly cast the argument to size_t to silence this warning">;
677 def warn_suspicious_sizeof_memset : Warning<
678   "%select{'size' argument to memset is '0'|"
679   "setting buffer to a 'sizeof' expression}0"
680   "; did you mean to transpose the last two arguments?">,
681   InGroup<MemsetTransposedArgs>;
682 def note_suspicious_sizeof_memset_silence : Note<
683   "%select{parenthesize the third argument|"
684   "cast the second argument to 'int'}0 to silence">;
685 def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">,
686   InGroup<SuspiciousBzero>;
687 def note_suspicious_bzero_size_silence : Note<
688   "parenthesize the second argument to silence">;
689
690 def warn_strncat_large_size : Warning<
691   "the value of the size argument in 'strncat' is too large, might lead to a "
692   "buffer overflow">, InGroup<StrncatSize>;
693 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
694   "to be size of the source">, InGroup<StrncatSize>;
695 def warn_strncat_wrong_size : Warning<
696   "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
697 def note_strncat_wrong_size : Note<
698   "change the argument to be the free space in the destination buffer minus "
699   "the terminating null byte">;
700
701 def warn_assume_side_effects : Warning<
702   "the argument to %0 has side effects that will be discarded">,
703   InGroup<DiagGroup<"assume">>;
704
705 def warn_builtin_chk_overflow : Warning<
706   "'%0' will always overflow; destination buffer has size %1,"
707   " but size argument is %2">,
708   InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
709
710 def warn_fortify_source_overflow
711   : Warning<warn_builtin_chk_overflow.Text>, InGroup<FortifySource>;
712 def warn_fortify_source_size_mismatch : Warning<
713   "'%0' size argument is too large; destination buffer has size %1,"
714   " but size argument is %2">, InGroup<FortifySource>;
715
716 /// main()
717 // static main() is not an error in C, just in C++.
718 def warn_static_main : Warning<"'main' should not be declared static">,
719     InGroup<Main>;
720 def err_static_main : Error<"'main' is not allowed to be declared static">;
721 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
722 def ext_variadic_main : ExtWarn<
723   "'main' is not allowed to be declared variadic">, InGroup<Main>;
724 def ext_noreturn_main : ExtWarn<
725   "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
726 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
727 def err_constexpr_main : Error<
728   "'main' is not allowed to be declared %select{constexpr|consteval}0">;
729 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
730 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
731 def err_main_returns_nonint : Error<"'main' must return 'int'">;
732 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
733     InGroup<MainReturnType>;
734 def note_main_change_return_type : Note<"change return type to 'int'">;
735 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
736     "must be 0, 2, or 3">;
737 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
738     InGroup<Main>;
739 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
740     "parameter of 'main' (%select{argument count|argument array|environment|"
741     "platform-specific data}0) must be of type %1">;
742 def warn_main_returns_bool_literal : Warning<"bool literal returned from "
743     "'main'">, InGroup<Main>;
744 def err_main_global_variable :
745     Error<"main cannot be declared as global variable">;
746 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
747     "has undefined behavior">, InGroup<Main>;
748 def ext_main_used : Extension<
749   "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
750
751 /// parser diagnostics
752 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
753   InGroup<MissingDeclarations>;
754 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
755   InGroup<MissingDeclarations>;
756 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
757 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
758   " of anonymous type, but linkage was already computed">;
759 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
760   "linkage prior to definition">;
761 def err_statically_allocated_object : Error<
762   "interface type cannot be statically allocated">;
763 def err_object_cannot_be_passed_returned_by_value : Error<
764   "interface type %1 cannot be %select{returned|passed}0 by value"
765   "; did you forget * in %1?">;
766 def err_parameters_retval_cannot_have_fp16_type : Error<
767   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
768 def err_opencl_half_load_store : Error<
769   "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
770   "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
771 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
772 def err_opencl_half_declaration : Error<
773   "declaring variable of type %0 is not allowed">;
774 def err_opencl_half_param : Error<
775   "declaring function parameter of type %0 is not allowed; did you forget * ?">;
776 def err_opencl_invalid_return : Error<
777   "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
778 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
779 def warn_pragma_options_align_reset_failed : Warning<
780   "#pragma options align=reset failed: %0">,
781   InGroup<IgnoredPragmas>;
782 def err_pragma_options_align_mac68k_target_unsupported : Error<
783   "mac68k alignment pragma is not supported on this target">;
784 def warn_pragma_pack_invalid_alignment : Warning<
785   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
786   InGroup<IgnoredPragmas>;
787 def warn_pragma_pack_non_default_at_include : Warning<
788   "non-default #pragma pack value changes the alignment of struct or union "
789   "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
790   DefaultIgnore;
791 def warn_pragma_pack_modified_after_include : Warning<
792   "the current #pragma pack alignment value is modified in the included "
793   "file">, InGroup<PragmaPack>;
794 def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
795   "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
796 def note_pragma_pack_here : Note<
797   "previous '#pragma pack' directive that modifies alignment is here">;
798 def note_pragma_pack_pop_instead_reset : Note<
799   "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
800 // Follow the Microsoft implementation.
801 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
802 def warn_pragma_pack_pop_identifier_and_alignment : Warning<
803   "specifying both a name and alignment to 'pop' is undefined">;
804 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
805   InGroup<IgnoredPragmas>;
806 def warn_cxx_ms_struct :
807   Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
808           "with base classes or virtual functions">,
809   DefaultError, InGroup<IncompatibleMSStruct>;
810 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
811 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
812 def err_invalid_super_scope : Error<"invalid use of '__super', "
813   "this keyword can only be used inside class or member function scope">;
814 def err_super_in_lambda_unsupported : Error<
815   "use of '__super' inside a lambda is unsupported">;
816
817 def warn_pragma_unused_undeclared_var : Warning<
818   "undeclared variable %0 used as an argument for '#pragma unused'">,
819   InGroup<IgnoredPragmas>;
820 def warn_atl_uuid_deprecated : Warning<
821   "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
822   InGroup<DeprecatedDeclarations>;
823 def warn_pragma_unused_expected_var_arg : Warning<
824   "only variables can be arguments to '#pragma unused'">,
825   InGroup<IgnoredPragmas>;
826 def err_pragma_push_visibility_mismatch : Error<
827   "#pragma visibility push with no matching #pragma visibility pop">;
828 def note_surrounding_namespace_ends_here : Note<
829   "surrounding namespace with visibility attribute ends here">;
830 def err_pragma_pop_visibility_mismatch : Error<
831   "#pragma visibility pop with no matching #pragma visibility push">;
832 def note_surrounding_namespace_starts_here : Note<
833   "surrounding namespace with visibility attribute starts here">;
834 def err_pragma_loop_invalid_argument_type : Error<
835   "invalid argument of type %0; expected an integer type">;
836 def err_pragma_loop_invalid_argument_value : Error<
837   "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
838 def err_pragma_loop_compatibility : Error<
839   "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
840 def err_pragma_loop_precedes_nonloop : Error<
841   "expected a for, while, or do-while loop to follow '%0'">;
842
843 def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
844   "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
845   "those declarations">;
846 def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
847   "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
848 def err_pragma_attribute_invalid_matchers : Error<
849   "attribute %0 can't be applied to %1">;
850 def err_pragma_attribute_stack_mismatch : Error<
851   "'#pragma clang attribute %select{%1.|}0pop' with no matching"
852   " '#pragma clang attribute %select{%1.|}0push'">;
853 def warn_pragma_attribute_unused : Warning<
854   "unused attribute %0 in '#pragma clang attribute push' region">,
855   InGroup<PragmaClangAttribute>;
856 def note_pragma_attribute_region_ends_here : Note<
857   "'#pragma clang attribute push' regions ends here">;
858 def err_pragma_attribute_no_pop_eof : Error<"unterminated "
859   "'#pragma clang attribute push' at end of file">;
860 def note_pragma_attribute_applied_decl_here : Note<
861   "when applied to this declaration">;
862 def err_pragma_attr_attr_no_push : Error<
863   "'#pragma clang attribute' attribute with no matching "
864   "'#pragma clang attribute push'">;
865
866 /// Objective-C parser diagnostics
867 def err_duplicate_class_def : Error<
868   "duplicate interface definition for class %0">;
869 def err_undef_superclass : Error<
870   "cannot find interface declaration for %0, superclass of %1">;
871 def err_forward_superclass : Error<
872   "attempting to use the forward class %0 as superclass of %1">;
873 def err_no_nsconstant_string_class : Error<
874   "cannot find interface declaration for %0">;
875 def err_recursive_superclass : Error<
876   "trying to recursively use %0 as superclass of %1">;
877 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
878 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
879 def warn_duplicate_protocol_def : Warning<
880   "duplicate protocol definition of %0 is ignored">,
881   InGroup<DiagGroup<"duplicate-protocol">>;
882 def err_protocol_has_circular_dependency : Error<
883   "protocol has circular dependency">;
884 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
885 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
886 def err_atprotocol_protocol : Error<
887   "@protocol is using a forward protocol declaration of %0">;
888 def warn_readonly_property : Warning<
889   "attribute 'readonly' of property %0 restricts attribute "
890   "'readwrite' of property inherited from %1">,
891   InGroup<PropertyAttr>;
892
893 def warn_property_attribute : Warning<
894   "'%1' attribute on property %0 does not match the property inherited from %2">,
895   InGroup<PropertyAttr>;
896 def warn_property_types_are_incompatible : Warning<
897   "property type %0 is incompatible with type %1 inherited from %2">,
898   InGroup<DiagGroup<"incompatible-property-type">>;
899 def warn_protocol_property_mismatch : Warning<
900   "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
901   "getter %1|with setter %1}0 was selected for synthesis">,
902   InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
903 def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
904 def err_undef_interface : Error<"cannot find interface declaration for %0">;
905 def err_category_forward_interface : Error<
906   "cannot define %select{category|class extension}0 for undefined class %1">;
907 def err_class_extension_after_impl : Error<
908   "cannot declare class extension for %0 after class implementation">;
909 def note_implementation_declared : Note<
910   "class implementation is declared here">;
911 def note_while_in_implementation : Note<
912   "detected while default synthesizing properties in class implementation">;
913 def note_class_declared : Note<
914   "class is declared here">;
915 def note_receiver_class_declared : Note<
916   "receiver is instance of class declared here">;
917 def note_receiver_expr_here : Note<
918   "receiver expression is here">;
919 def note_receiver_is_id : Note<
920   "receiver is treated with 'id' type for purpose of method lookup">;
921 def note_suppressed_class_declare : Note<
922   "class with specified objc_requires_property_definitions attribute is declared here">;
923 def err_objc_root_class_subclass : Error<
924   "objc_root_class attribute may only be specified on a root class declaration">;
925 def err_restricted_superclass_mismatch : Error<
926   "cannot subclass a class that was declared with the "
927   "'objc_subclassing_restricted' attribute">;
928 def err_class_stub_subclassing_mismatch : Error<
929   "'objc_class_stub' attribute cannot be specified on a class that does not "
930   "have the 'objc_subclassing_restricted' attribute">;
931 def err_implementation_of_class_stub : Error<
932   "cannot declare implementation of a class declared with the "
933   "'objc_class_stub' attribute">;
934 def warn_objc_root_class_missing : Warning<
935   "class %0 defined without specifying a base class">,
936   InGroup<ObjCRootClass>;
937 def err_objc_runtime_visible_category : Error<
938   "cannot implement a category for class %0 that is only visible via the "
939   "Objective-C runtime">;
940 def err_objc_runtime_visible_subclass : Error<
941   "cannot implement subclass %0 of a superclass %1 that is only visible via the "
942   "Objective-C runtime">;
943 def note_objc_needs_superclass : Note<
944   "add a super class to fix this problem">;
945 def err_conflicting_super_class : Error<"conflicting super class name %0">;
946 def err_dup_implementation_class : Error<"reimplementation of class %0">;
947 def err_dup_implementation_category : Error<
948   "reimplementation of category %1 for class %0">;
949 def err_conflicting_ivar_type : Error<
950   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
951 def err_duplicate_ivar_declaration : Error<
952   "instance variable is already declared">;
953 def warn_on_superclass_use : Warning<
954   "class implementation may not have super class">;
955 def err_conflicting_ivar_bitwidth : Error<
956   "instance variable %0 has conflicting bit-field width">;
957 def err_conflicting_ivar_name : Error<
958   "conflicting instance variable names: %0 vs %1">;
959 def err_inconsistent_ivar_count : Error<
960   "inconsistent number of instance variables specified">;
961 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
962   InGroup<DiagGroup<"incomplete-implementation">>;
963 def warn_objc_boxing_invalid_utf8_string : Warning<
964   "string is ill-formed as UTF-8 and will become a null %0 when boxed">,
965   InGroup<ObjCBoxing>;
966
967 def warn_conflicting_overriding_ret_types : Warning<
968   "conflicting return type in "
969   "declaration of %0%diff{: $ vs $|}1,2">,
970   InGroup<OverridingMethodMismatch>, DefaultIgnore;
971
972 def warn_conflicting_ret_types : Warning<
973   "conflicting return type in "
974   "implementation of %0%diff{: $ vs $|}1,2">,
975   InGroup<MismatchedReturnTypes>;
976
977 def warn_conflicting_overriding_ret_type_modifiers : Warning<
978   "conflicting distributed object modifiers on return type "
979   "in declaration of %0">,
980   InGroup<OverridingMethodMismatch>, DefaultIgnore;
981
982 def warn_conflicting_ret_type_modifiers : Warning<
983   "conflicting distributed object modifiers on return type "
984   "in implementation of %0">,
985   InGroup<DistributedObjectModifiers>;
986
987 def warn_non_covariant_overriding_ret_types : Warning<
988   "conflicting return type in "
989   "declaration of %0: %1 vs %2">,
990   InGroup<OverridingMethodMismatch>, DefaultIgnore;
991
992 def warn_non_covariant_ret_types : Warning<
993   "conflicting return type in "
994   "implementation of %0: %1 vs %2">,
995   InGroup<MethodSignatures>, DefaultIgnore;
996
997 def warn_conflicting_overriding_param_types : Warning<
998   "conflicting parameter types in "
999   "declaration of %0%diff{: $ vs $|}1,2">,
1000   InGroup<OverridingMethodMismatch>, DefaultIgnore;
1001
1002 def warn_conflicting_param_types : Warning<
1003   "conflicting parameter types in "
1004   "implementation of %0%diff{: $ vs $|}1,2">,
1005   InGroup<MismatchedParameterTypes>;
1006
1007 def warn_conflicting_param_modifiers : Warning<
1008   "conflicting distributed object modifiers on parameter type "
1009   "in implementation of %0">,
1010   InGroup<DistributedObjectModifiers>;
1011
1012 def warn_conflicting_overriding_param_modifiers : Warning<
1013   "conflicting distributed object modifiers on parameter type "
1014   "in declaration of %0">,
1015   InGroup<OverridingMethodMismatch>, DefaultIgnore;
1016
1017 def warn_non_contravariant_overriding_param_types : Warning<
1018   "conflicting parameter types in "
1019   "declaration of %0: %1 vs %2">,
1020   InGroup<OverridingMethodMismatch>, DefaultIgnore;
1021
1022 def warn_non_contravariant_param_types : Warning<
1023   "conflicting parameter types in "
1024   "implementation of %0: %1 vs %2">,
1025   InGroup<MethodSignatures>, DefaultIgnore;
1026
1027 def warn_conflicting_overriding_variadic :Warning<
1028   "conflicting variadic declaration of method and its "
1029   "implementation">,
1030   InGroup<OverridingMethodMismatch>, DefaultIgnore;
1031
1032 def warn_conflicting_variadic :Warning<
1033   "conflicting variadic declaration of method and its "
1034   "implementation">;
1035
1036 def warn_category_method_impl_match:Warning<
1037   "category is implementing a method which will also be implemented"
1038   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
1039
1040 def warn_implements_nscopying : Warning<
1041 "default assign attribute on property %0 which implements "
1042 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
1043
1044 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
1045   InGroup<ObjCMultipleMethodNames>;
1046 def warn_strict_multiple_method_decl : Warning<
1047   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
1048 def warn_accessor_property_type_mismatch : Warning<
1049   "type of property %0 does not match type of accessor %1">;
1050 def note_conv_function_declared_at : Note<"type conversion function declared here">;
1051 def note_method_declared_at : Note<"method %0 declared here">;
1052 def note_property_attribute : Note<"property %0 is declared "
1053   "%select{deprecated|unavailable|partial}1 here">;
1054 def err_setter_type_void : Error<"type of setter must be void">;
1055 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
1056 def warn_duplicate_method_decl :
1057   Warning<"multiple declarations of method %0 found and ignored">,
1058   InGroup<MethodDuplicate>, DefaultIgnore;
1059 def warn_objc_cdirective_format_string :
1060   Warning<"using %0 directive in %select{NSString|CFString}1 "
1061           "which is being passed as a formatting argument to the formatting "
1062           "%select{method|CFfunction}2">,
1063   InGroup<ObjCCStringFormat>, DefaultIgnore;
1064 def err_objc_var_decl_inclass :
1065     Error<"cannot declare variable inside @interface or @protocol">;
1066 def err_missing_method_context : Error<
1067   "missing context for method declaration">;
1068 def err_objc_property_attr_mutually_exclusive : Error<
1069   "property attributes '%0' and '%1' are mutually exclusive">;
1070 def err_objc_property_requires_object : Error<
1071   "property with '%0' attribute must be of object type">;
1072 def warn_objc_property_assign_on_object : Warning<
1073   "'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'">,
1074   InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
1075 def warn_objc_property_no_assignment_attribute : Warning<
1076   "no 'assign', 'retain', or 'copy' attribute is specified - "
1077   "'assign' is assumed">,
1078   InGroup<ObjCPropertyNoAttribute>;
1079 def warn_objc_isa_use : Warning<
1080   "direct access to Objective-C's isa is deprecated in favor of "
1081   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1082 def warn_objc_isa_assign : Warning<
1083   "assignment to Objective-C's isa is deprecated in favor of "
1084   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1085 def warn_objc_pointer_masking : Warning<
1086   "bitmasking for introspection of Objective-C object pointers is strongly "
1087   "discouraged">,
1088   InGroup<ObjCPointerIntrospect>;
1089 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1090   InGroup<ObjCPointerIntrospectPerformSelector>;
1091 def warn_objc_property_default_assign_on_object : Warning<
1092   "default property attribute 'assign' not appropriate for object">,
1093   InGroup<ObjCPropertyNoAttribute>;
1094 def warn_property_attr_mismatch : Warning<
1095   "property attribute in class extension does not match the primary class">,
1096   InGroup<PropertyAttr>;
1097 def warn_property_implicitly_mismatched : Warning <
1098   "primary property declaration is implicitly strong while redeclaration "
1099   "in class extension is weak">,
1100   InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1101 def warn_objc_property_copy_missing_on_block : Warning<
1102     "'copy' attribute must be specified for the block property "
1103     "when -fobjc-gc-only is specified">;
1104 def warn_objc_property_retain_of_block : Warning<
1105     "retain'ed block property does not copy the block "
1106     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1107 def warn_objc_readonly_property_has_setter : Warning<
1108     "setter cannot be specified for a readonly property">,
1109     InGroup<ObjCReadonlyPropertyHasSetter>;
1110 def warn_atomic_property_rule : Warning<
1111   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1112   "with a user defined %select{getter|setter}2">,
1113   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1114 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1115   "synthesized, or both be user defined,or the property must be nonatomic">;
1116 def err_atomic_property_nontrivial_assign_op : Error<
1117   "atomic property of reference type %0 cannot have non-trivial assignment"
1118   " operator">;
1119 def warn_cocoa_naming_owned_rule : Warning<
1120   "property follows Cocoa naming"
1121   " convention for returning 'owned' objects">,
1122   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1123 def err_cocoa_naming_owned_rule : Error<
1124   "property follows Cocoa naming"
1125   " convention for returning 'owned' objects">;
1126 def note_cocoa_naming_declare_family : Note<
1127   "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1128   "object">;
1129 def warn_auto_synthesizing_protocol_property :Warning<
1130   "auto property synthesis will not synthesize property %0"
1131   " declared in protocol %1">,
1132   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1133 def note_add_synthesize_directive : Note<
1134   "add a '@synthesize' directive">;
1135 def warn_no_autosynthesis_shared_ivar_property : Warning <
1136   "auto property synthesis will not synthesize property "
1137   "%0 because it cannot share an ivar with another synthesized property">,
1138   InGroup<ObjCNoPropertyAutoSynthesis>;
1139 def warn_no_autosynthesis_property : Warning<
1140   "auto property synthesis will not synthesize property "
1141   "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1142   "via another property">,
1143   InGroup<ObjCNoPropertyAutoSynthesis>;
1144 def warn_autosynthesis_property_in_superclass : Warning<
1145   "auto property synthesis will not synthesize property "
1146   "%0; it will be implemented by its superclass, use @dynamic to "
1147   "acknowledge intention">,
1148   InGroup<ObjCNoPropertyAutoSynthesis>;
1149 def warn_autosynthesis_property_ivar_match :Warning<
1150   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1151   "%2, not existing instance variable %3">,
1152   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1153 def warn_missing_explicit_synthesis : Warning <
1154   "auto property synthesis is synthesizing property not explicitly synthesized">,
1155   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1156 def warn_property_getter_owning_mismatch : Warning<
1157   "property declared as returning non-retained objects"
1158   "; getter returning retained objects">;
1159 def warn_property_redecl_getter_mismatch : Warning<
1160   "getter name mismatch between property redeclaration (%1) and its original "
1161   "declaration (%0)">, InGroup<PropertyAttr>;
1162 def err_property_setter_ambiguous_use : Error<
1163   "synthesized properties %0 and %1 both claim setter %2 -"
1164   " use of this setter will cause unexpected behavior">;
1165 def warn_default_atomic_custom_getter_setter : Warning<
1166   "atomic by default property %0 has a user defined %select{getter|setter}1 "
1167   "(property should be marked 'atomic' if this is intended)">,
1168   InGroup<CustomAtomic>, DefaultIgnore;
1169 def err_use_continuation_class : Error<
1170   "illegal redeclaration of property in class extension %0"
1171   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1172 def err_type_mismatch_continuation_class : Error<
1173   "type of property %0 in class extension does not match "
1174   "property type in primary class">;
1175 def err_use_continuation_class_redeclaration_readwrite : Error<
1176   "illegal redeclaration of 'readwrite' property in class extension %0"
1177   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1178   "'readonly' public property?)">;
1179 def err_continuation_class : Error<"class extension has no primary class">;
1180 def err_property_type : Error<"property cannot have array or function type %0">;
1181 def err_missing_property_context : Error<
1182   "missing context for property implementation declaration">;
1183 def err_bad_property_decl : Error<
1184   "property implementation must have its declaration in interface %0 or one of "
1185   "its extensions">;
1186 def err_category_property : Error<
1187   "property declared in category %0 cannot be implemented in "
1188   "class implementation">;
1189 def note_property_declare : Note<
1190   "property declared here">;
1191 def note_protocol_property_declare : Note<
1192   "it could also be property "
1193   "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1194   "%1|with setter %1}0 declared here">;
1195 def note_property_synthesize : Note<
1196   "property synthesized here">;
1197 def err_synthesize_category_decl : Error<
1198   "@synthesize not allowed in a category's implementation">;
1199 def err_synthesize_on_class_property : Error<
1200   "@synthesize not allowed on a class property %0">;
1201 def err_missing_property_interface : Error<
1202   "property implementation in a category with no category declaration">;
1203 def err_bad_category_property_decl : Error<
1204   "property implementation must have its declaration in the category %0">;
1205 def err_bad_property_context : Error<
1206   "property implementation must be in a class or category implementation">;
1207 def err_missing_property_ivar_decl : Error<
1208   "synthesized property %0 must either be named the same as a compatible"
1209   " instance variable or must explicitly name an instance variable">;
1210 def err_arc_perform_selector_retains : Error<
1211   "performSelector names a selector which retains the object">;
1212 def warn_arc_perform_selector_leaks : Warning<
1213   "performSelector may cause a leak because its selector is unknown">,
1214   InGroup<DiagGroup<"arc-performSelector-leaks">>;
1215 def warn_dealloc_in_category : Warning<
1216 "-dealloc is being overridden in a category">,
1217 InGroup<DeallocInCategory>;
1218 def err_gc_weak_property_strong_type : Error<
1219   "weak attribute declared on a __strong type property in GC mode">;
1220 def warn_arc_repeated_use_of_weak : Warning <
1221   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1222   "accessed multiple times in this %select{function|method|block|lambda}2 "
1223   "but may be unpredictably set to nil; assign to a strong variable to keep "
1224   "the object alive">,
1225   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1226 def warn_implicitly_retains_self : Warning <
1227   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1228   "this is intended behavior">,
1229   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1230 def warn_arc_possible_repeated_use_of_weak : Warning <
1231   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1232   "be accessed multiple times in this %select{function|method|block|lambda}2 "
1233   "and may be unpredictably set to nil; assign to a strong variable to keep "
1234   "the object alive">,
1235   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1236 def note_arc_weak_also_accessed_here : Note<
1237   "also accessed here">;
1238 def err_incomplete_synthesized_property : Error<
1239   "cannot synthesize property %0 with incomplete type %1">;
1240
1241 def err_property_ivar_type : Error<
1242   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1243 def err_property_accessor_type : Error<
1244   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1245 def err_ivar_in_superclass_use : Error<
1246   "property %0 attempting to use instance variable %1 declared in super class %2">;
1247 def err_weak_property : Error<
1248   "existing instance variable %1 for __weak property %0 must be __weak">;
1249 def err_strong_property : Error<
1250   "existing instance variable %1 for strong property %0 may not be __weak">;
1251 def err_dynamic_property_ivar_decl : Error<
1252   "dynamic property cannot have instance variable specification">;
1253 def err_duplicate_ivar_use : Error<
1254   "synthesized properties %0 and %1 both claim instance variable %2">;
1255 def err_property_implemented : Error<"property %0 is already implemented">;
1256 def warn_objc_missing_super_call : Warning<
1257   "method possibly missing a [super %0] call">,
1258   InGroup<ObjCMissingSuperCalls>;
1259 def err_dealloc_bad_result_type : Error<
1260   "dealloc return type must be correctly specified as 'void' under ARC, "
1261   "instead of %0">;
1262 def warn_undeclared_selector : Warning<
1263   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1264 def warn_undeclared_selector_with_typo : Warning<
1265   "undeclared selector %0; did you mean %1?">,
1266   InGroup<UndeclaredSelector>, DefaultIgnore;
1267 def warn_implicit_atomic_property : Warning<
1268   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1269 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1270   "property should be changed to be readwrite">;
1271 def warn_auto_readonly_iboutlet_property : Warning<
1272   "readonly IBOutlet property %0 when auto-synthesized may "
1273   "not work correctly with 'nib' loader">,
1274   InGroup<DiagGroup<"readonly-iboutlet-property">>;
1275 def warn_auto_implicit_atomic_property : Warning<
1276   "property is assumed atomic when auto-synthesizing the property">,
1277   InGroup<ImplicitAtomic>, DefaultIgnore;
1278 def warn_unimplemented_selector:  Warning<
1279   "no method with selector %0 is implemented in this translation unit">,
1280   InGroup<Selector>, DefaultIgnore;
1281 def warn_unimplemented_protocol_method : Warning<
1282   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1283 def warn_multiple_selectors: Warning<
1284   "several methods with selector %0 of mismatched types are found "
1285   "for the @selector expression">,
1286   InGroup<SelectorTypeMismatch>, DefaultIgnore;
1287
1288 def err_objc_kindof_nonobject : Error<
1289   "'__kindof' specifier cannot be applied to non-object type %0">;
1290 def err_objc_kindof_wrong_position : Error<
1291   "'__kindof' type specifier must precede the declarator">;
1292
1293 def err_objc_method_unsupported_param_ret_type : Error<
1294   "%0 %select{parameter|return}1 type is unsupported; "
1295   "support for vector types for this target is introduced in %2">;
1296
1297 def warn_messaging_unqualified_id : Warning<
1298   "messaging unqualified id">, DefaultIgnore,
1299   InGroup<DiagGroup<"objc-messaging-id">>;
1300
1301 // C++ declarations
1302 def err_static_assert_expression_is_not_constant : Error<
1303   "static_assert expression is not an integral constant expression">;
1304 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1305 def err_static_assert_requirement_failed : Error<
1306   "static_assert failed due to requirement '%0'%select{ %2|}1">;
1307
1308 def ext_inline_variable : ExtWarn<
1309   "inline variables are a C++17 extension">, InGroup<CXX17>;
1310 def warn_cxx14_compat_inline_variable : Warning<
1311   "inline variables are incompatible with C++ standards before C++17">,
1312   DefaultIgnore, InGroup<CXXPre17Compat>;
1313
1314 def warn_inline_namespace_reopened_noninline : Warning<
1315   "inline namespace reopened as a non-inline namespace">;
1316 def err_inline_namespace_mismatch : Error<
1317   "non-inline namespace cannot be reopened as inline">;
1318
1319 def err_unexpected_friend : Error<
1320   "friends can only be classes or functions">;
1321 def ext_enum_friend : ExtWarn<
1322   "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1323 def warn_cxx98_compat_enum_friend : Warning<
1324   "befriending enumeration type %0 is incompatible with C++98">,
1325   InGroup<CXX98Compat>, DefaultIgnore;
1326 def ext_nonclass_type_friend : ExtWarn<
1327   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1328 def warn_cxx98_compat_nonclass_type_friend : Warning<
1329   "non-class friend type %0 is incompatible with C++98">,
1330   InGroup<CXX98Compat>, DefaultIgnore;
1331 def err_friend_is_member : Error<
1332   "friends cannot be members of the declaring class">;
1333 def warn_cxx98_compat_friend_is_member : Warning<
1334   "friend declaration naming a member of the declaring class is incompatible "
1335   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1336 def ext_unelaborated_friend_type : ExtWarn<
1337   "unelaborated friend declaration is a C++11 extension; specify "
1338   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1339   InGroup<CXX11>;
1340 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1341   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1342   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1343 def err_qualified_friend_no_match : Error<
1344   "friend declaration of %0 does not match any declaration in %1">;
1345 def err_introducing_special_friend : Error<
1346   "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1347   " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1348   "as a friend">;
1349 def err_tagless_friend_type_template : Error<
1350   "friend type templates must use an elaborated type">;
1351 def err_no_matching_local_friend : Error<
1352   "no matching function found in local scope">;
1353 def err_no_matching_local_friend_suggest : Error<
1354   "no matching function %0 found in local scope; did you mean %3?">;
1355 def err_partial_specialization_friend : Error<
1356   "partial specialization cannot be declared as a friend">;
1357 def err_qualified_friend_def : Error<
1358   "friend function definition cannot be qualified with '%0'">;
1359 def err_friend_def_in_local_class : Error<
1360   "friend function cannot be defined in a local class">;
1361 def err_friend_not_first_in_declaration : Error<
1362   "'friend' must appear first in a non-function declaration">;
1363 def err_using_decl_friend : Error<
1364   "cannot befriend target of using declaration">;
1365 def warn_template_qualified_friend_unsupported : Warning<
1366   "dependent nested name specifier '%0' for friend class declaration is "
1367   "not supported; turning off access control for %1">,
1368   InGroup<UnsupportedFriend>;
1369 def warn_template_qualified_friend_ignored : Warning<
1370   "dependent nested name specifier '%0' for friend template declaration is "
1371   "not supported; ignoring this friend declaration">,
1372   InGroup<UnsupportedFriend>;
1373 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1374   "unqualified friend declaration referring to type outside of the nearest "
1375   "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1376   InGroup<MicrosoftUnqualifiedFriend>;
1377 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1378
1379 def err_invalid_base_in_interface : Error<
1380   "interface type cannot inherit from "
1381   "%select{struct|non-public interface|class}0 %1">;
1382
1383 def err_abstract_type_in_decl : Error<
1384   "%select{return|parameter|variable|field|instance variable|"
1385   "synthesized instance variable}0 type %1 is an abstract class">;
1386 def err_allocation_of_abstract_type : Error<
1387   "allocating an object of abstract class type %0">;
1388 def err_throw_abstract_type : Error<
1389   "cannot throw an object of abstract type %0">;
1390 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1391 def err_capture_of_abstract_type : Error<
1392   "by-copy capture of value of abstract type %0">;
1393 def err_capture_of_incomplete_type : Error<
1394   "by-copy capture of variable %0 with incomplete type %1">;
1395 def err_capture_default_non_local : Error<
1396   "non-local lambda expression cannot have a capture-default">;
1397
1398 def err_multiple_final_overriders : Error<
1399   "virtual function %q0 has more than one final overrider in %1">;
1400 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1401
1402 def err_type_defined_in_type_specifier : Error<
1403   "%0 cannot be defined in a type specifier">;
1404 def err_type_defined_in_result_type : Error<
1405   "%0 cannot be defined in the result type of a function">;
1406 def err_type_defined_in_param_type : Error<
1407   "%0 cannot be defined in a parameter type">;
1408 def err_type_defined_in_alias_template : Error<
1409   "%0 cannot be defined in a type alias template">;
1410 def err_type_defined_in_condition : Error<
1411   "%0 cannot be defined in a condition">;
1412 def err_type_defined_in_enum : Error<
1413   "%0 cannot be defined in an enumeration">;
1414
1415 def note_pure_virtual_function : Note<
1416   "unimplemented pure virtual method %0 in %1">;
1417
1418 def note_pure_qualified_call_kext : Note<
1419   "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1420
1421 def err_deleted_decl_not_first : Error<
1422   "deleted definition must be first declaration">;
1423
1424 def err_deleted_override : Error<
1425   "deleted function %0 cannot override a non-deleted function">;
1426
1427 def err_non_deleted_override : Error<
1428   "non-deleted function %0 cannot override a deleted function">;
1429
1430 def warn_weak_vtable : Warning<
1431   "%0 has no out-of-line virtual method definitions; its vtable will be "
1432   "emitted in every translation unit">,
1433   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1434 def warn_weak_template_vtable : Warning<
1435   "explicit template instantiation %0 will emit a vtable in every "
1436   "translation unit">,
1437   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1438
1439 def ext_using_undefined_std : ExtWarn<
1440   "using directive refers to implicitly-defined namespace 'std'">;
1441
1442 // C++ exception specifications
1443 def err_exception_spec_in_typedef : Error<
1444   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1445 def err_distant_exception_spec : Error<
1446   "exception specifications are not allowed beyond a single level "
1447   "of indirection">;
1448 def err_incomplete_in_exception_spec : Error<
1449   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1450   "in exception specification">;
1451 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1452   InGroup<MicrosoftExceptionSpec>;
1453 def err_rref_in_exception_spec : Error<
1454   "rvalue reference type %0 is not allowed in exception specification">;
1455 def err_mismatched_exception_spec : Error<
1456   "exception specification in declaration does not match previous declaration">;
1457 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1458   InGroup<MicrosoftExceptionSpec>;
1459 def err_override_exception_spec : Error<
1460   "exception specification of overriding function is more lax than "
1461   "base version">;
1462 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1463   InGroup<MicrosoftExceptionSpec>;
1464 def err_incompatible_exception_specs : Error<
1465   "target exception specification is not superset of source">;
1466 def warn_incompatible_exception_specs : Warning<
1467   err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1468 def err_deep_exception_specs_differ : Error<
1469   "exception specifications of %select{return|argument}0 types differ">;
1470 def warn_deep_exception_specs_differ : Warning<
1471   err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1472 def err_missing_exception_specification : Error<
1473   "%0 is missing exception specification '%1'">;
1474 def ext_missing_exception_specification : ExtWarn<
1475   err_missing_exception_specification.Text>,
1476   InGroup<DiagGroup<"missing-exception-spec">>;
1477 def ext_ms_missing_exception_specification : ExtWarn<
1478   err_missing_exception_specification.Text>,
1479   InGroup<MicrosoftExceptionSpec>;
1480 def err_noexcept_needs_constant_expression : Error<
1481   "argument to noexcept specifier must be a constant expression">;
1482 def err_exception_spec_not_parsed : Error<
1483   "exception specification is not available until end of class definition">;
1484 def err_exception_spec_cycle : Error<
1485   "exception specification of %0 uses itself">;
1486 def err_exception_spec_incomplete_type : Error<
1487   "exception specification needed for member of incomplete class %0">;
1488
1489 // C++ access checking
1490 def err_class_redeclared_with_different_access : Error<
1491   "%0 redeclared with '%1' access">;
1492 def err_access : Error<
1493   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1494 def ext_ms_using_declaration_inaccessible : ExtWarn<
1495   "using declaration referring to inaccessible member '%0' (which refers "
1496   "to accessible member '%1') is a Microsoft compatibility extension">,
1497     AccessControl, InGroup<MicrosoftUsingDecl>;
1498 def err_access_ctor : Error<
1499   "calling a %select{private|protected}0 constructor of class %2">,
1500   AccessControl;
1501 def ext_rvalue_to_reference_access_ctor : Extension<
1502   "C++98 requires an accessible copy constructor for class %2 when binding "
1503   "a reference to a temporary; was %select{private|protected}0">,
1504   AccessControl, InGroup<BindToTemporaryCopy>;
1505 def err_access_base_ctor : Error<
1506   // The ERRORs represent other special members that aren't constructors, in
1507   // hopes that someone will bother noticing and reporting if they appear
1508   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1509   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1510   "|*ERROR*|}2constructor">, AccessControl;
1511 def err_access_field_ctor : Error<
1512   // The ERRORs represent other special members that aren't constructors, in
1513   // hopes that someone will bother noticing and reporting if they appear
1514   "field of type %0 has %select{private|protected}2 "
1515   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1516   AccessControl;
1517 def err_access_friend_function : Error<
1518   "friend function %1 is a %select{private|protected}0 member of %3">,
1519   AccessControl;
1520
1521 def err_access_dtor : Error<
1522   "calling a %select{private|protected}1 destructor of class %0">,
1523   AccessControl;
1524 def err_access_dtor_base :
1525     Error<"base class %0 has %select{private|protected}1 destructor">,
1526     AccessControl;
1527 def err_access_dtor_vbase :
1528     Error<"inherited virtual base class %1 has "
1529     "%select{private|protected}2 destructor">,
1530     AccessControl;
1531 def err_access_dtor_temp :
1532     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1533     AccessControl;
1534 def err_access_dtor_exception :
1535     Error<"exception object of type %0 has %select{private|protected}1 "
1536           "destructor">, AccessControl;
1537 def err_access_dtor_field :
1538     Error<"field of type %1 has %select{private|protected}2 destructor">,
1539     AccessControl;
1540 def err_access_dtor_var :
1541     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1542     AccessControl;
1543 def err_access_dtor_ivar :
1544     Error<"instance variable of type %0 has %select{private|protected}1 "
1545           "destructor">,
1546     AccessControl;
1547 def note_previous_access_declaration : Note<
1548   "previously declared '%1' here">;
1549 def note_access_natural : Note<
1550   "%select{|implicitly }1declared %select{private|protected}0 here">;
1551 def note_access_constrained_by_path : Note<
1552   "constrained by %select{|implicitly }1%select{private|protected}0"
1553   " inheritance here">;
1554 def note_access_protected_restricted_noobject : Note<
1555   "must name member using the type of the current context %0">;
1556 def note_access_protected_restricted_ctordtor : Note<
1557   "protected %select{constructor|destructor}0 can only be used to "
1558   "%select{construct|destroy}0 a base class subobject">;
1559 def note_access_protected_restricted_object : Note<
1560   "can only access this member on an object of type %0">;
1561 def warn_cxx98_compat_sfinae_access_control : Warning<
1562   "substitution failure due to access control is incompatible with C++98">,
1563   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1564
1565 // C++ name lookup
1566 def err_incomplete_nested_name_spec : Error<
1567   "incomplete type %0 named in nested name specifier">;
1568 def err_dependent_nested_name_spec : Error<
1569   "nested name specifier for a declaration cannot depend on a template "
1570   "parameter">;
1571 def err_nested_name_member_ref_lookup_ambiguous : Error<
1572   "lookup of %0 in member access expression is ambiguous">;
1573 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1574   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1575   InGroup<AmbigMemberTemplate>;
1576 def note_ambig_member_ref_object_type : Note<
1577   "lookup in the object type %0 refers here">;
1578 def note_ambig_member_ref_scope : Note<
1579   "lookup from the current scope refers here">;
1580 def err_qualified_member_nonclass : Error<
1581   "qualified member access refers to a member in %0">;
1582 def err_incomplete_member_access : Error<
1583   "member access into incomplete type %0">;
1584 def err_incomplete_type : Error<
1585   "incomplete type %0 where a complete type is required">;
1586 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1587   "enumeration type in nested name specifier is incompatible with C++98">,
1588   InGroup<CXX98Compat>, DefaultIgnore;
1589 def err_nested_name_spec_is_not_class : Error<
1590   "%0 cannot appear before '::' because it is not a class"
1591   "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1592 def ext_nested_name_spec_is_enum : ExtWarn<
1593   "use of enumeration in a nested name specifier is a C++11 extension">,
1594   InGroup<CXX11>;
1595 def err_out_of_line_qualified_id_type_names_constructor : Error<
1596   "qualified reference to %0 is a constructor name rather than a "
1597   "%select{template name|type}1 in this context">;
1598 def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1599   "ISO C++ specifies that "
1600   "qualified reference to %0 is a constructor name rather than a "
1601   "%select{template name|type}1 in this context, despite preceding "
1602   "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1603   InGroup<DiagGroup<"injected-class-name">>;
1604
1605 // C++ class members
1606 def err_storageclass_invalid_for_member : Error<
1607   "storage class specified for a member declaration">;
1608 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1609 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1610 def ext_mutable_reference : ExtWarn<
1611   "'mutable' on a reference type is a Microsoft extension">,
1612   InGroup<MicrosoftMutableReference>;
1613 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1614 def err_mutable_nonmember : Error<
1615   "'mutable' can only be applied to member variables">;
1616 def err_virtual_in_union : Error<
1617   "unions cannot have virtual functions">;
1618 def err_virtual_non_function : Error<
1619   "'virtual' can only appear on non-static member functions">;
1620 def err_virtual_out_of_class : Error<
1621   "'virtual' can only be specified inside the class definition">;
1622 def err_virtual_member_function_template : Error<
1623   "'virtual' cannot be specified on member function templates">;
1624 def err_static_overrides_virtual : Error<
1625   "'static' member function %0 overrides a virtual function in a base class">;
1626 def err_explicit_non_function : Error<
1627   "'explicit' can only appear on non-static member functions">;
1628 def err_explicit_out_of_class : Error<
1629   "'explicit' can only be specified inside the class definition">;
1630 def err_explicit_non_ctor_or_conv_function : Error<
1631   "'explicit' can only be applied to a constructor or conversion function">;
1632 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1633 def err_static_out_of_line : Error<
1634   "'static' can only be specified inside the class definition">;
1635 def ext_static_out_of_line : ExtWarn<
1636   err_static_out_of_line.Text>,
1637   InGroup<MicrosoftTemplate>;
1638 def err_storage_class_for_static_member : Error<
1639   "static data member definition cannot specify a storage class">;
1640 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1641 def err_not_integral_type_bitfield : Error<
1642   "bit-field %0 has non-integral type %1">;
1643 def err_not_integral_type_anon_bitfield : Error<
1644   "anonymous bit-field has non-integral type %0">;
1645 def err_anon_bitfield_qualifiers : Error<
1646   "anonymous bit-field cannot have qualifiers">;
1647 def err_member_function_initialization : Error<
1648   "initializer on function does not look like a pure-specifier">;
1649 def err_non_virtual_pure : Error<
1650   "%0 is not virtual and cannot be declared pure">;
1651 def ext_pure_function_definition : ExtWarn<
1652   "function definition with pure-specifier is a Microsoft extension">,
1653   InGroup<MicrosoftPureDefinition>;
1654 def err_qualified_member_of_unrelated : Error<
1655   "%q0 is not a member of class %1">;
1656
1657 def err_member_function_call_bad_cvr : Error<
1658   "'this' argument to member function %0 has type %1, but function is not marked "
1659   "%select{const|restrict|const or restrict|volatile|const or volatile|"
1660   "volatile or restrict|const, volatile, or restrict}2">;
1661 def err_member_function_call_bad_ref : Error<
1662   "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1663   "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1664 def err_member_function_call_bad_type : Error<
1665   "cannot initialize object parameter of type %0 with an expression "
1666   "of type %1">;
1667
1668 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1669   "call to pure virtual member function %0 has undefined behavior; "
1670   "overrides of %0 in subclasses are not available in the "
1671   "%select{constructor|destructor}1 of %2">, InGroup<PureVirtualCallFromCtorDtor>;
1672
1673 def select_special_member_kind : TextSubstitution<
1674   "%select{default constructor|copy constructor|move constructor|"
1675   "copy assignment operator|move assignment operator|destructor}0">;
1676
1677 def note_member_declared_at : Note<"member is declared here">;
1678 def note_ivar_decl : Note<"instance variable is declared here">;
1679 def note_bitfield_decl : Note<"bit-field is declared here">;
1680 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1681 def note_member_synthesized_at : Note<
1682   "in implicit %sub{select_special_member_kind}0 for %1 "
1683   "first required here">;
1684 def err_missing_default_ctor : Error<
1685   "%select{constructor for %1 must explicitly initialize the|"
1686   "implicit default constructor for %1 must explicitly initialize the|"
1687   "cannot use constructor inherited from base class %4;}0 "
1688   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1689   "does not have a default constructor">;
1690 def note_due_to_dllexported_class : Note<
1691   "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">;
1692
1693 def err_illegal_union_or_anon_struct_member : Error<
1694   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1695   "%sub{select_special_member_kind}2">;
1696 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1697   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1698   "%sub{select_special_member_kind}2 is incompatible with C++98">,
1699   InGroup<CXX98Compat>, DefaultIgnore;
1700
1701 def note_nontrivial_virtual_dtor : Note<
1702   "destructor for %0 is not trivial because it is virtual">;
1703 def note_nontrivial_has_virtual : Note<
1704   "because type %0 has a virtual %select{member function|base class}1">;
1705 def note_nontrivial_no_def_ctor : Note<
1706   "because %select{base class of |field of |}0type %1 has no "
1707   "default constructor">;
1708 def note_user_declared_ctor : Note<
1709   "implicit default constructor suppressed by user-declared constructor">;
1710 def note_nontrivial_no_copy : Note<
1711   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1712   "assignment operator|<<ERROR>>}2 can be used to "
1713   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1714   "%select{base class|field|an object}0 of type %3">;
1715 def note_nontrivial_user_provided : Note<
1716   "because %select{base class of |field of |}0type %1 has a user-provided "
1717   "%sub{select_special_member_kind}2">;
1718 def note_nontrivial_in_class_init : Note<
1719   "because field %0 has an initializer">;
1720 def note_nontrivial_param_type : Note<
1721   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1722 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1723 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1724 def note_nontrivial_subobject : Note<
1725   "because the function selected to %select{construct|copy|move|copy|move|"
1726   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1727 def note_nontrivial_objc_ownership : Note<
1728   "because type %0 has a member with %select{no|no|__strong|__weak|"
1729   "__autoreleasing}1 ownership">;
1730
1731 def err_static_data_member_not_allowed_in_anon_struct : Error<
1732   "static data member %0 not allowed in anonymous struct">;
1733 def ext_static_data_member_in_union : ExtWarn<
1734   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1735 def warn_cxx98_compat_static_data_member_in_union : Warning<
1736   "static data member %0 in union is incompatible with C++98">,
1737   InGroup<CXX98Compat>, DefaultIgnore;
1738 def ext_union_member_of_reference_type : ExtWarn<
1739   "union member %0 has reference type %1, which is a Microsoft extension">,
1740   InGroup<MicrosoftUnionMemberReference>;
1741 def err_union_member_of_reference_type : Error<
1742   "union member %0 has reference type %1">;
1743 def ext_anonymous_struct_union_qualified : Extension<
1744   "anonymous %select{struct|union}0 cannot be '%1'">;
1745 def err_different_return_type_for_overriding_virtual_function : Error<
1746   "virtual function %0 has a different return type "
1747   "%diff{($) than the function it overrides (which has return type $)|"
1748   "than the function it overrides}1,2">;
1749 def note_overridden_virtual_function : Note<
1750   "overridden virtual function is here">;
1751 def err_conflicting_overriding_cc_attributes : Error<
1752   "virtual function %0 has different calling convention attributes "
1753   "%diff{($) than the function it overrides (which has calling convention $)|"
1754   "than the function it overrides}1,2">;
1755 def warn_overriding_method_missing_noescape : Warning<
1756   "parameter of overriding method should be annotated with "
1757   "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1758 def note_overridden_marked_noescape : Note<
1759   "parameter of overridden method is annotated with __attribute__((noescape))">;
1760 def note_cat_conform_to_noescape_prot : Note<
1761   "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
1762
1763 def err_covariant_return_inaccessible_base : Error<
1764   "invalid covariant return for virtual function: %1 is a "
1765   "%select{private|protected}2 base class of %0">, AccessControl;
1766 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1767   "return type of virtual function %3 is not covariant with the return type of "
1768   "the function it overrides (ambiguous conversion from derived class "
1769   "%0 to base class %1:%2)">;
1770 def err_covariant_return_not_derived : Error<
1771   "return type of virtual function %0 is not covariant with the return type of "
1772   "the function it overrides (%1 is not derived from %2)">;
1773 def err_covariant_return_incomplete : Error<
1774   "return type of virtual function %0 is not covariant with the return type of "
1775   "the function it overrides (%1 is incomplete)">;
1776 def err_covariant_return_type_different_qualifications : Error<
1777   "return type of virtual function %0 is not covariant with the return type of "
1778   "the function it overrides (%1 has different qualifiers than %2)">;
1779 def err_covariant_return_type_class_type_more_qualified : Error<
1780   "return type of virtual function %0 is not covariant with the return type of "
1781   "the function it overrides (class type %1 is more qualified than class "
1782   "type %2">;
1783
1784 // C++ implicit special member functions
1785 def note_in_declaration_of_implicit_special_member : Note<
1786   "while declaring the implicit %sub{select_special_member_kind}1"
1787   " for %0">;
1788
1789 // C++ constructors
1790 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1791 def err_invalid_qualified_constructor : Error<
1792   "'%0' qualifier is not allowed on a constructor">;
1793 def err_ref_qualifier_constructor : Error<
1794   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1795
1796 def err_constructor_return_type : Error<
1797   "constructor cannot have a return type">;
1798 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1799 def err_constructor_byvalue_arg : Error<
1800   "copy constructor must pass its first argument by reference">;
1801 def warn_no_constructor_for_refconst : Warning<
1802   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1803   "constructor to initialize its non-modifiable members">;
1804 def note_refconst_member_not_initialized : Note<
1805   "%select{const|reference}0 member %1 will never be initialized">;
1806 def ext_ms_explicit_constructor_call : ExtWarn<
1807   "explicit constructor calls are a Microsoft extension">,
1808   InGroup<MicrosoftExplicitConstructorCall>;
1809
1810 // C++ destructors
1811 def err_destructor_not_member : Error<
1812   "destructor must be a non-static member function">;
1813 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1814 def err_invalid_qualified_destructor : Error<
1815   "'%0' qualifier is not allowed on a destructor">;
1816 def err_ref_qualifier_destructor : Error<
1817   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1818 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1819 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1820 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1821 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1822 def err_destructor_typedef_name : Error<
1823   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1824 def err_destructor_name : Error<
1825   "expected the class name after '~' to name the enclosing class">;
1826 def err_destructor_class_name : Error<
1827   "expected the class name after '~' to name a destructor">;
1828 def err_ident_in_dtor_not_a_type : Error<
1829   "identifier %0 in object destruction expression does not name a type">;
1830 def err_destructor_expr_type_mismatch : Error<
1831   "destructor type %0 in object destruction expression does not match the "
1832   "type %1 of the object being destroyed">;
1833 def note_destructor_type_here : Note<
1834   "type %0 is declared here">;
1835
1836 def err_destroy_attr_on_non_static_var : Error<
1837   "%select{no_destroy|always_destroy}0 attribute can only be applied to a"
1838   " variable with static or thread storage duration">;
1839
1840 def err_destructor_template : Error<
1841   "destructor cannot be declared as a template">;
1842
1843 // C++ initialization
1844 def err_init_conversion_failed : Error<
1845   "cannot initialize %select{a variable|a parameter|return object|"
1846   "statement expression result|an "
1847   "exception object|a member subobject|an array element|a new value|a value|a "
1848   "base class|a constructor delegation|a vector element|a block element|a "
1849   "block element|a complex element|a lambda capture|a compound literal "
1850   "initializer|a related result|a parameter of CF audited function}0 "
1851   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1852   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1853   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1854   "|: different number of parameters (%5 vs %6)"
1855   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1856   "|: different return type%diff{ ($ vs $)|}5,6"
1857   "|: different qualifiers (%5 vs %6)"
1858   "|: different exception specifications}4">;
1859
1860 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1861   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1862 def err_lvalue_reference_bind_to_initlist : Error<
1863   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1864   "initializer list temporary">;
1865 def err_lvalue_reference_bind_to_temporary : Error<
1866   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1867   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1868 def err_lvalue_reference_bind_to_unrelated : Error<
1869   "%select{non-const|volatile}0 lvalue reference "
1870   "%diff{to type $ cannot bind to a value of unrelated type $|"
1871   "cannot bind to a value of unrelated type}1,2">;
1872 def err_reference_bind_drops_quals : Error<
1873   "binding reference %diff{of type $ to value of type $|to value}0,1 "
1874   "%select{drops %3 qualifier%plural{1:|2:|4:|:s}4|changes address space}2">;
1875 def err_reference_bind_failed : Error<
1876   "reference %diff{to %select{type|incomplete type}1 $ could not bind to an "
1877   "%select{rvalue|lvalue}2 of type $|could not bind to %select{rvalue|lvalue}2 of "
1878   "incompatible type}0,3">;
1879 def err_reference_bind_temporary_addrspace : Error<
1880   "reference of type %0 cannot bind to a temporary object because of "
1881   "address space mismatch">;
1882 def err_reference_bind_init_list : Error<
1883   "reference to type %0 cannot bind to an initializer list">;
1884 def err_init_list_bad_dest_type : Error<
1885   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1886   "list">;
1887 def warn_cxx2a_compat_aggregate_init_with_ctors : Warning<
1888   "aggregate initialization of type %0 with user-declared constructors "
1889   "is incompatible with C++2a">, DefaultIgnore, InGroup<CXX2aCompat>;
1890
1891 def err_reference_bind_to_bitfield : Error<
1892   "%select{non-const|volatile}0 reference cannot bind to "
1893   "bit-field%select{| %1}2">;
1894 def err_reference_bind_to_vector_element : Error<
1895   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1896 def err_reference_var_requires_init : Error<
1897   "declaration of reference variable %0 requires an initializer">;
1898 def err_reference_without_init : Error<
1899   "reference to type %0 requires an initializer">;
1900 def note_value_initialization_here : Note<
1901   "in value-initialization of type %0 here">;
1902 def err_reference_has_multiple_inits : Error<
1903   "reference cannot be initialized with multiple values">;
1904 def err_init_non_aggr_init_list : Error<
1905   "initialization of non-aggregate type %0 with an initializer list">;
1906 def err_init_reference_member_uninitialized : Error<
1907   "reference member of type %0 uninitialized">;
1908 def note_uninit_reference_member : Note<
1909   "uninitialized reference member is here">;
1910 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1911   InGroup<Uninitialized>;
1912 def warn_base_class_is_uninit : Warning<
1913   "base class %0 is uninitialized when used here to access %q1">,
1914   InGroup<Uninitialized>;
1915 def warn_reference_field_is_uninit : Warning<
1916   "reference %0 is not yet bound to a value when used here">,
1917   InGroup<Uninitialized>;
1918 def note_uninit_in_this_constructor : Note<
1919   "during field initialization in %select{this|the implicit default}0 "
1920   "constructor">;
1921 def warn_static_self_reference_in_init : Warning<
1922   "static variable %0 is suspiciously used within its own initialization">,
1923   InGroup<UninitializedStaticSelfInit>;
1924 def warn_uninit_self_reference_in_init : Warning<
1925   "variable %0 is uninitialized when used within its own initialization">,
1926   InGroup<Uninitialized>;
1927 def warn_uninit_self_reference_in_reference_init : Warning<
1928   "reference %0 is not yet bound to a value when used within its own"
1929   " initialization">,
1930   InGroup<Uninitialized>;
1931 def warn_uninit_var : Warning<
1932   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1933   InGroup<Uninitialized>, DefaultIgnore;
1934 def warn_sometimes_uninit_var : Warning<
1935   "variable %0 is %select{used|captured}1 uninitialized whenever "
1936   "%select{'%3' condition is %select{true|false}4|"
1937   "'%3' loop %select{is entered|exits because its condition is false}4|"
1938   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1939   "switch %3 is taken|"
1940   "its declaration is reached|"
1941   "%3 is called}2">,
1942   InGroup<UninitializedSometimes>, DefaultIgnore;
1943 def warn_maybe_uninit_var : Warning<
1944   "variable %0 may be uninitialized when "
1945   "%select{used here|captured by block}1">,
1946   InGroup<UninitializedMaybe>, DefaultIgnore;
1947 def note_var_declared_here : Note<"variable %0 is declared here">;
1948 def note_uninit_var_use : Note<
1949   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1950 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1951   "block pointer variable %0 is %select{uninitialized|null}1 when captured by "
1952   "block">, InGroup<Uninitialized>, DefaultIgnore;
1953 def note_block_var_fixit_add_initialization : Note<
1954   "did you mean to use __block %0?">;
1955 def note_in_omitted_aggregate_initializer : Note<
1956   "in implicit initialization of %select{"
1957   "array element %1 with omitted initializer|"
1958   "field %1 with omitted initializer|"
1959   "trailing array elements in runtime-sized array new}0">;
1960 def note_in_reference_temporary_list_initializer : Note<
1961   "in initialization of temporary of type %0 created to "
1962   "list-initialize this reference">;
1963 def note_var_fixit_add_initialization : Note<
1964   "initialize the variable %0 to silence this warning">;
1965 def note_uninit_fixit_remove_cond : Note<
1966   "remove the %select{'%1' if its condition|condition if it}0 "
1967   "is always %select{false|true}2">;
1968 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1969 def err_list_init_in_parens : Error<
1970   "cannot initialize %select{non-class|reference}0 type %1 with a "
1971   "parenthesized initializer list">;
1972
1973 def warn_unsequenced_mod_mod : Warning<
1974   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1975 def warn_unsequenced_mod_use : Warning<
1976   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1977
1978 def select_initialized_entity_kind : TextSubstitution<
1979   "%select{copying variable|copying parameter|"
1980   "returning object|initializing statement expression result|"
1981   "throwing object|copying member subobject|copying array element|"
1982   "allocating object|copying temporary|initializing base subobject|"
1983   "initializing vector element|capturing value}0">;
1984
1985 def err_temp_copy_no_viable : Error<
1986   "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">;
1987 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1988   "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; "
1989   "C++98 requires a copy constructor when binding a reference to a temporary">,
1990   InGroup<BindToTemporaryCopy>;
1991 def err_temp_copy_ambiguous : Error<
1992   "ambiguous constructor call when %sub{select_initialized_entity_kind}0 "
1993   "of type %1">;
1994 def err_temp_copy_deleted : Error<
1995   "%sub{select_initialized_entity_kind}0 of type %1 "
1996   "invokes deleted constructor">;
1997 def err_temp_copy_incomplete : Error<
1998   "copying a temporary object of incomplete type %0">;
1999 def warn_cxx98_compat_temp_copy : Warning<
2000   "%sub{select_initialized_entity_kind}1 "
2001   "of type %2 when binding a reference to a temporary would %select{invoke "
2002   "an inaccessible constructor|find no viable constructor|find ambiguous "
2003   "constructors|invoke a deleted constructor}0 in C++98">,
2004   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
2005 def err_selected_explicit_constructor : Error<
2006   "chosen constructor is explicit in copy-initialization">;
2007 def note_explicit_ctor_deduction_guide_here : Note<
2008   "explicit %select{constructor|deduction guide}0 declared here">;
2009
2010 // C++11 decltype
2011 def err_decltype_in_declarator : Error<
2012     "'decltype' cannot be used to name a declaration">;
2013
2014 // C++11 auto
2015 def warn_cxx98_compat_auto_type_specifier : Warning<
2016   "'auto' type specifier is incompatible with C++98">,
2017   InGroup<CXX98Compat>, DefaultIgnore;
2018 def err_auto_variable_cannot_appear_in_own_initializer : Error<
2019   "variable %0 declared with deduced type %1 "
2020   "cannot appear in its own initializer">;
2021 def err_binding_cannot_appear_in_own_initializer : Error<
2022   "binding %0 cannot appear in the initializer of its own "
2023   "decomposition declaration">;
2024 def err_illegal_decl_array_of_auto : Error<
2025   "'%0' declared as array of %1">;
2026 def err_new_array_of_auto : Error<
2027   "cannot allocate array of 'auto'">;
2028 def err_auto_not_allowed : Error<
2029   "%select{'auto'|'decltype(auto)'|'__auto_type'|"
2030   "use of "
2031   "%select{class template|function template|variable template|alias template|"
2032   "template template parameter|concept|template}2 %3 requires template "
2033   "arguments; argument deduction}0 not allowed "
2034   "%select{in function prototype"
2035   "|in non-static struct member|in struct member"
2036   "|in non-static union member|in union member"
2037   "|in non-static class member|in interface member"
2038   "|in exception declaration|in template parameter until C++17|in block literal"
2039   "|in template argument|in typedef|in type alias|in function return type"
2040   "|in conversion function type|here|in lambda parameter"
2041   "|in type allocated by 'new'|in K&R-style function parameter"
2042   "|in template parameter|in friend declaration}1">;
2043 def err_dependent_deduced_tst : Error<
2044   "typename specifier refers to "
2045   "%select{class template|function template|variable template|alias template|"
2046   "template template parameter|template}0 member in %1; "
2047   "argument deduction not allowed here">;
2048 def err_auto_not_allowed_var_inst : Error<
2049   "'auto' variable template instantiation is not allowed">;
2050 def err_auto_var_requires_init : Error<
2051   "declaration of variable %0 with deduced type %1 requires an initializer">;
2052 def err_auto_new_requires_ctor_arg : Error<
2053   "new expression for type %0 requires a constructor argument">;
2054 def ext_auto_new_list_init : Extension<
2055   "ISO C++ standards before C++17 do not allow new expression for "
2056   "type %0 to use list-initialization">, InGroup<CXX17>;
2057 def err_auto_var_init_no_expression : Error<
2058   "initializer for variable %0 with type %1 is empty">;
2059 def err_auto_var_init_multiple_expressions : Error<
2060   "initializer for variable %0 with type %1 contains multiple expressions">;
2061 def err_auto_var_init_paren_braces : Error<
2062   "cannot deduce type for variable %1 with type %2 from "
2063   "%select{parenthesized|nested}0 initializer list">;
2064 def err_auto_new_ctor_multiple_expressions : Error<
2065   "new expression for type %0 contains multiple constructor arguments">;
2066 def err_auto_missing_trailing_return : Error<
2067   "'auto' return without trailing return type; deduced return types are a "
2068   "C++14 extension">;
2069 def err_deduced_return_type : Error<
2070   "deduced return types are a C++14 extension">;
2071 def err_trailing_return_without_auto : Error<
2072   "function with trailing return type must specify return type 'auto', not %0">;
2073 def err_trailing_return_in_parens : Error<
2074   "trailing return type may not be nested within parentheses">;
2075 def err_auto_var_deduction_failure : Error<
2076   "variable %0 with type %1 has incompatible initializer of type %2">;
2077 def err_auto_var_deduction_failure_from_init_list : Error<
2078   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2079 def err_auto_new_deduction_failure : Error<
2080   "new expression for type %0 has incompatible constructor argument of type %1">;
2081 def err_auto_inconsistent_deduction : Error<
2082   "deduced conflicting types %diff{($ vs $) |}0,1"
2083   "for initializer list element type">;
2084 def err_auto_different_deductions : Error<
2085   "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2086   "deduced as %1 in declaration of %2 and "
2087   "deduced as %3 in declaration of %4">;
2088 def err_auto_non_deduced_not_alone : Error<
2089   "%select{function with deduced return type|"
2090   "declaration with trailing return type}0 "
2091   "must be the only declaration in its group">;
2092 def err_implied_std_initializer_list_not_found : Error<
2093   "cannot deduce type of initializer list because std::initializer_list was "
2094   "not found; include <initializer_list>">;
2095 def err_malformed_std_initializer_list : Error<
2096   "std::initializer_list must be a class template with a single type parameter">;
2097 def err_auto_init_list_from_c : Error<
2098   "cannot use __auto_type with initializer list in C">;
2099 def err_auto_bitfield : Error<
2100   "cannot pass bit-field as __auto_type initializer in C">;
2101
2102 // C++1y decltype(auto) type
2103 def err_decltype_auto_invalid : Error<
2104   "'decltype(auto)' not allowed here">;
2105 def err_decltype_auto_cannot_be_combined : Error<
2106   "'decltype(auto)' cannot be combined with other type specifiers">;
2107 def err_decltype_auto_function_declarator_not_declaration : Error<
2108   "'decltype(auto)' can only be used as a return type "
2109   "in a function declaration">;
2110 def err_decltype_auto_compound_type : Error<
2111   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2112 def err_decltype_auto_initializer_list : Error<
2113   "cannot deduce 'decltype(auto)' from initializer list">;
2114
2115 // C++17 deduced class template specialization types
2116 def err_deduced_class_template_compound_type : Error<
2117   "cannot %select{form pointer to|form reference to|form array of|"
2118   "form function returning|use parentheses when declaring variable with}0 "
2119   "deduced class template specialization type">;
2120 def err_deduced_non_class_template_specialization_type : Error<
2121   "%select{<error>|function template|variable template|alias template|"
2122   "template template parameter|concept|template}0 %1 requires template "
2123   "arguments; argument deduction only allowed for class templates">;
2124 def err_deduced_class_template_ctor_ambiguous : Error<
2125   "ambiguous deduction for template arguments of %0">;
2126 def err_deduced_class_template_ctor_no_viable : Error<
2127   "no viable constructor or deduction guide for deduction of "
2128   "template arguments of %0">;
2129 def err_deduced_class_template_incomplete : Error<
2130   "template %0 has no definition and no %select{|viable }1deduction guides "
2131   "for deduction of template arguments">;
2132 def err_deduced_class_template_deleted : Error<
2133   "class template argument deduction for %0 selected a deleted constructor">;
2134 def err_deduced_class_template_explicit : Error<
2135   "class template argument deduction for %0 selected an explicit "
2136   "%select{constructor|deduction guide}1 for copy-list-initialization">;
2137 def err_deduction_guide_no_trailing_return_type : Error<
2138   "deduction guide declaration without trailing return type">;
2139 def err_deduction_guide_bad_trailing_return_type : Error<
2140   "deduced type %1 of deduction guide is not %select{|written as }2"
2141   "a specialization of template %0">;
2142 def err_deduction_guide_with_complex_decl : Error<
2143   "cannot specify any part of a return type in the "
2144   "declaration of a deduction guide">;
2145 def err_deduction_guide_invalid_specifier : Error<
2146   "deduction guide cannot be declared '%0'">;
2147 def err_deduction_guide_name_not_class_template : Error<
2148   "cannot specify deduction guide for "
2149   "%select{<error>|function template|variable template|alias template|"
2150   "template template parameter|concept|dependent template name}0 %1">;
2151 def err_deduction_guide_wrong_scope : Error<
2152   "deduction guide must be declared in the same scope as template %q0">;
2153 def err_deduction_guide_defines_function : Error<
2154   "deduction guide cannot have a function definition">;
2155 def err_deduction_guide_redeclared : Error<
2156   "redeclaration of deduction guide">;
2157 def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2158   "%select{explicitly instantiated|explicitly specialized}0">;
2159 def err_deduction_guide_template_not_deducible : Error<
2160   "deduction guide template contains "
2161   "%select{a template parameter|template parameters}0 that cannot be "
2162   "deduced">;
2163 def err_deduction_guide_wrong_access : Error<
2164   "deduction guide has different access from the corresponding "
2165   "member template">;
2166 def note_deduction_guide_template_access : Note<
2167   "member template declared %0 here">;
2168 def note_deduction_guide_access : Note<
2169   "deduction guide declared %0 by intervening access specifier">;
2170 def warn_cxx14_compat_class_template_argument_deduction : Warning<
2171   "class template argument deduction is incompatible with C++ standards "
2172   "before C++17%select{|; for compatibility, use explicit type name %1}0">,
2173   InGroup<CXXPre17Compat>, DefaultIgnore;
2174 def warn_ctad_maybe_unsupported : Warning<
2175   "%0 may not intend to support class template argument deduction">,
2176   InGroup<CTADMaybeUnsupported>, DefaultIgnore;
2177 def note_suppress_ctad_maybe_unsupported : Note<
2178   "add a deduction guide to suppress this warning">;
2179
2180
2181 // C++14 deduced return types
2182 def err_auto_fn_deduction_failure : Error<
2183   "cannot deduce return type %0 from returned value of type %1">;
2184 def err_auto_fn_different_deductions : Error<
2185   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2186   "deduced as %2 in earlier return statement">;
2187 def err_auto_fn_used_before_defined : Error<
2188   "function %0 with deduced return type cannot be used before it is defined">;
2189 def err_auto_fn_no_return_but_not_auto : Error<
2190   "cannot deduce return type %0 for function with no return statements">;
2191 def err_auto_fn_return_void_but_not_auto : Error<
2192   "cannot deduce return type %0 from omitted return expression">;
2193 def err_auto_fn_return_init_list : Error<
2194   "cannot deduce return type from initializer list">;
2195 def err_auto_fn_virtual : Error<
2196   "function with deduced return type cannot be virtual">;
2197 def warn_cxx11_compat_deduced_return_type : Warning<
2198   "return type deduction is incompatible with C++ standards before C++14">,
2199   InGroup<CXXPre14Compat>, DefaultIgnore;
2200
2201 // C++11 override control
2202 def override_keyword_only_allowed_on_virtual_member_functions : Error<
2203   "only virtual member functions can be marked '%0'">;
2204 def override_keyword_hides_virtual_member_function : Error<
2205   "non-virtual member function marked '%0' hides virtual member "
2206   "%select{function|functions}1">;
2207 def err_function_marked_override_not_overriding : Error<
2208   "%0 marked 'override' but does not override any member functions">;
2209 def warn_destructor_marked_not_override_overriding : Warning <
2210   "%0 overrides a destructor but is not marked 'override'">,
2211   InGroup<CXX11WarnOverrideDestructor>, DefaultIgnore;
2212 def warn_function_marked_not_override_overriding : Warning <
2213   "%0 overrides a member function but is not marked 'override'">,
2214   InGroup<CXX11WarnOverrideMethod>;
2215 def err_class_marked_final_used_as_base : Error<
2216   "base %0 is marked '%select{final|sealed}1'">;
2217 def warn_abstract_final_class : Warning<
2218   "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2219
2220 // C++11 attributes
2221 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2222
2223 // C++11 final
2224 def err_final_function_overridden : Error<
2225   "declaration of %0 overrides a '%select{final|sealed}1' function">;
2226
2227 // C++11 scoped enumerations
2228 def err_enum_invalid_underlying : Error<
2229   "non-integral type %0 is an invalid underlying type">;
2230 def err_enumerator_too_large : Error<
2231   "enumerator value is not representable in the underlying type %0">;
2232 def ext_enumerator_too_large : Extension<
2233   "enumerator value is not representable in the underlying type %0">,
2234   InGroup<MicrosoftEnumValue>;
2235 def err_enumerator_wrapped : Error<
2236   "enumerator value %0 is not representable in the underlying type %1">;
2237 def err_enum_redeclare_type_mismatch : Error<
2238   "enumeration redeclared with different underlying type %0 (was %1)">;
2239 def err_enum_redeclare_fixed_mismatch : Error<
2240   "enumeration previously declared with %select{non|}0fixed underlying type">;
2241 def err_enum_redeclare_scoped_mismatch : Error<
2242   "enumeration previously declared as %select{un|}0scoped">;
2243 def err_enum_class_reference : Error<
2244   "reference to %select{|scoped }0enumeration must use 'enum' "
2245   "not 'enum class'">;
2246 def err_only_enums_have_underlying_types : Error<
2247   "only enumeration types have underlying types">;
2248 def err_underlying_type_of_incomplete_enum : Error<
2249   "cannot determine underlying type of incomplete enumeration type %0">;
2250
2251 // C++11 delegating constructors
2252 def err_delegating_ctor : Error<
2253   "delegating constructors are permitted only in C++11">;
2254 def warn_cxx98_compat_delegating_ctor : Warning<
2255   "delegating constructors are incompatible with C++98">,
2256   InGroup<CXX98Compat>, DefaultIgnore;
2257 def err_delegating_initializer_alone : Error<
2258   "an initializer for a delegating constructor must appear alone">;
2259 def warn_delegating_ctor_cycle : Warning<
2260   "constructor for %0 creates a delegation cycle">, DefaultError,
2261   InGroup<DelegatingCtorCycles>;
2262 def note_it_delegates_to : Note<"it delegates to">;
2263 def note_which_delegates_to : Note<"which delegates to">;
2264
2265 // C++11 range-based for loop
2266 def err_for_range_decl_must_be_var : Error<
2267   "for range declaration must declare a variable">;
2268 def err_for_range_storage_class : Error<
2269   "loop variable %0 may not be declared %select{'extern'|'static'|"
2270   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2271 def err_type_defined_in_for_range : Error<
2272   "types may not be defined in a for range declaration">;
2273 def err_for_range_deduction_failure : Error<
2274   "cannot use type %0 as a range">;
2275 def err_for_range_incomplete_type : Error<
2276   "cannot use incomplete type %0 as a range">;
2277 def err_for_range_iter_deduction_failure : Error<
2278   "cannot use type %0 as an iterator">;
2279 def ext_for_range_begin_end_types_differ : ExtWarn<
2280   "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2281   InGroup<CXX17>;
2282 def warn_for_range_begin_end_types_differ : Warning<
2283   "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2284   "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2285 def note_in_for_range: Note<
2286   "when looking up '%select{begin|end}0' function for range expression "
2287   "of type %1">;
2288 def err_for_range_invalid: Error<
2289   "invalid range expression of type %0; no viable '%select{begin|end}1' "
2290   "function available">;
2291 def note_for_range_member_begin_end_ignored : Note<
2292   "member is not a candidate because range type %0 has no '%select{end|begin}1' member">;
2293 def err_range_on_array_parameter : Error<
2294   "cannot build range expression with array function parameter %0 since "
2295   "parameter with array type %1 is treated as pointer type %2">;
2296 def err_for_range_dereference : Error<
2297   "invalid range expression of type %0; did you mean to dereference it "
2298   "with '*'?">;
2299 def note_for_range_invalid_iterator : Note <
2300   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2301 def note_for_range_begin_end : Note<
2302   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2303 def warn_for_range_const_reference_copy : Warning<
2304   "loop variable %0 "
2305   "%diff{has type $ but is initialized with type $"
2306   "| is initialized with a value of a different type}1,2 resulting in a copy">,
2307   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2308 def note_use_type_or_non_reference : Note<
2309   "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2310 def warn_for_range_variable_always_copy : Warning<
2311   "loop variable %0 is always a copy because the range of type %1 does not "
2312   "return a reference">,
2313   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2314 def note_use_non_reference_type : Note<"use non-reference type %0">;
2315 def warn_for_range_copy : Warning<
2316   "loop variable %0 of type %1 creates a copy from type %2">,
2317   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2318 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2319 def err_objc_for_range_init_stmt : Error<
2320   "initialization statement is not supported when iterating over Objective-C "
2321   "collection">;
2322
2323 // C++11 constexpr
2324 def warn_cxx98_compat_constexpr : Warning<
2325   "'constexpr' specifier is incompatible with C++98">,
2326   InGroup<CXX98Compat>, DefaultIgnore;
2327 // FIXME: Maybe this should also go in -Wc++14-compat?
2328 def warn_cxx14_compat_constexpr_not_const : Warning<
2329   "'constexpr' non-static member function will not be implicitly 'const' "
2330   "in C++14; add 'const' to avoid a change in behavior">,
2331   InGroup<DiagGroup<"constexpr-not-const">>;
2332 def err_invalid_constexpr : Error<
2333   "%select{function parameter|typedef|non-static data member}0 "
2334   "cannot be %select{constexpr|consteval}1">;
2335 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2336   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2337 def err_constexpr_tag : Error<
2338   "%select{class|struct|interface|union|enum}0 "
2339   "cannot be marked %select{constexpr|consteval}1">;
2340 def err_constexpr_dtor : Error<
2341   "destructor cannot be marked %select{constexpr|consteval}0">;
2342 def err_constexpr_wrong_decl_kind : Error<
2343   "%select{constexpr|consteval}0 can only be used "
2344   "in %select{variable and |}0function declarations">;
2345 def err_invalid_constexpr_var_decl : Error<
2346   "constexpr variable declaration must be a definition">;
2347 def err_constexpr_static_mem_var_requires_init : Error<
2348   "declaration of constexpr static data member %0 requires an initializer">;
2349 def err_constexpr_var_non_literal : Error<
2350   "constexpr variable cannot have non-literal type %0">;
2351 def err_constexpr_var_requires_const_init : Error<
2352   "constexpr variable %0 must be initialized by a constant expression">;
2353 def err_constexpr_redecl_mismatch : Error<
2354   "%select{non-constexpr|constexpr|consteval}1 declaration of %0"
2355   " follows %select{non-constexpr|constexpr|consteval}2 declaration">;
2356 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2357 def warn_cxx17_compat_constexpr_virtual : Warning<
2358   "virtual constexpr functions are incompatible with "
2359   "C++ standards before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
2360 def err_constexpr_virtual_base : Error<
2361   "constexpr %select{member function|constructor}0 not allowed in "
2362   "%select{struct|interface|class}1 with virtual base "
2363   "%plural{1:class|:classes}2">;
2364 def note_non_literal_incomplete : Note<
2365   "incomplete type %0 is not a literal type">;
2366 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2367   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2368 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2369 def err_constexpr_non_literal_return : Error<
2370   "%select{constexpr|consteval}0 function's return type %1 is not a literal type">;
2371 def err_constexpr_non_literal_param : Error<
2372   "%select{constexpr|consteval}2 %select{function|constructor}1's %ordinal0 parameter type %3 is "
2373   "not a literal type">;
2374 def err_constexpr_body_invalid_stmt : Error<
2375   "statement not allowed in %select{constexpr|consteval}1 %select{function|constructor}0">;
2376 def ext_constexpr_body_invalid_stmt : ExtWarn<
2377   "use of this statement in a constexpr %select{function|constructor}0 "
2378   "is a C++14 extension">, InGroup<CXX14>;
2379 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2380   "use of this statement in a constexpr %select{function|constructor}0 "
2381   "is incompatible with C++ standards before C++14">,
2382   InGroup<CXXPre14Compat>, DefaultIgnore;
2383 def ext_constexpr_body_invalid_stmt_cxx2a : ExtWarn<
2384   "use of this statement in a constexpr %select{function|constructor}0 "
2385   "is a C++2a extension">, InGroup<CXX2a>;
2386 def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
2387   "use of this statement in a constexpr %select{function|constructor}0 "
2388   "is incompatible with C++ standards before C++2a">,
2389   InGroup<CXXPre2aCompat>, DefaultIgnore;
2390 def ext_constexpr_type_definition : ExtWarn<
2391   "type definition in a constexpr %select{function|constructor}0 "
2392   "is a C++14 extension">, InGroup<CXX14>;
2393 def warn_cxx11_compat_constexpr_type_definition : Warning<
2394   "type definition in a constexpr %select{function|constructor}0 "
2395   "is incompatible with C++ standards before C++14">,
2396   InGroup<CXXPre14Compat>, DefaultIgnore;
2397 def err_constexpr_vla : Error<
2398   "variably-modified type %0 cannot be used in a constexpr "
2399   "%select{function|constructor}1">;
2400 def ext_constexpr_local_var : ExtWarn<
2401   "variable declaration in a constexpr %select{function|constructor}0 "
2402   "is a C++14 extension">, InGroup<CXX14>;
2403 def warn_cxx11_compat_constexpr_local_var : Warning<
2404   "variable declaration in a constexpr %select{function|constructor}0 "
2405   "is incompatible with C++ standards before C++14">,
2406   InGroup<CXXPre14Compat>, DefaultIgnore;
2407 def err_constexpr_local_var_static : Error<
2408   "%select{static|thread_local}1 variable not permitted in a constexpr "
2409   "%select{function|constructor}0">;
2410 def err_constexpr_local_var_non_literal_type : Error<
2411   "variable of non-literal type %1 cannot be defined in a constexpr "
2412   "%select{function|constructor}0">;
2413 def err_constexpr_local_var_no_init : Error<
2414   "variables defined in a constexpr %select{function|constructor}0 must be "
2415   "initialized">;
2416 def ext_constexpr_function_never_constant_expr : ExtWarn<
2417   "constexpr %select{function|constructor}0 never produces a "
2418   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2419 def err_attr_cond_never_constant_expr : Error<
2420   "%0 attribute expression never produces a constant expression">;
2421 def err_diagnose_if_invalid_diagnostic_type : Error<
2422   "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2423   "instead">;
2424 def err_constexpr_body_no_return : Error<
2425   "no return statement in %select{constexpr|consteval}0 function">;
2426 def err_constexpr_return_missing_expr : Error<
2427   "non-void %select{constexpr|consteval}1 function %0 should return a value">;
2428 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2429   "constexpr function with no return statements is incompatible with C++ "
2430   "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2431 def ext_constexpr_body_multiple_return : ExtWarn<
2432   "multiple return statements in constexpr function is a C++14 extension">,
2433   InGroup<CXX14>;
2434 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2435   "multiple return statements in constexpr function "
2436   "is incompatible with C++ standards before C++14">,
2437   InGroup<CXXPre14Compat>, DefaultIgnore;
2438 def note_constexpr_body_previous_return : Note<
2439   "previous return statement is here">;
2440 def err_constexpr_function_try_block : Error<
2441   "function try block not allowed in constexpr %select{function|constructor}0">;
2442
2443 // c++2a function try blocks in constexpr
2444 def ext_constexpr_function_try_block_cxx2a : ExtWarn<
2445   "function try block in constexpr %select{function|constructor}0 is "
2446   "a C++2a extension">, InGroup<CXX2a>;
2447 def warn_cxx17_compat_constexpr_function_try_block : Warning<
2448   "function try block in constexpr %select{function|constructor}0 is "
2449   "incompatible with C++ standards before C++2a">,
2450   InGroup<CXXPre2aCompat>, DefaultIgnore;
2451
2452 def err_constexpr_union_ctor_no_init : Error<
2453   "constexpr union constructor does not initialize any member">;
2454 def err_constexpr_ctor_missing_init : Error<
2455   "constexpr constructor must initialize all members">;
2456 def note_constexpr_ctor_missing_init : Note<
2457   "member not initialized by constructor">;
2458 def note_non_literal_no_constexpr_ctors : Note<
2459   "%0 is not literal because it is not an aggregate and has no constexpr "
2460   "constructors other than copy or move constructors">;
2461 def note_non_literal_base_class : Note<
2462   "%0 is not literal because it has base class %1 of non-literal type">;
2463 def note_non_literal_field : Note<
2464   "%0 is not literal because it has data member %1 of "
2465   "%select{non-literal|volatile}3 type %2">;
2466 def note_non_literal_user_provided_dtor : Note<
2467   "%0 is not literal because it has a user-provided destructor">;
2468 def note_non_literal_nontrivial_dtor : Note<
2469   "%0 is not literal because it has a non-trivial destructor">;
2470 def note_non_literal_lambda : Note<
2471   "lambda closure types are non-literal types before C++17">;
2472 def warn_private_extern : Warning<
2473   "use of __private_extern__ on a declaration may not produce external symbol "
2474   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2475 def note_private_extern : Note<
2476   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2477
2478 // C++ Concepts
2479 def err_concept_initialized_with_non_bool_type : Error<
2480   "constraint expression must be of type 'bool' but is of type %0">;
2481 def err_concept_decls_may_only_appear_in_global_namespace_scope : Error<
2482   "concept declarations may only appear in global or namespace scope">;
2483 def err_concept_no_parameters : Error<
2484   "concept template parameter list must have at least one parameter; explicit "
2485   "specialization of concepts is not allowed">;
2486 def err_concept_extra_headers : Error<
2487   "extraneous template parameter list in concept definition">;
2488 def err_concept_no_associated_constraints : Error<
2489   "concept cannot have associated constraints">;
2490 def err_concept_not_implemented : Error<
2491   "sorry, unimplemented concepts feature %0 used">;
2492
2493 def err_template_different_associated_constraints : Error<
2494   "associated constraints differ in template redeclaration">;
2495
2496 // C++11 char16_t/char32_t
2497 def warn_cxx98_compat_unicode_type : Warning<
2498   "'%0' type specifier is incompatible with C++98">,
2499   InGroup<CXX98Compat>, DefaultIgnore;
2500 def warn_cxx17_compat_unicode_type : Warning<
2501   "'char8_t' type specifier is incompatible with C++ standards before C++20">,
2502   InGroup<CXXPre2aCompat>, DefaultIgnore;
2503
2504 // __make_integer_seq
2505 def err_integer_sequence_negative_length : Error<
2506   "integer sequences must have non-negative sequence length">;
2507 def err_integer_sequence_integral_element_type : Error<
2508   "integer sequences must have integral element type">;
2509
2510 // __type_pack_element
2511 def err_type_pack_element_out_of_bounds : Error<
2512   "a parameter pack may not be accessed at an out of bounds index">;
2513
2514 // Objective-C++
2515 def err_objc_decls_may_only_appear_in_global_scope : Error<
2516   "Objective-C declarations may only appear in global scope">;
2517 def warn_auto_var_is_id : Warning<
2518   "'auto' deduced as 'id' in declaration of %0">,
2519   InGroup<DiagGroup<"auto-var-id">>;
2520
2521 // Attributes
2522 def err_nsobject_attribute : Error<
2523   "'NSObject' attribute is for pointer types only">;
2524 def err_attributes_are_not_compatible : Error<
2525   "%0 and %1 attributes are not compatible">;
2526 def err_attribute_wrong_number_arguments : Error<
2527   "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2528   ":requires exactly %1 arguments}1">;
2529 def err_attribute_too_many_arguments : Error<
2530   "%0 attribute takes no more than %1 argument%s1">;
2531 def err_attribute_too_few_arguments : Error<
2532   "%0 attribute takes at least %1 argument%s1">;
2533 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2534 def err_attribute_bad_neon_vector_size : Error<
2535   "Neon vector size must be 64 or 128 bits">;
2536 def err_attribute_requires_positive_integer : Error<
2537   "%0 attribute requires a %select{positive|non-negative}1 "
2538   "integral compile time constant expression">;
2539 def err_attribute_requires_opencl_version : Error<
2540   "%0 attribute requires OpenCL version %1%select{| or above}2">;
2541 def warn_unsupported_target_attribute
2542     : Warning<"%select{unsupported|duplicate}0%select{| architecture}1 '%2' in"
2543               " the 'target' attribute string; 'target' attribute ignored">,
2544       InGroup<IgnoredAttributes>;
2545 def err_attribute_unsupported
2546     : Error<"%0 attribute is not supported for this target">;
2547 // The err_*_attribute_argument_not_int are separate because they're used by
2548 // VerifyIntegerConstantExpression.
2549 def err_aligned_attribute_argument_not_int : Error<
2550   "'aligned' attribute requires integer constant">;
2551 def err_align_value_attribute_argument_not_int : Error<
2552   "'align_value' attribute requires integer constant">;
2553 def err_alignas_attribute_wrong_decl_type : Error<
2554   "%0 attribute cannot be applied to a %select{function parameter|"
2555   "variable with 'register' storage class|'catch' variable|bit-field}1">;
2556 def err_alignas_missing_on_definition : Error<
2557   "%0 must be specified on definition if it is specified on any declaration">;
2558 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2559 def err_alignas_mismatch : Error<
2560   "redeclaration has different alignment requirement (%1 vs %0)">;
2561 def err_alignas_underaligned : Error<
2562   "requested alignment is less than minimum alignment of %1 for type %0">;
2563 def err_attribute_argument_n_type : Error<
2564   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2565   "constant|a string|an identifier}2">;
2566 def err_attribute_argument_type : Error<
2567   "%0 attribute requires %select{int or bool|an integer "
2568   "constant|a string|an identifier}1">;
2569 def err_attribute_argument_out_of_range : Error<
2570   "%0 attribute requires integer constant between %1 and %2 inclusive">;
2571 def err_init_priority_object_attr : Error<
2572   "can only use 'init_priority' attribute on file-scope definitions "
2573   "of objects of class type">;
2574 def err_attribute_argument_vec_type_hint : Error<
2575   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2576 def err_attribute_argument_out_of_bounds : Error<
2577   "%0 attribute parameter %1 is out of bounds">;
2578 def err_attribute_only_once_per_parameter : Error<
2579   "%0 attribute can only be applied once per parameter">;
2580 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2581 def note_previous_uuid : Note<"previous uuid specified here">;
2582 def warn_attribute_pointers_only : Warning<
2583   "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2584   InGroup<IgnoredAttributes>;
2585 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2586 def err_attribute_integers_only : Error<
2587   "%0 attribute argument may only refer to a function parameter of integer "
2588   "type">;
2589 def warn_attribute_return_pointers_only : Warning<
2590   "%0 attribute only applies to return values that are pointers">,
2591   InGroup<IgnoredAttributes>;
2592 def warn_attribute_return_pointers_refs_only : Warning<
2593   "%0 attribute only applies to return values that are pointers or references">,
2594   InGroup<IgnoredAttributes>;
2595 def warn_attribute_pointer_or_reference_only : Warning<
2596   "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2597   InGroup<IgnoredAttributes>;
2598 def err_attribute_no_member_pointers : Error<
2599   "%0 attribute cannot be used with pointers to members">;
2600 def err_attribute_invalid_implicit_this_argument : Error<
2601   "%0 attribute is invalid for the implicit this argument">;
2602 def err_ownership_type : Error<
2603   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2604 def err_ownership_returns_index_mismatch : Error<
2605   "'ownership_returns' attribute index does not match; here it is %0">;
2606 def note_ownership_returns_index_mismatch : Note<
2607   "declared with index %0 here">;
2608 def err_format_strftime_third_parameter : Error<
2609   "strftime format attribute requires 3rd parameter to be 0">;
2610 def err_format_attribute_requires_variadic : Error<
2611   "format attribute requires variadic function">;
2612 def err_format_attribute_not : Error<"format argument not %0">;
2613 def err_format_attribute_result_not : Error<"function does not return %0">;
2614 def err_format_attribute_implicit_this_format_string : Error<
2615   "format attribute cannot specify the implicit this argument as the format "
2616   "string">;
2617 def err_callback_attribute_no_callee : Error<
2618   "'callback' attribute specifies no callback callee">;
2619 def err_callback_attribute_invalid_callee : Error<
2620   "'callback' attribute specifies invalid callback callee">;
2621 def err_callback_attribute_multiple : Error<
2622   "multiple 'callback' attributes specified">;
2623 def err_callback_attribute_argument_unknown : Error<
2624   "'callback' attribute argument %0 is not a known function parameter">;
2625 def err_callback_callee_no_function_type : Error<
2626   "'callback' attribute callee does not have function type">;
2627 def err_callback_callee_is_variadic : Error<
2628   "'callback' attribute callee may not be variadic">;
2629 def err_callback_implicit_this_not_available : Error<
2630   "'callback' argument at position %0 references unavailable implicit 'this'">;
2631 def err_init_method_bad_return_type : Error<
2632   "init methods must return an object pointer type, not %0">;
2633 def err_attribute_invalid_size : Error<
2634   "vector size not an integral multiple of component size">;
2635 def err_attribute_zero_size : Error<"zero vector size">;
2636 def err_attribute_size_too_large : Error<"vector size too large">;
2637 def err_typecheck_vector_not_convertable_implict_truncation : Error<
2638    "cannot convert between %select{scalar|vector}0 type %1 and vector type"
2639    " %2 as implicit conversion would cause truncation">;
2640 def err_typecheck_vector_not_convertable : Error<
2641   "cannot convert between vector values of different size (%0 and %1)">;
2642 def err_typecheck_vector_not_convertable_non_scalar : Error<
2643   "cannot convert between vector and non-scalar values (%0 and %1)">;
2644 def err_typecheck_vector_lengths_not_equal : Error<
2645   "vector operands do not have the same number of elements (%0 and %1)">;
2646 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2647   "vector operands do not have the same elements sizes (%0 and %1)">,
2648   InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2649 def err_ext_vector_component_exceeds_length : Error<
2650   "vector component access exceeds type %0">;
2651 def err_ext_vector_component_name_illegal : Error<
2652   "illegal vector component name '%0'">;
2653 def err_attribute_address_space_negative : Error<
2654   "address space is negative">;
2655 def err_attribute_address_space_too_high : Error<
2656   "address space is larger than the maximum supported (%0)">;
2657 def err_attribute_address_multiple_qualifiers : Error<
2658   "multiple address spaces specified for type">;
2659 def warn_attribute_address_multiple_identical_qualifiers : Warning<
2660   "multiple identical address spaces specified for type">,
2661   InGroup<DuplicateDeclSpecifier>;
2662 def err_attribute_address_function_type : Error<
2663   "function type may not be qualified with an address space">;
2664 def err_as_qualified_auto_decl : Error<
2665   "automatic variable qualified with an%select{| invalid}0 address space">;
2666 def err_arg_with_address_space : Error<
2667   "parameter may not be qualified with an address space">;
2668 def err_field_with_address_space : Error<
2669   "field may not be qualified with an address space">;
2670 def err_compound_literal_with_address_space : Error<
2671   "compound literal in function scope may not be qualified with an address space">;
2672 def err_address_space_mismatch_templ_inst : Error<
2673   "conflicting address space qualifiers are provided between types %0 and %1">;
2674 def err_attr_objc_ownership_redundant : Error<
2675   "the type %0 is already explicitly ownership-qualified">;
2676 def err_invalid_nsnumber_type : Error<
2677   "%0 is not a valid literal type for NSNumber">;
2678 def err_objc_illegal_boxed_expression_type : Error<
2679   "illegal type %0 used in a boxed expression">;
2680 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2681   "non-trivially copyable type %0 cannot be used in a boxed expression">;
2682 def err_objc_incomplete_boxed_expression_type : Error<
2683   "incomplete type %0 used in a boxed expression">;
2684 def err_undeclared_objc_literal_class : Error<
2685   "definition of class %0 must be available to use Objective-C "
2686   "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2687   "string literals}1">;
2688 def err_undeclared_boxing_method : Error<
2689   "declaration of %0 is missing in %1 class">;
2690 def err_objc_literal_method_sig : Error<
2691   "literal construction method %0 has incompatible signature">;
2692 def note_objc_literal_method_param : Note<
2693   "%select{first|second|third}0 parameter has unexpected type %1 "
2694   "(should be %2)">;
2695 def note_objc_literal_method_return : Note<
2696   "method returns unexpected type %0 (should be an object type)">;
2697 def err_invalid_collection_element : Error<
2698   "collection element of type %0 is not an Objective-C object">;
2699 def err_box_literal_collection : Error<
2700   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2701   "in a collection">;
2702 def warn_objc_literal_comparison : Warning<
2703   "direct comparison of %select{an array literal|a dictionary literal|"
2704   "a numeric literal|a boxed expression|}0 has undefined behavior">,
2705   InGroup<ObjCLiteralComparison>;
2706 def err_missing_atsign_prefix : Error<
2707   "string literal must be prefixed by '@' ">;
2708 def warn_objc_string_literal_comparison : Warning<
2709   "direct comparison of a string literal has undefined behavior">,
2710   InGroup<ObjCStringComparison>;
2711 def warn_concatenated_nsarray_literal : Warning<
2712   "concatenated NSString literal for an NSArray expression - "
2713   "possibly missing a comma">,
2714   InGroup<ObjCStringConcatenation>;
2715 def note_objc_literal_comparison_isequal : Note<
2716   "use 'isEqual:' instead">;
2717 def warn_objc_collection_literal_element : Warning<
2718   "object of type %0 is not compatible with "
2719   "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2720   InGroup<ObjCLiteralConversion>;
2721 def err_swift_param_attr_not_swiftcall : Error<
2722   "'%0' parameter can only be used with swiftcall calling convention">;
2723 def err_swift_indirect_result_not_first : Error<
2724   "'swift_indirect_result' parameters must be first parameters of function">;
2725 def err_swift_error_result_not_after_swift_context : Error<
2726   "'swift_error_result' parameter must follow 'swift_context' parameter">;
2727 def err_swift_abi_parameter_wrong_type : Error<
2728   "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2729   "type here is %2">;
2730
2731 def err_attribute_argument_invalid : Error<
2732   "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2733   "min must not be greater than max}1">;
2734 def err_attribute_argument_is_zero : Error<
2735   "%0 attribute must be greater than 0">;
2736 def warn_attribute_argument_n_negative : Warning<
2737   "%0 attribute parameter %1 is negative and will be ignored">,
2738   InGroup<CudaCompat>;
2739 def err_property_function_in_objc_container : Error<
2740   "use of Objective-C property in function nested in Objective-C "
2741   "container not supported, move function outside its container">;
2742
2743 let CategoryName = "Cocoa API Issue" in {
2744 def warn_objc_redundant_literal_use : Warning<
2745   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2746 }
2747
2748 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2749   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2750
2751 def err_tls_var_aligned_over_maximum : Error<
2752   "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2753   "alignment (%2) for a thread-local variable on this target">;
2754
2755 def err_only_annotate_after_access_spec : Error<
2756   "access specifier can only have annotation attributes">;
2757
2758 def err_attribute_section_invalid_for_target : Error<
2759   "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">;
2760 def warn_attribute_section_drectve : Warning<
2761   "#pragma %0(\".drectve\") has undefined behavior, "
2762   "use #pragma comment(linker, ...) instead">, InGroup<MicrosoftDrectveSection>;
2763 def warn_mismatched_section : Warning<
2764   "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>;
2765 def warn_attribute_section_on_redeclaration : Warning<
2766   "section attribute is specified on redeclared variable">, InGroup<Section>;
2767 def err_mismatched_code_seg_base : Error<
2768   "derived class must specify the same code segment as its base classes">;
2769 def err_mismatched_code_seg_override : Error<
2770   "overriding virtual function must specify the same code segment as its overridden function">;
2771 def err_conflicting_codeseg_attribute : Error<
2772   "conflicting code segment specifiers">;
2773 def warn_duplicate_codeseg_attribute : Warning<
2774   "duplicate code segment specifiers">, InGroup<Section>;
2775
2776 def err_anonymous_property: Error<
2777   "anonymous property is not supported">;
2778 def err_property_is_variably_modified : Error<
2779   "property %0 has a variably modified type">;
2780 def err_no_accessor_for_property : Error<
2781   "no %select{getter|setter}0 defined for property %1">;
2782 def err_cannot_find_suitable_accessor : Error<
2783   "cannot find suitable %select{getter|setter}0 for property %1">;
2784
2785 def warn_alloca_align_alignof : Warning<
2786   "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2787   InGroup<DiagGroup<"alloca-with-align-alignof">>;
2788
2789 def err_alignment_too_small : Error<
2790   "requested alignment must be %0 or greater">;
2791 def err_alignment_too_big : Error<
2792   "requested alignment must be %0 or smaller">;
2793 def err_alignment_not_power_of_two : Error<
2794   "requested alignment is not a power of 2">;
2795 def err_alignment_dependent_typedef_name : Error<
2796   "requested alignment is dependent but declaration is not dependent">;
2797
2798 def err_attribute_aligned_too_great : Error<
2799   "requested alignment must be %0 bytes or smaller">;
2800 def warn_assume_aligned_too_great
2801     : Warning<"requested alignment must be %0 bytes or smaller; maximum "
2802               "alignment assumed">,
2803       InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
2804 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2805   "%q0 redeclared without %1 attribute: previous %1 ignored">,
2806   InGroup<MicrosoftInconsistentDllImport>;
2807 def warn_redeclaration_without_import_attribute : Warning<
2808   "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2809   InGroup<MicrosoftInconsistentDllImport>;
2810 def warn_dllimport_dropped_from_inline_function : Warning<
2811   "%q0 redeclared inline; %1 attribute ignored">,
2812   InGroup<IgnoredAttributes>;
2813 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2814   InGroup<IgnoredAttributes>;
2815 def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with"
2816   " exception specification; attribute ignored">,
2817   InGroup<IgnoredAttributes>;
2818 def warn_attribute_ignored_on_inline :
2819   Warning<"%0 attribute ignored on inline function">,
2820   InGroup<IgnoredAttributes>;
2821 def warn_nocf_check_attribute_ignored :
2822   Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">,
2823   InGroup<IgnoredAttributes>;
2824 def warn_attribute_after_definition_ignored : Warning<
2825   "attribute %0 after definition is ignored">,
2826    InGroup<IgnoredAttributes>;
2827 def warn_cxx11_gnu_attribute_on_type : Warning<
2828   "attribute %0 ignored, because it cannot be applied to a type">,
2829   InGroup<IgnoredAttributes>;
2830 def warn_unhandled_ms_attribute_ignored : Warning<
2831   "__declspec attribute %0 is not supported">,
2832   InGroup<IgnoredAttributes>;
2833 def err_decl_attribute_invalid_on_stmt : Error<
2834   "%0 attribute cannot be applied to a statement">;
2835 def err_stmt_attribute_invalid_on_decl : Error<
2836   "%0 attribute cannot be applied to a declaration">;
2837 def warn_declspec_attribute_ignored : Warning<
2838   "attribute %0 is ignored, place it after "
2839   "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2840   "type declaration">, InGroup<IgnoredAttributes>;
2841 def warn_attribute_precede_definition : Warning<
2842   "attribute declaration must precede definition">,
2843   InGroup<IgnoredAttributes>;
2844 def warn_attribute_void_function_method : Warning<
2845   "attribute %0 cannot be applied to "
2846   "%select{functions|Objective-C method}1 without return value">,
2847   InGroup<IgnoredAttributes>;
2848 def warn_attribute_weak_on_field : Warning<
2849   "__weak attribute cannot be specified on a field declaration">,
2850   InGroup<IgnoredAttributes>;
2851 def warn_gc_attribute_weak_on_local : Warning<
2852   "Objective-C GC does not allow weak variables on the stack">,
2853   InGroup<IgnoredAttributes>;
2854 def warn_nsobject_attribute : Warning<
2855   "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2856   InGroup<NSobjectAttribute>;
2857 def warn_independentclass_attribute : Warning<
2858   "'objc_independent_class' attribute may be put on a typedef only; "
2859   "attribute is ignored">,
2860   InGroup<IndependentClassAttribute>;
2861 def warn_ptr_independentclass_attribute : Warning<
2862   "'objc_independent_class' attribute may be put on Objective-C object "
2863   "pointer type only; attribute is ignored">,
2864   InGroup<IndependentClassAttribute>;
2865 def warn_attribute_weak_on_local : Warning<
2866   "__weak attribute cannot be specified on an automatic variable when ARC "
2867   "is not enabled">,
2868   InGroup<IgnoredAttributes>;
2869 def warn_weak_identifier_undeclared : Warning<
2870   "weak identifier %0 never declared">;
2871 def err_attribute_weak_static : Error<
2872   "weak declaration cannot have internal linkage">;
2873 def err_attribute_selectany_non_extern_data : Error<
2874   "'selectany' can only be applied to data items with external linkage">;
2875 def err_declspec_thread_on_thread_variable : Error<
2876   "'__declspec(thread)' applied to variable that already has a "
2877   "thread-local storage specifier">;
2878 def err_attribute_dll_not_extern : Error<
2879   "%q0 must have external linkage when declared %q1">;
2880 def err_attribute_dll_thread_local : Error<
2881   "%q0 cannot be thread local when declared %q1">;
2882 def err_attribute_dll_lambda : Error<
2883   "lambda cannot be declared %0">;
2884 def warn_attribute_invalid_on_definition : Warning<
2885   "'%0' attribute cannot be specified on a definition">,
2886   InGroup<IgnoredAttributes>;
2887 def err_attribute_dll_redeclaration : Error<
2888   "redeclaration of %q0 cannot add %q1 attribute">;
2889 def warn_attribute_dll_redeclaration : Warning<
2890   "redeclaration of %q0 should not add %q1 attribute">,
2891   InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2892 def err_attribute_dllimport_function_definition : Error<
2893   "dllimport cannot be applied to non-inline function definition">;
2894 def err_attribute_dll_deleted : Error<
2895   "attribute %q0 cannot be applied to a deleted function">;
2896 def err_attribute_dllimport_data_definition : Error<
2897   "definition of dllimport data">;
2898 def err_attribute_dllimport_static_field_definition : Error<
2899   "definition of dllimport static field not allowed">;
2900 def warn_attribute_dllimport_static_field_definition : Warning<
2901   "definition of dllimport static field">,
2902   InGroup<DiagGroup<"dllimport-static-field-def">>;
2903 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2904   "explicit instantiation declaration should not be 'dllexport'">,
2905   InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2906 def warn_attribute_dllexport_explicit_instantiation_def : Warning<
2907   "'dllexport' attribute ignored on explicit instantiation definition">,
2908   InGroup<IgnoredAttributes>;
2909 def warn_invalid_initializer_from_system_header : Warning<
2910   "invalid constructor form class in system header, should not be explicit">,
2911   InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2912 def note_used_in_initialization_here : Note<"used in initialization here">;
2913 def err_attribute_dll_member_of_dll_class : Error<
2914   "attribute %q0 cannot be applied to member of %q1 class">;
2915 def warn_attribute_dll_instantiated_base_class : Warning<
2916   "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2917   "base class template without dll attribute is not supported">,
2918   InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2919 def err_attribute_dll_ambiguous_default_ctor : Error<
2920   "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2921 def err_attribute_weakref_not_static : Error<
2922   "weakref declaration must have internal linkage">;
2923 def err_attribute_weakref_not_global_context : Error<
2924   "weakref declaration of %0 must be in a global context">;
2925 def err_attribute_weakref_without_alias : Error<
2926   "weakref declaration of %0 must also have an alias attribute">;
2927 def err_alias_not_supported_on_darwin : Error <
2928   "aliases are not supported on darwin">;
2929 def warn_attribute_wrong_decl_type_str : Warning<
2930   "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
2931 def err_attribute_wrong_decl_type_str : Error<
2932   warn_attribute_wrong_decl_type_str.Text>;
2933 def warn_attribute_wrong_decl_type : Warning<
2934   "%0 attribute only applies to %select{"
2935   "functions"
2936   "|unions"
2937   "|variables and functions"
2938   "|functions and methods"
2939   "|functions, methods and blocks"
2940   "|functions, methods, and parameters"
2941   "|variables"
2942   "|variables and fields"
2943   "|variables, data members and tag types"
2944   "|types and namespaces"
2945   "|variables, functions and classes"
2946   "|kernel functions"
2947   "|non-K&R-style functions}1">,
2948   InGroup<IgnoredAttributes>;
2949 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2950 def warn_type_attribute_wrong_type : Warning<
2951   "'%0' only applies to %select{function|pointer|"
2952   "Objective-C object or block pointer}1 types; type here is %2">,
2953   InGroup<IgnoredAttributes>;
2954 def warn_incomplete_encoded_type : Warning<
2955   "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2956   InGroup<DiagGroup<"encode-type">>;
2957 def warn_gnu_inline_attribute_requires_inline : Warning<
2958   "'gnu_inline' attribute requires function to be marked 'inline',"
2959   " attribute ignored">,
2960   InGroup<IgnoredAttributes>;
2961 def err_attribute_vecreturn_only_vector_member : Error<
2962   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2963 def err_attribute_vecreturn_only_pod_record : Error<
2964   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2965 def err_cconv_change : Error<
2966   "function declared '%0' here was previously declared "
2967   "%select{'%2'|without calling convention}1">;
2968 def warn_cconv_unsupported : Warning<
2969   "%0 calling convention is not supported %select{"
2970   // Use CallingConventionIgnoredReason Enum to specify these.
2971   "for this target"
2972   "|on variadic function"
2973   "|on constructor/destructor"
2974   "|on builtin function"
2975   "}1">,
2976   InGroup<IgnoredAttributes>;
2977 def err_cconv_knr : Error<
2978   "function with no prototype cannot use the %0 calling convention">;
2979 def warn_cconv_knr : Warning<
2980   err_cconv_knr.Text>,
2981   InGroup<DiagGroup<"missing-prototype-for-cc">>;
2982 def err_cconv_varargs : Error<
2983   "variadic function cannot use %0 calling convention">;
2984 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2985   "attribute was previously declared "
2986   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2987 def err_function_attribute_mismatch : Error<
2988   "function declared with %0 attribute "
2989   "was previously declared without the %0 attribute">;
2990 def err_objc_precise_lifetime_bad_type : Error<
2991   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2992 def warn_objc_precise_lifetime_meaningless : Error<
2993   "objc_precise_lifetime is not meaningful for "
2994   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2995 def err_invalid_pcs : Error<"invalid PCS type">;
2996 def warn_attribute_not_on_decl : Warning<
2997   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2998 def err_base_specifier_attribute : Error<
2999   "%0 attribute cannot be applied to a base specifier">;
3000 def err_invalid_attribute_on_virtual_function : Error<
3001   "%0 attribute cannot be applied to virtual functions">;
3002 def warn_declspec_allocator_nonpointer : Warning<
3003   "ignoring __declspec(allocator) because the function return type %0 is not "
3004   "a pointer or reference type">, InGroup<IgnoredAttributes>;
3005 def err_cconv_incomplete_param_type : Error<
3006   "parameter %0 must have a complete type to use function %1 with the %2 "
3007   "calling convention">;
3008
3009 def ext_cannot_use_trivial_abi : ExtWarn<
3010   "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>;
3011
3012 // Availability attribute
3013 def warn_availability_unknown_platform : Warning<
3014   "unknown platform %0 in availability macro">, InGroup<Availability>;
3015 def warn_availability_version_ordering : Warning<
3016   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
3017   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
3018   "attribute ignored">, InGroup<Availability>;
3019 def warn_mismatched_availability: Warning<
3020   "availability does not match previous declaration">, InGroup<Availability>;
3021 def warn_mismatched_availability_override : Warning<
3022   "%select{|overriding }4method %select{introduced after|"
3023   "deprecated before|obsoleted before}0 "
3024   "%select{the protocol method it implements|overridden method}4 "
3025   "on %1 (%2 vs. %3)">, InGroup<Availability>;
3026 def warn_mismatched_availability_override_unavail : Warning<
3027   "%select{|overriding }1method cannot be unavailable on %0 when "
3028   "%select{the protocol method it implements|its overridden method}1 is "
3029   "available">,
3030   InGroup<Availability>;
3031 def warn_availability_on_static_initializer : Warning<
3032   "ignoring availability attribute %select{on '+load' method|"
3033   "with constructor attribute|with destructor attribute}0">,
3034   InGroup<Availability>;
3035 def note_overridden_method : Note<
3036   "overridden method is here">;
3037 def warn_availability_swift_unavailable_deprecated_only : Warning<
3038   "only 'unavailable' and 'deprecated' are supported for Swift availability">,
3039   InGroup<Availability>;
3040 def note_protocol_method : Note<
3041   "protocol method is here">;
3042
3043 def warn_unguarded_availability :
3044   Warning<"%0 is only available on %1 %2 or newer">,
3045   InGroup<UnguardedAvailability>, DefaultIgnore;
3046 def warn_unguarded_availability_new :
3047   Warning<warn_unguarded_availability.Text>,
3048   InGroup<UnguardedAvailabilityNew>;
3049 def note_decl_unguarded_availability_silence : Note<
3050   "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
3051 def note_unguarded_available_silence : Note<
3052   "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
3053   " this warning">;
3054 def warn_at_available_unchecked_use : Warning<
3055   "%select{@available|__builtin_available}0 does not guard availability here; "
3056   "use if (%select{@available|__builtin_available}0) instead">,
3057   InGroup<DiagGroup<"unsupported-availability-guard">>;
3058
3059 // Thread Safety Attributes
3060 def warn_invalid_capability_name : Warning<
3061   "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
3062   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3063 def warn_thread_attribute_ignored : Warning<
3064   "ignoring %0 attribute because its argument is invalid">,
3065   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3066 def warn_thread_attribute_not_on_non_static_member : Warning<
3067   "%0 attribute without capability arguments can only be applied to non-static "
3068   "methods of a class">,
3069   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3070 def warn_thread_attribute_not_on_capability_member : Warning<
3071   "%0 attribute without capability arguments refers to 'this', but %1 isn't "
3072   "annotated with 'capability' or 'scoped_lockable' attribute">,
3073   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3074 def warn_thread_attribute_argument_not_lockable : Warning<
3075   "%0 attribute requires arguments whose type is annotated "
3076   "with 'capability' attribute; type here is %1">,
3077   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3078 def warn_thread_attribute_decl_not_lockable : Warning<
3079   "%0 attribute can only be applied in a context annotated "
3080   "with 'capability(\"mutex\")' attribute">,
3081   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3082 def warn_thread_attribute_decl_not_pointer : Warning<
3083   "%0 only applies to pointer types; type here is %1">,
3084   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
3085 def err_attribute_argument_out_of_bounds_extra_info : Error<
3086   "%0 attribute parameter %1 is out of bounds: "
3087   "%plural{0:no parameters to index into|"
3088   "1:can only be 1, since there is one parameter|"
3089   ":must be between 1 and %2}2">;
3090
3091 // Thread Safety Analysis
3092 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
3093   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3094 def warn_unlock_kind_mismatch : Warning<
3095   "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
3096   "%select{shared|exclusive}3 access">,
3097   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3098 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
3099   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3100 def warn_no_unlock : Warning<
3101   "%0 '%1' is still held at the end of function">,
3102   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3103 def warn_expecting_locked : Warning<
3104   "expecting %0 '%1' to be held at the end of function">,
3105   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3106 // FIXME: improve the error message about locks not in scope
3107 def warn_lock_some_predecessors : Warning<
3108   "%0 '%1' is not held on every path through here">,
3109   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3110 def warn_expecting_lock_held_on_loop : Warning<
3111   "expecting %0 '%1' to be held at start of each loop">,
3112   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3113 def note_locked_here : Note<"%0 acquired here">;
3114 def warn_lock_exclusive_and_shared : Warning<
3115   "%0 '%1' is acquired exclusively and shared in the same scope">,
3116   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3117 def note_lock_exclusive_and_shared : Note<
3118   "the other acquisition of %0 '%1' is here">;
3119 def warn_variable_requires_any_lock : Warning<
3120   "%select{reading|writing}1 variable %0 requires holding "
3121   "%select{any mutex|any mutex exclusively}1">,
3122   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3123 def warn_var_deref_requires_any_lock : Warning<
3124   "%select{reading|writing}1 the value pointed to by %0 requires holding "
3125   "%select{any mutex|any mutex exclusively}1">,
3126   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3127 def warn_fun_excludes_mutex : Warning<
3128   "cannot call function '%1' while %0 '%2' is held">,
3129   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3130 def warn_cannot_resolve_lock : Warning<
3131   "cannot resolve lock expression">,
3132   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3133 def warn_acquired_before : Warning<
3134   "%0 '%1' must be acquired before '%2'">,
3135   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3136 def warn_acquired_before_after_cycle : Warning<
3137   "Cycle in acquired_before/after dependencies, starting with '%0'">,
3138   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3139
3140
3141 // Thread safety warnings negative capabilities
3142 def warn_acquire_requires_negative_cap : Warning<
3143   "acquiring %0 '%1' requires negative capability '%2'">,
3144   InGroup<ThreadSafetyNegative>, DefaultIgnore;
3145
3146 // Thread safety warnings on pass by reference
3147 def warn_guarded_pass_by_reference : Warning<
3148   "passing variable %1 by reference requires holding %0 "
3149   "%select{'%2'|'%2' exclusively}3">,
3150   InGroup<ThreadSafetyReference>, DefaultIgnore;
3151 def warn_pt_guarded_pass_by_reference : Warning<
3152   "passing the value that %1 points to by reference requires holding %0 "
3153   "%select{'%2'|'%2' exclusively}3">,
3154   InGroup<ThreadSafetyReference>, DefaultIgnore;
3155
3156 // Imprecise thread safety warnings
3157 def warn_variable_requires_lock : Warning<
3158   "%select{reading|writing}3 variable %1 requires holding %0 "
3159   "%select{'%2'|'%2' exclusively}3">,
3160   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3161 def warn_var_deref_requires_lock : Warning<
3162   "%select{reading|writing}3 the value pointed to by %1 requires "
3163   "holding %0 %select{'%2'|'%2' exclusively}3">,
3164   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3165 def warn_fun_requires_lock : Warning<
3166   "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">,
3167   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3168
3169 // Precise thread safety warnings
3170 def warn_variable_requires_lock_precise :
3171   Warning<warn_variable_requires_lock.Text>,
3172   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3173 def warn_var_deref_requires_lock_precise :
3174   Warning<warn_var_deref_requires_lock.Text>,
3175   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3176 def warn_fun_requires_lock_precise :
3177   Warning<warn_fun_requires_lock.Text>,
3178   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3179 def note_found_mutex_near_match : Note<"found near match '%0'">;
3180
3181 // Verbose thread safety warnings
3182 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
3183   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3184 def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
3185 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
3186
3187 // Dummy warning that will trigger "beta" warnings from the analysis if enabled.
3188 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
3189   InGroup<ThreadSafetyBeta>, DefaultIgnore;
3190
3191 // Consumed warnings
3192 def warn_use_in_invalid_state : Warning<
3193   "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3194   "state">, InGroup<Consumed>, DefaultIgnore;
3195 def warn_use_of_temp_in_invalid_state : Warning<
3196   "invalid invocation of method '%0' on a temporary object while it is in the "
3197   "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3198 def warn_attr_on_unconsumable_class : Warning<
3199   "consumed analysis attribute is attached to member of class '%0' which isn't "
3200   "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3201 def warn_return_typestate_for_unconsumable_type : Warning<
3202   "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3203   DefaultIgnore;
3204 def warn_return_typestate_mismatch : Warning<
3205   "return value not in expected state; expected '%0', observed '%1'">,
3206   InGroup<Consumed>, DefaultIgnore;
3207 def warn_loop_state_mismatch : Warning<
3208   "state of variable '%0' must match at the entry and exit of loop">,
3209   InGroup<Consumed>, DefaultIgnore;
3210 def warn_param_return_typestate_mismatch : Warning<
3211   "parameter '%0' not in expected state when the function returns: expected "
3212   "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3213 def warn_param_typestate_mismatch : Warning<
3214   "argument not in expected state; expected '%0', observed '%1'">,
3215   InGroup<Consumed>, DefaultIgnore;
3216
3217 // no_sanitize attribute
3218 def warn_unknown_sanitizer_ignored : Warning<
3219   "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3220
3221 def warn_impcast_vector_scalar : Warning<
3222   "implicit conversion turns vector to scalar: %0 to %1">,
3223   InGroup<Conversion>, DefaultIgnore;
3224 def warn_impcast_complex_scalar : Warning<
3225   "implicit conversion discards imaginary component: %0 to %1">,
3226   InGroup<Conversion>, DefaultIgnore;
3227 def err_impcast_complex_scalar : Error<
3228   "implicit conversion from %0 to %1 is not permitted in C++">;
3229 def warn_impcast_float_precision : Warning<
3230   "implicit conversion loses floating-point precision: %0 to %1">,
3231   InGroup<ImplicitFloatConversion>, DefaultIgnore;
3232 def warn_impcast_float_result_precision : Warning<
3233   "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">,
3234   InGroup<ImplicitFloatConversion>, DefaultIgnore;
3235 def warn_impcast_double_promotion : Warning<
3236   "implicit conversion increases floating-point precision: %0 to %1">,
3237   InGroup<DoublePromotion>, DefaultIgnore;
3238 def warn_impcast_integer_sign : Warning<
3239   "implicit conversion changes signedness: %0 to %1">,
3240   InGroup<SignConversion>, DefaultIgnore;
3241 def warn_impcast_integer_sign_conditional : Warning<
3242   "operand of ? changes signedness: %0 to %1">,
3243   InGroup<SignConversion>, DefaultIgnore;
3244 def warn_impcast_integer_precision : Warning<
3245   "implicit conversion loses integer precision: %0 to %1">,
3246   InGroup<ImplicitIntConversion>, DefaultIgnore;
3247 def warn_impcast_high_order_zero_bits : Warning<
3248   "higher order bits are zeroes after implicit conversion">,
3249   InGroup<ImplicitIntConversion>, DefaultIgnore;
3250 def warn_impcast_nonnegative_result : Warning<
3251   "the resulting value is always non-negative after implicit conversion">,
3252   InGroup<SignConversion>, DefaultIgnore;
3253 def warn_impcast_integer_64_32 : Warning<
3254   "implicit conversion loses integer precision: %0 to %1">,
3255   InGroup<Shorten64To32>, DefaultIgnore;
3256 def warn_impcast_integer_precision_constant : Warning<
3257   "implicit conversion from %2 to %3 changes value from %0 to %1">,
3258   InGroup<ConstantConversion>;
3259 def warn_impcast_bitfield_precision_constant : Warning<
3260   "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3261   InGroup<BitFieldConstantConversion>;
3262 def warn_impcast_constant_int_to_objc_bool : Warning<
3263   "implicit conversion from constant value %0 to BOOL; "
3264   "the only well defined values for BOOL are YES and NO">,
3265   InGroup<ObjCBoolConstantConversion>;
3266
3267 def warn_impcast_fixed_point_range : Warning<
3268   "implicit conversion from %0 cannot fit within the range of values for %1">,
3269   InGroup<ImplicitFixedPointConversion>;
3270
3271 def warn_impcast_literal_float_to_integer : Warning<
3272   "implicit conversion from %0 to %1 changes value from %2 to %3">,
3273   InGroup<LiteralConversion>;
3274 def warn_impcast_literal_float_to_integer_out_of_range : Warning<
3275   "implicit conversion of out of range value from %0 to %1 is undefined">,
3276   InGroup<LiteralConversion>;
3277 def warn_impcast_float_integer : Warning<
3278   "implicit conversion turns floating-point number into integer: %0 to %1">,
3279   InGroup<FloatConversion>, DefaultIgnore;
3280
3281 def warn_impcast_float_to_integer : Warning<
3282   "implicit conversion from %0 to %1 changes value from %2 to %3">,
3283   InGroup<FloatOverflowConversion>, DefaultIgnore;
3284 def warn_impcast_float_to_integer_out_of_range : Warning<
3285   "implicit conversion of out of range value from %0 to %1 is undefined">,
3286   InGroup<FloatOverflowConversion>, DefaultIgnore;
3287 def warn_impcast_float_to_integer_zero : Warning<
3288   "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3289   InGroup<FloatZeroConversion>, DefaultIgnore;
3290
3291 def warn_impcast_string_literal_to_bool : Warning<
3292   "implicit conversion turns string literal into bool: %0 to %1">,
3293   InGroup<StringConversion>, DefaultIgnore;
3294 def warn_impcast_different_enum_types : Warning<
3295   "implicit conversion from enumeration type %0 to different enumeration type "
3296   "%1">, InGroup<EnumConversion>;
3297 def warn_impcast_bool_to_null_pointer : Warning<
3298     "initialization of pointer of type %0 to null from a constant boolean "
3299     "expression">, InGroup<BoolConversion>;
3300 def warn_non_literal_null_pointer : Warning<
3301     "expression which evaluates to zero treated as a null pointer constant of "
3302     "type %0">, InGroup<NonLiteralNullConversion>;
3303 def warn_impcast_null_pointer_to_integer : Warning<
3304     "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3305     InGroup<NullConversion>;
3306 def warn_impcast_floating_point_to_bool : Warning<
3307     "implicit conversion turns floating-point number into bool: %0 to %1">,
3308     InGroup<ImplicitConversionFloatingPointToBool>;
3309 def ext_ms_impcast_fn_obj : ExtWarn<
3310   "implicit conversion between pointer-to-function and pointer-to-object is a "
3311   "Microsoft extension">, InGroup<MicrosoftCast>;
3312
3313 def warn_impcast_pointer_to_bool : Warning<
3314     "address of%select{| function| array}0 '%1' will always evaluate to "
3315     "'true'">,
3316     InGroup<PointerBoolConversion>;
3317 def warn_cast_nonnull_to_bool : Warning<
3318     "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3319     "'true' on first encounter">,
3320     InGroup<PointerBoolConversion>;
3321 def warn_this_bool_conversion : Warning<
3322   "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3323   "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3324 def warn_address_of_reference_bool_conversion : Warning<
3325   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3326   "code; pointer may be assumed to always convert to true">,
3327   InGroup<UndefinedBoolConversion>;
3328
3329 def warn_null_pointer_compare : Warning<
3330     "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3331     "equal to a null pointer is always %select{true|false}2">,
3332     InGroup<TautologicalPointerCompare>;
3333 def warn_nonnull_expr_compare : Warning<
3334     "comparison of nonnull %select{function call|parameter}0 '%1' "
3335     "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3336     "encounter">,
3337     InGroup<TautologicalPointerCompare>;
3338 def warn_this_null_compare : Warning<
3339   "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3340   "assumed to always evaluate to %select{true|false}0">,
3341   InGroup<TautologicalUndefinedCompare>;
3342 def warn_address_of_reference_null_compare : Warning<
3343   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3344   "code; comparison may be assumed to always evaluate to "
3345   "%select{true|false}0">,
3346   InGroup<TautologicalUndefinedCompare>;
3347 def note_reference_is_return_value : Note<"%0 returns a reference">;
3348
3349 def warn_division_sizeof_ptr : Warning<
3350   "'%0' will return the size of the pointer, not the array itself">,
3351   InGroup<DiagGroup<"sizeof-pointer-div">>;
3352
3353 def note_function_warning_silence : Note<
3354     "prefix with the address-of operator to silence this warning">;
3355 def note_function_to_function_call : Note<
3356     "suffix with parentheses to turn this into a function call">;
3357 def warn_impcast_objective_c_literal_to_bool : Warning<
3358     "implicit boolean conversion of Objective-C object literal always "
3359     "evaluates to true">,
3360     InGroup<ObjCLiteralConversion>;
3361
3362 def warn_cast_align : Warning<
3363   "cast from %0 to %1 increases required alignment from %2 to %3">,
3364   InGroup<CastAlign>, DefaultIgnore;
3365 def warn_old_style_cast : Warning<
3366   "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3367
3368 // Separate between casts to void* and non-void* pointers.
3369 // Some APIs use (abuse) void* for something like a user context,
3370 // and often that value is an integer even if it isn't a pointer itself.
3371 // Having a separate warning flag allows users to control the warning
3372 // for their workflow.
3373 def warn_int_to_pointer_cast : Warning<
3374   "cast to %1 from smaller integer type %0">,
3375   InGroup<IntToPointerCast>;
3376 def warn_int_to_void_pointer_cast : Warning<
3377   "cast to %1 from smaller integer type %0">,
3378   InGroup<IntToVoidPointerCast>;
3379
3380 def warn_attribute_ignored_for_field_of_type : Warning<
3381   "%0 attribute ignored for field of type %1">,
3382   InGroup<IgnoredAttributes>;
3383 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3384   "enums in the Microsoft ABI are signed integers by default; consider giving "
3385   "the enum %0 an unsigned underlying type to make this code portable">,
3386   InGroup<SignedEnumBitfield>, DefaultIgnore;
3387 def warn_attribute_packed_for_bitfield : Warning<
3388   "'packed' attribute was ignored on bit-fields with single-byte alignment "
3389   "in older versions of GCC and Clang">,
3390   InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3391 def warn_transparent_union_attribute_field_size_align : Warning<
3392   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3393   "%select{alignment|size}0 of the first field in transparent union; "
3394   "transparent_union attribute ignored">,
3395   InGroup<IgnoredAttributes>;
3396 def note_transparent_union_first_field_size_align : Note<
3397   "%select{alignment|size}0 of first field is %1 bits">;
3398 def warn_transparent_union_attribute_not_definition : Warning<
3399   "transparent_union attribute can only be applied to a union definition; "
3400   "attribute ignored">,
3401   InGroup<IgnoredAttributes>;
3402 def warn_transparent_union_attribute_floating : Warning<
3403   "first field of a transparent union cannot have %select{floating point|"
3404   "vector}0 type %1; transparent_union attribute ignored">,
3405   InGroup<IgnoredAttributes>;
3406 def warn_transparent_union_attribute_zero_fields : Warning<
3407   "transparent union definition must contain at least one field; "
3408   "transparent_union attribute ignored">,
3409   InGroup<IgnoredAttributes>;
3410 def warn_attribute_type_not_supported : Warning<
3411   "%0 attribute argument not supported: %1">,
3412   InGroup<IgnoredAttributes>;
3413 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3414   InGroup<IgnoredAttributes>;
3415 def warn_attribute_protected_visibility :
3416   Warning<"target does not support 'protected' visibility; using 'default'">,
3417   InGroup<DiagGroup<"unsupported-visibility">>;
3418 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3419 def note_previous_attribute : Note<"previous attribute is here">;
3420 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3421 def note_attribute : Note<"attribute is here">;
3422 def err_mismatched_ms_inheritance : Error<
3423   "inheritance model does not match %select{definition|previous declaration}0">;
3424 def warn_ignored_ms_inheritance : Warning<
3425   "inheritance model ignored on %select{primary template|partial specialization}0">,
3426   InGroup<IgnoredAttributes>;
3427 def note_previous_ms_inheritance : Note<
3428   "previous inheritance model specified here">;
3429 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3430 def err_mode_not_primitive : Error<
3431   "mode attribute only supported for integer and floating-point types">;
3432 def err_mode_wrong_type : Error<
3433   "type of machine mode does not match type of base type">;
3434 def warn_vector_mode_deprecated : Warning<
3435   "specifying vector types with the 'mode' attribute is deprecated; "
3436   "use the 'vector_size' attribute instead">,
3437   InGroup<DeprecatedAttributes>;
3438 def err_complex_mode_vector_type : Error<
3439   "type of machine mode does not support base vector types">;
3440 def err_enum_mode_vector_type : Error<
3441   "mode %0 is not supported for enumeration types">;
3442 def warn_attribute_nonnull_no_pointers : Warning<
3443   "'nonnull' attribute applied to function with no pointer arguments">,
3444   InGroup<IgnoredAttributes>;
3445 def warn_attribute_nonnull_parm_no_args : Warning<
3446   "'nonnull' attribute when used on parameters takes no arguments">,
3447   InGroup<IgnoredAttributes>;
3448 def note_declared_nonnull : Note<
3449   "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3450 def warn_attribute_sentinel_named_arguments : Warning<
3451   "'sentinel' attribute requires named arguments">,
3452   InGroup<IgnoredAttributes>;
3453 def warn_attribute_sentinel_not_variadic : Warning<
3454   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3455   InGroup<IgnoredAttributes>;
3456 def err_attribute_sentinel_less_than_zero : Error<
3457   "'sentinel' parameter 1 less than zero">;
3458 def err_attribute_sentinel_not_zero_or_one : Error<
3459   "'sentinel' parameter 2 not 0 or 1">;
3460 def warn_cleanup_ext : Warning<
3461   "GCC does not allow the 'cleanup' attribute argument to be anything other "
3462   "than a simple identifier">,
3463   InGroup<GccCompat>;
3464 def err_attribute_cleanup_arg_not_function : Error<
3465   "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3466 def err_attribute_cleanup_func_must_take_one_arg : Error<
3467   "'cleanup' function %0 must take 1 parameter">;
3468 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3469   "'cleanup' function %0 parameter has "
3470   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3471 def err_attribute_regparm_wrong_platform : Error<
3472   "'regparm' is not valid on this platform">;
3473 def err_attribute_regparm_invalid_number : Error<
3474   "'regparm' parameter must be between 0 and %0 inclusive">;
3475 def err_attribute_not_supported_in_lang : Error<
3476   "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3477 def err_attribute_not_supported_on_arch
3478     : Error<"%0 attribute is not supported on '%1'">;
3479 def warn_gcc_ignores_type_attr : Warning<
3480   "GCC does not allow the %0 attribute to be written on a type">,
3481   InGroup<GccCompat>;
3482
3483 // Clang-Specific Attributes
3484 def warn_attribute_iboutlet : Warning<
3485   "%0 attribute can only be applied to instance variables or properties">,
3486   InGroup<IgnoredAttributes>;
3487 def err_iboutletcollection_type : Error<
3488   "invalid type %0 as argument of iboutletcollection attribute">;
3489 def err_iboutletcollection_builtintype : Error<
3490   "type argument of iboutletcollection attribute cannot be a builtin type">;
3491 def warn_iboutlet_object_type : Warning<
3492   "%select{instance variable|property}2 with %0 attribute must "
3493   "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3494 def warn_iboutletcollection_property_assign : Warning<
3495   "IBOutletCollection properties should be copy/strong and not assign">,
3496   InGroup<ObjCInvalidIBOutletProperty>;
3497
3498 def err_attribute_overloadable_mismatch : Error<
3499   "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
3500 def note_attribute_overloadable_prev_overload : Note<
3501   "previous %select{unmarked |}0overload of function is here">;
3502 def err_attribute_overloadable_no_prototype : Error<
3503   "'overloadable' function %0 must have a prototype">;
3504 def err_attribute_overloadable_multiple_unmarked_overloads : Error<
3505   "at most one overload for a given name may lack the 'overloadable' "
3506   "attribute">;
3507 def warn_ns_attribute_wrong_return_type : Warning<
3508   "%0 attribute only applies to %select{functions|methods|properties}1 that "
3509   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3510   InGroup<IgnoredAttributes>;
3511 def err_ns_attribute_wrong_parameter_type : Error<
3512   "%0 attribute only applies to "
3513   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3514 def warn_ns_attribute_wrong_parameter_type : Warning<
3515   "%0 attribute only applies to "
3516   "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">,
3517   InGroup<IgnoredAttributes>;
3518 def warn_objc_requires_super_protocol : Warning<
3519   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3520   InGroup<DiagGroup<"requires-super-attribute">>;
3521 def note_protocol_decl : Note<
3522   "protocol is declared here">;
3523 def note_protocol_decl_undefined : Note<
3524   "protocol %0 has no definition">;
3525
3526 // objc_designated_initializer attribute diagnostics.
3527 def warn_objc_designated_init_missing_super_call : Warning<
3528   "designated initializer missing a 'super' call to a designated initializer of the super class">,
3529   InGroup<ObjCDesignatedInit>;
3530 def note_objc_designated_init_marked_here : Note<
3531   "method marked as designated initializer of the class here">;
3532 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3533   "designated initializer should only invoke a designated initializer on 'super'">,
3534   InGroup<ObjCDesignatedInit>;
3535 def warn_objc_designated_init_non_designated_init_call : Warning<
3536   "designated initializer invoked a non-designated initializer">,
3537   InGroup<ObjCDesignatedInit>;
3538 def warn_objc_secondary_init_super_init_call : Warning<
3539   "convenience initializer should not invoke an initializer on 'super'">,
3540   InGroup<ObjCDesignatedInit>;
3541 def warn_objc_secondary_init_missing_init_call : Warning<
3542   "convenience initializer missing a 'self' call to another initializer">,
3543   InGroup<ObjCDesignatedInit>;
3544 def warn_objc_implementation_missing_designated_init_override : Warning<
3545   "method override for the designated initializer of the superclass %objcinstance0 not found">,
3546   InGroup<ObjCDesignatedInit>;
3547 def err_designated_init_attr_non_init : Error<
3548   "'objc_designated_initializer' attribute only applies to init methods "
3549   "of interface or class extension declarations">;
3550
3551 // objc_bridge attribute diagnostics.
3552 def err_objc_attr_not_id : Error<
3553   "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3554 def err_objc_attr_typedef_not_id : Error<
3555   "parameter of %0 attribute must be 'id' when used on a typedef">;
3556 def err_objc_attr_typedef_not_void_pointer : Error<
3557   "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3558 def err_objc_cf_bridged_not_interface : Error<
3559   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3560 def err_objc_ns_bridged_invalid_cfobject : Error<
3561   "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3562 def warn_objc_invalid_bridge : Warning<
3563   "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3564 def warn_objc_invalid_bridge_to_cf : Warning<
3565   "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3566
3567 // objc_bridge_related attribute diagnostics.
3568 def err_objc_bridged_related_invalid_class : Error<
3569   "could not find Objective-C class %0 to convert %1 to %2">;
3570 def err_objc_bridged_related_invalid_class_name : Error<
3571   "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3572 def err_objc_bridged_related_known_method : Error<
3573  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3574  "method for this conversion">;
3575
3576 def err_objc_attr_protocol_requires_definition : Error<
3577   "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3578
3579 def warn_ignored_objc_externally_retained : Warning<
3580   "'objc_externally_retained' can only be applied to local variables "
3581   "%select{of retainable type|with strong ownership}0">,
3582   InGroup<IgnoredAttributes>;
3583
3584 // Function Parameter Semantic Analysis.
3585 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3586 def err_void_only_param : Error<
3587   "'void' must be the first and only parameter if specified">;
3588 def err_void_param_qualified : Error<
3589   "'void' as parameter must not have type qualifiers">;
3590 def err_ident_list_in_fn_declaration : Error<
3591   "a parameter list without types is only allowed in a function definition">;
3592 def ext_param_not_declared : Extension<
3593   "parameter %0 was not declared, defaulting to type 'int'">;
3594 def err_param_default_argument : Error<
3595   "C does not support default arguments">;
3596 def err_param_default_argument_redefinition : Error<
3597   "redefinition of default argument">;
3598 def ext_param_default_argument_redefinition : ExtWarn<
3599   err_param_default_argument_redefinition.Text>,
3600   InGroup<MicrosoftDefaultArgRedefinition>;
3601 def err_param_default_argument_missing : Error<
3602   "missing default argument on parameter">;
3603 def err_param_default_argument_missing_name : Error<
3604   "missing default argument on parameter %0">;
3605 def err_param_default_argument_references_param : Error<
3606   "default argument references parameter %0">;
3607 def err_param_default_argument_references_local : Error<
3608   "default argument references local variable %0 of enclosing function">;
3609 def err_param_default_argument_references_this : Error<
3610   "default argument references 'this'">;
3611 def err_param_default_argument_nonfunc : Error<
3612   "default arguments can only be specified for parameters in a function "
3613   "declaration">;
3614 def err_param_default_argument_template_redecl : Error<
3615   "default arguments cannot be added to a function template that has already "
3616   "been declared">;
3617 def err_param_default_argument_member_template_redecl : Error<
3618   "default arguments cannot be added to an out-of-line definition of a member "
3619   "of a %select{class template|class template partial specialization|nested "
3620   "class in a template}0">;
3621 def err_param_default_argument_on_parameter_pack : Error<
3622   "parameter pack cannot have a default argument">;
3623 def err_uninitialized_member_for_assign : Error<
3624   "cannot define the implicit copy assignment operator for %0, because "
3625   "non-static %select{reference|const}1 member %2 cannot use copy "
3626   "assignment operator">;
3627 def err_uninitialized_member_in_ctor : Error<
3628   "%select{constructor for %1|"
3629   "implicit default constructor for %1|"
3630   "cannot use constructor inherited from %1:}0 must explicitly "
3631   "initialize the %select{reference|const}2 member %3">;
3632 def err_default_arg_makes_ctor_special : Error<
3633   "addition of default argument on redeclaration makes this constructor a "
3634   "%select{default|copy|move}0 constructor">;
3635
3636 def err_use_of_default_argument_to_function_declared_later : Error<
3637   "use of default argument to function %0 that is declared later in class %1">;
3638 def note_default_argument_declared_here : Note<
3639   "default argument declared here">;
3640 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3641
3642 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3643   "%diff{promoted type $ of K&R function parameter is not compatible with the "
3644   "parameter type $|promoted type of K&R function parameter is not compatible "
3645   "with parameter type}0,1 declared in a previous prototype">,
3646   InGroup<KNRPromotedParameter>;
3647
3648
3649 // C++ Overloading Semantic Analysis.
3650 def err_ovl_diff_return_type : Error<
3651   "functions that differ only in their return type cannot be overloaded">;
3652 def err_ovl_static_nonstatic_member : Error<
3653   "static and non-static member functions with the same parameter types "
3654   "cannot be overloaded">;
3655
3656 def err_ovl_no_viable_function_in_call : Error<
3657   "no matching function for call to %0">;
3658 def err_ovl_no_viable_member_function_in_call : Error<
3659   "no matching member function for call to %0">;
3660 def err_ovl_ambiguous_call : Error<
3661   "call to %0 is ambiguous">;
3662 def err_ovl_deleted_call : Error<"call to deleted function %0">;
3663 def err_ovl_ambiguous_member_call : Error<
3664   "call to member function %0 is ambiguous">;
3665 def err_ovl_deleted_member_call : Error<
3666   "call to deleted member function %0">;
3667 def note_ovl_too_many_candidates : Note<
3668     "remaining %0 candidate%s0 omitted; "
3669     "pass -fshow-overloads=all to show them">;
3670
3671 def select_ovl_candidate_kind : TextSubstitution<
3672   "%select{function|function|constructor|"
3673     "constructor (the implicit default constructor)|"
3674     "constructor (the implicit copy constructor)|"
3675     "constructor (the implicit move constructor)|"
3676     "function (the implicit copy assignment operator)|"
3677     "function (the implicit move assignment operator)|"
3678     "inherited constructor}0%select{| template| %2}1">;
3679
3680 def note_ovl_candidate : Note<
3681     "candidate %sub{select_ovl_candidate_kind}0,1,3"
3682     "%select{| has different class%diff{ (expected $ but has $)|}5,6"
3683     "| has different number of parameters (expected %5 but has %6)"
3684     "| has type mismatch at %ordinal5 parameter"
3685     "%diff{ (expected $ but has $)|}6,7"
3686     "| has different return type%diff{ ($ expected but has $)|}5,6"
3687     "| has different qualifiers (expected %5 but found %6)"
3688     "| has different exception specification}4">;
3689
3690 def note_ovl_candidate_explicit_forbidden : Note<
3691     "candidate %0 ignored: cannot be explicit">;
3692 def note_explicit_bool_resolved_to_true : Note<
3693     "explicit(bool) specifier resolved to true">;
3694 def note_ovl_candidate_inherited_constructor : Note<
3695     "constructor from base class %0 inherited here">;
3696 def note_ovl_candidate_inherited_constructor_slice : Note<
3697     "candidate %select{constructor|template}0 ignored: "
3698     "inherited constructor cannot be used to %select{copy|move}1 object">;
3699 def note_ovl_candidate_illegal_constructor : Note<
3700     "candidate %select{constructor|template}0 ignored: "
3701     "instantiation %select{takes|would take}0 its own class type by value">;
3702 def note_ovl_candidate_illegal_constructor_adrspace_mismatch : Note<
3703     "candidate constructor ignored: cannot be used to construct an object "
3704     "in address space %0">;
3705 def note_ovl_candidate_bad_deduction : Note<
3706     "candidate template ignored: failed template argument deduction">;
3707 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3708     "couldn't infer template argument %0">;
3709 def note_ovl_candidate_incomplete_deduction_pack : Note<"candidate template ignored: "
3710     "deduced too few arguments for expanded pack %0; no argument for %ordinal1 "
3711     "expanded parameter in deduced argument pack %2">;
3712 def note_ovl_candidate_inconsistent_deduction : Note<
3713     "candidate template ignored: deduced conflicting %select{types|values|"
3714     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3715 def note_ovl_candidate_inconsistent_deduction_types : Note<
3716     "candidate template ignored: deduced values %diff{"
3717     "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3718     "%1 and %3 of conflicting types for parameter %0}2,4">;
3719 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3720     "candidate template ignored: invalid explicitly-specified argument "
3721     "for template parameter %0">;
3722 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3723     "candidate template ignored: invalid explicitly-specified argument "
3724     "for %ordinal0 template parameter">;
3725 def note_ovl_candidate_instantiation_depth : Note<
3726     "candidate template ignored: substitution exceeded maximum template "
3727     "instantiation depth">;
3728 def note_ovl_candidate_underqualified : Note<
3729     "candidate template ignored: cannot deduce a type for %0 that would "
3730     "make %2 equal %1">;
3731 def note_ovl_candidate_substitution_failure : Note<
3732     "candidate template ignored: substitution failure%0%1">;
3733 def note_ovl_candidate_disabled_by_enable_if : Note<
3734     "candidate template ignored: disabled by %0%1">;
3735 def note_ovl_candidate_disabled_by_requirement : Note<
3736     "candidate template ignored: requirement '%0' was not satisfied%1">;
3737 def note_ovl_candidate_has_pass_object_size_params: Note<
3738     "candidate address cannot be taken because parameter %0 has "
3739     "pass_object_size attribute">;
3740 def err_diagnose_if_succeeded : Error<"%0">;
3741 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3742     ShowInSystemHeader;
3743 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3744     "candidate disabled: %0">;
3745 def note_ovl_candidate_disabled_by_extension : Note<
3746     "candidate unavailable as it requires OpenCL extension '%0' to be enabled">;
3747 def err_addrof_function_disabled_by_enable_if_attr : Error<
3748     "cannot take address of function %0 because it has one or more "
3749     "non-tautological enable_if conditions">;
3750 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3751     "candidate function made ineligible by enable_if">;
3752 def note_ovl_candidate_deduced_mismatch : Note<
3753     "candidate template ignored: deduced type "
3754     "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3755     "adjusted type $ of %select{|element of }4argument"
3756     "|of %select{|element of }4%ordinal0 parameter does not match "
3757     "adjusted type of %select{|element of }4argument}1,2%3">;
3758 def note_ovl_candidate_non_deduced_mismatch : Note<
3759     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3760 // This note is needed because the above note would sometimes print two
3761 // different types with the same name.  Remove this note when the above note
3762 // can handle that case properly.
3763 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3764     "candidate template ignored: could not match %q0 against %q1">;
3765
3766 // Note that we don't treat templates differently for this diagnostic.
3767 def note_ovl_candidate_arity : Note<"candidate "
3768     "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
3769     "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "
3770     "%plural{1:was|:were}5 provided">;
3771
3772 def note_ovl_candidate_arity_one : Note<"candidate "
3773     "%sub{select_ovl_candidate_kind}0,1,2 not viable: "
3774     "%select{requires at least|allows at most single|requires single}3 "
3775     "argument %4, but %plural{0:no|:%5}5 arguments were provided">;
3776
3777 def note_ovl_candidate_deleted : Note<
3778     "candidate %sub{select_ovl_candidate_kind}0,1,2 has been "
3779     "%select{explicitly made unavailable|explicitly deleted|"
3780     "implicitly deleted}3">;
3781
3782 // Giving the index of the bad argument really clutters this message, and
3783 // it's relatively unimportant because 1) it's generally obvious which
3784 // argument(s) are of the given object type and 2) the fix is usually
3785 // to complete the type, which doesn't involve changes to the call line
3786 // anyway.  If people complain, we can change it.
3787 def note_ovl_candidate_bad_conv_incomplete : Note<
3788     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3789     "cannot convert argument of incomplete type "
3790     "%diff{$ to $|to parameter type}3,4 for "
3791     "%select{%ordinal6 argument|object argument}5"
3792     "%select{|; dereference the argument with *|"
3793     "; take the address of the argument with &|"
3794     "; remove *|"
3795     "; remove &}7">;
3796 def note_ovl_candidate_bad_list_argument : Note<
3797     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3798     "cannot convert initializer list argument to %4">;
3799 def note_ovl_candidate_bad_overload : Note<
3800     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3801     "no overload of %4 matching %3 for %ordinal5 argument">;
3802 def note_ovl_candidate_bad_conv : Note<
3803     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3804     "no known conversion "
3805     "%diff{from $ to $|from argument type to parameter type}3,4 for "
3806     "%select{%ordinal6 argument|object argument}5"
3807     "%select{|; dereference the argument with *|"
3808     "; take the address of the argument with &|"
3809     "; remove *|"
3810     "; remove &}7">;
3811 def note_ovl_candidate_bad_arc_conv : Note<
3812     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3813     "cannot implicitly convert argument "
3814     "%diff{of type $ to $|type to parameter type}3,4 for "
3815     "%select{%ordinal6 argument|object argument}5 under ARC">;
3816 def note_ovl_candidate_bad_lvalue : Note<
3817     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3818     "expects an l-value for "
3819     "%select{%ordinal4 argument|object argument}3">;
3820 def note_ovl_candidate_bad_addrspace : Note<
3821     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3822     "address space mismatch in %select{%ordinal6|'this'}5 argument (%3), "
3823     "parameter type must be %4">;
3824 def note_ovl_candidate_bad_gc : Note<
3825     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3826     "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "
3827     "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;
3828 def note_ovl_candidate_bad_ownership : Note<
3829     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3830     "%select{%ordinal7|'this'}6 argument (%3) has "
3831     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership,"
3832     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3833     "__autoreleasing}5 ownership">;
3834 def note_ovl_candidate_bad_cvr_this : Note<
3835     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3836     "'this' argument has type %3, but method is not marked "
3837     "%select{const|restrict|const or restrict|volatile|const or volatile|"
3838     "volatile or restrict|const, volatile, or restrict}4">;
3839 def note_ovl_candidate_bad_cvr : Note<
3840     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3841     "%ordinal5 argument (%3) would lose "
3842     "%select{const|restrict|const and restrict|volatile|const and volatile|"
3843     "volatile and restrict|const, volatile, and restrict}4 qualifier"
3844     "%select{||s||s|s|s}4">;
3845 def note_ovl_candidate_bad_unaligned : Note<
3846     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3847     "%ordinal5 argument (%3) would lose __unaligned qualifier">;
3848 def note_ovl_candidate_bad_base_to_derived_conv : Note<
3849     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3850     "cannot %select{convert from|convert from|bind}3 "
3851     "%select{base class pointer|superclass|base class object of type}3 %4 to "
3852     "%select{derived class pointer|subclass|derived class reference}3 %5 for "
3853     "%ordinal6 argument">;
3854 def note_ovl_candidate_bad_target : Note<
3855     "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
3856     "call to "
3857     "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from"
3858     " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">;
3859 def note_implicit_member_target_infer_collision : Note<
3860     "implicit %sub{select_special_member_kind}0 inferred target collision: call to both "
3861     "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3862     "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3863
3864 def note_ambiguous_type_conversion: Note<
3865     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3866 def note_ovl_builtin_binary_candidate : Note<
3867     "built-in candidate %0">;
3868 def note_ovl_builtin_unary_candidate : Note<
3869     "built-in candidate %0">;
3870 def err_ovl_no_viable_function_in_init : Error<
3871   "no matching constructor for initialization of %0">;
3872 def err_ovl_no_conversion_in_cast : Error<
3873   "cannot convert %1 to %2 without a conversion operator">;
3874 def err_ovl_no_viable_conversion_in_cast : Error<
3875   "no matching conversion for %select{|static_cast|reinterpret_cast|"
3876   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3877 def err_ovl_ambiguous_conversion_in_cast : Error<
3878   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3879   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3880 def err_ovl_deleted_conversion_in_cast : Error<
3881   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3882   "functional-style cast}0 from %1 to %2 uses deleted function">;
3883 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3884 def err_ref_init_ambiguous : Error<
3885   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3886 def err_ovl_deleted_init : Error<
3887   "call to deleted constructor of %0">;
3888 def err_ovl_deleted_special_init : Error<
3889   "call to implicitly-deleted %select{default constructor|copy constructor|"
3890   "move constructor|copy assignment operator|move assignment operator|"
3891   "destructor|function}0 of %1">;
3892 def err_ovl_ambiguous_oper_unary : Error<
3893   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3894 def err_ovl_ambiguous_oper_binary : Error<
3895   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3896 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3897 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3898 def err_ovl_deleted_oper : Error<
3899   "overload resolution selected deleted operator '%0'">;
3900 def err_ovl_deleted_special_oper : Error<
3901   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3902   "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is implicitly deleted">;
3903 def err_ovl_no_viable_subscript :
3904     Error<"no viable overloaded operator[] for type %0">;
3905 def err_ovl_no_oper :
3906     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3907 def err_ovl_unresolvable : Error<
3908   "reference to %select{overloaded|multiversioned}1 function could not be "
3909   "resolved; did you mean to call it%select{| with no arguments}0?">;
3910 def err_bound_member_function : Error<
3911   "reference to non-static member function must be called"
3912   "%select{|; did you mean to call it with no arguments?}0">;
3913 def note_possible_target_of_call : Note<"possible target for call">;
3914
3915 def err_ovl_no_viable_object_call : Error<
3916   "no matching function for call to object of type %0">;
3917 def err_ovl_ambiguous_object_call : Error<
3918   "call to object of type %0 is ambiguous">;
3919 def err_ovl_deleted_object_call : Error<
3920   "call to deleted function call operator in type %0">;
3921 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3922 def err_member_call_without_object : Error<
3923   "call to non-static member function without an object argument">;
3924
3925 // C++ Address of Overloaded Function
3926 def err_addr_ovl_no_viable : Error<
3927   "address of overloaded function %0 does not match required type %1">;
3928 def err_addr_ovl_ambiguous : Error<
3929   "address of overloaded function %0 is ambiguous">;
3930 def err_addr_ovl_not_func_ptrref : Error<
3931   "address of overloaded function %0 cannot be converted to type %1">;
3932 def err_addr_ovl_no_qualifier : Error<
3933   "cannot form member pointer of type %0 without '&' and class name">;
3934
3935 // C++11 Literal Operators
3936 def err_ovl_no_viable_literal_operator : Error<
3937   "no matching literal operator for call to %0"
3938   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3939   "%select{| or 'const char *'}4"
3940   "%select{|, and no matching literal operator template}5">;
3941
3942 // C++ Template Declarations
3943 def err_template_param_shadow : Error<
3944   "declaration of %0 shadows template parameter">;
3945 def note_template_param_here : Note<"template parameter is declared here">;
3946 def warn_template_export_unsupported : Warning<
3947   "exported templates are unsupported">;
3948 def err_template_outside_namespace_or_class_scope : Error<
3949   "templates can only be declared in namespace or class scope">;
3950 def err_template_inside_local_class : Error<
3951   "templates cannot be declared inside of a local class">;
3952 def err_template_linkage : Error<"templates must have C++ linkage">;
3953 def err_template_typedef : Error<"a typedef cannot be a template">;
3954 def err_template_unnamed_class : Error<
3955   "cannot declare a class template with no name">;
3956 def err_template_param_list_different_arity : Error<
3957   "%select{too few|too many}0 template parameters in template "
3958   "%select{|template parameter }1redeclaration">;
3959 def note_template_param_list_different_arity : Note<
3960   "%select{too few|too many}0 template parameters in template template "
3961   "argument">;
3962 def note_template_prev_declaration : Note<
3963   "previous template %select{declaration|template parameter}0 is here">;
3964 def err_template_param_different_kind : Error<
3965   "template parameter has a different kind in template "
3966   "%select{|template parameter }0redeclaration">;
3967 def note_template_param_different_kind : Note<
3968   "template parameter has a different kind in template argument">;
3969
3970 def err_invalid_decl_specifier_in_nontype_parm : Error<
3971   "invalid declaration specifier in template non-type parameter">;
3972
3973 def err_template_nontype_parm_different_type : Error<
3974   "template non-type parameter has a different type %0 in template "
3975   "%select{|template parameter }1redeclaration">;
3976
3977 def note_template_nontype_parm_different_type : Note<
3978   "template non-type parameter has a different type %0 in template argument">;
3979 def note_template_nontype_parm_prev_declaration : Note<
3980   "previous non-type template parameter with type %0 is here">;
3981 def err_template_nontype_parm_bad_type : Error<
3982   "a non-type template parameter cannot have type %0">;
3983 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3984   "non-type template parameters declared with %0 are incompatible with C++ "
3985   "standards before C++17">,
3986   DefaultIgnore, InGroup<CXXPre17Compat>;
3987 def err_template_param_default_arg_redefinition : Error<
3988   "template parameter redefines default argument">;
3989 def note_template_param_prev_default_arg : Note<
3990   "previous default template argument defined here">;
3991 def err_template_param_default_arg_missing : Error<
3992   "template parameter missing a default argument">;
3993 def ext_template_parameter_default_in_function_template : ExtWarn<
3994   "default template arguments for a function template are a C++11 extension">,
3995   InGroup<CXX11>;
3996 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3997   "default template arguments for a function template are incompatible with C++98">,
3998   InGroup<CXX98Compat>, DefaultIgnore;
3999 def err_template_parameter_default_template_member : Error<
4000   "cannot add a default template argument to the definition of a member of a "
4001   "class template">;
4002 def err_template_parameter_default_friend_template : Error<
4003   "default template argument not permitted on a friend template">;
4004 def err_template_template_parm_no_parms : Error<
4005   "template template parameter must have its own template parameters">;
4006
4007 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
4008   InGroup<CXX14>;
4009 def warn_cxx11_compat_variable_template : Warning<
4010   "variable templates are incompatible with C++ standards before C++14">,
4011   InGroup<CXXPre14Compat>, DefaultIgnore;
4012 def err_template_variable_noparams : Error<
4013   "extraneous 'template<>' in declaration of variable %0">;
4014 def err_template_member : Error<"member %0 declared as a template">;
4015 def err_template_member_noparams : Error<
4016   "extraneous 'template<>' in declaration of member %0">;
4017 def err_template_tag_noparams : Error<
4018   "extraneous 'template<>' in declaration of %0 %1">;
4019
4020 def warn_cxx17_compat_adl_only_template_id : Warning<
4021   "use of function template name with no prior function template "
4022   "declaration in function call with explicit template arguments "
4023   "is incompatible with C++ standards before C++2a">,
4024   InGroup<CXXPre2aCompat>, DefaultIgnore;
4025 def ext_adl_only_template_id : ExtWarn<
4026   "use of function template name with no prior declaration in function call "
4027   "with explicit template arguments is a C++2a extension">, InGroup<CXX2a>;
4028
4029 // C++ Template Argument Lists
4030 def err_template_missing_args : Error<
4031   "use of "
4032   "%select{class template|function template|variable template|alias template|"
4033   "template template parameter|concept|template}0 %1 requires template "
4034   "arguments">;
4035 def err_template_arg_list_different_arity : Error<
4036   "%select{too few|too many}0 template arguments for "
4037   "%select{class template|function template|variable template|alias template|"
4038   "template template parameter|concept|template}1 %2">;
4039 def note_template_decl_here : Note<"template is declared here">;
4040 def err_template_arg_must_be_type : Error<
4041   "template argument for template type parameter must be a type">;
4042 def err_template_arg_must_be_type_suggest : Error<
4043   "template argument for template type parameter must be a type; "
4044   "did you forget 'typename'?">;
4045 def ext_ms_template_type_arg_missing_typename : ExtWarn<
4046   "template argument for template type parameter must be a type; "
4047   "omitted 'typename' is a Microsoft extension">,
4048   InGroup<MicrosoftTemplate>;
4049 def err_template_arg_must_be_expr : Error<
4050   "template argument for non-type template parameter must be an expression">;
4051 def err_template_arg_nontype_ambig : Error<
4052   "template argument for non-type template parameter is treated as function type %0">;
4053 def err_template_arg_must_be_template : Error<
4054   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
4055 def ext_template_arg_local_type : ExtWarn<
4056   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
4057 def ext_template_arg_unnamed_type : ExtWarn<
4058   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4059 def warn_cxx98_compat_template_arg_local_type : Warning<
4060   "local type %0 as template argument is incompatible with C++98">,
4061   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4062 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4063   "unnamed type as template argument is incompatible with C++98">,
4064   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4065 def note_template_unnamed_type_here : Note<
4066   "unnamed type used in template argument was declared here">;
4067 def err_template_arg_overload_type : Error<
4068   "template argument is the type of an unresolved overloaded function">;
4069 def err_template_arg_not_valid_template : Error<
4070   "template argument does not refer to a class or alias template, or template "
4071   "template parameter">;
4072 def note_template_arg_refers_here_func : Note<
4073   "template argument refers to function template %0, here">;
4074 def err_template_arg_template_params_mismatch : Error<
4075   "template template argument has different template parameters than its "
4076   "corresponding template template parameter">;
4077 def err_template_arg_not_integral_or_enumeral : Error<
4078   "non-type template argument of type %0 must have an integral or enumeration"
4079   " type">;
4080 def err_template_arg_not_ice : Error<
4081   "non-type template argument of type %0 is not an integral constant "
4082   "expression">;
4083 def err_template_arg_not_address_constant : Error<
4084   "non-type template argument of type %0 is not a constant expression">;
4085 def warn_cxx98_compat_template_arg_null : Warning<
4086   "use of null pointer as non-type template argument is incompatible with "
4087   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4088 def err_template_arg_untyped_null_constant : Error<
4089   "null non-type template argument must be cast to template parameter type %0">;
4090 def err_template_arg_wrongtype_null_constant : Error<
4091   "null non-type template argument of type %0 does not match template parameter "
4092   "of type %1">;
4093 def err_non_type_template_parm_type_deduction_failure : Error<
4094   "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4095 def err_deduced_non_type_template_arg_type_mismatch : Error<
4096   "deduced non-type template argument does not have the same type as the "
4097   "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4098 def err_non_type_template_arg_subobject : Error<
4099   "non-type template argument refers to subobject '%0'">;
4100 def err_non_type_template_arg_addr_label_diff : Error<
4101   "template argument / label address difference / what did you expect?">;
4102 def err_template_arg_not_convertible : Error<
4103   "non-type template argument of type %0 cannot be converted to a value "
4104   "of type %1">;
4105 def warn_template_arg_negative : Warning<
4106   "non-type template argument with value '%0' converted to '%1' for unsigned "
4107   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4108 def warn_template_arg_too_large : Warning<
4109   "non-type template argument value '%0' truncated to '%1' for "
4110   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4111 def err_template_arg_no_ref_bind : Error<
4112   "non-type template parameter of reference type "
4113   "%diff{$ cannot bind to template argument of type $"
4114   "|cannot bind to template of incompatible argument type}0,1">;
4115 def err_template_arg_ref_bind_ignores_quals : Error<
4116   "reference binding of non-type template parameter "
4117   "%diff{of type $ to template argument of type $|to template argument}0,1 "
4118   "ignores qualifiers">;
4119 def err_template_arg_not_decl_ref : Error<
4120   "non-type template argument does not refer to any declaration">;
4121 def err_template_arg_not_address_of : Error<
4122   "non-type template argument for template parameter of pointer type %0 must "
4123   "have its address taken">;
4124 def err_template_arg_address_of_non_pointer : Error<
4125   "address taken in non-type template argument for template parameter of "
4126   "reference type %0">;
4127 def err_template_arg_reference_var : Error<
4128   "non-type template argument of reference type %0 is not an object">;
4129 def err_template_arg_field : Error<
4130   "non-type template argument refers to non-static data member %0">;
4131 def err_template_arg_method : Error<
4132   "non-type template argument refers to non-static member function %0">;
4133 def err_template_arg_object_no_linkage : Error<
4134   "non-type template argument refers to %select{function|object}0 %1 that "
4135   "does not have linkage">;
4136 def warn_cxx98_compat_template_arg_object_internal : Warning<
4137   "non-type template argument referring to %select{function|object}0 %1 with "
4138   "internal linkage is incompatible with C++98">,
4139   InGroup<CXX98Compat>, DefaultIgnore;
4140 def ext_template_arg_object_internal : ExtWarn<
4141   "non-type template argument referring to %select{function|object}0 %1 with "
4142   "internal linkage is a C++11 extension">, InGroup<CXX11>;
4143 def err_template_arg_thread_local : Error<
4144   "non-type template argument refers to thread-local object">;
4145 def note_template_arg_internal_object : Note<
4146   "non-type template argument refers to %select{function|object}0 here">;
4147 def note_template_arg_refers_here : Note<
4148   "non-type template argument refers here">;
4149 def err_template_arg_not_object_or_func : Error<
4150   "non-type template argument does not refer to an object or function">;
4151 def err_template_arg_not_pointer_to_member_form : Error<
4152   "non-type template argument is not a pointer to member constant">;
4153 def err_template_arg_member_ptr_base_derived_not_supported : Error<
4154   "sorry, non-type template argument of pointer-to-member type %1 that refers "
4155   "to member %q0 of a different class is not supported yet">;
4156 def ext_template_arg_extra_parens : ExtWarn<
4157   "address non-type template argument cannot be surrounded by parentheses">;
4158 def warn_cxx98_compat_template_arg_extra_parens : Warning<
4159   "redundant parentheses surrounding address non-type template argument are "
4160   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4161 def err_pointer_to_member_type : Error<
4162   "invalid use of pointer to member type after %select{.*|->*}0">;
4163 def err_pointer_to_member_call_drops_quals : Error<
4164   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4165 def err_pointer_to_member_oper_value_classify: Error<
4166   "pointer-to-member function type %0 can only be called on an "
4167   "%select{rvalue|lvalue}1">;
4168 def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4169   "invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension">,
4170   InGroup<CXX2a>, SFINAEFailure;
4171 def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4172   "invoking a pointer to a 'const &' member function on an rvalue is "
4173   "incompatible with C++ standards before C++2a">,
4174   InGroup<CXXPre2aCompatPedantic>, DefaultIgnore;
4175 def ext_ms_deref_template_argument: ExtWarn<
4176   "non-type template argument containing a dereference operation is a "
4177   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4178 def ext_ms_delayed_template_argument: ExtWarn<
4179   "using the undeclared type %0 as a default template argument is a "
4180   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4181 def err_template_arg_deduced_incomplete_pack : Error<
4182   "deduced incomplete pack %0 for template parameter %1">;
4183
4184 // C++ template specialization
4185 def err_template_spec_unknown_kind : Error<
4186   "can only provide an explicit specialization for a class template, function "
4187   "template, variable template, or a member function, static data member, "
4188   "%select{or member class|member class, or member enumeration}0 of a "
4189   "class template">;
4190 def note_specialized_entity : Note<
4191   "explicitly specialized declaration is here">;
4192 def note_explicit_specialization_declared_here : Note<
4193   "explicit specialization declared here">;
4194 def err_template_spec_decl_function_scope : Error<
4195   "explicit specialization of %0 in function scope">;
4196 def err_template_spec_decl_friend : Error<
4197   "cannot declare an explicit specialization in a friend">;
4198 def err_template_spec_redecl_out_of_scope : Error<
4199   "%select{class template|class template partial|variable template|"
4200   "variable template partial|function template|member "
4201   "function|static data member|member class|member enumeration}0 "
4202   "specialization of %1 not in %select{a namespace enclosing %2|"
4203   "class %2 or an enclosing namespace}3">;
4204 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4205   "%select{class template|class template partial|variable template|"
4206   "variable template partial|function template|member "
4207   "function|static data member|member class|member enumeration}0 "
4208   "specialization of %1 not in %select{a namespace enclosing %2|"
4209   "class %2 or an enclosing namespace}3 "
4210   "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4211 def err_template_spec_redecl_global_scope : Error<
4212   "%select{class template|class template partial|variable template|"
4213   "variable template partial|function template|member "
4214   "function|static data member|member class|member enumeration}0 "
4215   "specialization of %1 must occur at global scope">;
4216 def err_spec_member_not_instantiated : Error<
4217   "specialization of member %q0 does not specialize an instantiated member">;
4218 def note_specialized_decl : Note<"attempt to specialize declaration here">;
4219 def err_specialization_after_instantiation : Error<
4220   "explicit specialization of %0 after instantiation">;
4221 def note_instantiation_required_here : Note<
4222   "%select{implicit|explicit}0 instantiation first required here">;
4223 def err_template_spec_friend : Error<
4224   "template specialization declaration cannot be a friend">;
4225 def err_template_spec_default_arg : Error<
4226   "default argument not permitted on an explicit "
4227   "%select{instantiation|specialization}0 of function %1">;
4228 def err_not_class_template_specialization : Error<
4229   "cannot specialize a %select{dependent template|template template "
4230   "parameter}0">;
4231 def ext_explicit_specialization_storage_class : ExtWarn<
4232   "explicit specialization cannot have a storage class">;
4233 def err_explicit_specialization_inconsistent_storage_class : Error<
4234   "explicit specialization has extraneous, inconsistent storage class "
4235   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4236 def err_dependent_function_template_spec_no_match : Error<
4237   "no candidate function template was found for dependent"
4238   " friend function template specialization">;
4239 def note_dependent_function_template_spec_discard_reason : Note<
4240   "candidate ignored: %select{not a function template"
4241   "|not a member of the enclosing namespace;"
4242   " did you mean to explicitly qualify the specialization?}0">;
4243
4244 // C++ class template specializations and out-of-line definitions
4245 def err_template_spec_needs_header : Error<
4246   "template specialization requires 'template<>'">;
4247 def err_template_spec_needs_template_parameters : Error<
4248   "template specialization or definition requires a template parameter list "
4249   "corresponding to the nested type %0">;
4250 def err_template_param_list_matches_nontemplate : Error<
4251   "template parameter list matching the non-templated nested type %0 should "
4252   "be empty ('template<>')">;
4253 def err_alias_template_extra_headers : Error<
4254   "extraneous template parameter list in alias template declaration">;
4255 def err_template_spec_extra_headers : Error<
4256   "extraneous template parameter list in template specialization or "
4257   "out-of-line template definition">;
4258 def warn_template_spec_extra_headers : Warning<
4259   "extraneous template parameter list in template specialization">;
4260 def note_explicit_template_spec_does_not_need_header : Note<
4261   "'template<>' header not required for explicitly-specialized class %0 "
4262   "declared here">;
4263 def err_template_qualified_declarator_no_match : Error<
4264   "nested name specifier '%0' for declaration does not refer into a class, "
4265   "class template or class template partial specialization">;
4266 def err_specialize_member_of_template : Error<
4267   "cannot specialize %select{|(with 'template<>') }0a member of an "
4268   "unspecialized template">;
4269
4270 // C++ Class Template Partial Specialization
4271 def err_default_arg_in_partial_spec : Error<
4272     "default template argument in a class template partial specialization">;
4273 def err_dependent_non_type_arg_in_partial_spec : Error<
4274     "type of specialized non-type template argument depends on a template "
4275     "parameter of the partial specialization">;
4276 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4277     "template parameter is used in default argument declared here">;
4278 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4279     "non-type template argument specializes a template parameter with "
4280     "dependent type %0">;
4281 def err_partial_spec_args_match_primary_template : Error<
4282     "%select{class|variable}0 template partial specialization does not "
4283     "specialize any template argument; to %select{declare|define}1 the "
4284     "primary template, remove the template argument list">;
4285 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4286     "%select{class|variable}0 template partial specialization is not "
4287     "more specialized than the primary template">, DefaultError,
4288     InGroup<DiagGroup<"invalid-partial-specialization">>;
4289 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4290 def ext_partial_specs_not_deducible : ExtWarn<
4291     "%select{class|variable}0 template partial specialization contains "
4292     "%select{a template parameter|template parameters}1 that cannot be "
4293     "deduced; this partial specialization will never be used">,
4294     DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4295 def note_non_deducible_parameter : Note<
4296     "non-deducible template parameter %0">;
4297 def err_partial_spec_ordering_ambiguous : Error<
4298     "ambiguous partial specializations of %0">;
4299 def note_partial_spec_match : Note<"partial specialization matches %0">;
4300 def err_partial_spec_redeclared : Error<
4301   "class template partial specialization %0 cannot be redeclared">;
4302 def note_partial_specialization_declared_here : Note<
4303   "explicit specialization declared here">;
4304 def note_prev_partial_spec_here : Note<
4305   "previous declaration of class template partial specialization %0 is here">;
4306 def err_partial_spec_fully_specialized : Error<
4307   "partial specialization of %0 does not use any of its template parameters">;
4308
4309 // C++ Variable Template Partial Specialization
4310 def err_var_partial_spec_redeclared : Error<
4311   "variable template partial specialization %0 cannot be redefined">;
4312 def note_var_prev_partial_spec_here : Note<
4313   "previous declaration of variable template partial specialization is here">;
4314 def err_var_spec_no_template : Error<
4315   "no variable template matches%select{| partial}0 specialization">;
4316 def err_var_spec_no_template_but_method : Error<
4317   "no variable template matches specialization; "
4318   "did you mean to use %0 as function template instead?">;
4319
4320 // C++ Function template specializations
4321 def err_function_template_spec_no_match : Error<
4322     "no function template matches function template specialization %0">;
4323 def err_function_template_spec_ambiguous : Error<
4324     "function template specialization %0 ambiguously refers to more than one "
4325     "function template; explicitly specify%select{| additional}1 template "
4326     "arguments to identify a particular function template">;
4327 def note_function_template_spec_matched : Note<
4328     "function template %q0 matches specialization %1">;
4329 def err_function_template_partial_spec : Error<
4330     "function template partial specialization is not allowed">;
4331
4332 // C++ Template Instantiation
4333 def err_template_recursion_depth_exceeded : Error<
4334   "recursive template instantiation exceeded maximum depth of %0">,
4335   DefaultFatal, NoSFINAE;
4336 def note_template_recursion_depth : Note<
4337   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4338
4339 def err_template_instantiate_within_definition : Error<
4340   "%select{implicit|explicit}0 instantiation of template %1 within its"
4341   " own definition">;
4342 def err_template_instantiate_undefined : Error<
4343   "%select{implicit|explicit}0 instantiation of undefined template %1">;
4344 def err_implicit_instantiate_member_undefined : Error<
4345   "implicit instantiation of undefined member %0">;
4346 def note_template_class_instantiation_was_here : Note<
4347   "class template %0 was instantiated here">;
4348 def note_template_class_explicit_specialization_was_here : Note<
4349   "class template %0 was explicitly specialized here">;
4350 def note_template_class_instantiation_here : Note<
4351   "in instantiation of template class %q0 requested here">;
4352 def note_template_member_class_here : Note<
4353   "in instantiation of member class %q0 requested here">;
4354 def note_template_member_function_here : Note<
4355   "in instantiation of member function %q0 requested here">;
4356 def note_function_template_spec_here : Note<
4357   "in instantiation of function template specialization %q0 requested here">;
4358 def note_template_static_data_member_def_here : Note<
4359   "in instantiation of static data member %q0 requested here">;
4360 def note_template_variable_def_here : Note<
4361   "in instantiation of variable template specialization %q0 requested here">;
4362 def note_template_enum_def_here : Note<
4363   "in instantiation of enumeration %q0 requested here">;
4364 def note_template_nsdmi_here : Note<
4365   "in instantiation of default member initializer %q0 requested here">;
4366 def note_template_type_alias_instantiation_here : Note<
4367   "in instantiation of template type alias %0 requested here">;
4368 def note_template_exception_spec_instantiation_here : Note<
4369   "in instantiation of exception specification for %0 requested here">;
4370 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4371   "required here, but no definition is available">,
4372   InGroup<UndefinedVarTemplate>;
4373 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4374   "required here, but no definition is available">,
4375   InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4376 def note_forward_template_decl : Note<
4377   "forward declaration of template entity is here">;
4378 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4379   "declaration to suppress this warning if %q0 is explicitly instantiated in "
4380   "another translation unit">;
4381 def note_evaluating_exception_spec_here : Note<
4382   "in evaluation of exception specification for %q0 needed here">;
4383
4384 def note_default_arg_instantiation_here : Note<
4385   "in instantiation of default argument for '%0' required here">;
4386 def note_default_function_arg_instantiation_here : Note<
4387   "in instantiation of default function argument expression "
4388   "for '%0' required here">;
4389 def note_explicit_template_arg_substitution_here : Note<
4390   "while substituting explicitly-specified template arguments into function "
4391   "template %0 %1">;
4392 def note_function_template_deduction_instantiation_here : Note<
4393   "while substituting deduced template arguments into function template %0 "
4394   "%1">;
4395 def note_deduced_template_arg_substitution_here : Note<
4396   "during template argument deduction for %select{class|variable}0 template "
4397   "%select{partial specialization |}1%2 %3">;
4398 def note_prior_template_arg_substitution : Note<
4399   "while substituting prior template arguments into %select{non-type|template}0"
4400   " template parameter%1 %2">;
4401 def note_template_default_arg_checking : Note<
4402   "while checking a default template argument used here">;
4403 def note_instantiation_contexts_suppressed : Note<
4404   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4405   "see all)">;
4406
4407 def err_field_instantiates_to_function : Error<
4408   "data member instantiated with function type %0">;
4409 def err_variable_instantiates_to_function : Error<
4410   "%select{variable|static data member}0 instantiated with function type %1">;
4411 def err_nested_name_spec_non_tag : Error<
4412   "type %0 cannot be used prior to '::' because it has no members">;
4413
4414 def err_using_pack_expansion_empty : Error<
4415   "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4416
4417 // C++ Explicit Instantiation
4418 def err_explicit_instantiation_duplicate : Error<
4419     "duplicate explicit instantiation of %0">;
4420 def ext_explicit_instantiation_duplicate : ExtWarn<
4421     "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4422     InGroup<MicrosoftTemplate>;
4423 def note_previous_explicit_instantiation : Note<
4424     "previous explicit instantiation is here">;
4425 def warn_explicit_instantiation_after_specialization : Warning<
4426   "explicit instantiation of %0 that occurs after an explicit "
4427   "specialization has no effect">,
4428   InGroup<DiagGroup<"instantiation-after-specialization">>;
4429 def note_previous_template_specialization : Note<
4430     "previous template specialization is here">;
4431 def err_explicit_instantiation_nontemplate_type : Error<
4432     "explicit instantiation of non-templated type %0">;
4433 def note_nontemplate_decl_here : Note<
4434     "non-templated declaration is here">;
4435 def err_explicit_instantiation_in_class : Error<
4436   "explicit instantiation of %0 in class scope">;
4437 def err_explicit_instantiation_out_of_scope : Error<
4438   "explicit instantiation of %0 not in a namespace enclosing %1">;
4439 def err_explicit_instantiation_must_be_global : Error<
4440   "explicit instantiation of %0 must occur at global scope">;
4441 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4442   "explicit instantiation of %0 not in a namespace enclosing %1">,
4443   InGroup<CXX11Compat>, DefaultIgnore;
4444 def warn_explicit_instantiation_must_be_global_0x : Warning<
4445   "explicit instantiation of %0 must occur at global scope">,
4446   InGroup<CXX11Compat>, DefaultIgnore;
4447
4448 def err_explicit_instantiation_requires_name : Error<
4449   "explicit instantiation declaration requires a name">;
4450 def err_explicit_instantiation_of_typedef : Error<
4451   "explicit instantiation of typedef %0">;
4452 def err_explicit_instantiation_storage_class : Error<
4453   "explicit instantiation cannot have a storage class">;
4454 def err_explicit_instantiation_internal_linkage : Error<
4455   "explicit instantiation declaration of %0 with internal linkage">;
4456 def err_explicit_instantiation_not_known : Error<
4457   "explicit instantiation of %0 does not refer to a function template, "
4458   "variable template, member function, member class, or static data member">;
4459 def note_explicit_instantiation_here : Note<
4460   "explicit instantiation refers here">;
4461 def err_explicit_instantiation_data_member_not_instantiated : Error<
4462   "explicit instantiation refers to static data member %q0 that is not an "
4463   "instantiation">;
4464 def err_explicit_instantiation_member_function_not_instantiated : Error<
4465   "explicit instantiation refers to member function %q0 that is not an "
4466   "instantiation">;
4467 def err_explicit_instantiation_ambiguous : Error<
4468   "partial ordering for explicit instantiation of %0 is ambiguous">;
4469 def note_explicit_instantiation_candidate : Note<
4470   "explicit instantiation candidate function %q0 template here %1">;
4471 def err_explicit_instantiation_inline : Error<
4472   "explicit instantiation cannot be 'inline'">;
4473 def warn_explicit_instantiation_inline_0x : Warning<
4474   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4475   DefaultIgnore;
4476 def err_explicit_instantiation_constexpr : Error<
4477   "explicit instantiation cannot be 'constexpr'">;
4478 def ext_explicit_instantiation_without_qualified_id : Extension<
4479   "qualifier in explicit instantiation of %q0 requires a template-id "
4480   "(a typedef is not permitted)">;
4481 def err_explicit_instantiation_without_template_id : Error<
4482   "explicit instantiation of %q0 must specify a template argument list">;
4483 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4484   "explicit instantiation of %q0 must occur in namespace %1">;
4485 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4486   "explicit instantiation of %q0 must occur in namespace %1">,
4487   InGroup<CXX11Compat>, DefaultIgnore;
4488 def err_explicit_instantiation_undefined_member : Error<
4489   "explicit instantiation of undefined %select{member class|member function|"
4490   "static data member}0 %1 of class template %2">;
4491 def err_explicit_instantiation_undefined_func_template : Error<
4492   "explicit instantiation of undefined function template %0">;
4493 def err_explicit_instantiation_undefined_var_template : Error<
4494   "explicit instantiation of undefined variable template %q0">;
4495 def err_explicit_instantiation_declaration_after_definition : Error<
4496   "explicit instantiation declaration (with 'extern') follows explicit "
4497   "instantiation definition (without 'extern')">;
4498 def note_explicit_instantiation_definition_here : Note<
4499   "explicit instantiation definition is here">;
4500 def err_invalid_var_template_spec_type : Error<"type %2 "
4501   "of %select{explicit instantiation|explicit specialization|"
4502   "partial specialization|redeclaration}0 of %1 does not match"
4503   " expected type %3">;
4504 def err_mismatched_exception_spec_explicit_instantiation : Error<
4505   "exception specification in explicit instantiation does not match "
4506   "instantiated one">;
4507 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4508   err_mismatched_exception_spec_explicit_instantiation.Text>,
4509   InGroup<MicrosoftExceptionSpec>;
4510
4511 // C++ typename-specifiers
4512 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4513 def err_typename_nested_not_found_enable_if : Error<
4514   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4515   "this declaration">;
4516 def err_typename_nested_not_found_requirement : Error<
4517   "failed requirement '%0'; 'enable_if' cannot be used to disable this "
4518   "declaration">;
4519 def err_typename_nested_not_type : Error<
4520     "typename specifier refers to non-type member %0 in %1">;
4521 def note_typename_refers_here : Note<
4522     "referenced member %0 is declared here">;
4523 def err_typename_missing : Error<
4524   "missing 'typename' prior to dependent type name '%0%1'">;
4525 def err_typename_missing_template : Error<
4526   "missing 'typename' prior to dependent type template name '%0%1'">;
4527 def ext_typename_missing : ExtWarn<
4528   "missing 'typename' prior to dependent type name '%0%1'">,
4529   InGroup<DiagGroup<"typename-missing">>;
4530 def ext_typename_outside_of_template : ExtWarn<
4531   "'typename' occurs outside of a template">, InGroup<CXX11>;
4532 def warn_cxx98_compat_typename_outside_of_template : Warning<
4533   "use of 'typename' outside of a template is incompatible with C++98">,
4534   InGroup<CXX98Compat>, DefaultIgnore;
4535 def err_typename_refers_to_using_value_decl : Error<
4536   "typename specifier refers to a dependent using declaration for a value "
4537   "%0 in %1">;
4538 def note_using_value_decl_missing_typename : Note<
4539   "add 'typename' to treat this using declaration as a type">;
4540
4541 def err_template_kw_refers_to_non_template : Error<
4542   "%0 following the 'template' keyword does not refer to a template">;
4543 def note_template_kw_refers_to_non_template : Note<
4544   "declared as a non-template here">;
4545 def err_template_kw_refers_to_class_template : Error<
4546   "'%0%1' instantiated to a class template, not a function template">;
4547 def note_referenced_class_template : Note<
4548   "class template declared here">;
4549 def err_template_kw_missing : Error<
4550   "missing 'template' keyword prior to dependent template name '%0%1'">;
4551 def ext_template_outside_of_template : ExtWarn<
4552   "'template' keyword outside of a template">, InGroup<CXX11>;
4553 def warn_cxx98_compat_template_outside_of_template : Warning<
4554   "use of 'template' keyword outside of a template is incompatible with C++98">,
4555   InGroup<CXX98Compat>, DefaultIgnore;
4556
4557 def err_non_type_template_in_nested_name_specifier : Error<
4558   "qualified name refers into a specialization of %select{function|variable}0 "
4559   "template %1">;
4560 def err_template_id_not_a_type : Error<
4561   "template name refers to non-type template %0">;
4562 def note_template_declared_here : Note<
4563   "%select{function template|class template|variable template"
4564   "|type alias template|template template parameter}0 "
4565   "%1 declared here">;
4566 def err_alias_template_expansion_into_fixed_list : Error<
4567   "pack expansion used as argument for non-pack parameter of alias template">;
4568 def note_parameter_type : Note<
4569   "parameter of type %0 is declared here">;
4570
4571 // C++11 Variadic Templates
4572 def err_template_param_pack_default_arg : Error<
4573   "template parameter pack cannot have a default argument">;
4574 def err_template_param_pack_must_be_last_template_parameter : Error<
4575   "template parameter pack must be the last template parameter">;
4576
4577 def err_template_parameter_pack_non_pack : Error<
4578   "%select{template type|non-type template|template template}0 parameter"
4579   "%select{| pack}1 conflicts with previous %select{template type|"
4580   "non-type template|template template}0 parameter%select{ pack|}1">;
4581 def note_template_parameter_pack_non_pack : Note<
4582   "%select{template type|non-type template|template template}0 parameter"
4583   "%select{| pack}1 does not match %select{template type|non-type template"
4584   "|template template}0 parameter%select{ pack|}1 in template argument">;
4585 def note_template_parameter_pack_here : Note<
4586   "previous %select{template type|non-type template|template template}0 "
4587   "parameter%select{| pack}1 declared here">;
4588
4589 def err_unexpanded_parameter_pack : Error<
4590   "%select{expression|base type|declaration type|data member type|bit-field "
4591   "size|static assertion|fixed underlying type|enumerator value|"
4592   "using declaration|friend declaration|qualifier|initializer|default argument|"
4593   "non-type template parameter type|exception type|partial specialization|"
4594   "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4595   "%plural{0: an|:}1 unexpanded parameter pack"
4596   "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4597
4598 def err_pack_expansion_without_parameter_packs : Error<
4599   "pack expansion does not contain any unexpanded parameter packs">;
4600 def err_pack_expansion_length_conflict : Error<
4601   "pack expansion contains parameter packs %0 and %1 that have different "
4602   "lengths (%2 vs. %3)">;
4603 def err_pack_expansion_length_conflict_multilevel : Error<
4604   "pack expansion contains parameter pack %0 that has a different "
4605   "length (%1 vs. %2) from outer parameter packs">;
4606 def err_pack_expansion_length_conflict_partial : Error<
4607   "pack expansion contains parameter pack %0 that has a different "
4608   "length (at least %1 vs. %2) from outer parameter packs">;
4609 def err_pack_expansion_member_init : Error<
4610   "pack expansion for initialization of member %0">;
4611
4612 def err_function_parameter_pack_without_parameter_packs : Error<
4613   "type %0 of function parameter pack does not contain any unexpanded "
4614   "parameter packs">;
4615 def err_ellipsis_in_declarator_not_parameter : Error<
4616   "only function and template parameters can be parameter packs">;
4617
4618 def err_sizeof_pack_no_pack_name : Error<
4619   "%0 does not refer to the name of a parameter pack">;
4620
4621 def err_fold_expression_packs_both_sides : Error<
4622   "binary fold expression has unexpanded parameter packs in both operands">;
4623 def err_fold_expression_empty : Error<
4624   "unary fold expression has empty expansion for operator '%0' "
4625   "with no fallback value">;
4626 def err_fold_expression_bad_operand : Error<
4627   "expression not permitted as operand of fold expression">;
4628
4629 def err_unexpected_typedef : Error<
4630   "unexpected type name %0: expected expression">;
4631 def err_unexpected_namespace : Error<
4632   "unexpected namespace name %0: expected expression">;
4633 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4634 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4635   "use of undeclared identifier %0; "
4636   "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4637   InGroup<MicrosoftTemplate>;
4638 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4639   "found via unqualified lookup into dependent bases of class templates is a "
4640   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4641 def note_dependent_var_use : Note<"must qualify identifier to find this "
4642     "declaration in dependent base class">;
4643 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4644     "visible in the template definition nor found by argument-dependent lookup">;
4645 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4646     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4647 def err_undeclared_use : Error<"use of undeclared %0">;
4648 def warn_deprecated : Warning<"%0 is deprecated">,
4649     InGroup<DeprecatedDeclarations>;
4650 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4651 def warn_property_method_deprecated :
4652     Warning<"property access is using %0 method which is deprecated">,
4653     InGroup<DeprecatedDeclarations>;
4654 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4655     InGroup<DeprecatedDeclarations>;
4656 def warn_deprecated_anonymous_namespace : Warning<
4657   "'deprecated' attribute on anonymous namespace ignored">,
4658   InGroup<IgnoredAttributes>;
4659 def warn_deprecated_fwdclass_message : Warning<
4660     "%0 may be deprecated because the receiver type is unknown">,
4661     InGroup<DeprecatedDeclarations>;
4662 def warn_deprecated_def : Warning<
4663   "implementing deprecated %select{method|class|category}0">,
4664   InGroup<DeprecatedImplementations>, DefaultIgnore;
4665 def warn_unavailable_def : Warning<
4666   "implementing unavailable method">,
4667   InGroup<DeprecatedImplementations>, DefaultIgnore;
4668 def err_unavailable : Error<"%0 is unavailable">;
4669 def err_property_method_unavailable :
4670     Error<"property access is using %0 method which is unavailable">;
4671 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4672 def warn_unavailable_fwdclass_message : Warning<
4673     "%0 may be unavailable because the receiver type is unknown">,
4674     InGroup<UnavailableDeclarations>;
4675 def note_availability_specified_here : Note<
4676   "%0 has been explicitly marked "
4677   "%select{unavailable|deleted|deprecated}1 here">;
4678 def note_partial_availability_specified_here : Note<
4679   "%0 has been marked as being introduced in %1 %2 here, "
4680   "but the deployment target is %1 %3">;
4681 def note_implicitly_deleted : Note<
4682   "explicitly defaulted function was implicitly deleted here">;
4683 def warn_not_enough_argument : Warning<
4684   "not enough variable arguments in %0 declaration to fit a sentinel">,
4685   InGroup<Sentinel>;
4686 def warn_missing_sentinel : Warning <
4687   "missing sentinel in %select{function call|method dispatch|block call}0">,
4688   InGroup<Sentinel>;
4689 def note_sentinel_here : Note<
4690   "%select{function|method|block}0 has been explicitly marked sentinel here">;
4691 def warn_missing_prototype : Warning<
4692   "no previous prototype for function %0">,
4693   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4694 def note_declaration_not_a_prototype : Note<
4695   "this declaration is not a prototype; add %select{'void'|parameter declarations}0 "
4696   "to make it %select{a prototype for a zero-parameter function|one}0">;
4697 def warn_strict_prototypes : Warning<
4698   "this %select{function declaration is not|block declaration is not|"
4699   "old-style function definition is not preceded by}0 a prototype">,
4700   InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4701 def warn_missing_variable_declarations : Warning<
4702   "no previous extern declaration for non-static variable %0">,
4703   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4704 def note_static_for_internal_linkage : Note<
4705   "declare 'static' if the %select{variable|function}0 is not intended to be "
4706   "used outside of this translation unit">;
4707 def err_static_data_member_reinitialization :
4708   Error<"static data member %0 already has an initializer">;
4709 def err_redefinition : Error<"redefinition of %0">;
4710 def err_alias_after_tentative :
4711   Error<"alias definition of %0 after tentative definition">;
4712 def err_alias_is_definition :
4713   Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4714 def err_definition_of_implicitly_declared_member : Error<
4715   "definition of implicitly declared %select{default constructor|copy "
4716   "constructor|move constructor|copy assignment operator|move assignment "
4717   "operator|destructor|function}1">;
4718 def err_definition_of_explicitly_defaulted_member : Error<
4719   "definition of explicitly defaulted %select{default constructor|copy "
4720   "constructor|move constructor|copy assignment operator|move assignment "
4721   "operator|destructor|function}0">;
4722 def err_redefinition_extern_inline : Error<
4723   "redefinition of a 'extern inline' function %0 is not supported in "
4724   "%select{C99 mode|C++}1">;
4725 def warn_attr_abi_tag_namespace : Warning<
4726   "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4727   InGroup<IgnoredAttributes>;
4728 def err_abi_tag_on_redeclaration : Error<
4729   "cannot add 'abi_tag' attribute in a redeclaration">;
4730 def err_new_abi_tag_on_redeclaration : Error<
4731   "'abi_tag' %0 missing in original declaration">;
4732 def note_use_ifdef_guards : Note<
4733   "unguarded header; consider using #ifdef guards or #pragma once">;
4734
4735 def note_deleted_dtor_no_operator_delete : Note<
4736   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4737 def note_deleted_special_member_class_subobject : Note<
4738   "%select{default constructor of|copy constructor of|move constructor of|"
4739   "copy assignment operator of|move assignment operator of|destructor of|"
4740   "constructor inherited by}0 "
4741   "%1 is implicitly deleted because "
4742   "%select{base class %3|%select{||||variant }4field %3}2 "
4743   "%select{has "
4744   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4745   "%select{%select{default constructor|copy constructor|move constructor|copy "
4746   "assignment operator|move assignment operator|destructor|"
4747   "%select{default|corresponding|default|default|default}4 constructor}0|"
4748   "destructor}5"
4749   "%select{||s||}4"
4750   "|is an ObjC pointer}6">;
4751 def note_deleted_default_ctor_uninit_field : Note<
4752   "%select{default constructor of|constructor inherited by}0 "
4753   "%1 is implicitly deleted because field %2 of "
4754   "%select{reference|const-qualified}4 type %3 would not be initialized">;
4755 def note_deleted_default_ctor_all_const : Note<
4756   "%select{default constructor of|constructor inherited by}0 "
4757   "%1 is implicitly deleted because all "
4758   "%select{data members|data members of an anonymous union member}2"
4759   " are const-qualified">;
4760 def note_deleted_copy_ctor_rvalue_reference : Note<
4761   "copy constructor of %0 is implicitly deleted because field %1 is of "
4762   "rvalue reference type %2">;
4763 def note_deleted_copy_user_declared_move : Note<
4764   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4765   " %1 has a user-declared move %select{constructor|assignment operator}2">;
4766 def note_deleted_assign_field : Note<
4767   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4768   "because field %2 is of %select{reference|const-qualified}4 type %3">;
4769
4770 // These should be errors.
4771 def warn_undefined_internal : Warning<
4772   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4773   InGroup<DiagGroup<"undefined-internal">>;
4774 def err_undefined_internal_type : Error<
4775   "%select{function|variable}0 %q1 is used but not defined in this "
4776   "translation unit, and cannot be defined in any other translation unit "
4777   "because its type does not have linkage">;
4778 def ext_undefined_internal_type : Extension<
4779   "ISO C++ requires a definition in this translation unit for "
4780   "%select{function|variable}0 %q1 because its type does not have linkage">,
4781   InGroup<DiagGroup<"undefined-internal-type">>;
4782 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4783   InGroup<DiagGroup<"undefined-inline">>;
4784 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4785 def note_used_here : Note<"used here">;
4786
4787 def err_internal_linkage_redeclaration : Error<
4788   "'internal_linkage' attribute does not appear on the first declaration of %0">;
4789 def warn_internal_linkage_local_storage : Warning<
4790   "'internal_linkage' attribute on a non-static local variable is ignored">,
4791   InGroup<IgnoredAttributes>;
4792
4793 def ext_internal_in_extern_inline : ExtWarn<
4794   "static %select{function|variable}0 %1 is used in an inline function with "
4795   "external linkage">, InGroup<StaticInInline>;
4796 def ext_internal_in_extern_inline_quiet : Extension<
4797   "static %select{function|variable}0 %1 is used in an inline function with "
4798   "external linkage">, InGroup<StaticInInline>;
4799 def warn_static_local_in_extern_inline : Warning<
4800   "non-constant static local variable in inline function may be different "
4801   "in different files">, InGroup<StaticLocalInInline>;
4802 def note_convert_inline_to_static : Note<
4803   "use 'static' to give inline function %0 internal linkage">;
4804
4805 def ext_redefinition_of_typedef : ExtWarn<
4806   "redefinition of typedef %0 is a C11 feature">,
4807   InGroup<DiagGroup<"typedef-redefinition"> >;
4808 def err_redefinition_variably_modified_typedef : Error<
4809   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4810
4811 def err_inline_decl_follows_def : Error<
4812   "inline declaration of %0 follows non-inline definition">;
4813 def err_inline_declaration_block_scope : Error<
4814   "inline declaration of %0 not allowed in block scope">;
4815 def err_static_non_static : Error<
4816   "static declaration of %0 follows non-static declaration">;
4817 def err_different_language_linkage : Error<
4818   "declaration of %0 has a different language linkage">;
4819 def ext_retained_language_linkage : Extension<
4820   "friend function %0 retaining previous language linkage is an extension">,
4821   InGroup<DiagGroup<"retained-language-linkage">>;
4822 def err_extern_c_global_conflict : Error<
4823   "declaration of %1 %select{with C language linkage|in global scope}0 "
4824   "conflicts with declaration %select{in global scope|with C language linkage}0">;
4825 def note_extern_c_global_conflict : Note<
4826   "declared %select{in global scope|with C language linkage}0 here">;
4827 def note_extern_c_begins_here : Note<
4828   "extern \"C\" language linkage specification begins here">;
4829 def warn_weak_import : Warning <
4830   "an already-declared variable is made a weak_import declaration %0">;
4831 def ext_static_non_static : Extension<
4832   "redeclaring non-static %0 as static is a Microsoft extension">,
4833   InGroup<MicrosoftRedeclareStatic>;
4834 def err_non_static_static : Error<
4835   "non-static declaration of %0 follows static declaration">;
4836 def err_extern_non_extern : Error<
4837   "extern declaration of %0 follows non-extern declaration">;
4838 def err_non_extern_extern : Error<
4839   "non-extern declaration of %0 follows extern declaration">;
4840 def err_non_thread_thread : Error<
4841   "non-thread-local declaration of %0 follows thread-local declaration">;
4842 def err_thread_non_thread : Error<
4843   "thread-local declaration of %0 follows non-thread-local declaration">;
4844 def err_thread_thread_different_kind : Error<
4845   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4846   "follows declaration with %select{dynamic|static}1 initialization">;
4847 def err_mismatched_owning_module : Error<
4848   "declaration of %0 in %select{the global module|module %2}1 follows "
4849   "declaration in %select{the global module|module %4}3">;
4850 def err_redefinition_different_type : Error<
4851   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4852 def err_redefinition_different_kind : Error<
4853   "redefinition of %0 as different kind of symbol">;
4854 def err_redefinition_different_namespace_alias : Error<
4855   "redefinition of %0 as an alias for a different namespace">;
4856 def note_previous_namespace_alias : Note<
4857   "previously defined as an alias for %0">;
4858 def warn_forward_class_redefinition : Warning<
4859   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4860   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4861 def err_redefinition_different_typedef : Error<
4862   "%select{typedef|type alias|type alias template}0 "
4863   "redefinition with different types%diff{ ($ vs $)|}1,2">;
4864 def err_tag_reference_non_tag : Error<
4865   "%select{non-struct type|non-class type|non-union type|non-enum "
4866   "type|typedef|type alias|template|type alias template|template "
4867   "template argument}1 %0 cannot be referenced with a "
4868   "%select{struct|interface|union|class|enum}2 specifier">;
4869 def err_tag_reference_conflict : Error<
4870   "implicit declaration introduced by elaborated type conflicts with a "
4871   "%select{non-struct type|non-class type|non-union type|non-enum "
4872   "type|typedef|type alias|template|type alias template|template "
4873   "template argument}0 of the same name">;
4874 def err_dependent_tag_decl : Error<
4875   "%select{declaration|definition}0 of "
4876   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4877 def err_tag_definition_of_typedef : Error<
4878   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4879 def err_conflicting_types : Error<"conflicting types for %0">;
4880 def err_different_pass_object_size_params : Error<
4881   "conflicting pass_object_size attributes on parameters">;
4882 def err_late_asm_label_name : Error<
4883   "cannot apply asm label to %select{variable|function}0 after its first use">;
4884 def err_different_asm_label : Error<"conflicting asm label">;
4885 def err_nested_redefinition : Error<"nested redefinition of %0">;
4886 def err_use_with_wrong_tag : Error<
4887   "use of %0 with tag type that does not match previous declaration">;
4888 def warn_struct_class_tag_mismatch : Warning<
4889   "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4890   "declared as a %select{struct|interface|class}3%select{| template}1; "
4891   "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
4892   InGroup<MismatchedTags>, DefaultIgnore;
4893 def warn_struct_class_previous_tag_mismatch : Warning<
4894   "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4895   "here but previously declared as "
4896   "%select{a struct|an interface|a class}3%select{| template}1; "
4897   "this is valid, but may result in linker errors under the Microsoft C++ ABI">,
4898   InGroup<MismatchedTags>, DefaultIgnore;
4899 def note_struct_class_suggestion : Note<
4900   "did you mean %select{struct|interface|class}0 here?">;
4901 def ext_forward_ref_enum : Extension<
4902   "ISO C forbids forward references to 'enum' types">;
4903 def err_forward_ref_enum : Error<
4904   "ISO C++ forbids forward references to 'enum' types">;
4905 def ext_ms_forward_ref_enum : ExtWarn<
4906   "forward references to 'enum' types are a Microsoft extension">,
4907   InGroup<MicrosoftEnumForwardReference>;
4908 def ext_forward_ref_enum_def : Extension<
4909   "redeclaration of already-defined enum %0 is a GNU extension">,
4910   InGroup<GNURedeclaredEnum>;
4911
4912 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4913 def err_duplicate_member : Error<"duplicate member %0">;
4914 def err_misplaced_ivar : Error<
4915   "instance variables may not be placed in %select{categories|class extension}0">;
4916 def warn_ivars_in_interface : Warning<
4917   "declaration of instance variables in the interface is deprecated">,
4918   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4919 def ext_enum_value_not_int : Extension<
4920   "ISO C restricts enumerator values to range of 'int' (%0 is too "
4921   "%select{small|large}1)">;
4922 def ext_enum_too_large : ExtWarn<
4923   "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4924 def ext_enumerator_increment_too_large : ExtWarn<
4925   "incremented enumerator value %0 is not representable in the "
4926   "largest integer type">, InGroup<EnumTooLarge>;
4927 def warn_flag_enum_constant_out_of_range : Warning<
4928   "enumeration value %0 is out of range of flags in enumeration type %1">,
4929   InGroup<FlagEnum>;
4930
4931 def warn_illegal_constant_array_size : Extension<
4932   "size of static array must be an integer constant expression">;
4933 def err_vm_decl_in_file_scope : Error<
4934   "variably modified type declaration not allowed at file scope">;
4935 def err_vm_decl_has_extern_linkage : Error<
4936   "variably modified type declaration cannot have 'extern' linkage">;
4937 def err_typecheck_field_variable_size : Error<
4938   "fields must have a constant size: 'variable length array in structure' "
4939   "extension will never be supported">;
4940 def err_vm_func_decl : Error<
4941   "function declaration cannot have variably modified type">;
4942 def err_array_too_large : Error<
4943   "array is too large (%0 elements)">;
4944
4945 def err_typecheck_negative_array_size : Error<"array size is negative">;
4946 def warn_typecheck_function_qualifiers_ignored : Warning<
4947   "'%0' qualifier on function type %1 has no effect">,
4948   InGroup<IgnoredQualifiers>;
4949 def warn_typecheck_function_qualifiers_unspecified : Warning<
4950   "'%0' qualifier on function type %1 has unspecified behavior">;
4951 def warn_typecheck_reference_qualifiers : Warning<
4952   "'%0' qualifier on reference type %1 has no effect">,
4953   InGroup<IgnoredQualifiers>;
4954 def err_typecheck_invalid_restrict_not_pointer : Error<
4955   "restrict requires a pointer or reference (%0 is invalid)">;
4956 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4957   "restrict requires a pointer or reference">;
4958 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4959   "pointer to function type %0 may not be 'restrict' qualified">;
4960 def ext_typecheck_zero_array_size : Extension<
4961   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4962 def err_typecheck_zero_array_size : Error<
4963   "zero-length arrays are not permitted in C++">;
4964 def warn_typecheck_zero_static_array_size : Warning<
4965   "'static' has no effect on zero-length arrays">,
4966   InGroup<ArrayBounds>;
4967 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4968 def err_init_element_not_constant : Error<
4969   "initializer element is not a compile-time constant">;
4970 def ext_aggregate_init_not_constant : Extension<
4971   "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4972 def err_local_cant_init : Error<
4973   "'__local' variable cannot have an initializer">;
4974 def err_block_extern_cant_init : Error<
4975   "'extern' variable cannot have an initializer">;
4976 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4977   InGroup<DiagGroup<"extern-initializer">>;
4978 def err_variable_object_no_init : Error<
4979   "variable-sized object may not be initialized">;
4980 def err_excess_initializers : Error<
4981   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4982 def ext_excess_initializers : ExtWarn<
4983   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4984 def err_excess_initializers_in_char_array_initializer : Error<
4985   "excess elements in char array initializer">;
4986 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4987   "excess elements in char array initializer">;
4988 def err_initializer_string_for_char_array_too_long : Error<
4989   "initializer-string for char array is too long">;
4990 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4991   "initializer-string for char array is too long">;
4992 def warn_missing_field_initializers : Warning<
4993   "missing field %0 initializer">,
4994   InGroup<MissingFieldInitializers>, DefaultIgnore;
4995 def warn_braces_around_scalar_init : Warning<
4996   "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4997 def ext_many_braces_around_scalar_init : ExtWarn<
4998   "too many braces around scalar initializer">,
4999   InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure;
5000 def ext_complex_component_init : Extension<
5001   "complex initialization specifying real and imaginary components "
5002   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
5003 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
5004 def warn_cxx98_compat_empty_scalar_initializer : Warning<
5005   "scalar initialized from empty initializer list is incompatible with C++98">,
5006   InGroup<CXX98Compat>, DefaultIgnore;
5007 def warn_cxx98_compat_reference_list_init : Warning<
5008   "reference initialized from initializer list is incompatible with C++98">,
5009   InGroup<CXX98Compat>, DefaultIgnore;
5010 def warn_cxx98_compat_initializer_list_init : Warning<
5011   "initialization of initializer_list object is incompatible with C++98">,
5012   InGroup<CXX98Compat>, DefaultIgnore;
5013 def warn_cxx98_compat_ctor_list_init : Warning<
5014   "constructor call from initializer list is incompatible with C++98">,
5015   InGroup<CXX98Compat>, DefaultIgnore;
5016 def err_illegal_initializer : Error<
5017   "illegal initializer (only variables can be initialized)">;
5018 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
5019 def ext_init_list_type_narrowing : ExtWarn<
5020   "type %0 cannot be narrowed to %1 in initializer list">,
5021   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5022 def ext_init_list_variable_narrowing : ExtWarn<
5023   "non-constant-expression cannot be narrowed from type %0 to %1 in "
5024   "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5025 def ext_init_list_constant_narrowing : ExtWarn<
5026   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
5027   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
5028 def warn_init_list_type_narrowing : Warning<
5029   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
5030   InGroup<CXX11Narrowing>, DefaultIgnore;
5031 def warn_init_list_variable_narrowing : Warning<
5032   "non-constant-expression cannot be narrowed from type %0 to %1 in "
5033   "initializer list in C++11">,
5034   InGroup<CXX11Narrowing>, DefaultIgnore;
5035 def warn_init_list_constant_narrowing : Warning<
5036   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
5037   "C++11">,
5038   InGroup<CXX11Narrowing>, DefaultIgnore;
5039 def note_init_list_narrowing_silence : Note<
5040   "insert an explicit cast to silence this issue">;
5041 def err_init_objc_class : Error<
5042   "cannot initialize Objective-C class type %0">;
5043 def err_implicit_empty_initializer : Error<
5044   "initializer for aggregate with no elements requires explicit braces">;
5045 def err_bitfield_has_negative_width : Error<
5046   "bit-field %0 has negative width (%1)">;
5047 def err_anon_bitfield_has_negative_width : Error<
5048   "anonymous bit-field has negative width (%0)">;
5049 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
5050 def err_bitfield_width_exceeds_type_width : Error<
5051   "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
5052   "of its type (%3 bit%s3)">;
5053 def err_anon_bitfield_width_exceeds_type_width : Error<
5054   "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
5055   "of its type (%2 bit%s2)">;
5056 def err_incorrect_number_of_vector_initializers : Error<
5057   "number of elements must be either one or match the size of the vector">;
5058
5059 // Used by C++ which allows bit-fields that are wider than the type.
5060 def warn_bitfield_width_exceeds_type_width: Warning<
5061   "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
5062   "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
5063 def warn_anon_bitfield_width_exceeds_type_width : Warning<
5064   "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
5065   "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
5066 def warn_bitfield_too_small_for_enum : Warning<
5067   "bit-field %0 is not wide enough to store all enumerators of %1">,
5068   InGroup<BitFieldEnumConversion>, DefaultIgnore;
5069 def note_widen_bitfield : Note<
5070   "widen this field to %0 bits to store all values of %1">;
5071 def warn_unsigned_bitfield_assigned_signed_enum : Warning<
5072   "assigning value of signed enum type %1 to unsigned bit-field %0; "
5073   "negative enumerators of enum %1 will be converted to positive values">,
5074   InGroup<BitFieldEnumConversion>, DefaultIgnore;
5075 def warn_signed_bitfield_enum_conversion : Warning<
5076   "signed bit-field %0 needs an extra bit to represent the largest positive "
5077   "enumerators of %1">,
5078   InGroup<BitFieldEnumConversion>, DefaultIgnore;
5079 def note_change_bitfield_sign : Note<
5080   "consider making the bitfield type %select{unsigned|signed}0">;
5081
5082 def warn_missing_braces : Warning<
5083   "suggest braces around initialization of subobject">,
5084   InGroup<MissingBraces>, DefaultIgnore;
5085
5086 def err_redefinition_of_label : Error<"redefinition of label %0">;
5087 def err_undeclared_label_use : Error<"use of undeclared label %0">;
5088 def err_goto_ms_asm_label : Error<
5089   "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5090 def note_goto_ms_asm_label : Note<
5091   "inline assembly label %0 declared here">;
5092 def warn_unused_label : Warning<"unused label %0">,
5093   InGroup<UnusedLabel>, DefaultIgnore;
5094
5095 def err_goto_into_protected_scope : Error<
5096   "cannot jump from this goto statement to its label">;
5097 def ext_goto_into_protected_scope : ExtWarn<
5098   "jump from this goto statement to its label is a Microsoft extension">,
5099   InGroup<MicrosoftGoto>;
5100 def warn_cxx98_compat_goto_into_protected_scope : Warning<
5101   "jump from this goto statement to its label is incompatible with C++98">,
5102   InGroup<CXX98Compat>, DefaultIgnore;
5103 def err_switch_into_protected_scope : Error<
5104   "cannot jump from switch statement to this case label">;
5105 def warn_cxx98_compat_switch_into_protected_scope : Warning<
5106   "jump from switch statement to this case label is incompatible with C++98">,
5107   InGroup<CXX98Compat>, DefaultIgnore;
5108 def err_indirect_goto_without_addrlabel : Error<
5109   "indirect goto in function with no address-of-label expressions">;
5110 def err_indirect_goto_in_protected_scope : Error<
5111   "cannot jump from this %select{indirect|asm}0 goto statement to one of its possible targets">;
5112 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5113   "jump from this %select{indirect|asm}0 goto statement to one of its possible targets "
5114   "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5115 def note_indirect_goto_target : Note<
5116   "possible target of %select{indirect|asm}0 goto statement">;
5117 def note_protected_by_variable_init : Note<
5118   "jump bypasses variable initialization">;
5119 def note_protected_by_variable_nontriv_destructor : Note<
5120   "jump bypasses variable with a non-trivial destructor">;
5121 def note_protected_by_variable_non_pod : Note<
5122   "jump bypasses initialization of non-POD variable">;
5123 def note_protected_by_cleanup : Note<
5124   "jump bypasses initialization of variable with __attribute__((cleanup))">;
5125 def note_protected_by_vla_typedef : Note<
5126   "jump bypasses initialization of VLA typedef">;
5127 def note_protected_by_vla_type_alias : Note<
5128   "jump bypasses initialization of VLA type alias">;
5129 def note_protected_by_constexpr_if : Note<
5130   "jump enters controlled statement of constexpr if">;
5131 def note_protected_by_if_available : Note<
5132   "jump enters controlled statement of if available">;
5133 def note_protected_by_vla : Note<
5134   "jump bypasses initialization of variable length array">;
5135 def note_protected_by_objc_fast_enumeration : Note<
5136   "jump enters Objective-C fast enumeration loop">;
5137 def note_protected_by_objc_try : Note<
5138   "jump bypasses initialization of @try block">;
5139 def note_protected_by_objc_catch : Note<
5140   "jump bypasses initialization of @catch block">;
5141 def note_protected_by_objc_finally : Note<
5142   "jump bypasses initialization of @finally block">;
5143 def note_protected_by_objc_synchronized : Note<
5144   "jump bypasses initialization of @synchronized block">;
5145 def note_protected_by_objc_autoreleasepool : Note<
5146   "jump bypasses auto release push of @autoreleasepool block">;
5147 def note_protected_by_cxx_try : Note<
5148   "jump bypasses initialization of try block">;
5149 def note_protected_by_cxx_catch : Note<
5150   "jump bypasses initialization of catch block">;
5151 def note_protected_by_seh_try : Note<
5152   "jump bypasses initialization of __try block">;
5153 def note_protected_by_seh_except : Note<
5154   "jump bypasses initialization of __except block">;
5155 def note_protected_by_seh_finally : Note<
5156   "jump bypasses initialization of __finally block">;
5157 def note_protected_by___block : Note<
5158   "jump bypasses setup of __block variable">;
5159 def note_protected_by_objc_strong_init : Note<
5160   "jump bypasses initialization of __strong variable">;
5161 def note_protected_by_objc_weak_init : Note<
5162   "jump bypasses initialization of __weak variable">;
5163 def note_protected_by_non_trivial_c_struct_init : Note<
5164   "jump bypasses initialization of variable of non-trivial C struct type">;
5165 def note_enters_block_captures_cxx_obj : Note<
5166   "jump enters lifetime of block which captures a destructible C++ object">;
5167 def note_enters_block_captures_strong : Note<
5168   "jump enters lifetime of block which strongly captures a variable">;
5169 def note_enters_block_captures_weak : Note<
5170   "jump enters lifetime of block which weakly captures a variable">;
5171 def note_enters_block_captures_non_trivial_c_struct : Note<
5172   "jump enters lifetime of block which captures a C struct that is non-trivial "
5173   "to destroy">;
5174
5175 def note_exits_cleanup : Note<
5176   "jump exits scope of variable with __attribute__((cleanup))">;
5177 def note_exits_dtor : Note<
5178   "jump exits scope of variable with non-trivial destructor">;
5179 def note_exits_temporary_dtor : Note<
5180   "jump exits scope of lifetime-extended temporary with non-trivial "
5181   "destructor">;
5182 def note_exits___block : Note<
5183   "jump exits scope of __block variable">;
5184 def note_exits_objc_try : Note<
5185   "jump exits @try block">;
5186 def note_exits_objc_catch : Note<
5187   "jump exits @catch block">;
5188 def note_exits_objc_finally : Note<
5189   "jump exits @finally block">;
5190 def note_exits_objc_synchronized : Note<
5191   "jump exits @synchronized block">;
5192 def note_exits_cxx_try : Note<
5193   "jump exits try block">;
5194 def note_exits_cxx_catch : Note<
5195   "jump exits catch block">;
5196 def note_exits_seh_try : Note<
5197   "jump exits __try block">;
5198 def note_exits_seh_except : Note<
5199   "jump exits __except block">;
5200 def note_exits_seh_finally : Note<
5201   "jump exits __finally block">;
5202 def note_exits_objc_autoreleasepool : Note<
5203   "jump exits autoreleasepool block">;
5204 def note_exits_objc_strong : Note<
5205   "jump exits scope of __strong variable">;
5206 def note_exits_objc_weak : Note<
5207   "jump exits scope of __weak variable">;
5208 def note_exits_block_captures_cxx_obj : Note<
5209   "jump exits lifetime of block which captures a destructible C++ object">;
5210 def note_exits_block_captures_strong : Note<
5211   "jump exits lifetime of block which strongly captures a variable">;
5212 def note_exits_block_captures_weak : Note<
5213   "jump exits lifetime of block which weakly captures a variable">;
5214 def note_exits_block_captures_non_trivial_c_struct : Note<
5215   "jump exits lifetime of block which captures a C struct that is non-trivial "
5216   "to destroy">;
5217
5218 def err_func_returning_qualified_void : ExtWarn<
5219   "function cannot return qualified void type %0">,
5220   InGroup<DiagGroup<"qualified-void-return-type">>;
5221 def err_func_returning_array_function : Error<
5222   "function cannot return %select{array|function}0 type %1">;
5223 def err_field_declared_as_function : Error<"field %0 declared as a function">;
5224 def err_field_incomplete : Error<"field has incomplete type %0">;
5225 def ext_variable_sized_type_in_struct : ExtWarn<
5226   "field %0 with variable sized type %1 not at the end of a struct or class is"
5227   " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5228
5229 def ext_c99_flexible_array_member : Extension<
5230   "flexible array members are a C99 feature">, InGroup<C99>;
5231 def err_flexible_array_virtual_base : Error<
5232   "flexible array member %0 not allowed in "
5233   "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5234 def err_flexible_array_empty_aggregate : Error<
5235   "flexible array member %0 not allowed in otherwise empty "
5236   "%select{struct|interface|union|class|enum}1">;
5237 def err_flexible_array_has_nontrivial_dtor : Error<
5238   "flexible array member %0 of type %1 with non-trivial destruction">;
5239 def ext_flexible_array_in_struct : Extension<
5240   "%0 may not be nested in a struct due to flexible array member">,
5241   InGroup<FlexibleArrayExtensions>;
5242 def ext_flexible_array_in_array : Extension<
5243   "%0 may not be used as an array element due to flexible array member">,
5244   InGroup<FlexibleArrayExtensions>;
5245 def err_flexible_array_init : Error<
5246   "initialization of flexible array member is not allowed">;
5247 def ext_flexible_array_empty_aggregate_ms : Extension<
5248   "flexible array member %0 in otherwise empty "
5249   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5250   InGroup<MicrosoftFlexibleArray>;
5251 def err_flexible_array_union : Error<
5252   "flexible array member %0 in a union is not allowed">;
5253 def ext_flexible_array_union_ms : Extension<
5254   "flexible array member %0 in a union is a Microsoft extension">,
5255   InGroup<MicrosoftFlexibleArray>;
5256 def ext_flexible_array_empty_aggregate_gnu : Extension<
5257   "flexible array member %0 in otherwise empty "
5258   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5259   InGroup<GNUEmptyStruct>;
5260 def ext_flexible_array_union_gnu : Extension<
5261   "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5262
5263 def err_flexible_array_not_at_end : Error<
5264   "flexible array member %0 with type %1 is not at the end of"
5265   " %select{struct|interface|union|class|enum}2">;
5266 def err_objc_variable_sized_type_not_at_end : Error<
5267   "field %0 with variable sized type %1 is not at the end of class">;
5268 def note_next_field_declaration : Note<
5269   "next field declaration is here">;
5270 def note_next_ivar_declaration : Note<
5271   "next %select{instance variable declaration|synthesized instance variable}0"
5272   " is here">;
5273 def err_synthesize_variable_sized_ivar : Error<
5274   "synthesized property with variable size type %0"
5275   " requires an existing instance variable">;
5276 def err_flexible_array_arc_retainable : Error<
5277   "ARC forbids flexible array members with retainable object type">;
5278 def warn_variable_sized_ivar_visibility : Warning<
5279   "field %0 with variable sized type %1 is not visible to subclasses and"
5280   " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
5281 def warn_superclass_variable_sized_type_not_at_end : Warning<
5282   "field %0 can overwrite instance variable %1 with variable sized type %2"
5283   " in superclass %3">, InGroup<ObjCFlexibleArray>;
5284
5285 let CategoryName = "ARC Semantic Issue" in {
5286
5287 // ARC-mode diagnostics.
5288
5289 let CategoryName = "ARC Weak References" in {
5290
5291 def err_arc_weak_no_runtime : Error<
5292   "cannot create __weak reference because the current deployment target "
5293   "does not support weak references">;
5294 def err_arc_weak_disabled : Error<
5295   "cannot create __weak reference in file using manual reference counting">;
5296 def err_synthesizing_arc_weak_property_disabled : Error<
5297   "cannot synthesize weak property in file using manual reference counting">;
5298 def err_synthesizing_arc_weak_property_no_runtime : Error<
5299   "cannot synthesize weak property because the current deployment target "
5300   "does not support weak references">;
5301 def err_arc_unsupported_weak_class : Error<
5302   "class is incompatible with __weak references">;
5303 def err_arc_weak_unavailable_assign : Error<
5304   "assignment of a weak-unavailable object to a __weak object">;
5305 def err_arc_weak_unavailable_property : Error<
5306   "synthesizing __weak instance variable of type %0, which does not "
5307   "support weak references">;
5308 def note_implemented_by_class : Note<
5309   "when implemented by class %0">;
5310 def err_arc_convesion_of_weak_unavailable : Error<
5311   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5312   " a __weak object of type %2">;
5313
5314 } // end "ARC Weak References" category
5315
5316 let CategoryName = "ARC Restrictions" in {
5317
5318 def err_unavailable_in_arc : Error<
5319   "%0 is unavailable in ARC">;
5320 def note_arc_forbidden_type : Note<
5321   "declaration uses type that is ill-formed in ARC">;
5322 def note_performs_forbidden_arc_conversion : Note<
5323   "inline function performs a conversion which is forbidden in ARC">;
5324 def note_arc_init_returns_unrelated : Note<
5325   "init method must return a type related to its receiver type">;
5326 def note_arc_weak_disabled : Note<
5327   "declaration uses __weak, but ARC is disabled">;
5328 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5329   "the current deployment target does not support">;
5330 def note_arc_field_with_ownership : Note<
5331   "field has non-trivial ownership qualification">;
5332
5333 def err_arc_illegal_explicit_message : Error<
5334   "ARC forbids explicit message send of %0">;
5335 def err_arc_unused_init_message : Error<
5336   "the result of a delegate init call must be immediately returned "
5337   "or assigned to 'self'">;
5338 def err_arc_mismatched_cast : Error<
5339   "%select{implicit conversion|cast}0 of "
5340   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5341   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5342   " to %3 is disallowed with ARC">;
5343 def err_arc_nolifetime_behavior : Error<
5344   "explicit ownership qualifier on cast result has no effect">;
5345 def err_arc_objc_object_in_tag : Error<
5346   "ARC forbids %select{Objective-C objects|blocks}0 in "
5347   "%select{struct|interface|union|<<ERROR>>|enum}1">;
5348 def err_arc_objc_property_default_assign_on_object : Error<
5349   "ARC forbids synthesizing a property of an Objective-C object "
5350   "with unspecified ownership or storage attribute">;
5351 def err_arc_illegal_selector : Error<
5352   "ARC forbids use of %0 in a @selector">;
5353 def err_arc_illegal_method_def : Error<
5354   "ARC forbids %select{implementation|synthesis}0 of %1">;
5355 def warn_arc_strong_pointer_objc_pointer : Warning<
5356   "method parameter of type %0 with no explicit ownership">,
5357   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5358
5359 } // end "ARC Restrictions" category
5360
5361 def err_arc_lost_method_convention : Error<
5362   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5363   "method, but its implementation doesn't match because %select{"
5364   "its result type is not an object pointer|"
5365   "its result type is unrelated to its receiver type}1">;
5366 def note_arc_lost_method_convention : Note<"declaration in interface">;
5367 def err_arc_gained_method_convention : Error<
5368   "method implementation does not match its declaration">;
5369 def note_arc_gained_method_convention : Note<
5370   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5371   "family because %select{its result type is not an object pointer|"
5372   "its result type is unrelated to its receiver type}1">;
5373 def err_typecheck_arc_assign_self : Error<
5374   "cannot assign to 'self' outside of a method in the init family">;
5375 def err_typecheck_arc_assign_self_class_method : Error<
5376   "cannot assign to 'self' in a class method">;
5377 def err_typecheck_arr_assign_enumeration : Error<
5378   "fast enumeration variables cannot be modified in ARC by default; "
5379   "declare the variable __strong to allow this">;
5380 def err_typecheck_arc_assign_externally_retained : Error<
5381   "variable declared with 'objc_externally_retained' "
5382   "cannot be modified in ARC">;
5383 def warn_arc_retained_assign : Warning<
5384   "assigning retained object to %select{weak|unsafe_unretained}0 "
5385   "%select{property|variable}1"
5386   "; object will be released after assignment">,
5387   InGroup<ARCUnsafeRetainedAssign>;
5388 def warn_arc_retained_property_assign : Warning<
5389   "assigning retained object to unsafe property"
5390   "; object will be released after assignment">,
5391   InGroup<ARCUnsafeRetainedAssign>;
5392 def warn_arc_literal_assign : Warning<
5393   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5394   " to a weak %select{property|variable}1"
5395   "; object will be released after assignment">,
5396   InGroup<ARCUnsafeRetainedAssign>;
5397 def err_arc_new_array_without_ownership : Error<
5398   "'new' cannot allocate an array of %0 with no explicit ownership">;
5399 def err_arc_autoreleasing_var : Error<
5400   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5401   "__autoreleasing ownership">;
5402 def err_arc_autoreleasing_capture : Error<
5403   "cannot capture __autoreleasing variable in a "
5404   "%select{block|lambda by copy}0">;
5405 def err_arc_thread_ownership : Error<
5406   "thread-local variable has non-trivial ownership: type is %0">;
5407 def err_arc_indirect_no_ownership : Error<
5408   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5409 def err_arc_array_param_no_ownership : Error<
5410   "must explicitly describe intended ownership of an object array parameter">;
5411 def err_arc_pseudo_dtor_inconstant_quals : Error<
5412   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5413   "type %1">;
5414 def err_arc_init_method_unrelated_result_type : Error<
5415   "init methods must return a type related to the receiver type">;
5416 def err_arc_nonlocal_writeback : Error<
5417   "passing address of %select{non-local|non-scalar}0 object to "
5418   "__autoreleasing parameter for write-back">;
5419 def err_arc_method_not_found : Error<
5420   "no known %select{instance|class}1 method for selector %0">;
5421 def err_arc_receiver_forward_class : Error<
5422   "receiver %0 for class message is a forward declaration">;
5423 def err_arc_may_not_respond : Error<
5424   "no visible @interface for %0 declares the selector %1">;
5425 def err_arc_receiver_forward_instance : Error<
5426   "receiver type %0 for instance message is a forward declaration">;
5427 def warn_receiver_forward_instance : Warning<
5428   "receiver type %0 for instance message is a forward declaration">,
5429   InGroup<ForwardClassReceiver>, DefaultIgnore;
5430 def err_arc_collection_forward : Error<
5431   "collection expression type %0 is a forward declaration">;
5432 def err_arc_multiple_method_decl : Error<
5433   "multiple methods named %0 found with mismatched result, "
5434   "parameter type or attributes">;
5435 def warn_arc_lifetime_result_type : Warning<
5436   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5437   "lifetime qualifier on return type is ignored">,
5438   InGroup<IgnoredQualifiers>;
5439
5440 let CategoryName = "ARC Retain Cycle" in {
5441
5442 def warn_arc_retain_cycle : Warning<
5443   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5444   InGroup<ARCRetainCycles>;
5445 def note_arc_retain_cycle_owner : Note<
5446   "block will be retained by %select{the captured object|an object strongly "
5447   "retained by the captured object}0">;
5448
5449 } // end "ARC Retain Cycle" category
5450
5451 def warn_arc_object_memaccess : Warning<
5452   "%select{destination for|source of}0 this %1 call is a pointer to "
5453   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5454
5455 let CategoryName = "ARC and @properties" in {
5456
5457 def err_arc_strong_property_ownership : Error<
5458   "existing instance variable %1 for strong property %0 may not be "
5459   "%select{|__unsafe_unretained||__weak}2">;
5460 def err_arc_assign_property_ownership : Error<
5461   "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5462   "attribute must be __unsafe_unretained">;
5463 def err_arc_inconsistent_property_ownership : Error<
5464   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5465   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5466
5467 } // end "ARC and @properties" category
5468
5469 def warn_block_capture_autoreleasing : Warning<
5470   "block captures an autoreleasing out-parameter, which may result in "
5471   "use-after-free bugs">,
5472   InGroup<BlockCaptureAutoReleasing>;
5473 def note_declare_parameter_strong : Note<
5474   "declare the parameter __strong or capture a __block __strong variable to "
5475   "keep values alive across autorelease pools">;
5476
5477 def err_arc_atomic_ownership : Error<
5478   "cannot perform atomic operation on a pointer to type %0: type has "
5479   "non-trivial ownership">;
5480
5481 let CategoryName = "ARC Casting Rules" in {
5482
5483 def err_arc_bridge_cast_incompatible : Error<
5484   "incompatible types casting %0 to %1 with a %select{__bridge|"
5485   "__bridge_transfer|__bridge_retained}2 cast">;
5486 def err_arc_bridge_cast_wrong_kind : Error<
5487   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5488   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5489   "__bridge_transfer|__bridge_retained}4">;
5490 def err_arc_cast_requires_bridge : Error<
5491   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5492   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5493   "requires a bridged cast">;
5494 def note_arc_bridge : Note<
5495   "use __bridge to convert directly (no change in ownership)">;
5496 def note_arc_cstyle_bridge : Note<
5497   "use __bridge with C-style cast to convert directly (no change in ownership)">;
5498 def note_arc_bridge_transfer : Note<
5499   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5500   "ownership of a +1 %0 into ARC">;
5501 def note_arc_cstyle_bridge_transfer : Note<
5502   "use __bridge_transfer with C-style cast to transfer "
5503   "ownership of a +1 %0 into ARC">;
5504 def note_arc_bridge_retained : Note<
5505   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5506   "ARC object available as a +1 %0">;
5507 def note_arc_cstyle_bridge_retained : Note<
5508   "use __bridge_retained with C-style cast to make an "
5509   "ARC object available as a +1 %0">;
5510
5511 } // ARC Casting category
5512
5513 } // ARC category name
5514
5515 def err_flexible_array_init_needs_braces : Error<
5516   "flexible array requires brace-enclosed initializer">;
5517 def err_illegal_decl_array_of_functions : Error<
5518   "'%0' declared as array of functions of type %1">;
5519 def err_illegal_decl_array_incomplete_type : Error<
5520   "array has incomplete element type %0">;
5521 def err_illegal_message_expr_incomplete_type : Error<
5522   "Objective-C message has incomplete result type %0">;
5523 def err_illegal_decl_array_of_references : Error<
5524   "'%0' declared as array of references of type %1">;
5525 def err_decl_negative_array_size : Error<
5526   "'%0' declared as an array with a negative size">;
5527 def err_array_static_outside_prototype : Error<
5528   "%0 used in array declarator outside of function prototype">;
5529 def err_array_static_not_outermost : Error<
5530   "%0 used in non-outermost array type derivation">;
5531 def err_array_star_outside_prototype : Error<
5532   "star modifier used outside of function prototype">;
5533 def err_illegal_decl_pointer_to_reference : Error<
5534   "'%0' declared as a pointer to a reference of type %1">;
5535 def err_illegal_decl_mempointer_to_reference : Error<
5536   "'%0' declared as a member pointer to a reference of type %1">;
5537 def err_illegal_decl_mempointer_to_void : Error<
5538   "'%0' declared as a member pointer to void">;
5539 def err_illegal_decl_mempointer_in_nonclass : Error<
5540   "'%0' does not point into a class">;
5541 def err_mempointer_in_nonclass_type : Error<
5542   "member pointer refers into non-class type %0">;
5543 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5544 def err_nonfunction_block_type : Error<
5545   "block pointer to non-function type is invalid">;
5546 def err_return_block_has_expr : Error<"void block should not return a value">;
5547 def err_block_return_missing_expr : Error<
5548   "non-void block should return a value">;
5549 def err_func_def_incomplete_result : Error<
5550   "incomplete result type %0 in function definition">;
5551 def err_atomic_specifier_bad_type : Error<
5552   "_Atomic cannot be applied to "
5553   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5554   "%1 %select{||||||which is not trivially copyable}0">;
5555
5556 // Expressions.
5557 def select_unary_expr_or_type_trait_kind : TextSubstitution<
5558   "%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align|"
5559   "__alignof}0">;
5560 def ext_sizeof_alignof_function_type : Extension<
5561   "invalid application of '%sub{select_unary_expr_or_type_trait_kind}0' "
5562   "to a function type">, InGroup<PointerArith>;
5563 def ext_sizeof_alignof_void_type : Extension<
5564   "invalid application of '%sub{select_unary_expr_or_type_trait_kind}0' "
5565   "to a void type">, InGroup<PointerArith>;
5566 def err_opencl_sizeof_alignof_type : Error<
5567   "invalid application of '%sub{select_unary_expr_or_type_trait_kind}0' "
5568   "to a void type">;
5569 def err_sizeof_alignof_incomplete_type : Error<
5570   "invalid application of '%sub{select_unary_expr_or_type_trait_kind}0' "
5571   "to an incomplete type %1">;
5572 def err_sizeof_alignof_function_type : Error<
5573   "invalid application of '%sub{select_unary_expr_or_type_trait_kind}0' "
5574   "to a function type">;
5575 def err_openmp_default_simd_align_expr : Error<
5576   "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5577 def err_sizeof_alignof_typeof_bitfield : Error<
5578   "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5579 def err_alignof_member_of_incomplete_type : Error<
5580   "invalid application of 'alignof' to a field of a class still being defined">;
5581 def err_vecstep_non_scalar_vector_type : Error<
5582   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5583 def err_offsetof_incomplete_type : Error<
5584   "offsetof of incomplete type %0">;
5585 def err_offsetof_record_type : Error<
5586   "offsetof requires struct, union, or class type, %0 invalid">;
5587 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5588 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5589   InGroup<InvalidOffsetof>;
5590 def ext_offsetof_non_standardlayout_type : ExtWarn<
5591   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5592 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5593 def err_offsetof_field_of_virtual_base : Error<
5594   "invalid application of 'offsetof' to a field of a virtual base">;
5595 def warn_sub_ptr_zero_size_types : Warning<
5596   "subtraction of pointers to type %0 of zero size has undefined behavior">,
5597   InGroup<PointerArith>;
5598 def warn_pointer_arith_null_ptr : Warning<
5599   "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
5600   InGroup<NullPointerArithmetic>, DefaultIgnore;
5601 def warn_gnu_null_ptr_arith : Warning<
5602   "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
5603   InGroup<NullPointerArithmetic>, DefaultIgnore;
5604
5605 def warn_floatingpoint_eq : Warning<
5606   "comparing floating point with == or != is unsafe">,
5607   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5608
5609 def warn_remainder_division_by_zero : Warning<
5610   "%select{remainder|division}0 by zero is undefined">,
5611   InGroup<DivZero>;
5612 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5613   InGroup<DiagGroup<"shift-negative-value">>;
5614 def warn_shift_negative : Warning<"shift count is negative">,
5615   InGroup<DiagGroup<"shift-count-negative">>;
5616 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5617   InGroup<DiagGroup<"shift-count-overflow">>;
5618 def warn_shift_result_gt_typewidth : Warning<
5619   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5620   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5621 def warn_shift_result_sets_sign_bit : Warning<
5622   "signed shift result (%0) sets the sign bit of the shift expression's "
5623   "type (%1) and becomes negative">,
5624   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5625
5626 def warn_precedence_bitwise_rel : Warning<
5627   "%0 has lower precedence than %1; %1 will be evaluated first">,
5628   InGroup<Parentheses>;
5629 def note_precedence_bitwise_first : Note<
5630   "place parentheses around the %0 expression to evaluate it first">;
5631 def note_precedence_silence : Note<
5632   "place parentheses around the '%0' expression to silence this warning">;
5633
5634 def warn_precedence_conditional : Warning<
5635   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5636   InGroup<Parentheses>;
5637 def note_precedence_conditional_first : Note<
5638   "place parentheses around the '?:' expression to evaluate it first">;
5639
5640 def warn_logical_instead_of_bitwise : Warning<
5641   "use of logical '%0' with constant operand">,
5642   InGroup<DiagGroup<"constant-logical-operand">>;
5643 def note_logical_instead_of_bitwise_change_operator : Note<
5644   "use '%0' for a bitwise operation">;
5645 def note_logical_instead_of_bitwise_remove_constant : Note<
5646   "remove constant to silence this warning">;
5647
5648 def warn_bitwise_op_in_bitwise_op : Warning<
5649   "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5650
5651 def warn_logical_and_in_logical_or : Warning<
5652   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5653
5654 def warn_overloaded_shift_in_comparison :Warning<
5655   "overloaded operator %select{>>|<<}0 has higher precedence than "
5656   "comparison operator">,
5657   InGroup<OverloadedShiftOpParentheses>;
5658 def note_evaluate_comparison_first :Note<
5659   "place parentheses around comparison expression to evaluate it first">;
5660
5661 def warn_addition_in_bitshift : Warning<
5662   "operator '%0' has lower precedence than '%1'; "
5663   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5664
5665 def warn_self_assignment_builtin : Warning<
5666   "explicitly assigning value of variable of type %0 to itself">,
5667   InGroup<SelfAssignment>, DefaultIgnore;
5668 def warn_self_assignment_overloaded : Warning<
5669   "explicitly assigning value of variable of type %0 to itself">,
5670   InGroup<SelfAssignmentOverloaded>, DefaultIgnore;
5671 def warn_self_move : Warning<
5672   "explicitly moving variable of type %0 to itself">,
5673   InGroup<SelfMove>, DefaultIgnore;
5674
5675 def warn_redundant_move_on_return : Warning<
5676   "redundant move in return statement">,
5677   InGroup<RedundantMove>, DefaultIgnore;
5678 def warn_pessimizing_move_on_return : Warning<
5679   "moving a local object in a return statement prevents copy elision">,
5680   InGroup<PessimizingMove>, DefaultIgnore;
5681 def warn_pessimizing_move_on_initialization : Warning<
5682   "moving a temporary object prevents copy elision">,
5683   InGroup<PessimizingMove>, DefaultIgnore;
5684 def note_remove_move : Note<"remove std::move call here">;
5685
5686 def warn_return_std_move : Warning<
5687   "local variable %0 will be copied despite being %select{returned|thrown}1 by name">,
5688   InGroup<ReturnStdMove>, DefaultIgnore;
5689 def note_add_std_move : Note<
5690   "call 'std::move' explicitly to avoid copying">;
5691 def warn_return_std_move_in_cxx11 : Warning<
5692   "prior to the resolution of a defect report against ISO C++11, "
5693   "local variable %0 would have been copied despite being returned by name, "
5694   "due to its not matching the function return type%diff{ ($ vs $)|}1,2">,
5695   InGroup<ReturnStdMoveInCXX11>, DefaultIgnore;
5696 def note_add_std_move_in_cxx11 : Note<
5697   "call 'std::move' explicitly to avoid copying on older compilers">;
5698
5699 def warn_string_plus_int : Warning<
5700   "adding %0 to a string does not append to the string">,
5701   InGroup<StringPlusInt>;
5702 def warn_string_plus_char : Warning<
5703   "adding %0 to a string pointer does not append to the string">,
5704   InGroup<StringPlusChar>;
5705 def note_string_plus_scalar_silence : Note<
5706   "use array indexing to silence this warning">;
5707
5708 def warn_sizeof_array_param : Warning<
5709   "sizeof on array function parameter will return size of %0 instead of %1">,
5710   InGroup<SizeofArrayArgument>;
5711
5712 def warn_sizeof_array_decay : Warning<
5713   "sizeof on pointer operation will return size of %0 instead of %1">,
5714   InGroup<SizeofArrayDecay>;
5715
5716 def err_sizeof_nonfragile_interface : Error<
5717   "application of '%select{alignof|sizeof}1' to interface %0 is "
5718   "not supported on this architecture and platform">;
5719 def err_atdef_nonfragile_interface : Error<
5720   "use of @defs is not supported on this architecture and platform">;
5721 def err_subscript_nonfragile_interface : Error<
5722   "subscript requires size of interface %0, which is not constant for "
5723   "this architecture and platform">;
5724
5725 def err_arithmetic_nonfragile_interface : Error<
5726   "arithmetic on pointer to interface %0, which is not a constant size for "
5727   "this architecture and platform">;
5728
5729
5730 def ext_subscript_non_lvalue : Extension<
5731   "ISO C90 does not allow subscripting non-lvalue array">;
5732 def err_typecheck_subscript_value : Error<
5733   "subscripted value is not an array, pointer, or vector">;
5734 def err_typecheck_subscript_not_integer : Error<
5735   "array subscript is not an integer">;
5736 def err_subscript_function_type : Error<
5737   "subscript of pointer to function type %0">;
5738 def err_subscript_incomplete_type : Error<
5739   "subscript of pointer to incomplete type %0">;
5740 def err_dereference_incomplete_type : Error<
5741   "dereference of pointer to incomplete type %0">;
5742 def ext_gnu_subscript_void_type : Extension<
5743   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5744 def err_typecheck_member_reference_struct_union : Error<
5745   "member reference base type %0 is not a structure or union">;
5746 def err_typecheck_member_reference_ivar : Error<
5747   "%0 does not have a member named %1">;
5748 def err_arc_weak_ivar_access : Error<
5749   "dereferencing a __weak pointer is not allowed due to possible "
5750   "null value caused by race condition, assign it to strong variable first">;
5751 def err_typecheck_member_reference_arrow : Error<
5752   "member reference type %0 is not a pointer">;
5753 def err_typecheck_member_reference_suggestion : Error<
5754   "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5755 def note_typecheck_member_reference_suggestion : Note<
5756   "did you mean to use '.' instead?">;
5757 def note_member_reference_arrow_from_operator_arrow : Note<
5758   "'->' applied to return value of the operator->() declared here">;
5759 def err_typecheck_member_reference_type : Error<
5760   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5761 def err_typecheck_member_reference_unknown : Error<
5762   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5763 def err_member_reference_needs_call : Error<
5764   "base of member reference is a function; perhaps you meant to call "
5765   "it%select{| with no arguments}0?">;
5766 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5767   InGroup<CharSubscript>, DefaultIgnore;
5768
5769 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5770 def err_no_member : Error<"no member named %0 in %1">;
5771 def err_no_member_overloaded_arrow : Error<
5772   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5773
5774 def err_member_not_yet_instantiated : Error<
5775   "no member %0 in %1; it has not yet been instantiated">;
5776 def note_non_instantiated_member_here : Note<
5777   "not-yet-instantiated member is declared here">;
5778
5779 def err_enumerator_does_not_exist : Error<
5780   "enumerator %0 does not exist in instantiation of %1">;
5781 def note_enum_specialized_here : Note<
5782   "enum %0 was explicitly specialized here">;
5783
5784 def err_specialization_not_primary_template : Error<
5785   "cannot reference member of primary template because deduced class "
5786   "template specialization %0 is %select{instantiated from a partial|"
5787   "an explicit}1 specialization">;
5788
5789 def err_member_redeclared : Error<"class member cannot be redeclared">;
5790 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5791   InGroup<RedeclaredClassMember>;
5792 def err_member_redeclared_in_instantiation : Error<
5793   "multiple overloads of %0 instantiate to the same signature %1">;
5794 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5795 def err_member_def_undefined_record : Error<
5796   "out-of-line definition of %0 from class %1 without definition">;
5797 def err_member_decl_does_not_match : Error<
5798   "out-of-line %select{declaration|definition}2 of %0 "
5799   "does not match any declaration in %1">;
5800 def err_friend_decl_with_def_arg_must_be_def : Error<
5801   "friend declaration specifying a default argument must be a definition">;
5802 def err_friend_decl_with_def_arg_redeclared : Error<
5803   "friend declaration specifying a default argument must be the only declaration">;
5804 def err_friend_decl_does_not_match : Error<
5805   "friend declaration of %0 does not match any declaration in %1">;
5806 def err_member_decl_does_not_match_suggest : Error<
5807   "out-of-line %select{declaration|definition}2 of %0 "
5808   "does not match any declaration in %1; did you mean %3?">;
5809 def err_member_def_does_not_match_ret_type : Error<
5810   "return type of out-of-line definition of %q0 differs from "
5811   "that in the declaration">;
5812 def err_nonstatic_member_out_of_line : Error<
5813   "non-static data member defined out-of-line">;
5814 def err_qualified_typedef_declarator : Error<
5815   "typedef declarator cannot be qualified">;
5816 def err_qualified_param_declarator : Error<
5817   "parameter declarator cannot be qualified">;
5818 def ext_out_of_line_declaration : ExtWarn<
5819   "out-of-line declaration of a member must be a definition">,
5820   InGroup<OutOfLineDeclaration>, DefaultError;
5821 def err_member_extra_qualification : Error<
5822   "extra qualification on member %0">;
5823 def warn_member_extra_qualification : Warning<
5824   err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5825 def warn_namespace_member_extra_qualification : Warning<
5826   "extra qualification on member %0">,
5827   InGroup<DiagGroup<"extra-qualification">>;
5828 def err_member_qualification : Error<
5829   "non-friend class member %0 cannot have a qualified name">;
5830 def note_member_def_close_match : Note<"member declaration nearly matches">;
5831 def note_member_def_close_const_match : Note<
5832   "member declaration does not match because "
5833   "it %select{is|is not}0 const qualified">;
5834 def note_member_def_close_param_match : Note<
5835   "type of %ordinal0 parameter of member declaration does not match definition"
5836   "%diff{ ($ vs $)|}1,2">;
5837 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5838 def note_local_decl_close_param_match : Note<
5839   "type of %ordinal0 parameter of local declaration does not match definition"
5840   "%diff{ ($ vs $)|}1,2">;
5841 def err_typecheck_ivar_variable_size : Error<
5842   "instance variables must have a constant size">;
5843 def err_ivar_reference_type : Error<
5844   "instance variables cannot be of reference type">;
5845 def err_typecheck_illegal_increment_decrement : Error<
5846   "cannot %select{decrement|increment}1 value of type %0">;
5847 def err_typecheck_expect_int : Error<
5848   "used type %0 where integer is required">;
5849 def err_typecheck_arithmetic_incomplete_type : Error<
5850   "arithmetic on a pointer to an incomplete type %0">;
5851 def err_typecheck_pointer_arith_function_type : Error<
5852   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5853   "function type%select{|s}2 %1%select{| and %3}2">;
5854 def err_typecheck_pointer_arith_void_type : Error<
5855   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5856 def err_typecheck_decl_incomplete_type : Error<
5857   "variable has incomplete type %0">;
5858 def ext_typecheck_decl_incomplete_type : ExtWarn<
5859   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5860   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5861 def err_tentative_def_incomplete_type : Error<
5862   "tentative definition has type %0 that is never completed">;
5863 def warn_tentative_incomplete_array : Warning<
5864   "tentative array definition assumed to have one element">;
5865 def err_typecheck_incomplete_array_needs_initializer : Error<
5866   "definition of variable with array type needs an explicit size "
5867   "or an initializer">;
5868 def err_array_init_not_init_list : Error<
5869   "array initializer must be an initializer "
5870   "list%select{| or string literal| or wide string literal}0">;
5871 def err_array_init_narrow_string_into_wchar : Error<
5872   "initializing wide char array with non-wide string literal">;
5873 def err_array_init_wide_string_into_char : Error<
5874   "initializing char array with wide string literal">;
5875 def err_array_init_incompat_wide_string_into_wchar : Error<
5876   "initializing wide char array with incompatible wide string literal">;
5877 def err_array_init_plain_string_into_char8_t : Error<
5878   "initializing 'char8_t' array with plain string literal">;
5879 def note_array_init_plain_string_into_char8_t : Note<
5880   "add 'u8' prefix to form a 'char8_t' string literal">;
5881 def err_array_init_utf8_string_into_char : Error<
5882   "%select{|ISO C++20 does not permit }0initialization of char array with "
5883   "UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">;
5884 def warn_cxx2a_compat_utf8_string : Warning<
5885   "type of UTF-8 string literal will change from array of const char to "
5886   "array of const char8_t in C++2a">, InGroup<CXX2aCompat>, DefaultIgnore;
5887 def note_cxx2a_compat_utf8_string_remove_u8 : Note<
5888   "remove 'u8' prefix to avoid a change of behavior; "
5889   "Clang encodes unprefixed narrow string literals as UTF-8">;
5890 def err_array_init_different_type : Error<
5891   "cannot initialize array %diff{of type $ with array of type $|"
5892   "with different type of array}0,1">;
5893 def err_array_init_non_constant_array : Error<
5894   "cannot initialize array %diff{of type $ with non-constant array of type $|"
5895   "with different type of array}0,1">;
5896 def ext_array_init_copy : Extension<
5897   "initialization of an array "
5898   "%diff{of type $ from a compound literal of type $|"
5899   "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5900 // This is intentionally not disabled by -Wno-gnu.
5901 def ext_array_init_parens : ExtWarn<
5902   "parenthesized initialization of a member array is a GNU extension">,
5903   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5904 def warn_deprecated_string_literal_conversion : Warning<
5905   "conversion from string literal to %0 is deprecated">,
5906   InGroup<CXX11CompatDeprecatedWritableStr>;
5907 def ext_deprecated_string_literal_conversion : ExtWarn<
5908   "ISO C++11 does not allow conversion from string literal to %0">,
5909   InGroup<WritableStrings>, SFINAEFailure;
5910 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5911 def err_typecheck_sclass_fscope : Error<
5912   "illegal storage class on file-scoped variable">;
5913 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5914   InGroup<MissingDeclarations>;
5915 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5916   "of a type">, InGroup<MissingDeclarations>;
5917 def err_standalone_class_nested_name_specifier : Error<
5918   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5919   "have a nested name specifier">;
5920 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5921 def err_static_block_func : Error<
5922   "function declared in block scope cannot have 'static' storage class">;
5923 def err_typecheck_address_of : Error<"address of %select{bit-field"
5924   "|vector element|property expression|register variable}0 requested">;
5925 def ext_typecheck_addrof_void : Extension<
5926   "ISO C forbids taking the address of an expression of type 'void'">;
5927 def err_unqualified_pointer_member_function : Error<
5928   "must explicitly qualify name of member function when taking its address">;
5929 def err_invalid_form_pointer_member_function : Error<
5930   "cannot create a non-constant pointer to member function">;
5931 def err_address_of_function_with_pass_object_size_params: Error<
5932   "cannot take address of function %0 because parameter %1 has "
5933   "pass_object_size attribute">;
5934 def err_parens_pointer_member_function : Error<
5935   "cannot parenthesize the name of a method when forming a member pointer">;
5936 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5937   "extra '&' taking address of overloaded function">;
5938 def err_typecheck_invalid_lvalue_addrof : Error<
5939   "cannot take the address of an rvalue of type %0">;
5940 def ext_typecheck_addrof_temporary : ExtWarn<
5941   "taking the address of a temporary object of type %0">,
5942   InGroup<AddressOfTemporary>, DefaultError;
5943 def err_typecheck_addrof_temporary : Error<
5944   "taking the address of a temporary object of type %0">;
5945 def err_typecheck_addrof_dtor : Error<
5946   "taking the address of a destructor">;
5947 def err_typecheck_unary_expr : Error<
5948   "invalid argument type %0 to unary expression">;
5949 def err_typecheck_indirection_requires_pointer : Error<
5950   "indirection requires pointer operand (%0 invalid)">;
5951 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5952   "ISO C++ does not allow indirection on operand of type %0">,
5953   InGroup<DiagGroup<"void-ptr-dereference">>;
5954 def warn_indirection_through_null : Warning<
5955   "indirection of non-volatile null pointer will be deleted, not trap">,
5956   InGroup<NullDereference>;
5957 def warn_binding_null_to_reference : Warning<
5958   "binding dereferenced null pointer to reference has undefined behavior">,
5959   InGroup<NullDereference>;
5960 def note_indirection_through_null : Note<
5961   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5962 def warn_pointer_indirection_from_incompatible_type : Warning<
5963   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5964   "behavior">,
5965   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5966 def warn_taking_address_of_packed_member : Warning<
5967   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5968   InGroup<DiagGroup<"address-of-packed-member">>;
5969
5970 def err_objc_object_assignment : Error<
5971   "cannot assign to class object (%0 invalid)">;
5972 def err_typecheck_invalid_operands : Error<
5973   "invalid operands to binary expression (%0 and %1)">;
5974 def note_typecheck_invalid_operands_converted : Note<
5975   "%select{first|second}0 operand was implicitly converted to type %1">;
5976 def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
5977   "logical expression with vector %select{type %1 and non-vector type %2|types"
5978   " %1 and %2}0 is only supported in C++">;
5979 def err_typecheck_sub_ptr_compatible : Error<
5980   "%diff{$ and $ are not pointers to compatible types|"
5981   "pointers to incompatible types}0,1">;
5982 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5983   "ordered comparison between pointer and integer (%0 and %1)">;
5984 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5985   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5986 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5987   "ordered comparison between pointer and zero (%0 and %1)">;
5988 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5989   "ordered comparison of function pointers (%0 and %1)">,
5990   InGroup<DiagGroup<"ordered-compare-function-pointers">>;
5991 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5992   "equality comparison between function pointer and void pointer (%0 and %1)">;
5993 def err_typecheck_comparison_of_fptr_to_void : Error<
5994   "equality comparison between function pointer and void pointer (%0 and %1)">;
5995 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5996   "comparison between pointer and integer (%0 and %1)">,
5997   InGroup<DiagGroup<"pointer-integer-compare">>;
5998 def err_typecheck_comparison_of_pointer_integer : Error<
5999   "comparison between pointer and integer (%0 and %1)">;
6000 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
6001   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
6002   InGroup<CompareDistinctPointerType>;
6003 def ext_typecheck_cond_incompatible_operands : ExtWarn<
6004   "incompatible operand types (%0 and %1)">;
6005 def err_cond_voidptr_arc : Error <
6006   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
6007   "in ARC mode">;
6008 def err_typecheck_comparison_of_distinct_pointers : Error<
6009   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
6010 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
6011   "%select{comparison between %diff{ ($ and $)|}0,1"
6012   "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
6013   "|conditional operator with the second and third operands of type "
6014   "%diff{ ($ and $)|}0,1}2"
6015   " which are pointers to non-overlapping address spaces">;
6016
6017 def err_typecheck_assign_const : Error<
6018   "%select{"
6019   "cannot assign to return value because function %1 returns a const value|"
6020   "cannot assign to variable %1 with const-qualified type %2|"
6021   "cannot assign to %select{non-|}1static data member %2 "
6022   "with const-qualified type %3|"
6023   "cannot assign to non-static data member within const member function %1|"
6024   "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
6025   "with %select{|nested }3const-qualified data member %4|"
6026   "read-only variable is not assignable}0">;
6027
6028 def note_typecheck_assign_const : Note<
6029   "%select{"
6030   "function %1 which returns const-qualified type %2 declared here|"
6031   "variable %1 declared const here|"
6032   "%select{non-|}1static data member %2 declared const here|"
6033   "member function %q1 is declared const here|"
6034   "%select{|nested }1data member %2 declared const here}0">;
6035
6036 def warn_unsigned_always_true_comparison : Warning<
6037   "result of comparison of %select{%3|unsigned expression}0 %2 "
6038   "%select{unsigned expression|%3}0 is always %4">,
6039   InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
6040 def warn_unsigned_enum_always_true_comparison : Warning<
6041   "result of comparison of %select{%3|unsigned enum expression}0 %2 "
6042   "%select{unsigned enum expression|%3}0 is always %4">,
6043   InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
6044 def warn_tautological_constant_compare : Warning<
6045   "result of comparison %select{%3|%1}0 %2 "
6046   "%select{%1|%3}0 is always %4">,
6047   InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
6048 def warn_tautological_compare_objc_bool : Warning<
6049   "result of comparison of constant %0 with expression of type BOOL"
6050   " is always %1, as the only well defined values for BOOL are YES and NO">,
6051   InGroup<TautologicalObjCBoolCompare>;
6052
6053 def warn_mixed_sign_comparison : Warning<
6054   "comparison of integers of different signs: %0 and %1">,
6055   InGroup<SignCompare>, DefaultIgnore;
6056 def warn_out_of_range_compare : Warning<
6057   "result of comparison of %select{constant %0|true|false}1 with "
6058   "%select{expression of type %2|boolean expression}3 is always %4">,
6059   InGroup<TautologicalOutOfRangeCompare>;
6060 def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
6061   InGroup<TautologicalConstantCompare>;
6062 def warn_comparison_of_mixed_enum_types : Warning<
6063   "comparison of two values with different enumeration types"
6064   "%diff{ ($ and $)|}0,1">,
6065   InGroup<EnumCompare>;
6066 def warn_comparison_of_mixed_enum_types_switch : Warning<
6067   "comparison of two values with different enumeration types in switch statement"
6068   "%diff{ ($ and $)|}0,1">,
6069   InGroup<EnumCompareSwitch>;
6070 def warn_null_in_arithmetic_operation : Warning<
6071   "use of NULL in arithmetic operation">,
6072   InGroup<NullArithmetic>;
6073 def warn_null_in_comparison_operation : Warning<
6074   "comparison between NULL and non-pointer "
6075   "%select{(%1 and NULL)|(NULL and %1)}0">,
6076   InGroup<NullArithmetic>;
6077 def err_shift_rhs_only_vector : Error<
6078   "requested shift is a vector of type %0 but the first operand is not a "
6079   "vector (%1)">;
6080
6081 def warn_logical_not_on_lhs_of_check : Warning<
6082   "logical not is only applied to the left hand side of this "
6083   "%select{comparison|bitwise operator}0">,
6084   InGroup<LogicalNotParentheses>;
6085 def note_logical_not_fix : Note<
6086   "add parentheses after the '!' to evaluate the "
6087   "%select{comparison|bitwise operator}0 first">;
6088 def note_logical_not_silence_with_parens : Note<
6089   "add parentheses around left hand side expression to silence this warning">;
6090
6091 def err_invalid_this_use : Error<
6092   "invalid use of 'this' outside of a non-static member function">;
6093 def err_this_static_member_func : Error<
6094   "'this' cannot be%select{| implicitly}0 used in a static member function "
6095   "declaration">;
6096 def err_invalid_member_use_in_static_method : Error<
6097   "invalid use of member %0 in static member function">;
6098 def err_invalid_qualified_function_type : Error<
6099   "%select{non-member function|static member function|deduction guide}0 "
6100   "%select{of type %2 |}1cannot have '%3' qualifier">;
6101 def err_compound_qualified_function_type : Error<
6102   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
6103   "cannot have '%3' qualifier">;
6104
6105 def err_ref_qualifier_overload : Error<
6106   "cannot overload a member function %select{without a ref-qualifier|with "
6107   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
6108   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
6109
6110 def err_invalid_non_static_member_use : Error<
6111   "invalid use of non-static data member %0">;
6112 def err_nested_non_static_member_use : Error<
6113   "%select{call to non-static member function|use of non-static data member}0 "
6114   "%2 of %1 from nested type %3">;
6115 def warn_cxx98_compat_non_static_member_use : Warning<
6116   "use of non-static data member %0 in an unevaluated context is "
6117   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6118 def err_invalid_incomplete_type_use : Error<
6119   "invalid use of incomplete type %0">;
6120 def err_builtin_func_cast_more_than_one_arg : Error<
6121   "function-style cast to a builtin type can only take one argument">;
6122 def err_value_init_for_array_type : Error<
6123   "array types cannot be value-initialized">;
6124 def err_init_for_function_type : Error<
6125   "cannot create object of function type %0">;
6126 def warn_format_nonliteral_noargs : Warning<
6127   "format string is not a string literal (potentially insecure)">,
6128   InGroup<FormatSecurity>;
6129 def warn_format_nonliteral : Warning<
6130   "format string is not a string literal">,
6131   InGroup<FormatNonLiteral>, DefaultIgnore;
6132
6133 def err_unexpected_interface : Error<
6134   "unexpected interface name %0: expected expression">;
6135 def err_ref_non_value : Error<"%0 does not refer to a value">;
6136 def err_ref_vm_type : Error<
6137   "cannot refer to declaration with a variably modified type inside block">;
6138 def err_ref_flexarray_type : Error<
6139   "cannot refer to declaration of structure variable with flexible array member "
6140   "inside block">;
6141 def err_ref_array_type : Error<
6142   "cannot refer to declaration with an array type inside block">;
6143 def err_property_not_found : Error<
6144   "property %0 not found on object of type %1">;
6145 def err_invalid_property_name : Error<
6146   "%0 is not a valid property name (accessing an object of type %1)">;
6147 def err_getter_not_found : Error<
6148   "no getter method for read from property">;
6149 def err_objc_subscript_method_not_found : Error<
6150   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
6151   "found on object of type %0">;
6152 def err_objc_subscript_index_type : Error<
6153   "method index parameter type %0 is not integral type">;
6154 def err_objc_subscript_key_type : Error<
6155   "method key parameter type %0 is not object type">;
6156 def err_objc_subscript_dic_object_type : Error<
6157   "method object parameter type %0 is not object type">;
6158 def err_objc_subscript_object_type : Error<
6159   "cannot assign to this %select{dictionary|array}1 because assigning method's "
6160   "2nd parameter of type %0 is not an Objective-C pointer type">;
6161 def err_objc_subscript_base_type : Error<
6162   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
6163 def err_objc_multiple_subscript_type_conversion : Error<
6164   "indexing expression is invalid because subscript type %0 has "
6165   "multiple type conversion functions">;
6166 def err_objc_subscript_type_conversion : Error<
6167   "indexing expression is invalid because subscript type %0 is not an integral"
6168   " or Objective-C pointer type">;
6169 def err_objc_subscript_pointer : Error<
6170   "indexing expression is invalid because subscript type %0 is not an"
6171   " Objective-C pointer">;
6172 def err_objc_indexing_method_result_type : Error<
6173   "method for accessing %select{dictionary|array}1 element must have Objective-C"
6174   " object return type instead of %0">;
6175 def err_objc_index_incomplete_class_type : Error<
6176   "Objective-C index expression has incomplete class type %0">;
6177 def err_illegal_container_subscripting_op : Error<
6178   "illegal operation on Objective-C container subscripting">;
6179 def err_property_not_found_forward_class : Error<
6180   "property %0 cannot be found in forward class object %1">;
6181 def err_property_not_as_forward_class : Error<
6182   "property %0 refers to an incomplete Objective-C class %1 "
6183   "(with no @interface available)">;
6184 def note_forward_class : Note<
6185   "forward declaration of class here">;
6186 def err_duplicate_property : Error<
6187   "property has a previous declaration">;
6188 def ext_gnu_void_ptr : Extension<
6189   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
6190   InGroup<PointerArith>;
6191 def ext_gnu_ptr_func_arith : Extension<
6192   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
6193   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
6194   InGroup<PointerArith>;
6195 def err_readonly_message_assignment : Error<
6196   "assigning to 'readonly' return result of an Objective-C message not allowed">;
6197 def ext_integer_increment_complex : Extension<
6198   "ISO C does not support '++'/'--' on complex integer type %0">;
6199 def ext_integer_complement_complex : Extension<
6200   "ISO C does not support '~' for complex conjugation of %0">;
6201 def err_nosetter_property_assignment : Error<
6202   "%select{assignment to readonly property|"
6203   "no setter method %1 for assignment to property}0">;
6204 def err_nosetter_property_incdec : Error<
6205   "%select{%select{increment|decrement}1 of readonly property|"
6206   "no setter method %2 for %select{increment|decrement}1 of property}0">;
6207 def err_nogetter_property_compound_assignment : Error<
6208   "a getter method is needed to perform a compound assignment on a property">;
6209 def err_nogetter_property_incdec : Error<
6210   "no getter method %1 for %select{increment|decrement}0 of property">;
6211 def err_no_subobject_property_setting : Error<
6212   "expression is not assignable">;
6213 def err_qualified_objc_access : Error<
6214   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
6215
6216 def ext_freestanding_complex : Extension<
6217   "complex numbers are an extension in a freestanding C99 implementation">;
6218
6219 // FIXME: Remove when we support imaginary.
6220 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
6221
6222 // Obj-c expressions
6223 def warn_root_inst_method_not_found : Warning<
6224   "instance method %0 is being used on 'Class' which is not in the root class">,
6225   InGroup<MethodAccess>;
6226 def warn_class_method_not_found : Warning<
6227   "class method %objcclass0 not found (return type defaults to 'id')">,
6228   InGroup<MethodAccess>;
6229 def warn_instance_method_on_class_found : Warning<
6230   "instance method %0 found instead of class method %1">,
6231   InGroup<MethodAccess>;
6232 def warn_inst_method_not_found : Warning<
6233   "instance method %objcinstance0 not found (return type defaults to 'id')">,
6234   InGroup<MethodAccess>;
6235 def warn_instance_method_not_found_with_typo : Warning<
6236   "instance method %objcinstance0 not found (return type defaults to 'id')"
6237   "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6238 def warn_class_method_not_found_with_typo : Warning<
6239   "class method %objcclass0 not found (return type defaults to 'id')"
6240   "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6241 def err_method_not_found_with_typo : Error<
6242   "%select{instance|class}1 method %0 not found "
6243   "; did you mean %2?">;
6244 def err_no_super_class_message : Error<
6245   "no @interface declaration found in class messaging of %0">;
6246 def err_root_class_cannot_use_super : Error<
6247   "%0 cannot use 'super' because it is a root class">;
6248 def err_invalid_receiver_to_message_super : Error<
6249   "'super' is only valid in a method body">;
6250 def err_invalid_receiver_class_message : Error<
6251   "receiver type %0 is not an Objective-C class">;
6252 def err_missing_open_square_message_send : Error<
6253   "missing '[' at start of message send expression">;
6254 def warn_bad_receiver_type : Warning<
6255   "receiver type %0 is not 'id' or interface pointer, consider "
6256   "casting it to 'id'">,InGroup<ObjCReceiver>;
6257 def err_bad_receiver_type : Error<"bad receiver type %0">;
6258 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6259 def err_unknown_receiver_suggest : Error<
6260   "unknown receiver %0; did you mean %1?">;
6261 def err_objc_throw_expects_object : Error<
6262   "@throw requires an Objective-C object type (%0 invalid)">;
6263 def err_objc_synchronized_expects_object : Error<
6264   "@synchronized requires an Objective-C object type (%0 invalid)">;
6265 def err_rethrow_used_outside_catch : Error<
6266   "@throw (rethrow) used outside of a @catch block">;
6267 def err_attribute_multiple_objc_gc : Error<
6268   "multiple garbage collection attributes specified for type">;
6269 def err_catch_param_not_objc_type : Error<
6270   "@catch parameter is not a pointer to an interface type">;
6271 def err_illegal_qualifiers_on_catch_parm : Error<
6272   "illegal qualifiers on @catch parameter">;
6273 def err_storage_spec_on_catch_parm : Error<
6274   "@catch parameter cannot have storage specifier '%0'">;
6275 def warn_register_objc_catch_parm : Warning<
6276   "'register' storage specifier on @catch parameter will be ignored">;
6277 def err_qualified_objc_catch_parm : Error<
6278   "@catch parameter declarator cannot be qualified">;
6279 def warn_objc_pointer_cxx_catch_fragile : Warning<
6280   "cannot catch an exception thrown with @throw in C++ in the non-unified "
6281   "exception model">, InGroup<ObjCNonUnifiedException>;
6282 def err_objc_object_catch : Error<
6283   "cannot catch an Objective-C object by value">;
6284 def err_incomplete_type_objc_at_encode : Error<
6285   "'@encode' of incomplete type %0">;
6286 def warn_objc_circular_container : Warning<
6287   "adding %0 to %1 might cause circular dependency in container">,
6288   InGroup<DiagGroup<"objc-circular-container">>;
6289 def note_objc_circular_container_declared_here : Note<"%0 declared here">;
6290 def warn_objc_unsafe_perform_selector : Warning<
6291   "%0 is incompatible with selectors that return a "
6292   "%select{struct|union|vector}1 type">,
6293   InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
6294 def note_objc_unsafe_perform_selector_method_declared_here :  Note<
6295   "method %0 that returns %1 declared here">;
6296
6297 def warn_setter_getter_impl_required : Warning<
6298   "property %0 requires method %1 to be defined - "
6299   "use @synthesize, @dynamic or provide a method implementation "
6300   "in this class implementation">,
6301   InGroup<ObjCPropertyImpl>;
6302 def warn_setter_getter_impl_required_in_category : Warning<
6303   "property %0 requires method %1 to be defined - "
6304   "use @dynamic or provide a method implementation in this category">,
6305   InGroup<ObjCPropertyImpl>;
6306 def note_parameter_named_here : Note<
6307   "passing argument to parameter %0 here">;
6308 def note_parameter_here : Note<
6309   "passing argument to parameter here">;
6310 def note_method_return_type_change : Note<
6311   "compiler has implicitly changed method %0 return type">;
6312
6313 def warn_impl_required_for_class_property : Warning<
6314   "class property %0 requires method %1 to be defined - "
6315   "use @dynamic or provide a method implementation "
6316   "in this class implementation">,
6317   InGroup<ObjCPropertyImpl>;
6318 def warn_impl_required_in_category_for_class_property : Warning<
6319   "class property %0 requires method %1 to be defined - "
6320   "use @dynamic or provide a method implementation in this category">,
6321   InGroup<ObjCPropertyImpl>;
6322
6323 // C++ casts
6324 // These messages adhere to the TryCast pattern: %0 is an int specifying the
6325 // cast type, %1 is the source type, %2 is the destination type.
6326 def err_bad_reinterpret_cast_overload : Error<
6327   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
6328
6329 def warn_reinterpret_different_from_static : Warning<
6330   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
6331   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
6332   "'static_cast'">, InGroup<ReinterpretBaseClass>;
6333 def note_reinterpret_updowncast_use_static: Note<
6334   "use 'static_cast' to adjust the pointer correctly while "
6335   "%select{upcasting|downcasting}0">;
6336
6337 def err_bad_static_cast_overload : Error<
6338   "address of overloaded function %0 cannot be static_cast to type %1">;
6339
6340 def err_bad_cstyle_cast_overload : Error<
6341   "address of overloaded function %0 cannot be cast to type %1">;
6342
6343
6344 def err_bad_cxx_cast_generic : Error<
6345   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6346   "functional-style cast}0 from %1 to %2 is not allowed">;
6347 def err_bad_cxx_cast_unrelated_class : Error<
6348   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6349   "functional-style cast}0 from %1 to %2, which are not related by "
6350   "inheritance, is not allowed">;
6351 def note_type_incomplete : Note<"%0 is incomplete">;
6352 def err_bad_cxx_cast_rvalue : Error<
6353   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6354   "functional-style cast}0 from rvalue to reference type %2">;
6355 def err_bad_cxx_cast_bitfield : Error<
6356   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6357   "functional-style cast}0 from bit-field lvalue to reference type %2">;
6358 def err_bad_cxx_cast_qualifiers_away : Error<
6359   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6360   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
6361 def err_bad_cxx_cast_addr_space_mismatch : Error<
6362   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6363   "functional-style cast}0 from %1 to %2 converts between mismatching address"
6364   " spaces">;
6365 def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn<
6366   "ISO C++ does not allow "
6367   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6368   "functional-style cast}0 from %1 to %2 because it casts away qualifiers, "
6369   "even though the source and destination types are unrelated">,
6370   SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>;
6371 def err_bad_const_cast_dest : Error<
6372   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
6373   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
6374 def ext_cast_fn_obj : Extension<
6375   "cast between pointer-to-function and pointer-to-object is an extension">;
6376 def ext_ms_cast_fn_obj : ExtWarn<
6377   "static_cast between pointer-to-function and pointer-to-object is a "
6378   "Microsoft extension">, InGroup<MicrosoftCast>;
6379 def warn_cxx98_compat_cast_fn_obj : Warning<
6380   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
6381   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6382 def err_bad_reinterpret_cast_small_int : Error<
6383   "cast from pointer to smaller type %2 loses information">;
6384 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
6385   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
6386   "to scalar %2 of different size">;
6387 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6388   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
6389   "to vector %2 of different size">;
6390 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6391   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
6392   "to vector %2 of different size">;
6393 def err_bad_lvalue_to_rvalue_cast : Error<
6394   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6395   "not compatible">;
6396 def err_bad_rvalue_to_rvalue_cast : Error<
6397   "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6398   "not compatible">;
6399 def err_bad_static_cast_pointer_nonpointer : Error<
6400   "cannot cast from type %1 to pointer type %2">;
6401 def err_bad_static_cast_member_pointer_nonmp : Error<
6402   "cannot cast from type %1 to member pointer type %2">;
6403 def err_bad_cxx_cast_member_pointer_size : Error<
6404   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6405   "type %1 to member pointer type %2 of different size">;
6406 def err_bad_reinterpret_cast_reference : Error<
6407   "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6408 def warn_undefined_reinterpret_cast : Warning<
6409   "reinterpret_cast from %0 to %1 has undefined behavior">,
6410   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6411
6412 // These messages don't adhere to the pattern.
6413 // FIXME: Display the path somehow better.
6414 def err_ambiguous_base_to_derived_cast : Error<
6415   "ambiguous cast from base %0 to derived %1:%2">;
6416 def err_static_downcast_via_virtual : Error<
6417   "cannot cast %0 to %1 via virtual base %2">;
6418 def err_downcast_from_inaccessible_base : Error<
6419   "cannot cast %select{private|protected}2 base class %1 to %0">;
6420 def err_upcast_to_inaccessible_base : Error<
6421   "cannot cast %0 to its %select{private|protected}2 base class %1">;
6422 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6423   "%0 is not a reference or pointer">;
6424 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6425 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6426 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6427 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6428
6429 // Other C++ expressions
6430 def err_need_header_before_typeid : Error<
6431   "you need to include <typeinfo> before using the 'typeid' operator">;
6432 def err_need_header_before_ms_uuidof : Error<
6433   "you need to include <guiddef.h> before using the '__uuidof' operator">;
6434 def err_ms___leave_not_in___try : Error<
6435   "'__leave' statement not in __try block">;
6436 def err_uuidof_without_guid : Error<
6437   "cannot call operator __uuidof on a type with no GUID">;
6438 def err_uuidof_with_multiple_guids : Error<
6439   "cannot call operator __uuidof on a type with multiple GUIDs">;
6440 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6441 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6442 def err_static_illegal_in_new : Error<
6443   "the 'static' modifier for the array size is not legal in new expressions">;
6444 def err_array_new_needs_size : Error<
6445   "array size must be specified in new expression with no initializer">;
6446 def err_bad_new_type : Error<
6447   "cannot allocate %select{function|reference}1 type %0 with new">;
6448 def err_new_incomplete_type : Error<
6449   "allocation of incomplete type %0">;
6450 def err_new_array_nonconst : Error<
6451   "only the first dimension of an allocated array may have dynamic size">;
6452 def err_new_array_size_unknown_from_init : Error<
6453   "cannot determine allocated array size from initializer">;
6454 def err_new_array_init_args : Error<
6455   "array 'new' cannot have initialization arguments">;
6456 def ext_new_paren_array_nonconst : ExtWarn<
6457   "when type is in parentheses, array cannot have dynamic size">;
6458 def err_placement_new_non_placement_delete : Error<
6459   "'new' expression with placement arguments refers to non-placement "
6460   "'operator delete'">;
6461 def err_array_size_not_integral : Error<
6462   "array size expression must have integral or %select{|unscoped }0"
6463   "enumeration type, not %1">;
6464 def err_array_size_incomplete_type : Error<
6465   "array size expression has incomplete class type %0">;
6466 def err_array_size_explicit_conversion : Error<
6467   "array size expression of type %0 requires explicit conversion to type %1">;
6468 def note_array_size_conversion : Note<
6469   "conversion to %select{integral|enumeration}0 type %1 declared here">;
6470 def err_array_size_ambiguous_conversion : Error<
6471   "ambiguous conversion of array size expression of type %0 to an integral or "
6472   "enumeration type">;
6473 def ext_array_size_conversion : Extension<
6474   "implicit conversion from array size expression of type %0 to "
6475   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6476   InGroup<CXX11>;
6477 def warn_cxx98_compat_array_size_conversion : Warning<
6478   "implicit conversion from array size expression of type %0 to "
6479   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6480   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6481 def err_address_space_qualified_new : Error<
6482   "'new' cannot allocate objects of type %0 in address space '%1'">;
6483 def err_address_space_qualified_delete : Error<
6484   "'delete' cannot delete objects of type %0 in address space '%1'">;
6485
6486 def err_default_init_const : Error<
6487   "default initialization of an object of const type %0"
6488   "%select{| without a user-provided default constructor}1">;
6489 def ext_default_init_const : ExtWarn<
6490   "default initialization of an object of const type %0"
6491   "%select{| without a user-provided default constructor}1 "
6492   "is a Microsoft extension">,
6493   InGroup<MicrosoftConstInit>;
6494 def err_delete_operand : Error<"cannot delete expression of type %0">;
6495 def ext_delete_void_ptr_operand : ExtWarn<
6496   "cannot delete expression with pointer-to-'void' type %0">,
6497   InGroup<DeleteIncomplete>;
6498 def err_ambiguous_delete_operand : Error<
6499   "ambiguous conversion of delete expression of type %0 to a pointer">;
6500 def warn_delete_incomplete : Warning<
6501   "deleting pointer to incomplete type %0 may cause undefined behavior">,
6502   InGroup<DeleteIncomplete>;
6503 def err_delete_incomplete_class_type : Error<
6504   "deleting incomplete class type %0; no conversions to pointer type">;
6505 def err_delete_explicit_conversion : Error<
6506   "converting delete expression from type %0 to type %1 invokes an explicit "
6507   "conversion function">;
6508 def note_delete_conversion : Note<"conversion to pointer type %0">;
6509 def warn_delete_array_type : Warning<
6510   "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6511 def warn_mismatched_delete_new : Warning<
6512   "'delete%select{|[]}0' applied to a pointer that was allocated with "
6513   "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6514   InGroup<DiagGroup<"mismatched-new-delete">>;
6515 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6516 def err_no_suitable_delete_member_function_found : Error<
6517   "no suitable member %0 in %1">;
6518 def err_ambiguous_suitable_delete_member_function_found : Error<
6519   "multiple suitable %0 functions in %1">;
6520 def warn_ambiguous_suitable_delete_function_found : Warning<
6521   "multiple suitable %0 functions for %1; no 'operator delete' function "
6522   "will be invoked if initialization throws an exception">,
6523   InGroup<DiagGroup<"ambiguous-delete">>;
6524 def note_member_declared_here : Note<
6525   "member %0 declared here">;
6526 def note_member_first_declared_here : Note<
6527   "member %0 first declared here">;
6528 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6529 def warn_increment_bool : Warning<
6530   "incrementing expression of type bool is deprecated and "
6531   "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
6532 def ext_increment_bool : ExtWarn<
6533   "ISO C++17 does not allow incrementing expression of type bool">,
6534   DefaultError, InGroup<IncrementBool>;
6535 def err_increment_decrement_enum : Error<
6536   "cannot %select{decrement|increment}0 expression of enum type %1">;
6537 def err_catch_incomplete_ptr : Error<
6538   "cannot catch pointer to incomplete type %0">;
6539 def err_catch_incomplete_ref : Error<
6540   "cannot catch reference to incomplete type %0">;
6541 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6542 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6543 def err_catch_variably_modified : Error<
6544   "cannot catch variably modified type %0">;
6545 def err_qualified_catch_declarator : Error<
6546   "exception declarator cannot be qualified">;
6547 def err_early_catch_all : Error<"catch-all handler must come last">;
6548 def err_bad_memptr_rhs : Error<
6549   "right hand operand to %0 has non-pointer-to-member type %1">;
6550 def err_bad_memptr_lhs : Error<
6551   "left hand operand to %0 must be a %select{|pointer to }1class "
6552   "compatible with the right hand operand, but is %2">;
6553 def err_memptr_incomplete : Error<
6554   "member pointer has incomplete base type %0">;
6555 def warn_exception_caught_by_earlier_handler : Warning<
6556   "exception of type %0 will be caught by earlier handler">,
6557   InGroup<Exceptions>;
6558 def note_previous_exception_handler : Note<"for type %0">;
6559 def err_exceptions_disabled : Error<
6560   "cannot use '%0' with exceptions disabled">;
6561 def err_objc_exceptions_disabled : Error<
6562   "cannot use '%0' with Objective-C exceptions disabled">;
6563 def warn_throw_in_noexcept_func : Warning<
6564   "%0 has a non-throwing exception specification but can still throw">,
6565   InGroup<Exceptions>;
6566 def note_throw_in_dtor : Note<
6567   "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
6568   "non-throwing}1 exception specification">;
6569 def note_throw_in_function : Note<"function declared non-throwing here">;
6570 def err_seh_try_outside_functions : Error<
6571   "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6572 def err_mixing_cxx_try_seh_try : Error<
6573   "cannot use C++ 'try' in the same function as SEH '__try'">;
6574 def err_seh_try_unsupported : Error<
6575   "SEH '__try' is not supported on this target">;
6576 def note_conflicting_try_here : Note<
6577   "conflicting %0 here">;
6578 def warn_jump_out_of_seh_finally : Warning<
6579   "jump out of __finally block has undefined behavior">,
6580   InGroup<DiagGroup<"jump-seh-finally">>;
6581 def warn_non_virtual_dtor : Warning<
6582   "%0 has virtual functions but non-virtual destructor">,
6583   InGroup<NonVirtualDtor>, DefaultIgnore;
6584 def warn_delete_non_virtual_dtor : Warning<
6585   "%select{delete|destructor}0 called on non-final %1 that has "
6586   "virtual functions but non-virtual destructor">,
6587   InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
6588 def note_delete_non_virtual : Note<
6589   "qualify call to silence this warning">;
6590 def warn_delete_abstract_non_virtual_dtor : Warning<
6591   "%select{delete|destructor}0 called on %1 that is abstract but has "
6592   "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader;
6593 def warn_overloaded_virtual : Warning<
6594   "%q0 hides overloaded virtual %select{function|functions}1">,
6595   InGroup<OverloadedVirtual>, DefaultIgnore;
6596 def note_hidden_overloaded_virtual_declared_here : Note<
6597   "hidden overloaded virtual function %q0 declared here"
6598   "%select{|: different classes%diff{ ($ vs $)|}2,3"
6599   "|: different number of parameters (%2 vs %3)"
6600   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6601   "|: different return type%diff{ ($ vs $)|}2,3"
6602   "|: different qualifiers (%2 vs %3)"
6603   "|: different exception specifications}1">;
6604 def warn_using_directive_in_header : Warning<
6605   "using namespace directive in global context in header">,
6606   InGroup<HeaderHygiene>, DefaultIgnore;
6607 def warn_overaligned_type : Warning<
6608   "type %0 requires %1 bytes of alignment and the default allocator only "
6609   "guarantees %2 bytes">,
6610   InGroup<OveralignedType>, DefaultIgnore;
6611 def err_aligned_allocation_unavailable : Error<
6612   "aligned %select{allocation|deallocation}0 function of type '%1' is only "
6613   "available on %2 %3 or newer">;
6614 def note_silence_aligned_allocation_unavailable : Note<
6615   "if you supply your own aligned allocation functions, use "
6616   "-faligned-allocation to silence this diagnostic">;
6617
6618 def err_conditional_void_nonvoid : Error<
6619   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6620   "is of type %0">;
6621 def err_conditional_ambiguous : Error<
6622   "conditional expression is ambiguous; "
6623   "%diff{$ can be converted to $ and vice versa|"
6624   "types can be convert to each other}0,1">;
6625 def err_conditional_ambiguous_ovl : Error<
6626   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6627   "can be converted to several common types">;
6628 def err_conditional_vector_size : Error<
6629   "vector condition type %0 and result type %1 do not have the same number "
6630   "of elements">;
6631 def err_conditional_vector_element_size : Error<
6632   "vector condition type %0 and result type %1 do not have elements of the "
6633   "same size">;
6634
6635 def err_throw_incomplete : Error<
6636   "cannot throw object of incomplete type %0">;
6637 def err_throw_incomplete_ptr : Error<
6638   "cannot throw pointer to object of incomplete type %0">;
6639 def warn_throw_underaligned_obj : Warning<
6640   "underaligned exception object thrown">,
6641   InGroup<UnderalignedExceptionObject>;
6642 def note_throw_underaligned_obj : Note<
6643   "required alignment of type %0 (%1 bytes) is larger than the supported "
6644   "alignment of C++ exception objects on this target (%2 bytes)">;
6645 def err_return_in_constructor_handler : Error<
6646   "return in the catch of a function try block of a constructor is illegal">;
6647 def warn_cdtor_function_try_handler_mem_expr : Warning<
6648   "cannot refer to a non-static member from the handler of a "
6649   "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6650
6651 let CategoryName = "Lambda Issue" in {
6652   def err_capture_more_than_once : Error<
6653     "%0 can appear only once in a capture list">;
6654   def err_reference_capture_with_reference_default : Error<
6655     "'&' cannot precede a capture when the capture default is '&'">;
6656   def err_copy_capture_with_copy_default : Error<
6657     "'&' must precede a capture when the capture default is '='">;
6658   def err_capture_does_not_name_variable : Error<
6659     "%0 in capture list does not name a variable">;
6660   def err_capture_non_automatic_variable : Error<
6661     "%0 cannot be captured because it does not have automatic storage "
6662     "duration">;
6663   def err_this_capture : Error<
6664     "'this' cannot be %select{implicitly |}0captured in this context">;
6665   def err_lambda_capture_anonymous_var : Error<
6666     "unnamed variable cannot be implicitly captured in a lambda expression">;
6667   def err_lambda_capture_flexarray_type : Error<
6668     "variable %0 with flexible array member cannot be captured in "
6669     "a lambda expression">;
6670   def err_lambda_impcap : Error<
6671     "variable %0 cannot be implicitly captured in a lambda with no "
6672     "capture-default specified">;
6673   def note_lambda_decl : Note<"lambda expression begins here">;
6674   def err_lambda_unevaluated_operand : Error<
6675     "lambda expression in an unevaluated operand">;
6676   def err_lambda_in_constant_expression : Error<
6677     "a lambda expression may not appear inside of a constant expression">;
6678   def err_lambda_in_invalid_context : Error<
6679     "a lambda expression cannot appear in this context">;
6680   def err_lambda_return_init_list : Error<
6681     "cannot deduce lambda return type from initializer list">;
6682   def err_lambda_capture_default_arg : Error<
6683     "lambda expression in default argument cannot capture any entity">;
6684   def err_lambda_incomplete_result : Error<
6685     "incomplete result type %0 in lambda expression">;
6686   def err_noreturn_lambda_has_return_expr : Error<
6687     "lambda declared 'noreturn' should not return">;
6688   def warn_maybe_falloff_nonvoid_lambda : Warning<
6689     "control may reach end of non-void lambda">,
6690     InGroup<ReturnType>;
6691   def warn_falloff_nonvoid_lambda : Warning<
6692     "control reaches end of non-void lambda">,
6693     InGroup<ReturnType>;
6694   def err_access_lambda_capture : Error<
6695     // The ERRORs represent other special members that aren't constructors, in
6696     // hopes that someone will bother noticing and reporting if they appear
6697     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6698     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6699     AccessControl;
6700   def note_lambda_to_block_conv : Note<
6701     "implicit capture of lambda object due to conversion to block pointer "
6702     "here">;
6703   def note_var_explicitly_captured_here : Note<"variable %0 is"
6704     "%select{| explicitly}1 captured here">;
6705
6706   // C++14 lambda init-captures.
6707   def warn_cxx11_compat_init_capture : Warning<
6708     "initialized lambda captures are incompatible with C++ standards "
6709     "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6710   def ext_init_capture : ExtWarn<
6711     "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6712   def err_init_capture_no_expression : Error<
6713     "initializer missing for lambda capture %0">;
6714   def err_init_capture_multiple_expressions : Error<
6715     "initializer for lambda capture %0 contains multiple expressions">;
6716   def err_init_capture_paren_braces : Error<
6717     "cannot deduce type for lambda capture %1 from "
6718     "%select{parenthesized|nested}0 initializer list">;
6719   def err_init_capture_deduction_failure : Error<
6720     "cannot deduce type for lambda capture %0 from initializer of type %2">;
6721   def err_init_capture_deduction_failure_from_init_list : Error<
6722     "cannot deduce type for lambda capture %0 from initializer list">;
6723   def warn_cxx17_compat_init_capture_pack : Warning<
6724     "initialized lambda capture packs are incompatible with C++ standards "
6725     "before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
6726   def ext_init_capture_pack : ExtWarn<
6727     "initialized lambda pack captures are a C++2a extension">, InGroup<CXX2a>;
6728
6729   // C++14 generic lambdas.
6730   def warn_cxx11_compat_generic_lambda : Warning<
6731     "generic lambdas are incompatible with C++11">,
6732     InGroup<CXXPre14Compat>, DefaultIgnore;
6733
6734   // C++17 '*this' captures.
6735   def warn_cxx14_compat_star_this_lambda_capture : Warning<
6736     "by value capture of '*this' is incompatible with C++ standards before C++17">,
6737      InGroup<CXXPre17Compat>, DefaultIgnore;
6738   def ext_star_this_lambda_capture_cxx17 : ExtWarn<
6739     "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
6740
6741   // C++17 parameter shadows capture
6742   def err_parameter_shadow_capture : Error<
6743     "a lambda parameter cannot shadow an explicitly captured entity">;
6744
6745   // C++2a [=, this] captures.
6746   def warn_cxx17_compat_equals_this_lambda_capture : Warning<
6747     "explicit capture of 'this' with a capture default of '=' is incompatible "
6748     "with C++ standards before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
6749   def ext_equals_this_lambda_capture_cxx2a : ExtWarn<
6750     "explicit capture of 'this' with a capture default of '=' "
6751     "is a C++2a extension">, InGroup<CXX2a>;
6752   def warn_deprecated_this_capture : Warning<
6753     "implicit capture of 'this' with a capture default of '=' is deprecated">,
6754     InGroup<DeprecatedThisCapture>, DefaultIgnore;
6755   def note_deprecated_this_capture : Note<
6756     "add an explicit capture of 'this' to capture '*this' by reference">;
6757
6758   // C++2a default constructible / assignable lambdas.
6759   def warn_cxx17_compat_lambda_def_ctor_assign : Warning<
6760     "%select{default construction|assignment}0 of lambda is incompatible with "
6761     "C++ standards before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
6762 }
6763
6764 def err_return_in_captured_stmt : Error<
6765   "cannot return from %0">;
6766 def err_capture_block_variable : Error<
6767   "__block variable %0 cannot be captured in a "
6768   "%select{lambda expression|captured statement}1">;
6769
6770 def err_operator_arrow_circular : Error<
6771   "circular pointer delegation detected">;
6772 def err_operator_arrow_depth_exceeded : Error<
6773   "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6774   "'operator->' calls">;
6775 def note_operator_arrow_here : Note<
6776   "'operator->' declared here produces an object of type %0">;
6777 def note_operator_arrows_suppressed : Note<
6778   "(skipping %0 'operator->'%s0 in backtrace)">;
6779 def note_operator_arrow_depth : Note<
6780   "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6781
6782 def err_pseudo_dtor_base_not_scalar : Error<
6783   "object expression of non-scalar type %0 cannot be used in a "
6784   "pseudo-destructor expression">;
6785 def ext_pseudo_dtor_on_void : ExtWarn<
6786   "pseudo-destructors on type void are a Microsoft extension">,
6787   InGroup<MicrosoftVoidPseudoDtor>;
6788 def err_pseudo_dtor_type_mismatch : Error<
6789   "the type of object expression "
6790   "%diff{($) does not match the type being destroyed ($)|"
6791   "does not match the type being destroyed}0,1 "
6792   "in pseudo-destructor expression">;
6793 def err_pseudo_dtor_call_with_args : Error<
6794   "call to pseudo-destructor cannot have any arguments">;
6795 def err_dtor_expr_without_call : Error<
6796   "reference to %select{destructor|pseudo-destructor}0 must be called"
6797   "%select{|; did you mean to call it with no arguments?}1">;
6798 def err_pseudo_dtor_destructor_non_type : Error<
6799   "%0 does not refer to a type name in pseudo-destructor expression; expected "
6800   "the name of type %1">;
6801 def err_invalid_use_of_function_type : Error<
6802   "a function type is not allowed here">;
6803 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6804 def err_typecheck_bool_condition : Error<
6805   "value of type %0 is not contextually convertible to 'bool'">;
6806 def err_typecheck_ambiguous_condition : Error<
6807   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6808 def err_typecheck_nonviable_condition : Error<
6809   "no viable conversion%select{%diff{ from $ to $|}1,2|"
6810   "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6811 def err_typecheck_nonviable_condition_incomplete : Error<
6812   "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6813 def err_typecheck_deleted_function : Error<
6814   "conversion function %diff{from $ to $|between types}0,1 "
6815   "invokes a deleted function">;
6816
6817 def err_expected_class_or_namespace : Error<"%0 is not a class"
6818   "%select{ or namespace|, namespace, or enumeration}1">;
6819 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6820   "because namespace %1 does not enclose namespace %2">;
6821 def err_invalid_declarator_global_scope : Error<
6822   "definition or redeclaration of %0 cannot name the global scope">;
6823 def err_invalid_declarator_in_function : Error<
6824   "definition or redeclaration of %0 not allowed inside a function">;
6825 def err_invalid_declarator_in_block : Error<
6826   "definition or redeclaration of %0 not allowed inside a block">;
6827 def err_not_tag_in_scope : Error<
6828   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6829
6830 def err_no_typeid_with_fno_rtti : Error<
6831   "use of typeid requires -frtti">;
6832 def err_no_dynamic_cast_with_fno_rtti : Error<
6833   "use of dynamic_cast requires -frtti">;
6834
6835 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6836   "cannot form a pointer-to-member to member %0 of reference type %1">;
6837 def err_incomplete_object_call : Error<
6838   "incomplete type in call to object of type %0">;
6839
6840 def warn_condition_is_assignment : Warning<"using the result of an "
6841   "assignment as a condition without parentheses">,
6842   InGroup<Parentheses>;
6843 // Completely identical except off by default.
6844 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6845   "of an assignment as a condition without parentheses">,
6846   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6847 def note_condition_assign_to_comparison : Note<
6848   "use '==' to turn this assignment into an equality comparison">;
6849 def note_condition_or_assign_to_comparison : Note<
6850   "use '!=' to turn this compound assignment into an inequality comparison">;
6851 def note_condition_assign_silence : Note<
6852   "place parentheses around the assignment to silence this warning">;
6853
6854 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6855   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6856 def note_equality_comparison_to_assign : Note<
6857   "use '=' to turn this equality comparison into an assignment">;
6858 def note_equality_comparison_silence : Note<
6859   "remove extraneous parentheses around the comparison to silence this warning">;
6860
6861 // assignment related diagnostics (also for argument passing, returning, etc).
6862 // In most of these diagnostics the %2 is a value from the
6863 // Sema::AssignmentAction enumeration
6864 def err_typecheck_convert_incompatible : Error<
6865   "%select{%diff{assigning to $ from incompatible type $|"
6866   "assigning to type from incompatible type}0,1"
6867   "|%diff{passing $ to parameter of incompatible type $|"
6868   "passing type to parameter of incompatible type}0,1"
6869   "|%diff{returning $ from a function with incompatible result type $|"
6870   "returning type from a function with incompatible result type}0,1"
6871   "|%diff{converting $ to incompatible type $|"
6872   "converting type to incompatible type}0,1"
6873   "|%diff{initializing $ with an expression of incompatible type $|"
6874   "initializing type with an expression of incompatible type}0,1"
6875   "|%diff{sending $ to parameter of incompatible type $|"
6876   "sending type to parameter of incompatible type}0,1"
6877   "|%diff{casting $ to incompatible type $|"
6878   "casting type to incompatible type}0,1}2"
6879   "%select{|; dereference with *|"
6880   "; take the address with &|"
6881   "; remove *|"
6882   "; remove &}3"
6883   "%select{|: different classes%diff{ ($ vs $)|}5,6"
6884   "|: different number of parameters (%5 vs %6)"
6885   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6886   "|: different return type%diff{ ($ vs $)|}5,6"
6887   "|: different qualifiers (%5 vs %6)"
6888   "|: different exception specifications}4">;
6889 def err_typecheck_missing_return_type_incompatible : Error<
6890   "%diff{return type $ must match previous return type $|"
6891   "return type must match previous return type}0,1 when %select{block "
6892   "literal|lambda expression}2 has unspecified explicit return type">;
6893
6894 def note_incomplete_class_and_qualified_id : Note<
6895   "conformance of forward class %0 to protocol %1 can not be confirmed">;
6896 def warn_incompatible_qualified_id : Warning<
6897   "%select{%diff{assigning to $ from incompatible type $|"
6898   "assigning to type from incompatible type}0,1"
6899   "|%diff{passing $ to parameter of incompatible type $|"
6900   "passing type to parameter of incompatible type}0,1"
6901   "|%diff{returning $ from a function with incompatible result type $|"
6902   "returning type from a function with incompatible result type}0,1"
6903   "|%diff{converting $ to incompatible type $|"
6904   "converting type to incompatible type}0,1"
6905   "|%diff{initializing $ with an expression of incompatible type $|"
6906   "initializing type with an expression of incompatible type}0,1"
6907   "|%diff{sending $ to parameter of incompatible type $|"
6908   "sending type to parameter of incompatible type}0,1"
6909   "|%diff{casting $ to incompatible type $|"
6910   "casting type to incompatible type}0,1}2">;
6911 def ext_typecheck_convert_pointer_int : ExtWarn<
6912   "incompatible pointer to integer conversion "
6913   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6914   "|%diff{passing $ to parameter of type $|"
6915   "passing to parameter of different type}0,1"
6916   "|%diff{returning $ from a function with result type $|"
6917   "returning from function with different return type}0,1"
6918   "|%diff{converting $ to type $|converting between types}0,1"
6919   "|%diff{initializing $ with an expression of type $|"
6920   "initializing with expression of different type}0,1"
6921   "|%diff{sending $ to parameter of type $|"
6922   "sending to parameter of different type}0,1"
6923   "|%diff{casting $ to type $|casting between types}0,1}2"
6924   "%select{|; dereference with *|"
6925   "; take the address with &|"
6926   "; remove *|"
6927   "; remove &}3">,
6928   InGroup<IntConversion>;
6929 def ext_typecheck_convert_int_pointer : ExtWarn<
6930   "incompatible integer to pointer conversion "
6931   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6932   "|%diff{passing $ to parameter of type $|"
6933   "passing to parameter of different type}0,1"
6934   "|%diff{returning $ from a function with result type $|"
6935   "returning from function with different return type}0,1"
6936   "|%diff{converting $ to type $|converting between types}0,1"
6937   "|%diff{initializing $ with an expression of type $|"
6938   "initializing with expression of different type}0,1"
6939   "|%diff{sending $ to parameter of type $|"
6940   "sending to parameter of different type}0,1"
6941   "|%diff{casting $ to type $|casting between types}0,1}2"
6942   "%select{|; dereference with *|"
6943   "; take the address with &|"
6944   "; remove *|"
6945   "; remove &}3">,
6946   InGroup<IntConversion>, SFINAEFailure;
6947 def ext_typecheck_convert_pointer_void_func : Extension<
6948   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6949   "|%diff{passing $ to parameter of type $|"
6950   "passing to parameter of different type}0,1"
6951   "|%diff{returning $ from a function with result type $|"
6952   "returning from function with different return type}0,1"
6953   "|%diff{converting $ to type $|converting between types}0,1"
6954   "|%diff{initializing $ with an expression of type $|"
6955   "initializing with expression of different type}0,1"
6956   "|%diff{sending $ to parameter of type $|"
6957   "sending to parameter of different type}0,1"
6958   "|%diff{casting $ to type $|casting between types}0,1}2"
6959   " converts between void pointer and function pointer">;
6960 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6961   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6962   "|%diff{passing $ to parameter of type $|"
6963   "passing to parameter of different type}0,1"
6964   "|%diff{returning $ from a function with result type $|"
6965   "returning from function with different return type}0,1"
6966   "|%diff{converting $ to type $|converting between types}0,1"
6967   "|%diff{initializing $ with an expression of type $|"
6968   "initializing with expression of different type}0,1"
6969   "|%diff{sending $ to parameter of type $|"
6970   "sending to parameter of different type}0,1"
6971   "|%diff{casting $ to type $|casting between types}0,1}2"
6972   " converts between pointers to integer types with different sign">,
6973   InGroup<DiagGroup<"pointer-sign">>;
6974 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6975   "incompatible pointer types "
6976   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6977   "|%diff{passing $ to parameter of type $|"
6978   "passing to parameter of different type}0,1"
6979   "|%diff{returning $ from a function with result type $|"
6980   "returning from function with different return type}0,1"
6981   "|%diff{converting $ to type $|converting between types}0,1"
6982   "|%diff{initializing $ with an expression of type $|"
6983   "initializing with expression of different type}0,1"
6984   "|%diff{sending $ to parameter of type $|"
6985   "sending to parameter of different type}0,1"
6986   "|%diff{casting $ to type $|casting between types}0,1}2"
6987   "%select{|; dereference with *|"
6988   "; take the address with &|"
6989   "; remove *|"
6990   "; remove &}3">,
6991   InGroup<IncompatiblePointerTypes>;
6992 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6993   "incompatible function pointer types "
6994   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6995   "|%diff{passing $ to parameter of type $|"
6996   "passing to parameter of different type}0,1"
6997   "|%diff{returning $ from a function with result type $|"
6998   "returning from function with different return type}0,1"
6999   "|%diff{converting $ to type $|converting between types}0,1"
7000   "|%diff{initializing $ with an expression of type $|"
7001   "initializing with expression of different type}0,1"
7002   "|%diff{sending $ to parameter of type $|"
7003   "sending to parameter of different type}0,1"
7004   "|%diff{casting $ to type $|casting between types}0,1}2"
7005   "%select{|; dereference with *|"
7006   "; take the address with &|"
7007   "; remove *|"
7008   "; remove &}3">,
7009   InGroup<IncompatibleFunctionPointerTypes>;
7010 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
7011   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7012   "|%diff{passing $ to parameter of type $|"
7013   "passing to parameter of different type}0,1"
7014   "|%diff{returning $ from a function with result type $|"
7015   "returning from function with different return type}0,1"
7016   "|%diff{converting $ to type $|converting between types}0,1"
7017   "|%diff{initializing $ with an expression of type $|"
7018   "initializing with expression of different type}0,1"
7019   "|%diff{sending $ to parameter of type $|"
7020   "sending to parameter of different type}0,1"
7021   "|%diff{casting $ to type $|casting between types}0,1}2"
7022   " discards qualifiers">,
7023   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7024 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
7025   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7026   "|%diff{passing $ to parameter of type $|"
7027   "passing to parameter of different type}0,1"
7028   "|%diff{returning $ from a function with result type $|"
7029   "returning from function with different return type}0,1"
7030   "|%diff{converting $ to type $|converting between types}0,1"
7031   "|%diff{initializing $ with an expression of type $|"
7032   "initializing with expression of different type}0,1"
7033   "|%diff{sending $ to parameter of type $|"
7034   "sending to parameter of different type}0,1"
7035   "|%diff{casting $ to type $|casting between types}0,1}2"
7036   " discards qualifiers in nested pointer types">,
7037   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
7038 def warn_incompatible_vectors : Warning<
7039   "incompatible vector types "
7040   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7041   "|%diff{passing $ to parameter of type $|"
7042   "passing to parameter of different type}0,1"
7043   "|%diff{returning $ from a function with result type $|"
7044   "returning from function with different return type}0,1"
7045   "|%diff{converting $ to type $|converting between types}0,1"
7046   "|%diff{initializing $ with an expression of type $|"
7047   "initializing with expression of different type}0,1"
7048   "|%diff{sending $ to parameter of type $|"
7049   "sending to parameter of different type}0,1"
7050   "|%diff{casting $ to type $|casting between types}0,1}2">,
7051   InGroup<VectorConversion>, DefaultIgnore;
7052 def err_int_to_block_pointer : Error<
7053   "invalid block pointer conversion "
7054   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7055   "|%diff{passing $ to parameter of type $|"
7056   "passing to parameter of different type}0,1"
7057   "|%diff{returning $ from a function with result type $|"
7058   "returning from function with different return type}0,1"
7059   "|%diff{converting $ to type $|converting between types}0,1"
7060   "|%diff{initializing $ with an expression of type $|"
7061   "initializing with expression of different type}0,1"
7062   "|%diff{sending $ to parameter of type $|"
7063   "sending to parameter of different type}0,1"
7064   "|%diff{casting $ to type $|casting between types}0,1}2">;
7065 def err_typecheck_convert_incompatible_block_pointer : Error<
7066   "incompatible block pointer types "
7067   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
7068   "|%diff{passing $ to parameter of type $|"
7069   "passing to parameter of different type}0,1"
7070   "|%diff{returning $ from a function with result type $|"
7071   "returning from function with different return type}0,1"
7072   "|%diff{converting $ to type $|converting between types}0,1"
7073   "|%diff{initializing $ with an expression of type $|"
7074   "initializing with expression of different type}0,1"
7075   "|%diff{sending $ to parameter of type $|"
7076   "sending to parameter of different type}0,1"
7077   "|%diff{casting $ to type $|casting between types}0,1}2">;
7078 def err_typecheck_incompatible_address_space : Error<
7079   "%select{%diff{assigning $ to $|assigning to different types}1,0"
7080   "|%diff{passing $ to parameter of type $|"
7081   "passing to parameter of different type}0,1"
7082   "|%diff{returning $ from a function with result type $|"
7083   "returning from function with different return type}0,1"
7084   "|%diff{converting $ to type $|converting between types}0,1"
7085   "|%diff{initializing $ with an expression of type $|"
7086   "initializing with expression of different type}0,1"
7087   "|%diff{sending $ to parameter of type $|"
7088   "sending to parameter of different type}0,1"
7089   "|%diff{casting $ to type $|casting between types}0,1}2"
7090   " changes address space of pointer">;
7091 def err_typecheck_incompatible_nested_address_space : Error<
7092   "%select{%diff{assigning $ to $|assigning to different types}1,0"
7093   "|%diff{passing $ to parameter of type $|"
7094   "passing to parameter of different type}0,1"
7095   "|%diff{returning $ from a function with result type $|"
7096   "returning from function with different return type}0,1"
7097   "|%diff{converting $ to type $|converting between types}0,1"
7098   "|%diff{initializing $ with an expression of type $|"
7099   "initializing with expression of different type}0,1"
7100   "|%diff{sending $ to parameter of type $|"
7101   "sending to parameter of different type}0,1"
7102   "|%diff{casting $ to type $|casting between types}0,1}2"
7103   " changes address space of nested pointer">;
7104 def err_typecheck_incompatible_ownership : Error<
7105   "%select{%diff{assigning $ to $|assigning to different types}1,0"
7106   "|%diff{passing $ to parameter of type $|"
7107   "passing to parameter of different type}0,1"
7108   "|%diff{returning $ from a function with result type $|"
7109   "returning from function with different return type}0,1"
7110   "|%diff{converting $ to type $|converting between types}0,1"
7111   "|%diff{initializing $ with an expression of type $|"
7112   "initializing with expression of different type}0,1"
7113   "|%diff{sending $ to parameter of type $|"
7114   "sending to parameter of different type}0,1"
7115   "|%diff{casting $ to type $|casting between types}0,1}2"
7116   " changes retain/release properties of pointer">;
7117 def err_typecheck_comparison_of_distinct_blocks : Error<
7118   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
7119
7120 def err_typecheck_array_not_modifiable_lvalue : Error<
7121   "array type %0 is not assignable">;
7122 def err_typecheck_non_object_not_modifiable_lvalue : Error<
7123   "non-object type %0 is not assignable">;
7124 def err_typecheck_expression_not_modifiable_lvalue : Error<
7125   "expression is not assignable">;
7126 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
7127   "incomplete type %0 is not assignable">;
7128 def err_typecheck_lvalue_casts_not_supported : Error<
7129   "assignment to cast is illegal, lvalue casts are not supported">;
7130
7131 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
7132   "vector is not assignable (contains duplicate components)">;
7133 def err_block_decl_ref_not_modifiable_lvalue : Error<
7134   "variable is not assignable (missing __block type specifier)">;
7135 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
7136   "cannot assign to a variable captured by copy in a non-mutable lambda">;
7137 def err_typecheck_call_not_function : Error<
7138   "called object type %0 is not a function or function pointer">;
7139 def err_call_incomplete_return : Error<
7140   "calling function with incomplete return type %0">;
7141 def err_call_function_incomplete_return : Error<
7142   "calling %0 with incomplete return type %1">;
7143 def err_call_incomplete_argument : Error<
7144   "argument type %0 is incomplete">;
7145 def err_typecheck_call_too_few_args : Error<
7146   "too few %select{|||execution configuration }0arguments to "
7147   "%select{function|block|method|kernel function}0 call, "
7148   "expected %1, have %2">;
7149 def err_typecheck_call_too_few_args_one : Error<
7150   "too few %select{|||execution configuration }0arguments to "
7151   "%select{function|block|method|kernel function}0 call, "
7152   "single argument %1 was not specified">;
7153 def err_typecheck_call_too_few_args_at_least : Error<
7154   "too few %select{|||execution configuration }0arguments to "
7155   "%select{function|block|method|kernel function}0 call, "
7156   "expected at least %1, have %2">;
7157 def err_typecheck_call_too_few_args_at_least_one : Error<
7158   "too few %select{|||execution configuration }0arguments to "
7159   "%select{function|block|method|kernel function}0 call, "
7160   "at least argument %1 must be specified">;
7161 def err_typecheck_call_too_few_args_suggest : Error<
7162   "too few %select{|||execution configuration }0arguments to "
7163   "%select{function|block|method|kernel function}0 call, "
7164   "expected %1, have %2; did you mean %3?">;
7165 def err_typecheck_call_too_few_args_at_least_suggest : Error<
7166   "too few %select{|||execution configuration }0arguments to "
7167   "%select{function|block|method|kernel function}0 call, "
7168   "expected at least %1, have %2; did you mean %3?">;
7169 def err_typecheck_call_too_many_args : Error<
7170   "too many %select{|||execution configuration }0arguments to "
7171   "%select{function|block|method|kernel function}0 call, "
7172   "expected %1, have %2">;
7173 def err_typecheck_call_too_many_args_one : Error<
7174   "too many %select{|||execution configuration }0arguments to "
7175   "%select{function|block|method|kernel function}0 call, "
7176   "expected single argument %1, have %2 arguments">;
7177 def err_typecheck_call_too_many_args_at_most : Error<
7178   "too many %select{|||execution configuration }0arguments to "
7179   "%select{function|block|method|kernel function}0 call, "
7180   "expected at most %1, have %2">;
7181 def err_typecheck_call_too_many_args_at_most_one : Error<
7182   "too many %select{|||execution configuration }0arguments to "
7183   "%select{function|block|method|kernel function}0 call, "
7184   "expected at most single argument %1, have %2 arguments">;
7185 def err_typecheck_call_too_many_args_suggest : Error<
7186   "too many %select{|||execution configuration }0arguments to "
7187   "%select{function|block|method|kernel function}0 call, "
7188   "expected %1, have %2; did you mean %3?">;
7189 def err_typecheck_call_too_many_args_at_most_suggest : Error<
7190   "too many %select{|||execution configuration }0arguments to "
7191   "%select{function|block|method|kernel function}0 call, "
7192   "expected at most %1, have %2; did you mean %3?">;
7193
7194 def err_arc_typecheck_convert_incompatible_pointer : Error<
7195   "incompatible pointer types passing retainable parameter of type %0"
7196   "to a CF function expecting %1 type">;
7197
7198 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
7199
7200 def warn_call_wrong_number_of_arguments : Warning<
7201   "too %select{few|many}0 arguments in call to %1">;
7202 def err_atomic_builtin_must_be_pointer : Error<
7203   "address argument to atomic builtin must be a pointer (%0 invalid)">;
7204 def err_atomic_builtin_must_be_pointer_intptr : Error<
7205   "address argument to atomic builtin must be a pointer to integer or pointer"
7206   " (%0 invalid)">;
7207 def err_atomic_builtin_cannot_be_const : Error<
7208   "address argument to atomic builtin cannot be const-qualified (%0 invalid)">;
7209 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
7210   "address argument to atomic builtin must be a pointer to integer,"
7211   " floating-point or pointer (%0 invalid)">;
7212 def err_atomic_builtin_pointer_size : Error<
7213   "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
7214   "type (%0 invalid)">;
7215 def err_atomic_exclusive_builtin_pointer_size : Error<
7216   "address argument to load or store exclusive builtin must be a pointer to"
7217   " 1,2,4 or 8 byte type (%0 invalid)">;
7218 def err_atomic_op_needs_atomic : Error<
7219   "address argument to atomic operation must be a pointer to _Atomic "
7220   "type (%0 invalid)">;
7221 def err_atomic_op_needs_non_const_atomic : Error<
7222   "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
7223   "type (%1 invalid)">;
7224 def err_atomic_op_needs_non_const_pointer : Error<
7225   "address argument to atomic operation must be a pointer to non-const "
7226   "type (%0 invalid)">;
7227 def err_atomic_op_needs_trivial_copy : Error<
7228   "address argument to atomic operation must be a pointer to a "
7229   "trivially-copyable type (%0 invalid)">;
7230 def err_atomic_op_needs_atomic_int_or_ptr : Error<
7231   "address argument to atomic operation must be a pointer to %select{|atomic }0"
7232   "integer or pointer (%1 invalid)">;
7233 def err_atomic_op_needs_int32_or_ptr : Error<
7234   "address argument to atomic operation must be a pointer to signed or unsigned 32-bit integer">;
7235 def err_atomic_op_bitwise_needs_atomic_int : Error<
7236   "address argument to bitwise atomic operation must be a pointer to "
7237   "%select{|atomic }0integer (%1 invalid)">;
7238 def warn_atomic_op_has_invalid_memory_order : Warning<
7239   "memory order argument to atomic operation is invalid">,
7240   InGroup<DiagGroup<"atomic-memory-ordering">>;
7241 def err_atomic_op_has_invalid_synch_scope : Error<
7242   "synchronization scope argument to atomic operation is invalid">;
7243 def warn_atomic_implicit_seq_cst : Warning<
7244   "implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary">,
7245   InGroup<DiagGroup<"atomic-implicit-seq-cst">>, DefaultIgnore;
7246
7247 def err_overflow_builtin_must_be_int : Error<
7248   "operand argument to overflow builtin must be an integer (%0 invalid)">;
7249 def err_overflow_builtin_must_be_ptr_int : Error<
7250   "result argument to overflow builtin must be a pointer "
7251   "to a non-const integer (%0 invalid)">;
7252
7253 def err_atomic_load_store_uses_lib : Error<
7254   "atomic %select{load|store}0 requires runtime support that is not "
7255   "available for this target">;
7256
7257 def err_nontemporal_builtin_must_be_pointer : Error<
7258   "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
7259 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
7260   "address argument to nontemporal builtin must be a pointer to integer, float, "
7261   "pointer, or a vector of such types (%0 invalid)">;
7262
7263 def err_deleted_function_use : Error<"attempt to use a deleted function">;
7264 def err_deleted_inherited_ctor_use : Error<
7265   "constructor inherited by %0 from base class %1 is implicitly deleted">;
7266
7267 def note_called_by : Note<"called by %0">;
7268 def err_kern_type_not_void_return : Error<
7269   "kernel function type %0 must have void return type">;
7270 def err_kern_is_nonstatic_method : Error<
7271   "kernel function %0 must be a free function or static member function">;
7272 def err_config_scalar_return : Error<
7273   "CUDA special function '%0' must have scalar return type">;
7274 def err_kern_call_not_global_function : Error<
7275   "kernel call to non-global function %0">;
7276 def err_global_call_not_config : Error<
7277   "call to global function %0 not configured">;
7278 def err_ref_bad_target : Error<
7279   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7280   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
7281 def err_ref_bad_target_global_initializer : Error<
7282   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7283   "function %1 in global initializer">;
7284 def warn_kern_is_method : Extension<
7285   "kernel function %0 is a member function; this may not be accepted by nvcc">,
7286   InGroup<CudaCompat>;
7287 def warn_kern_is_inline : Warning<
7288   "ignored 'inline' attribute on kernel function %0">,
7289   InGroup<CudaCompat>;
7290 def err_variadic_device_fn : Error<
7291   "CUDA device code does not support variadic functions">;
7292 def err_va_arg_in_device : Error<
7293   "CUDA device code does not support va_arg">;
7294 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
7295 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
7296   "constexpr function %0 without __host__ or __device__ attributes cannot "
7297   "overload __device__ function with same signature.  Add a __host__ "
7298   "attribute, or build with -fno-cuda-host-device-constexpr.">;
7299 def note_cuda_conflicting_device_function_declared_here : Note<
7300   "conflicting __device__ function declared here">;
7301 def err_cuda_device_exceptions : Error<
7302   "cannot use '%0' in "
7303   "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
7304 def err_dynamic_var_init : Error<
7305     "dynamic initialization is not supported for "
7306     "__device__, __constant__, and __shared__ variables.">;
7307 def err_shared_var_init : Error<
7308     "initialization is not supported for __shared__ variables.">;
7309 def err_device_static_local_var : Error<
7310     "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
7311     "function, only __shared__ variables or const variables without device "
7312     "memory qualifier may be marked 'static'">;
7313 def err_cuda_vla : Error<
7314     "cannot use variable-length arrays in "
7315     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7316 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
7317 def err_cuda_host_shared : Error<
7318     "__shared__ local variables not allowed in "
7319     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7320 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
7321 def err_cuda_ovl_target : Error<
7322   "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
7323   "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
7324 def note_cuda_ovl_candidate_target_mismatch : Note<
7325     "candidate template ignored: target attributes do not match">;
7326
7327 def warn_non_pod_vararg_with_format_string : Warning<
7328   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
7329   "%select{function|block|method|constructor}2; expected type from format "
7330   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
7331 // The arguments to this diagnostic should match the warning above.
7332 def err_cannot_pass_objc_interface_to_vararg_format : Error<
7333   "cannot pass object with interface type %1 by value to variadic "
7334   "%select{function|block|method|constructor}2; expected type from format "
7335   "string was %3">;
7336 def err_cannot_pass_non_trivial_c_struct_to_vararg : Error<
7337   "cannot pass non-trivial C object of type %0 by value to variadic "
7338   "%select{function|block|method|constructor}1">;
7339
7340
7341 def err_cannot_pass_objc_interface_to_vararg : Error<
7342   "cannot pass object with interface type %0 by value through variadic "
7343   "%select{function|block|method|constructor}1">;
7344 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
7345   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
7346   " %select{function|block|method|constructor}2; call will abort at runtime">,
7347   InGroup<NonPODVarargs>, DefaultError;
7348 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
7349   "passing object of trivial but non-POD type %0 through variadic"
7350   " %select{function|block|method|constructor}1 is incompatible with C++98">,
7351   InGroup<CXX98Compat>, DefaultIgnore;
7352 def warn_pass_class_arg_to_vararg : Warning<
7353   "passing object of class type %0 through variadic "
7354   "%select{function|block|method|constructor}1"
7355   "%select{|; did you mean to call '%3'?}2">,
7356   InGroup<ClassVarargs>, DefaultIgnore;
7357 def err_cannot_pass_to_vararg : Error<
7358   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7359   "%select{function|block|method|constructor}2">;
7360 def err_cannot_pass_to_vararg_format : Error<
7361   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7362   "%select{function|block|method|constructor}2; expected type from format "
7363   "string was %3">;
7364
7365 def err_typecheck_call_invalid_ordered_compare : Error<
7366   "ordered compare requires two args of floating point type"
7367   "%diff{ ($ and $)|}0,1">;
7368 def err_typecheck_call_invalid_unary_fp : Error<
7369   "floating point classification requires argument of floating point type "
7370   "(passed in %0)">;
7371 def err_typecheck_cond_expect_int_float : Error<
7372   "used type %0 where integer or floating point type is required">;
7373 def err_typecheck_cond_expect_scalar : Error<
7374   "used type %0 where arithmetic or pointer type is required">;
7375 def err_typecheck_cond_expect_nonfloat : Error<
7376   "used type %0 where floating point type is not allowed">;
7377 def ext_typecheck_cond_one_void : Extension<
7378   "C99 forbids conditional expressions with only one void side">;
7379 def err_typecheck_cast_to_incomplete : Error<
7380   "cast to incomplete type %0">;
7381 def ext_typecheck_cast_nonscalar : Extension<
7382   "C99 forbids casting nonscalar type %0 to the same type">;
7383 def ext_typecheck_cast_to_union : Extension<
7384   "cast to union type is a GNU extension">,
7385   InGroup<GNUUnionCast>;
7386 def err_typecheck_cast_to_union_no_type : Error<
7387   "cast to union type from type %0 not present in union">;
7388 def err_cast_pointer_from_non_pointer_int : Error<
7389   "operand of type %0 cannot be cast to a pointer type">;
7390 def warn_cast_pointer_from_sel : Warning<
7391   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
7392   InGroup<SelTypeCast>;
7393 def warn_function_def_in_objc_container : Warning<
7394   "function definition inside an Objective-C container is deprecated">,
7395   InGroup<FunctionDefInObjCContainer>;
7396
7397 def warn_cast_calling_conv : Warning<
7398   "cast between incompatible calling conventions '%0' and '%1'; "
7399   "calls through this pointer may abort at runtime">,
7400   InGroup<DiagGroup<"cast-calling-convention">>;
7401 def note_change_calling_conv_fixit : Note<
7402   "consider defining %0 with the '%1' calling convention">;
7403 def warn_bad_function_cast : Warning<
7404   "cast from function call of type %0 to non-matching type %1">,
7405   InGroup<BadFunctionCast>, DefaultIgnore;
7406 def err_cast_pointer_to_non_pointer_int : Error<
7407   "pointer cannot be cast to type %0">;
7408 def err_typecheck_expect_scalar_operand : Error<
7409   "operand of type %0 where arithmetic or pointer type is required">;
7410 def err_typecheck_cond_incompatible_operands : Error<
7411   "incompatible operand types%diff{ ($ and $)|}0,1">;
7412 def err_cast_selector_expr : Error<
7413   "cannot type cast @selector expression">;
7414 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
7415   "pointer type mismatch%diff{ ($ and $)|}0,1">,
7416   InGroup<DiagGroup<"pointer-type-mismatch">>;
7417 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
7418   "pointer/integer type mismatch in conditional expression"
7419   "%diff{ ($ and $)|}0,1">,
7420   InGroup<DiagGroup<"conditional-type-mismatch">>;
7421 def err_typecheck_choose_expr_requires_constant : Error<
7422   "'__builtin_choose_expr' requires a constant expression">;
7423 def warn_unused_expr : Warning<"expression result unused">,
7424   InGroup<UnusedValue>;
7425 def warn_unused_voidptr : Warning<
7426   "expression result unused; should this cast be to 'void'?">,
7427   InGroup<UnusedValue>;
7428 def warn_unused_property_expr : Warning<
7429  "property access result unused - getters should not be used for side effects">,
7430   InGroup<UnusedGetterReturnValue>;
7431 def warn_unused_container_subscript_expr : Warning<
7432  "container access result unused - container access should not be used for side effects">,
7433   InGroup<UnusedValue>;
7434 def warn_unused_call : Warning<
7435   "ignoring return value of function declared with %0 attribute">,
7436   InGroup<UnusedValue>;
7437 def warn_side_effects_unevaluated_context : Warning<
7438   "expression with side effects has no effect in an unevaluated context">,
7439   InGroup<UnevaluatedExpression>;
7440 def warn_side_effects_typeid : Warning<
7441   "expression with side effects will be evaluated despite being used as an "
7442   "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
7443 def warn_unused_result : Warning<
7444   "ignoring return value of function declared with %0 attribute">,
7445   InGroup<UnusedResult>;
7446 def warn_unused_volatile : Warning<
7447   "expression result unused; assign into a variable to force a volatile load">,
7448   InGroup<DiagGroup<"unused-volatile-lvalue">>;
7449
7450 def ext_cxx14_attr : Extension<
7451   "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
7452 def ext_cxx17_attr : Extension<
7453   "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
7454
7455 def warn_unused_comparison : Warning<
7456   "%select{equality|inequality|relational|three-way}0 comparison result unused">,
7457   InGroup<UnusedComparison>;
7458 def note_inequality_comparison_to_or_assign : Note<
7459   "use '|=' to turn this inequality comparison into an or-assignment">;
7460
7461 def err_incomplete_type_used_in_type_trait_expr : Error<
7462   "incomplete type %0 used in type trait expression">;
7463
7464 def err_require_constant_init_failed : Error<
7465   "variable does not have a constant initializer">;
7466 def note_declared_required_constant_init_here : Note<
7467   "required by 'require_constant_initialization' attribute here">;
7468
7469 def err_dimension_expr_not_constant_integer : Error<
7470   "dimension expression does not evaluate to a constant unsigned int">;
7471
7472 def err_typecheck_cond_incompatible_operands_null : Error<
7473   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7474 def ext_empty_struct_union : Extension<
7475   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7476 def ext_no_named_members_in_struct_union : Extension<
7477   "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7478 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7479   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7480   InGroup<CXXCompat>, DefaultIgnore;
7481 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7482   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7483   InGroup<ExternCCompat>;
7484 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7485   "volatile qualifiers|const qualifier|volatile qualifier}2">,
7486   InGroup<CastQual>, DefaultIgnore;
7487 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7488   "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7489 def warn_redefine_extname_not_applied : Warning<
7490   "#pragma redefine_extname is applicable to external C declarations only; "
7491   "not applied to %select{function|variable}0 %1">,
7492   InGroup<Pragmas>;
7493 } // End of general sema category.
7494
7495 // inline asm.
7496 let CategoryName = "Inline Assembly Issue" in {
7497   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7498   def err_asm_invalid_output_constraint : Error<
7499     "invalid output constraint '%0' in asm">;
7500   def err_asm_invalid_lvalue_in_input : Error<
7501     "invalid lvalue in asm input for constraint '%0'">;
7502   def err_asm_invalid_input_constraint : Error<
7503     "invalid input constraint '%0' in asm">;
7504   def err_asm_immediate_expected : Error<"constraint '%0' expects "
7505     "an integer constant expression">;
7506   def err_asm_tying_incompatible_types : Error<
7507     "unsupported inline asm: input with type "
7508     "%diff{$ matching output with type $|}0,1">;
7509   def err_asm_unexpected_constraint_alternatives : Error<
7510     "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7511   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7512   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7513   def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7514     "global register variables on this target">;
7515   def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7516     "match variable size">;
7517   def err_asm_bad_register_type : Error<"bad type for named register variable">;
7518   def err_asm_invalid_input_size : Error<
7519     "invalid input size for constraint '%0'">;
7520   def err_asm_invalid_output_size : Error<
7521     "invalid output size for constraint '%0'">;
7522   def err_invalid_asm_cast_lvalue : Error<
7523     "invalid use of a cast in a inline asm context requiring an l-value: "
7524     "remove the cast or build with -fheinous-gnu-extensions">;
7525   def err_invalid_asm_value_for_constraint
7526       : Error <"value '%0' out of range for constraint '%1'">;
7527   def err_asm_non_addr_value_in_memory_constraint : Error <
7528     "reference to a %select{bit-field|vector element|global register variable}0"
7529     " in asm %select{input|output}1 with a memory constraint '%2'">;
7530   def err_asm_input_duplicate_match : Error<
7531     "more than one input constraint matches the same output '%0'">;
7532
7533   def warn_asm_label_on_auto_decl : Warning<
7534     "ignored asm label '%0' on automatic variable">;
7535   def warn_invalid_asm_cast_lvalue : Warning<
7536     "invalid use of a cast in an inline asm context requiring an l-value: "
7537     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7538     "for this in the future">;
7539   def warn_asm_mismatched_size_modifier : Warning<
7540     "value size does not match register size specified by the constraint "
7541     "and modifier">,
7542     InGroup<ASMOperandWidths>;
7543
7544   def note_asm_missing_constraint_modifier : Note<
7545     "use constraint modifier \"%0\"">;
7546   def note_asm_input_duplicate_first : Note<
7547     "constraint '%0' is already present here">;
7548  def error_duplicate_asm_operand_name : Error<
7549     "duplicate use of asm operand name \"%0\"">;
7550  def note_duplicate_asm_operand_name : Note<
7551     "asm operand name \"%0\" first referenced here">;
7552 }
7553
7554   def error_inoutput_conflict_with_clobber : Error<
7555     "asm-specifier for input or output variable conflicts with asm"
7556     " clobber list">;
7557
7558 let CategoryName = "Semantic Issue" in {
7559
7560 def err_invalid_conversion_between_vectors : Error<
7561   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7562   "size">;
7563 def err_invalid_conversion_between_vector_and_integer : Error<
7564   "invalid conversion between vector type %0 and integer type %1 "
7565   "of different size">;
7566
7567 def err_opencl_function_pointer : Error<
7568   "pointers to functions are not allowed">;
7569
7570 def err_opencl_taking_address_capture : Error<
7571   "taking address of a capture is not allowed">;
7572
7573 def err_invalid_conversion_between_vector_and_scalar : Error<
7574   "invalid conversion between vector type %0 and scalar type %1">;
7575
7576 // C++ member initializers.
7577 def err_only_constructors_take_base_inits : Error<
7578   "only constructors take base initializers">;
7579
7580 def err_multiple_mem_initialization : Error <
7581   "multiple initializations given for non-static member %0">;
7582 def err_multiple_mem_union_initialization : Error <
7583   "initializing multiple members of union">;
7584 def err_multiple_base_initialization : Error <
7585   "multiple initializations given for base %0">;
7586
7587 def err_mem_init_not_member_or_class : Error<
7588   "member initializer %0 does not name a non-static data member or base "
7589   "class">;
7590
7591 def warn_initializer_out_of_order : Warning<
7592   "%select{field|base class}0 %1 will be initialized after "
7593   "%select{field|base}2 %3">,
7594   InGroup<Reorder>, DefaultIgnore;
7595 def warn_abstract_vbase_init_ignored : Warning<
7596   "initializer for virtual base class %0 of abstract class %1 "
7597   "will never be used">,
7598   InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7599
7600 def err_base_init_does_not_name_class : Error<
7601   "constructor initializer %0 does not name a class">;
7602 def err_base_init_direct_and_virtual : Error<
7603   "base class initializer %0 names both a direct base class and an "
7604   "inherited virtual base class">;
7605 def err_not_direct_base_or_virtual : Error<
7606   "type %0 is not a direct or virtual base of %1">;
7607
7608 def err_in_class_initializer_non_const : Error<
7609   "non-const static data member must be initialized out of line">;
7610 def err_in_class_initializer_volatile : Error<
7611   "static const volatile data member must be initialized out of line">;
7612 def err_in_class_initializer_bad_type : Error<
7613   "static data member of type %0 must be initialized out of line">;
7614 def ext_in_class_initializer_float_type : ExtWarn<
7615   "in-class initializer for static data member of type %0 is a GNU extension">,
7616   InGroup<GNUStaticFloatInit>;
7617 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7618   "in-class initializer for static data member of type %0 requires "
7619   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7620 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7621 def err_in_class_initializer_literal_type : Error<
7622   "in-class initializer for static data member of type %0 requires "
7623   "'constexpr' specifier">;
7624 def err_in_class_initializer_non_constant : Error<
7625   "in-class initializer for static data member is not a constant expression">;
7626 def err_in_class_initializer_not_yet_parsed : Error<
7627   "default member initializer for %1 needed within definition of enclosing "
7628   "class %0 outside of member functions">;
7629 def note_in_class_initializer_not_yet_parsed : Note<
7630   "default member initializer declared here">;
7631 def err_in_class_initializer_cycle
7632     : Error<"default member initializer for %0 uses itself">;
7633
7634 def ext_in_class_initializer_non_constant : Extension<
7635   "in-class initializer for static data member is not a constant expression; "
7636   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7637
7638 def err_thread_dynamic_init : Error<
7639   "initializer for thread-local variable must be a constant expression">;
7640 def err_thread_nontrivial_dtor : Error<
7641   "type of thread-local variable has non-trivial destruction">;
7642 def note_use_thread_local : Note<
7643   "use 'thread_local' to allow this">;
7644
7645 // C++ anonymous unions and GNU anonymous structs/unions
7646 def ext_anonymous_union : Extension<
7647   "anonymous unions are a C11 extension">, InGroup<C11>;
7648 def ext_gnu_anonymous_struct : Extension<
7649   "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7650 def ext_c11_anonymous_struct : Extension<
7651   "anonymous structs are a C11 extension">, InGroup<C11>;
7652 def err_anonymous_union_not_static : Error<
7653   "anonymous unions at namespace or global scope must be declared 'static'">;
7654 def err_anonymous_union_with_storage_spec : Error<
7655   "anonymous union at class scope must not have a storage specifier">;
7656 def err_anonymous_struct_not_member : Error<
7657   "anonymous %select{structs|structs and classes}0 must be "
7658   "%select{struct or union|class}0 members">;
7659 def err_anonymous_record_member_redecl : Error<
7660   "member of anonymous %select{struct|union}0 redeclares %1">;
7661 def err_anonymous_record_with_type : Error<
7662   "types cannot be declared in an anonymous %select{struct|union}0">;
7663 def ext_anonymous_record_with_type : Extension<
7664   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7665   "extension">, InGroup<MicrosoftAnonTag>;
7666 def ext_anonymous_record_with_anonymous_type : Extension<
7667   "anonymous types declared in an anonymous %select{struct|union}0 "
7668   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7669 def err_anonymous_record_with_function : Error<
7670   "functions cannot be declared in an anonymous %select{struct|union}0">;
7671 def err_anonymous_record_with_static : Error<
7672   "static members cannot be declared in an anonymous %select{struct|union}0">;
7673 def err_anonymous_record_bad_member : Error<
7674   "anonymous %select{struct|union}0 can only contain non-static data members">;
7675 def err_anonymous_record_nonpublic_member : Error<
7676   "anonymous %select{struct|union}0 cannot contain a "
7677   "%select{private|protected}1 data member">;
7678 def ext_ms_anonymous_record : ExtWarn<
7679   "anonymous %select{structs|unions}0 are a Microsoft extension">,
7680   InGroup<MicrosoftAnonTag>;
7681
7682 // C++ local classes
7683 def err_reference_to_local_in_enclosing_context : Error<
7684   "reference to local %select{variable|binding}1 %0 declared in enclosing "
7685   "%select{%3|block literal|lambda expression|context}2">;
7686
7687 def err_static_data_member_not_allowed_in_local_class : Error<
7688   "static data member %0 not allowed in local class %1">;
7689
7690 // C++ derived classes
7691 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7692 def err_base_must_be_class : Error<"base specifier must name a class">;
7693 def err_union_as_base_class : Error<"unions cannot be base classes">;
7694 def err_circular_inheritance : Error<
7695   "circular inheritance between %0 and %1">;
7696 def err_base_class_has_flexible_array_member : Error<
7697   "base class %0 has a flexible array member">;
7698 def err_incomplete_base_class : Error<"base class has incomplete type">;
7699 def err_duplicate_base_class : Error<
7700   "base class %0 specified more than once as a direct base class">;
7701 def warn_inaccessible_base_class : Warning<
7702   "direct base %0 is inaccessible due to ambiguity:%1">,
7703   InGroup<DiagGroup<"inaccessible-base">>;
7704 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
7705 def err_ambiguous_derived_to_base_conv : Error<
7706   "ambiguous conversion from derived class %0 to base class %1:%2">;
7707 def err_ambiguous_memptr_conv : Error<
7708   "ambiguous conversion from pointer to member of %select{base|derived}0 "
7709   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7710 def ext_ms_ambiguous_direct_base : ExtWarn<
7711   "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
7712   InGroup<MicrosoftInaccessibleBase>;
7713
7714 def err_memptr_conv_via_virtual : Error<
7715   "conversion from pointer to member of class %0 to pointer to member "
7716   "of class %1 via virtual base %2 is not allowed">;
7717
7718 // C++ member name lookup
7719 def err_ambiguous_member_multiple_subobjects : Error<
7720   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7721 def err_ambiguous_member_multiple_subobject_types : Error<
7722   "member %0 found in multiple base classes of different types">;
7723 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7724 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7725 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7726 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7727   "declaration in a different namespace">;
7728 def note_hidden_tag : Note<"type declaration hidden">;
7729 def note_hiding_object : Note<"declaration hides type">;
7730
7731 // C++ operator overloading
7732 def err_operator_overload_needs_class_or_enum : Error<
7733   "overloaded %0 must have at least one parameter of class "
7734   "or enumeration type">;
7735
7736 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7737 def err_operator_overload_static : Error<
7738   "overloaded %0 cannot be a static member function">;
7739 def err_operator_overload_default_arg : Error<
7740   "parameter of overloaded %0 cannot have a default argument">;
7741 def err_operator_overload_must_be : Error<
7742   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7743   "(has %1 parameter%s1)">;
7744
7745 def err_operator_overload_must_be_member : Error<
7746   "overloaded %0 must be a non-static member function">;
7747 def err_operator_overload_post_incdec_must_be_int : Error<
7748   "parameter of overloaded post-%select{increment|decrement}1 operator must "
7749   "have type 'int' (not %0)">;
7750
7751 // C++ allocation and deallocation functions.
7752 def err_operator_new_delete_declared_in_namespace : Error<
7753   "%0 cannot be declared inside a namespace">;
7754 def err_operator_new_delete_declared_static : Error<
7755   "%0 cannot be declared static in global scope">;
7756 def ext_operator_new_delete_declared_inline : ExtWarn<
7757   "replacement function %0 cannot be declared 'inline'">,
7758   InGroup<DiagGroup<"inline-new-delete">>;
7759 def err_operator_new_delete_invalid_result_type : Error<
7760   "%0 must return type %1">;
7761 def err_operator_new_delete_dependent_result_type : Error<
7762   "%0 cannot have a dependent return type; use %1 instead">;
7763 def err_operator_new_delete_too_few_parameters : Error<
7764   "%0 must have at least one parameter">;
7765 def err_operator_new_delete_template_too_few_parameters : Error<
7766   "%0 template must have at least two parameters">;
7767 def warn_operator_new_returns_null : Warning<
7768   "%0 should not return a null pointer unless it is declared 'throw()'"
7769   "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7770
7771 def err_operator_new_dependent_param_type : Error<
7772   "%0 cannot take a dependent type as first parameter; "
7773   "use size_t (%1) instead">;
7774 def err_operator_new_param_type : Error<
7775   "%0 takes type size_t (%1) as first parameter">;
7776 def err_operator_new_default_arg: Error<
7777   "parameter of %0 cannot have a default argument">;
7778 def err_operator_delete_dependent_param_type : Error<
7779   "%0 cannot take a dependent type as first parameter; use %1 instead">;
7780 def err_operator_delete_param_type : Error<
7781   "first parameter of %0 must have type %1">;
7782 def err_destroying_operator_delete_not_usual : Error<
7783   "destroying operator delete can have only an optional size and optional "
7784   "alignment parameter">;
7785 def note_implicit_delete_this_in_destructor_here : Note<
7786   "while checking implicit 'delete this' for virtual destructor">;
7787 def err_builtin_operator_new_delete_not_usual : Error<
7788   "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' "
7789   "selects non-usual %select{allocation|deallocation}0 function">;
7790 def note_non_usual_function_declared_here : Note<
7791   "non-usual %0 declared here">;
7792
7793 // C++ literal operators
7794 def err_literal_operator_outside_namespace : Error<
7795   "literal operator %0 must be in a namespace or global scope">;
7796 def err_literal_operator_id_outside_namespace : Error<
7797   "non-namespace scope '%0' cannot have a literal operator member">;
7798 def err_literal_operator_default_argument : Error<
7799   "literal operator cannot have a default argument">;
7800 def err_literal_operator_bad_param_count : Error<
7801   "non-template literal operator must have one or two parameters">;
7802 def err_literal_operator_invalid_param : Error<
7803   "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7804 def err_literal_operator_param : Error<
7805   "invalid literal operator parameter type %0, did you mean %1?">;
7806 def err_literal_operator_template_with_params : Error<
7807   "literal operator template cannot have any parameters">;
7808 def err_literal_operator_template : Error<
7809   "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7810 def err_literal_operator_extern_c : Error<
7811   "literal operator must have C++ linkage">;
7812 def ext_string_literal_operator_template : ExtWarn<
7813   "string literal operator templates are a GNU extension">,
7814   InGroup<GNUStringLiteralOperatorTemplate>;
7815 def warn_user_literal_reserved : Warning<
7816   "user-defined literal suffixes not starting with '_' are reserved"
7817   "%select{; no literal will invoke this operator|}0">,
7818   InGroup<UserDefinedLiterals>;
7819
7820 // C++ conversion functions
7821 def err_conv_function_not_member : Error<
7822   "conversion function must be a non-static member function">;
7823 def err_conv_function_return_type : Error<
7824   "conversion function cannot have a return type">;
7825 def err_conv_function_with_params : Error<
7826   "conversion function cannot have any parameters">;
7827 def err_conv_function_variadic : Error<
7828   "conversion function cannot be variadic">;
7829 def err_conv_function_to_array : Error<
7830   "conversion function cannot convert to an array type">;
7831 def err_conv_function_to_function : Error<
7832   "conversion function cannot convert to a function type">;
7833 def err_conv_function_with_complex_decl : Error<
7834   "cannot specify any part of a return type in the "
7835   "declaration of a conversion function"
7836   "%select{"
7837   "; put the complete type after 'operator'|"
7838   "; use a typedef to declare a conversion to %1|"
7839   "; use an alias template to declare a conversion to %1|"
7840   "}0">;
7841 def err_conv_function_redeclared : Error<
7842   "conversion function cannot be redeclared">;
7843 def warn_conv_to_self_not_used : Warning<
7844   "conversion function converting %0 to itself will never be used">;
7845 def warn_conv_to_base_not_used : Warning<
7846   "conversion function converting %0 to its base class %1 will never be used">;
7847 def warn_conv_to_void_not_used : Warning<
7848   "conversion function converting %0 to %1 will never be used">;
7849
7850 def warn_not_compound_assign : Warning<
7851   "use of unary operator that may be intended as compound assignment (%0=)">;
7852
7853 // C++11 explicit conversion operators
7854 def ext_explicit_conversion_functions : ExtWarn<
7855   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7856 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7857   "explicit conversion functions are incompatible with C++98">,
7858   InGroup<CXX98Compat>, DefaultIgnore;
7859
7860 // C++11 defaulted functions
7861 def err_defaulted_special_member_params : Error<
7862   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7863   "have default arguments">;
7864 def err_defaulted_special_member_variadic : Error<
7865   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7866   "be variadic">;
7867 def err_defaulted_special_member_return_type : Error<
7868   "explicitly-defaulted %select{copy|move}0 assignment operator must "
7869   "return %1">;
7870 def err_defaulted_special_member_quals : Error<
7871   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7872   "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7873 def err_defaulted_special_member_volatile_param : Error<
7874   "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 "
7875   "may not be volatile">;
7876 def err_defaulted_special_member_move_const_param : Error<
7877   "the parameter for an explicitly-defaulted move "
7878   "%select{constructor|assignment operator}0 may not be const">;
7879 def err_defaulted_special_member_copy_const_param : Error<
7880   "the parameter for this explicitly-defaulted copy "
7881   "%select{constructor|assignment operator}0 is const, but a member or base "
7882   "requires it to be non-const">;
7883 def err_defaulted_copy_assign_not_ref : Error<
7884   "the parameter for an explicitly-defaulted copy assignment operator must be an "
7885   "lvalue reference type">;
7886 def err_incorrect_defaulted_constexpr : Error<
7887   "defaulted definition of %sub{select_special_member_kind}0 "
7888   "is not constexpr">;
7889 def err_incorrect_defaulted_consteval : Error<
7890   "defaulted declaration of %sub{select_special_member_kind}0 "
7891   "cannot be consteval because implicit definition is not constexpr">;
7892 def warn_defaulted_method_deleted : Warning<
7893   "explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
7894   "deleted">, InGroup<DiagGroup<"defaulted-function-deleted">>;
7895 def err_out_of_line_default_deletes : Error<
7896   "defaulting this %sub{select_special_member_kind}0 "
7897   "would delete it after its first declaration">;
7898 def note_deleted_type_mismatch : Note<
7899   "function is implicitly deleted because its declared type does not match "
7900   "the type of an implicit %sub{select_special_member_kind}0">;
7901 def warn_cxx17_compat_defaulted_method_type_mismatch : Warning<
7902   "explicitly defaulting this %sub{select_special_member_kind}0 with a type "
7903   "different from the implicit type is incompatible with C++ standards before "
7904   "C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
7905 def warn_vbase_moved_multiple_times : Warning<
7906   "defaulted move assignment operator of %0 will move assign virtual base "
7907   "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7908 def note_vbase_moved_here : Note<
7909   "%select{%1 is a virtual base class of base class %2 declared here|"
7910   "virtual base class %1 declared here}0">;
7911
7912 def ext_implicit_exception_spec_mismatch : ExtWarn<
7913   "function previously declared with an %select{explicit|implicit}0 exception "
7914   "specification redeclared with an %select{implicit|explicit}0 exception "
7915   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7916
7917 def warn_ptr_arith_precedes_bounds : Warning<
7918   "the pointer decremented by %0 refers before the beginning of the array">,
7919   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7920 def warn_ptr_arith_exceeds_bounds : Warning<
7921   "the pointer incremented by %0 refers past the end of the array (that "
7922   "contains %1 element%s2)">,
7923   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7924 def warn_array_index_precedes_bounds : Warning<
7925   "array index %0 is before the beginning of the array">,
7926   InGroup<ArrayBounds>;
7927 def warn_array_index_exceeds_bounds : Warning<
7928   "array index %0 is past the end of the array (which contains %1 "
7929   "element%s2)">, InGroup<ArrayBounds>;
7930 def note_array_index_out_of_bounds : Note<
7931   "array %0 declared here">;
7932
7933 def warn_printf_insufficient_data_args : Warning<
7934   "more '%%' conversions than data arguments">, InGroup<Format>;
7935 def warn_printf_data_arg_not_used : Warning<
7936   "data argument not used by format string">, InGroup<FormatExtraArgs>;
7937 def warn_format_invalid_conversion : Warning<
7938   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7939 def warn_printf_incomplete_specifier : Warning<
7940   "incomplete format specifier">, InGroup<Format>;
7941 def warn_missing_format_string : Warning<
7942   "format string missing">, InGroup<Format>;
7943 def warn_scanf_nonzero_width : Warning<
7944   "zero field width in scanf format string is unused">,
7945   InGroup<Format>;
7946 def warn_format_conversion_argument_type_mismatch : Warning<
7947   "format specifies type %0 but the argument has "
7948   "%select{type|underlying type}2 %1">,
7949   InGroup<Format>;
7950 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7951   "format specifies type %0 but the argument has "
7952   "%select{type|underlying type}2 %1">,
7953   InGroup<FormatPedantic>;
7954 def warn_format_argument_needs_cast : Warning<
7955   "%select{values of type|enum values with underlying type}2 '%0' should not "
7956   "be used as format arguments; add an explicit cast to %1 instead">,
7957   InGroup<Format>;
7958 def warn_format_argument_needs_cast_pedantic : Warning<
7959   "%select{values of type|enum values with underlying type}2 '%0' should not "
7960   "be used as format arguments; add an explicit cast to %1 instead">,
7961   InGroup<FormatPedantic>, DefaultIgnore;
7962 def warn_printf_positional_arg_exceeds_data_args : Warning <
7963   "data argument position '%0' exceeds the number of data arguments (%1)">,
7964   InGroup<Format>;
7965 def warn_format_zero_positional_specifier : Warning<
7966   "position arguments in format strings start counting at 1 (not 0)">,
7967   InGroup<Format>;
7968 def warn_format_invalid_positional_specifier : Warning<
7969   "invalid position specified for %select{field width|field precision}0">,
7970   InGroup<Format>;
7971 def warn_format_mix_positional_nonpositional_args : Warning<
7972   "cannot mix positional and non-positional arguments in format string">,
7973   InGroup<Format>;
7974 def warn_static_array_too_small : Warning<
7975   "array argument is too small; %select{contains %0 elements|is of size %0}2,"
7976   " callee requires at least %1">,
7977   InGroup<ArrayBounds>;
7978 def note_callee_static_array : Note<
7979   "callee declares array parameter as static here">;
7980 def warn_empty_format_string : Warning<
7981   "format string is empty">, InGroup<FormatZeroLength>;
7982 def warn_format_string_is_wide_literal : Warning<
7983   "format string should not be a wide string">, InGroup<Format>;
7984 def warn_printf_format_string_contains_null_char : Warning<
7985   "format string contains '\\0' within the string body">, InGroup<Format>;
7986 def warn_printf_format_string_not_null_terminated : Warning<
7987   "format string is not null-terminated">, InGroup<Format>;
7988 def warn_printf_asterisk_missing_arg : Warning<
7989   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7990   InGroup<Format>;
7991 def warn_printf_asterisk_wrong_type : Warning<
7992   "field %select{width|precision}0 should have type %1, but argument has type %2">,
7993   InGroup<Format>;
7994 def warn_printf_nonsensical_optional_amount: Warning<
7995   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7996   InGroup<Format>;
7997 def warn_printf_nonsensical_flag: Warning<
7998   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7999   InGroup<Format>;
8000 def warn_format_nonsensical_length: Warning<
8001   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
8002   InGroup<Format>;
8003 def warn_format_non_standard_positional_arg: Warning<
8004   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
8005 def warn_format_non_standard: Warning<
8006   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
8007   InGroup<FormatNonStandard>, DefaultIgnore;
8008 def warn_format_non_standard_conversion_spec: Warning<
8009   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
8010   InGroup<FormatNonStandard>, DefaultIgnore;
8011 def err_invalid_mask_type_size : Error<
8012   "mask type size must be between 1-byte and 8-bytes">;
8013 def warn_format_invalid_annotation : Warning<
8014   "using '%0' format specifier annotation outside of os_log()/os_trace()">,
8015   InGroup<Format>;
8016 def warn_format_P_no_precision : Warning<
8017   "using '%%P' format specifier without precision">,
8018   InGroup<Format>;
8019 def warn_printf_ignored_flag: Warning<
8020   "flag '%0' is ignored when flag '%1' is present">,
8021   InGroup<Format>;
8022 def warn_printf_empty_objc_flag: Warning<
8023   "missing object format flag">,
8024   InGroup<Format>;
8025 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
8026   "object format flags cannot be used with '%0' conversion specifier">,
8027   InGroup<Format>;
8028 def warn_printf_invalid_objc_flag: Warning<
8029     "'%0' is not a valid object format flag">,
8030     InGroup<Format>;
8031 def warn_scanf_scanlist_incomplete : Warning<
8032   "no closing ']' for '%%[' in scanf format string">,
8033   InGroup<Format>;
8034 def note_format_string_defined : Note<"format string is defined here">;
8035 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
8036 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
8037 def note_format_security_fixit: Note<
8038   "treat the string as an argument to avoid this">;
8039
8040 def warn_null_arg : Warning<
8041   "null passed to a callee that requires a non-null argument">,
8042   InGroup<NonNull>;
8043 def warn_null_ret : Warning<
8044   "null returned from %select{function|method}0 that requires a non-null return value">,
8045   InGroup<NonNull>;
8046
8047 def err_lifetimebound_no_object_param : Error<
8048   "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
8049   "function has no implicit object parameter">;
8050 def err_lifetimebound_ctor_dtor : Error<
8051   "'lifetimebound' attribute cannot be applied to a "
8052   "%select{constructor|destructor}0">;
8053
8054 // CHECK: returning address/reference of stack memory
8055 def warn_ret_stack_addr_ref : Warning<
8056   "%select{address of|reference to}0 stack memory associated with "
8057   "%select{local variable|parameter}2 %1 returned">,
8058   InGroup<ReturnStackAddress>;
8059 def warn_ret_local_temp_addr_ref : Warning<
8060   "returning %select{address of|reference to}0 local temporary object">,
8061   InGroup<ReturnStackAddress>;
8062 def warn_ret_addr_label : Warning<
8063   "returning address of label, which is local">,
8064   InGroup<ReturnStackAddress>;
8065 def err_ret_local_block : Error<
8066   "returning block that lives on the local stack">;
8067 def note_local_var_initializer : Note<
8068   "%select{via initialization of|binding reference}0 variable "
8069   "%select{%2 |}1here">;
8070 def note_init_with_default_member_initalizer : Note<
8071   "initializing field %0 with default member initializer">;
8072
8073 // Check for initializing a member variable with the address or a reference to
8074 // a constructor parameter.
8075 def warn_bind_ref_member_to_parameter : Warning<
8076   "binding reference member %0 to stack allocated "
8077   "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
8078 def warn_init_ptr_member_to_parameter_addr : Warning<
8079   "initializing pointer member %0 with the stack address of "
8080   "%select{variable|parameter}2 %1">, InGroup<DanglingField>;
8081 def note_ref_or_ptr_member_declared_here : Note<
8082   "%select{reference|pointer}0 member declared here">;
8083
8084 def err_dangling_member : Error<
8085   "%select{reference|backing array for 'std::initializer_list'}2 "
8086   "%select{|subobject of }1member %0 "
8087   "%select{binds to|is}2 a temporary object "
8088   "whose lifetime would be shorter than the lifetime of "
8089   "the constructed object">;
8090 def warn_dangling_member : Warning<
8091   "%select{reference|backing array for 'std::initializer_list'}2 "
8092   "%select{|subobject of }1member %0 "
8093   "%select{binds to|is}2 a temporary object "
8094   "whose lifetime is shorter than the lifetime of the constructed object">,
8095   InGroup<DanglingField>;
8096 def note_lifetime_extending_member_declared_here : Note<
8097   "%select{%select{reference|'std::initializer_list'}0 member|"
8098   "member with %select{reference|'std::initializer_list'}0 subobject}1 "
8099   "declared here">;
8100 def warn_dangling_variable : Warning<
8101   "%select{temporary %select{whose address is used as value of|"
8102   "%select{|implicitly }2bound to}4 "
8103   "%select{%select{|reference }4member of local variable|"
8104   "local %select{variable|reference}4}1|"
8105   "array backing "
8106   "%select{initializer list subobject of local variable|"
8107   "local initializer list}1}0 "
8108   "%select{%3 |}2will be destroyed at the end of the full-expression">,
8109   InGroup<Dangling>;
8110 def warn_new_dangling_reference : Warning<
8111   "temporary bound to reference member of allocated object "
8112   "will be destroyed at the end of the full-expression">,
8113   InGroup<DanglingField>;
8114 def warn_new_dangling_initializer_list : Warning<
8115   "array backing "
8116   "%select{initializer list subobject of the allocated object|"
8117   "the allocated initializer list}0 "
8118   "will be destroyed at the end of the full-expression">,
8119   InGroup<DanglingInitializerList>;
8120 def warn_unsupported_lifetime_extension : Warning<
8121   "sorry, lifetime extension of "
8122   "%select{temporary|backing array of initializer list}0 created "
8123   "by aggregate initialization using default member initializer "
8124   "is not supported; lifetime of %select{temporary|backing array}0 "
8125   "will end at the end of the full-expression">, InGroup<Dangling>;
8126
8127 // For non-floating point, expressions of the form x == x or x != x
8128 // should result in a warning, since these always evaluate to a constant.
8129 // Array comparisons have similar warnings
8130 def warn_comparison_always : Warning<
8131   "%select{self-|array }0comparison always evaluates to %select{a constant|%2}1">,
8132   InGroup<TautologicalCompare>;
8133 def warn_comparison_bitwise_always : Warning<
8134   "bitwise comparison always evaluates to %select{false|true}0">,
8135   InGroup<TautologicalCompare>;
8136 def warn_tautological_overlap_comparison : Warning<
8137   "overlapping comparisons always evaluate to %select{false|true}0">,
8138   InGroup<TautologicalOverlapCompare>, DefaultIgnore;
8139
8140 def warn_stringcompare : Warning<
8141   "result of comparison against %select{a string literal|@encode}0 is "
8142   "unspecified (use strncmp instead)">,
8143   InGroup<StringCompare>;
8144
8145 def warn_identity_field_assign : Warning<
8146   "assigning %select{field|instance variable}0 to itself">,
8147   InGroup<SelfAssignmentField>;
8148
8149 // Type safety attributes
8150 def err_type_tag_for_datatype_not_ice : Error<
8151   "'type_tag_for_datatype' attribute requires the initializer to be "
8152   "an %select{integer|integral}0 constant expression">;
8153 def err_type_tag_for_datatype_too_large : Error<
8154   "'type_tag_for_datatype' attribute requires the initializer to be "
8155   "an %select{integer|integral}0 constant expression "
8156   "that can be represented by a 64 bit integer">;
8157 def err_tag_index_out_of_range : Error<
8158   "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
8159 def warn_type_tag_for_datatype_wrong_kind : Warning<
8160   "this type tag was not designed to be used with this function">,
8161   InGroup<TypeSafety>;
8162 def warn_type_safety_type_mismatch : Warning<
8163   "argument type %0 doesn't match specified %1 type tag "
8164   "%select{that requires %3|}2">, InGroup<TypeSafety>;
8165 def warn_type_safety_null_pointer_required : Warning<
8166   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
8167
8168 // Generic selections.
8169 def err_assoc_type_incomplete : Error<
8170   "type %0 in generic association incomplete">;
8171 def err_assoc_type_nonobject : Error<
8172   "type %0 in generic association not an object type">;
8173 def err_assoc_type_variably_modified : Error<
8174   "type %0 in generic association is a variably modified type">;
8175 def err_assoc_compatible_types : Error<
8176   "type %0 in generic association compatible with previously specified type %1">;
8177 def note_compat_assoc : Note<
8178   "compatible type %0 specified here">;
8179 def err_generic_sel_no_match : Error<
8180   "controlling expression type %0 not compatible with any generic association type">;
8181 def err_generic_sel_multi_match : Error<
8182   "controlling expression type %0 compatible with %1 generic association types">;
8183
8184
8185 // Blocks
8186 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
8187   " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">;
8188 def err_block_returning_array_function : Error<
8189   "block cannot return %select{array|function}0 type %1">;
8190
8191 // Builtin annotation
8192 def err_builtin_annotation_first_arg : Error<
8193   "first argument to __builtin_annotation must be an integer">;
8194 def err_builtin_annotation_second_arg : Error<
8195   "second argument to __builtin_annotation must be a non-wide string constant">;
8196 def err_msvc_annotation_wide_str : Error<
8197   "arguments to __annotation must be wide string constants">;
8198
8199 // CFString checking
8200 def err_cfstring_literal_not_string_constant : Error<
8201   "CFString literal is not a string constant">;
8202 def warn_cfstring_truncated : Warning<
8203   "input conversion stopped due to an input byte that does not "
8204   "belong to the input codeset UTF-8">,
8205   InGroup<DiagGroup<"CFString-literal">>;
8206
8207 // os_log checking
8208 // TODO: separate diagnostic for os_trace()
8209 def err_os_log_format_not_string_constant : Error<
8210   "os_log() format argument is not a string constant">;
8211 def err_os_log_argument_too_big : Error<
8212   "os_log() argument %0 is too big (%1 bytes, max %2)">;
8213 def warn_os_log_format_narg : Error<
8214  "os_log() '%%n' format specifier is not allowed">, DefaultError;
8215
8216 // Statements.
8217 def err_continue_not_in_loop : Error<
8218   "'continue' statement not in loop statement">;
8219 def err_break_not_in_loop_or_switch : Error<
8220   "'break' statement not in loop or switch statement">;
8221 def warn_loop_ctrl_binds_to_inner : Warning<
8222   "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
8223   InGroup<GccCompat>;
8224 def warn_break_binds_to_switch : Warning<
8225   "'break' is bound to loop, GCC binds it to switch">,
8226   InGroup<GccCompat>;
8227 def err_default_not_in_switch : Error<
8228   "'default' statement not in switch statement">;
8229 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
8230 def warn_bool_switch_condition : Warning<
8231   "switch condition has boolean value">, InGroup<SwitchBool>;
8232 def warn_case_value_overflow : Warning<
8233   "overflow converting case value to switch condition type (%0 to %1)">,
8234   InGroup<Switch>;
8235 def err_duplicate_case : Error<"duplicate case value '%0'">;
8236 def err_duplicate_case_differing_expr : Error<
8237   "duplicate case value: '%0' and '%1' both equal '%2'">;
8238 def warn_case_empty_range : Warning<"empty case range specified">;
8239 def warn_missing_case_for_condition :
8240   Warning<"no case matching constant switch condition '%0'">;
8241
8242 def warn_def_missing_case : Warning<"%plural{"
8243   "1:enumeration value %1 not explicitly handled in switch|"
8244   "2:enumeration values %1 and %2 not explicitly handled in switch|"
8245   "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
8246   ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
8247   InGroup<SwitchEnum>, DefaultIgnore;
8248
8249 def warn_missing_case : Warning<"%plural{"
8250   "1:enumeration value %1 not handled in switch|"
8251   "2:enumeration values %1 and %2 not handled in switch|"
8252   "3:enumeration values %1, %2, and %3 not handled in switch|"
8253   ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
8254   InGroup<Switch>;
8255
8256 def warn_unannotated_fallthrough : Warning<
8257   "unannotated fall-through between switch labels">,
8258   InGroup<ImplicitFallthrough>, DefaultIgnore;
8259 def warn_unannotated_fallthrough_per_function : Warning<
8260   "unannotated fall-through between switch labels in partly-annotated "
8261   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
8262 def note_insert_fallthrough_fixit : Note<
8263   "insert '%0;' to silence this warning">;
8264 def note_insert_break_fixit : Note<
8265   "insert 'break;' to avoid fall-through">;
8266 def err_fallthrough_attr_wrong_target : Error<
8267   "%0 attribute is only allowed on empty statements">;
8268 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
8269 def err_fallthrough_attr_outside_switch : Error<
8270   "fallthrough annotation is outside switch statement">;
8271 def err_fallthrough_attr_invalid_placement : Error<
8272   "fallthrough annotation does not directly precede switch label">;
8273 def warn_fallthrough_attr_unreachable : Warning<
8274   "fallthrough annotation in unreachable code">,
8275   InGroup<ImplicitFallthrough>, DefaultIgnore;
8276
8277 def warn_unreachable_default : Warning<
8278   "default label in switch which covers all enumeration values">,
8279   InGroup<CoveredSwitchDefault>, DefaultIgnore;
8280 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
8281   InGroup<Switch>;
8282 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
8283   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
8284 def err_typecheck_statement_requires_scalar : Error<
8285   "statement requires expression of scalar type (%0 invalid)">;
8286 def err_typecheck_statement_requires_integer : Error<
8287   "statement requires expression of integer type (%0 invalid)">;
8288 def err_multiple_default_labels_defined : Error<
8289   "multiple default labels in one switch">;
8290 def err_switch_multiple_conversions : Error<
8291   "multiple conversions from switch condition type %0 to an integral or "
8292   "enumeration type">;
8293 def note_switch_conversion : Note<
8294   "conversion to %select{integral|enumeration}0 type %1">;
8295 def err_switch_explicit_conversion : Error<
8296   "switch condition type %0 requires explicit conversion to %1">;
8297 def err_switch_incomplete_class_type : Error<
8298   "switch condition has incomplete class type %0">;
8299
8300 def warn_empty_if_body : Warning<
8301   "if statement has empty body">, InGroup<EmptyBody>;
8302 def warn_empty_for_body : Warning<
8303   "for loop has empty body">, InGroup<EmptyBody>;
8304 def warn_empty_range_based_for_body : Warning<
8305   "range-based for loop has empty body">, InGroup<EmptyBody>;
8306 def warn_empty_while_body : Warning<
8307   "while loop has empty body">, InGroup<EmptyBody>;
8308 def warn_empty_switch_body : Warning<
8309   "switch statement has empty body">, InGroup<EmptyBody>;
8310 def note_empty_body_on_separate_line : Note<
8311   "put the semicolon on a separate line to silence this warning">;
8312
8313 def err_va_start_captured_stmt : Error<
8314   "'va_start' cannot be used in a captured statement">;
8315 def err_va_start_outside_function : Error<
8316   "'va_start' cannot be used outside a function">;
8317 def err_va_start_fixed_function : Error<
8318   "'va_start' used in function with fixed args">;
8319 def err_va_start_used_in_wrong_abi_function : Error<
8320   "'va_start' used in %select{System V|Win64}0 ABI function">;
8321 def err_ms_va_start_used_in_sysv_function : Error<
8322   "'__builtin_ms_va_start' used in System V ABI function">;
8323 def warn_second_arg_of_va_start_not_last_named_param : Warning<
8324   "second argument to 'va_start' is not the last named parameter">,
8325   InGroup<Varargs>;
8326 def warn_va_start_type_is_undefined : Warning<
8327   "passing %select{an object that undergoes default argument promotion|"
8328   "an object of reference type|a parameter declared with the 'register' "
8329   "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
8330 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
8331   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
8332 def err_second_parameter_to_va_arg_incomplete: Error<
8333   "second argument to 'va_arg' is of incomplete type %0">;
8334 def err_second_parameter_to_va_arg_abstract: Error<
8335   "second argument to 'va_arg' is of abstract type %0">;
8336 def warn_second_parameter_to_va_arg_not_pod : Warning<
8337   "second argument to 'va_arg' is of non-POD type %0">,
8338   InGroup<NonPODVarargs>, DefaultError;
8339 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
8340   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
8341   InGroup<NonPODVarargs>, DefaultError;
8342 def warn_second_parameter_to_va_arg_never_compatible : Warning<
8343   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
8344   "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
8345
8346 def warn_return_missing_expr : Warning<
8347   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8348   InGroup<ReturnType>;
8349 def ext_return_missing_expr : ExtWarn<
8350   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8351   InGroup<ReturnType>;
8352 def ext_return_has_expr : ExtWarn<
8353   "%select{void function|void method|constructor|destructor}1 %0 "
8354   "should not return a value">,
8355   DefaultError, InGroup<ReturnType>;
8356 def ext_return_has_void_expr : Extension<
8357   "void %select{function|method|block}1 %0 should not return void expression">;
8358 def err_return_init_list : Error<
8359   "%select{void function|void method|constructor|destructor}1 %0 "
8360   "must not return a value">;
8361 def err_ctor_dtor_returns_void : Error<
8362   "%select{constructor|destructor}1 %0 must not return void expression">;
8363 def warn_noreturn_function_has_return_expr : Warning<
8364   "function %0 declared 'noreturn' should not return">,
8365   InGroup<InvalidNoreturn>;
8366 def warn_falloff_noreturn_function : Warning<
8367   "function declared 'noreturn' should not return">,
8368   InGroup<InvalidNoreturn>;
8369 def err_noreturn_block_has_return_expr : Error<
8370   "block declared 'noreturn' should not return">;
8371 def err_noreturn_missing_on_first_decl : Error<
8372   "function declared '[[noreturn]]' after its first declaration">;
8373 def note_noreturn_missing_first_decl : Note<
8374   "declaration missing '[[noreturn]]' attribute is here">;
8375 def err_carries_dependency_missing_on_first_decl : Error<
8376   "%select{function|parameter}0 declared '[[carries_dependency]]' "
8377   "after its first declaration">;
8378 def note_carries_dependency_missing_first_decl : Note<
8379   "declaration missing '[[carries_dependency]]' attribute is here">;
8380 def err_carries_dependency_param_not_function_decl : Error<
8381   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
8382   "declaration or lambda">;
8383 def err_block_on_nonlocal : Error<
8384   "__block attribute not allowed, only allowed on local variables">;
8385 def err_block_on_vm : Error<
8386   "__block attribute not allowed on declaration with a variably modified type">;
8387
8388 def err_vec_builtin_non_vector : Error<
8389  "first two arguments to %0 must be vectors">;
8390 def err_vec_builtin_incompatible_vector : Error<
8391   "first two arguments to %0 must have the same type">;
8392 def err_vsx_builtin_nonconstant_argument : Error<
8393   "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
8394
8395 def err_shufflevector_nonconstant_argument : Error<
8396   "index for __builtin_shufflevector must be a constant integer">;
8397 def err_shufflevector_argument_too_large : Error<
8398   "index for __builtin_shufflevector must be less than the total number "
8399   "of vector elements">;
8400
8401 def err_convertvector_non_vector : Error<
8402   "first argument to __builtin_convertvector must be a vector">;
8403 def err_convertvector_non_vector_type : Error<
8404   "second argument to __builtin_convertvector must be a vector type">;
8405 def err_convertvector_incompatible_vector : Error<
8406   "first two arguments to __builtin_convertvector must have the same number of elements">;
8407
8408 def err_first_argument_to_cwsc_not_call : Error<
8409   "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
8410 def err_first_argument_to_cwsc_block_call : Error<
8411   "first argument to __builtin_call_with_static_chain must not be a block call">;
8412 def err_first_argument_to_cwsc_builtin_call : Error<
8413   "first argument to __builtin_call_with_static_chain must not be a builtin call">;
8414 def err_first_argument_to_cwsc_pdtor_call : Error<
8415   "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
8416 def err_second_argument_to_cwsc_not_pointer : Error<
8417   "second argument to __builtin_call_with_static_chain must be of pointer type">;
8418
8419 def err_vector_incorrect_num_initializers : Error<
8420   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
8421 def err_altivec_empty_initializer : Error<"expected initializer">;
8422
8423 def err_invalid_neon_type_code : Error<
8424   "incompatible constant for this __builtin_neon function">;
8425 def err_argument_invalid_range : Error<
8426   "argument value %0 is outside the valid range [%1, %2]">;
8427 def warn_argument_invalid_range : Warning<
8428   "argument value %0 is outside the valid range [%1, %2]">, DefaultError,
8429   InGroup<DiagGroup<"argument-outside-range">>;
8430 def err_argument_not_multiple : Error<
8431   "argument should be a multiple of %0">;
8432 def warn_neon_vector_initializer_non_portable : Warning<
8433   "vector initializers are not compatible with NEON intrinsics in big endian "
8434   "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
8435 def note_neon_vector_initializer_non_portable : Note<
8436   "consider using vld1_%0%1() to initialize a vector from memory, or "
8437   "vcreate_%0%1() to initialize from an integer constant">;
8438 def note_neon_vector_initializer_non_portable_q : Note<
8439   "consider using vld1q_%0%1() to initialize a vector from memory, or "
8440   "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
8441   "constants">;
8442 def err_systemz_invalid_tabort_code : Error<
8443   "invalid transaction abort code">;
8444 def err_64_bit_builtin_32_bit_tgt : Error<
8445   "this builtin is only available on 64-bit targets">;
8446 def err_32_bit_builtin_64_bit_tgt : Error<
8447   "this builtin is only available on 32-bit targets">;
8448 def err_builtin_x64_aarch64_only : Error<
8449   "this builtin is only available on x86-64 and aarch64 targets">;
8450 def err_ppc_builtin_only_on_pwr7 : Error<
8451   "this builtin is only valid on POWER7 or later CPUs">;
8452 def err_x86_builtin_invalid_rounding : Error<
8453   "invalid rounding argument">;
8454 def err_x86_builtin_invalid_scale : Error<
8455   "scale argument must be 1, 2, 4, or 8">;
8456 def err_hexagon_builtin_unsupported_cpu : Error<
8457   "builtin is not supported on this CPU">;
8458 def err_hexagon_builtin_requires_hvx : Error<
8459   "builtin requires HVX">;
8460 def err_hexagon_builtin_unsupported_hvx : Error<
8461   "builtin is not supported on this version of HVX">;
8462
8463 def err_builtin_target_unsupported : Error<
8464   "builtin is not supported on this target">;
8465 def err_builtin_longjmp_unsupported : Error<
8466   "__builtin_longjmp is not supported for the current target">;
8467 def err_builtin_setjmp_unsupported : Error<
8468   "__builtin_setjmp is not supported for the current target">;
8469
8470 def err_builtin_longjmp_invalid_val : Error<
8471   "argument to __builtin_longjmp must be a constant 1">;
8472 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
8473
8474 def err_constant_integer_arg_type : Error<
8475   "argument to %0 must be a constant integer">;
8476
8477 def ext_mixed_decls_code : Extension<
8478   "ISO C90 forbids mixing declarations and code">,
8479   InGroup<DiagGroup<"declaration-after-statement">>;
8480
8481 def err_non_local_variable_decl_in_for : Error<
8482   "declaration of non-local variable in 'for' loop">;
8483 def err_non_variable_decl_in_for : Error<
8484   "non-variable declaration in 'for' loop">;
8485 def err_toomany_element_decls : Error<
8486   "only one element declaration is allowed">;
8487 def err_selector_element_not_lvalue : Error<
8488   "selector element is not a valid lvalue">;
8489 def err_selector_element_type : Error<
8490   "selector element type %0 is not a valid object">;
8491 def err_selector_element_const_type : Error<
8492   "selector element of type %0 cannot be a constant l-value expression">;
8493 def err_collection_expr_type : Error<
8494   "the type %0 is not a pointer to a fast-enumerable object">;
8495 def warn_collection_expr_type : Warning<
8496   "collection expression type %0 may not respond to %1">;
8497
8498 def err_invalid_conversion_between_ext_vectors : Error<
8499   "invalid conversion between ext-vector type %0 and %1">;
8500
8501 def warn_duplicate_attribute_exact : Warning<
8502   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
8503
8504 def warn_duplicate_attribute : Warning<
8505   "attribute %0 is already applied with different parameters">,
8506   InGroup<IgnoredAttributes>;
8507
8508 def warn_sync_fetch_and_nand_semantics_change : Warning<
8509   "the semantics of this intrinsic changed with GCC "
8510   "version 4.4 - the newer semantics are provided here">,
8511   InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
8512
8513 // Type
8514 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
8515 def warn_receiver_forward_class : Warning<
8516     "receiver %0 is a forward class and corresponding @interface may not exist">,
8517     InGroup<ForwardClassReceiver>;
8518 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
8519 def ext_missing_declspec : ExtWarn<
8520   "declaration specifier missing, defaulting to 'int'">;
8521 def ext_missing_type_specifier : ExtWarn<
8522   "type specifier missing, defaults to 'int'">,
8523   InGroup<ImplicitInt>;
8524 def err_decimal_unsupported : Error<
8525   "GNU decimal type extension not supported">;
8526 def err_missing_type_specifier : Error<
8527   "C++ requires a type specifier for all declarations">;
8528 def err_objc_array_of_interfaces : Error<
8529   "array of interface %0 is invalid (probably should be an array of pointers)">;
8530 def ext_c99_array_usage : Extension<
8531   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8532   "feature">, InGroup<C99>;
8533 def err_c99_array_usage_cxx : Error<
8534   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8535   "feature, not permitted in C++">;
8536 def err_type_unsupported : Error<
8537   "%0 is not supported on this target">;
8538 def err_nsconsumed_attribute_mismatch : Error<
8539   "overriding method has mismatched ns_consumed attribute on its"
8540   " parameter">;
8541 def err_nsreturns_retained_attribute_mismatch : Error<
8542   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
8543   " attributes">;
8544 def warn_nsconsumed_attribute_mismatch : Warning<
8545   err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
8546 def warn_nsreturns_retained_attribute_mismatch : Warning<
8547   err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
8548
8549 def note_getter_unavailable : Note<
8550   "or because setter is declared here, but no getter method %0 is found">;
8551 def err_invalid_protocol_qualifiers : Error<
8552   "invalid protocol qualifiers on non-ObjC type">;
8553 def warn_ivar_use_hidden : Warning<
8554   "local declaration of %0 hides instance variable">,
8555    InGroup<ShadowIvar>;
8556 def warn_direct_initialize_call : Warning<
8557   "explicit call to +initialize results in duplicate call to +initialize">,
8558    InGroup<ExplicitInitializeCall>;
8559 def warn_direct_super_initialize_call : Warning<
8560   "explicit call to [super initialize] should only be in implementation "
8561   "of +initialize">,
8562    InGroup<ExplicitInitializeCall>;
8563 def err_ivar_use_in_class_method : Error<
8564   "instance variable %0 accessed in class method">;
8565 def err_private_ivar_access : Error<"instance variable %0 is private">,
8566   AccessControl;
8567 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8568   AccessControl;
8569 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8570 def ext_typecheck_base_super : Warning<
8571   "method parameter type "
8572   "%diff{$ does not match super class method parameter type $|"
8573   "does not match super class method parameter type}0,1">,
8574    InGroup<SuperSubClassMismatch>, DefaultIgnore;
8575 def warn_missing_method_return_type : Warning<
8576   "method has no return type specified; defaults to 'id'">,
8577   InGroup<MissingMethodReturnType>, DefaultIgnore;
8578 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8579   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8580
8581 // Spell-checking diagnostics
8582 def err_unknown_typename : Error<
8583   "unknown type name %0">;
8584 def err_unknown_type_or_class_name_suggest : Error<
8585   "unknown %select{type|class}1 name %0; did you mean %2?">;
8586 def err_unknown_typename_suggest : Error<
8587   "unknown type name %0; did you mean %1?">;
8588 def err_unknown_nested_typename_suggest : Error<
8589   "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8590 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8591 def err_undeclared_use_suggest : Error<
8592   "use of undeclared %0; did you mean %1?">;
8593 def err_undeclared_var_use_suggest : Error<
8594   "use of undeclared identifier %0; did you mean %1?">;
8595 def err_no_template : Error<"no template named %0">;
8596 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8597 def err_no_member_template : Error<"no template named %0 in %1">;
8598 def err_no_member_template_suggest : Error<
8599   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8600 def err_non_template_in_template_id : Error<
8601   "%0 does not name a template but is followed by template arguments">;
8602 def err_non_template_in_template_id_suggest : Error<
8603   "%0 does not name a template but is followed by template arguments; "
8604   "did you mean %1?">;
8605 def err_non_template_in_member_template_id_suggest : Error<
8606   "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
8607 def note_non_template_in_template_id_found : Note<
8608   "non-template declaration found by name lookup">;
8609 def err_mem_init_not_member_or_class_suggest : Error<
8610   "initializer %0 does not name a non-static data member or base "
8611   "class; did you mean the %select{base class|member}1 %2?">;
8612 def err_field_designator_unknown_suggest : Error<
8613   "field designator %0 does not refer to any field in type %1; did you mean "
8614   "%2?">;
8615 def err_typecheck_member_reference_ivar_suggest : Error<
8616   "%0 does not have a member named %1; did you mean %2?">;
8617 def err_property_not_found_suggest : Error<
8618   "property %0 not found on object of type %1; did you mean %2?">;
8619 def err_class_property_found : Error<
8620   "property %0 is a class property; did you mean to access it with class '%1'?">;
8621 def err_ivar_access_using_property_syntax_suggest : Error<
8622   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8623 def warn_property_access_suggest : Warning<
8624 "property %0 not found on object of type %1; did you mean to access property %2?">,
8625 InGroup<PropertyAccessDotSyntax>;
8626 def err_property_found_suggest : Error<
8627   "property %0 found on object of type %1; did you mean to access "
8628   "it with the \".\" operator?">;
8629 def err_undef_interface_suggest : Error<
8630   "cannot find interface declaration for %0; did you mean %1?">;
8631 def warn_undef_interface_suggest : Warning<
8632   "cannot find interface declaration for %0; did you mean %1?">;
8633 def err_undef_superclass_suggest : Error<
8634   "cannot find interface declaration for %0, superclass of %1; did you mean "
8635   "%2?">;
8636 def err_undeclared_protocol_suggest : Error<
8637   "cannot find protocol declaration for %0; did you mean %1?">;
8638 def note_base_class_specified_here : Note<
8639   "base class %0 specified here">;
8640 def err_using_directive_suggest : Error<
8641   "no namespace named %0; did you mean %1?">;
8642 def err_using_directive_member_suggest : Error<
8643   "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8644 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8645 def err_sizeof_pack_no_pack_name_suggest : Error<
8646   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8647 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8648
8649 def err_uncasted_use_of_unknown_any : Error<
8650   "%0 has unknown type; cast it to its declared type to use it">;
8651 def err_uncasted_call_of_unknown_any : Error<
8652   "%0 has unknown return type; cast the call to its declared return type">;
8653 def err_uncasted_send_to_unknown_any_method : Error<
8654   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8655   "message send to the method's return type">;
8656 def err_unsupported_unknown_any_decl : Error<
8657   "%0 has unknown type, which is not supported for this kind of declaration">;
8658 def err_unsupported_unknown_any_expr : Error<
8659   "unsupported expression with unknown type">;
8660 def err_unsupported_unknown_any_call : Error<
8661   "call to unsupported expression with unknown type">;
8662 def err_unknown_any_addrof : Error<
8663   "the address of a declaration with unknown type "
8664   "can only be cast to a pointer type">;
8665 def err_unknown_any_addrof_call : Error<
8666   "address-of operator cannot be applied to a call to a function with "
8667   "unknown return type">;
8668 def err_unknown_any_var_function_type : Error<
8669   "variable %0 with unknown type cannot be given a function type">;
8670 def err_unknown_any_function : Error<
8671   "function %0 with unknown type must be given a function type">;
8672
8673 def err_filter_expression_integral : Error<
8674   "filter expression type should be an integral value not %0">;
8675
8676 def err_non_asm_stmt_in_naked_function : Error<
8677   "non-ASM statement in naked function is not supported">;
8678 def err_asm_naked_this_ref : Error<
8679   "'this' pointer references not allowed in naked functions">;
8680 def err_asm_naked_parm_ref : Error<
8681   "parameter references not allowed in naked functions">;
8682
8683 // OpenCL warnings and errors.
8684 def err_invalid_astype_of_different_size : Error<
8685   "invalid reinterpretation: sizes of %0 and %1 must match">;
8686 def err_static_kernel : Error<
8687   "kernel functions cannot be declared static">;
8688 def err_method_kernel : Error<
8689   "kernel functions cannot be class members">;
8690 def err_template_kernel : Error<
8691   "kernel functions cannot be used in a template declaration, instantiation or specialization">;
8692 def err_opencl_ptrptr_kernel_param : Error<
8693   "kernel parameter cannot be declared as a pointer to a pointer">;
8694 def err_kernel_arg_address_space : Error<
8695   "pointer arguments to kernel functions must reside in '__global', "
8696   "'__constant' or '__local' address space">;
8697 def err_opencl_ext_vector_component_invalid_length : Error<
8698   "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
8699 def err_opencl_function_variable : Error<
8700   "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8701 def err_opencl_addrspace_scope : Error<
8702   "variables in the %0 address space can only be declared in the outermost "
8703   "scope of a kernel function">;
8704 def err_static_function_scope : Error<
8705   "variables in function scope cannot be declared static">;
8706 def err_opencl_bitfields : Error<
8707   "bit-fields are not supported in OpenCL">;
8708 def err_opencl_vla : Error<
8709   "variable length arrays are not supported in OpenCL">;
8710 def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
8711     "scalar operand type has greater rank than the type of the vector "
8712     "element. (%0 and %1)">;
8713 def err_bad_kernel_param_type : Error<
8714   "%0 cannot be used as the type of a kernel parameter">;
8715 def err_opencl_implicit_function_decl : Error<
8716   "implicit declaration of function %0 is invalid in OpenCL">;
8717 def err_record_with_pointers_kernel_param : Error<
8718   "%select{struct|union}0 kernel parameters may not contain pointers">;
8719 def note_within_field_of_type : Note<
8720   "within field of type %0 declared here">;
8721 def note_illegal_field_declared_here : Note<
8722   "field of illegal %select{type|pointer type}0 %1 declared here">;
8723 def err_opencl_type_struct_or_union_field : Error<
8724   "the %0 type cannot be used to declare a structure or union field">;
8725 def err_event_t_addr_space_qual : Error<
8726   "the event_t type can only be used with __private address space qualifier">;
8727 def err_expected_kernel_void_return_type : Error<
8728   "kernel must have void return type">;
8729 def err_sampler_initializer_not_integer : Error<
8730   "sampler_t initialization requires 32-bit integer, not %0">;
8731 def warn_sampler_initializer_invalid_bits : Warning<
8732   "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8733 def err_sampler_argument_required : Error<
8734   "sampler_t variable required - got %0">;
8735 def err_wrong_sampler_addressspace: Error<
8736   "sampler type cannot be used with the __local and __global address space qualifiers">;
8737 def err_opencl_nonconst_global_sampler : Error<
8738   "global sampler requires a const or constant address space qualifier">;
8739 def err_opencl_cast_non_zero_to_event_t : Error<
8740   "cannot cast non-zero value '%0' to 'event_t'">;
8741 def err_opencl_global_invalid_addr_space : Error<
8742   "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8743 def err_missing_actual_pipe_type : Error<
8744   "missing actual type specifier for pipe">;
8745 def err_reference_pipe_type : Error <
8746   "pipes packet types cannot be of reference type">;
8747 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8748 def err_opencl_kernel_attr :
8749   Error<"attribute %0 can only be applied to an OpenCL kernel function">;
8750 def err_opencl_return_value_with_address_space : Error<
8751   "return value cannot be qualified with address space">;
8752 def err_opencl_constant_no_init : Error<
8753   "variable in constant address space must be initialized">;
8754 def err_opencl_atomic_init: Error<
8755   "atomic variable can be %select{assigned|initialized}0 to a variable only "
8756   "in global address space">;
8757 def err_opencl_implicit_vector_conversion : Error<
8758   "implicit conversions between vector types (%0 and %1) are not permitted">;
8759 def err_opencl_invalid_type_array : Error<
8760   "array of %0 type is invalid in OpenCL">;
8761 def err_opencl_ternary_with_block : Error<
8762   "block type cannot be used as expression in ternary expression in OpenCL">;
8763 def err_opencl_pointer_to_type : Error<
8764   "pointer to type %0 is invalid in OpenCL">;
8765 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8766   "type %0 can only be used as a function parameter in OpenCL">;
8767 def warn_opencl_attr_deprecated_ignored : Warning <
8768   "%0 attribute is deprecated and ignored in OpenCL version %1">,
8769   InGroup<IgnoredAttributes>;
8770 def err_opencl_variadic_function : Error<
8771   "invalid prototype, variadic arguments are not allowed in OpenCL">;
8772 def err_opencl_requires_extension : Error<
8773   "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">;
8774 def warn_opencl_generic_address_space_arg : Warning<
8775   "passing non-generic address space pointer to %0"
8776   " may cause dynamic conversion affecting performance">,
8777   InGroup<Conversion>, DefaultIgnore;
8778
8779 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8780 def err_opencl_builtin_pipe_first_arg : Error<
8781   "first argument to %0 must be a pipe type">;
8782 def err_opencl_builtin_pipe_arg_num : Error<
8783   "invalid number of arguments to function: %0">;
8784 def err_opencl_builtin_pipe_invalid_arg : Error<
8785   "invalid argument type to function %0 (expecting %1 having %2)">;
8786 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8787   "invalid pipe access modifier (expecting %0)">;
8788
8789 // OpenCL access qualifier
8790 def err_opencl_invalid_access_qualifier : Error<
8791   "access qualifier can only be used for pipe and image type">;
8792 def err_opencl_invalid_read_write : Error<
8793   "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8794 def err_opencl_multiple_access_qualifiers : Error<
8795   "multiple access qualifiers">;
8796 def note_opencl_typedef_access_qualifier : Note<
8797   "previously declared '%0' here">;
8798
8799 // OpenCL v2.0 s6.12.5 Blocks restrictions
8800 def err_opencl_block_storage_type : Error<
8801   "the __block storage type is not permitted">;
8802 def err_opencl_invalid_block_declaration : Error<
8803   "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8804 def err_opencl_extern_block_declaration : Error<
8805   "invalid block variable declaration - using 'extern' storage class is disallowed">;
8806 def err_opencl_block_ref_block : Error<
8807   "cannot refer to a block inside block">;
8808
8809 // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
8810 def err_opencl_builtin_to_addr_arg_num : Error<
8811   "invalid number of arguments to function: %0">;
8812 def err_opencl_builtin_to_addr_invalid_arg : Error<
8813   "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8814
8815 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8816 def err_opencl_enqueue_kernel_incorrect_args : Error<
8817   "illegal call to enqueue_kernel, incorrect argument types">;
8818 def err_opencl_enqueue_kernel_local_size_args : Error<
8819   "mismatch in number of block parameters and local size arguments passed">;
8820 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8821   "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8822 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8823   "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
8824 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8825   "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
8826
8827 def err_opencl_builtin_expected_type : Error<
8828   "illegal call to %0, expected %1 argument type">;
8829
8830 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8831 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8832   "vector component name '%0' is an OpenCL version 2.2 feature">,
8833   InGroup<OpenCLUnsupportedRGBA>;
8834
8835 def err_openclcxx_placement_new : Error<
8836   "use of placement new requires explicit declaration">;
8837
8838 // MIG routine annotations.
8839 def warn_mig_server_routine_does_not_return_kern_return_t : Warning<
8840   "'mig_server_routine' attribute only applies to routines that return a kern_return_t">,
8841   InGroup<IgnoredAttributes>;
8842 } // end of sema category
8843
8844 let CategoryName = "OpenMP Issue" in {
8845 // OpenMP support.
8846 def err_omp_expected_var_arg : Error<
8847   "%0 is not a global variable, static local variable or static data member">;
8848 def err_omp_expected_var_arg_suggest : Error<
8849   "%0 is not a global variable, static local variable or static data member; "
8850   "did you mean %1">;
8851 def err_omp_global_var_arg : Error<
8852   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8853 def err_omp_ref_type_arg : Error<
8854   "arguments of '#pragma omp %0' cannot be of reference type %1">;
8855 def err_omp_region_not_file_context : Error<
8856   "directive must be at file or namespace scope">;
8857 def err_omp_var_scope : Error<
8858   "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8859 def err_omp_var_used : Error<
8860   "'#pragma omp %0' must precede all references to variable %q1">;
8861 def err_omp_var_thread_local : Error<
8862   "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8863 def err_omp_private_incomplete_type : Error<
8864   "a private variable with incomplete type %0">;
8865 def err_omp_firstprivate_incomplete_type : Error<
8866   "a firstprivate variable with incomplete type %0">;
8867 def err_omp_lastprivate_incomplete_type : Error<
8868   "a lastprivate variable with incomplete type %0">;
8869 def err_omp_reduction_incomplete_type : Error<
8870   "a reduction list item with incomplete type %0">;
8871 def err_omp_unexpected_clause_value : Error<
8872   "expected %0 in OpenMP clause '%1'">;
8873 def err_omp_expected_var_name_member_expr : Error<
8874   "expected variable name%select{| or data member of current class}0">;
8875 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8876   "expected variable name%select{|, data member of current class}0, array element or array section">;
8877 def err_omp_expected_addressable_lvalue_or_array_item : Error<
8878   "expected addressable lvalue expression, array element or array section">;
8879 def err_omp_expected_named_var_member_or_array_expression: Error<
8880   "expected expression containing only member accesses and/or array sections based on named variables">;
8881 def err_omp_bit_fields_forbidden_in_clause : Error<
8882   "bit fields cannot be used to specify storage in a '%0' clause">;
8883 def err_array_section_does_not_specify_contiguous_storage : Error<
8884   "array section does not specify contiguous storage">;
8885 def err_omp_union_type_not_allowed : Error<
8886   "mapping of union members is not allowed">;
8887 def err_omp_expected_access_to_data_field : Error<
8888   "expected access to data field">;
8889 def err_omp_multiple_array_items_in_map_clause : Error<
8890   "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8891 def err_omp_duplicate_map_type_modifier : Error<
8892   "same map type modifier has been specified more than once">;
8893 def err_omp_pointer_mapped_along_with_derived_section : Error<
8894   "pointer cannot be mapped along with a section derived from itself">;
8895 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8896   "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8897 def err_omp_same_pointer_dereferenced : Error<
8898   "same pointer dereferenced in multiple different ways in map clause expressions">;
8899 def note_omp_task_predetermined_firstprivate_here : Note<
8900   "predetermined as a firstprivate in a task construct here">;
8901 def err_omp_threadprivate_incomplete_type : Error<
8902   "threadprivate variable with incomplete type %0">;
8903 def err_omp_no_dsa_for_variable : Error<
8904   "variable %0 must have explicitly specified data sharing attributes">;
8905 def note_omp_default_dsa_none : Note<
8906   "explicit data sharing attribute requested here">;
8907 def err_omp_wrong_dsa : Error<
8908   "%0 variable cannot be %1">;
8909 def err_omp_variably_modified_type_not_supported : Error<
8910   "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8911 def note_omp_explicit_dsa : Note<
8912   "defined as %0">;
8913 def note_omp_predetermined_dsa : Note<
8914   "%select{static data member is predetermined as shared|"
8915   "variable with static storage duration is predetermined as shared|"
8916   "loop iteration variable is predetermined as private|"
8917   "loop iteration variable is predetermined as linear|"
8918   "loop iteration variable is predetermined as lastprivate|"
8919   "constant variable is predetermined as shared|"
8920   "global variable is predetermined as shared|"
8921   "non-shared variable in a task construct is predetermined as firstprivate|"
8922   "variable with automatic storage duration is predetermined as private}0"
8923   "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8924 def note_omp_implicit_dsa : Note<
8925   "implicitly determined as %0">;
8926 def err_omp_loop_var_dsa : Error<
8927   "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8928 def err_omp_not_for : Error<
8929   "%select{statement after '#pragma omp %1' must be a for loop|"
8930   "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8931 def note_omp_collapse_ordered_expr : Note<
8932   "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8933 def err_omp_negative_expression_in_clause : Error<
8934   "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8935 def err_omp_not_integral : Error<
8936   "expression must have integral or unscoped enumeration "
8937   "type, not %0">;
8938 def err_omp_threadprivate_in_target : Error<
8939   "threadprivate variables cannot be used in target constructs">;
8940 def err_omp_incomplete_type : Error<
8941   "expression has incomplete class type %0">;
8942 def err_omp_explicit_conversion : Error<
8943   "expression requires explicit conversion from %0 to %1">;
8944 def note_omp_conversion_here : Note<
8945   "conversion to %select{integral|enumeration}0 type %1 declared here">;
8946 def err_omp_ambiguous_conversion : Error<
8947   "ambiguous conversion from type %0 to an integral or unscoped "
8948   "enumeration type">;
8949 def err_omp_required_access : Error<
8950   "%0 variable must be %1">;
8951 def err_omp_const_variable : Error<
8952   "const-qualified variable cannot be %0">;
8953 def err_omp_const_not_mutable_variable : Error<
8954   "const-qualified variable without mutable fields cannot be %0">;
8955 def err_omp_const_list_item : Error<
8956   "const-qualified list item cannot be %0">;
8957 def err_omp_linear_incomplete_type : Error<
8958   "a linear variable with incomplete type %0">;
8959 def err_omp_linear_expected_int_or_ptr : Error<
8960   "argument of a linear clause should be of integral or pointer "
8961   "type, not %0">;
8962 def warn_omp_linear_step_zero : Warning<
8963   "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8964   InGroup<OpenMPClauses>;
8965 def warn_omp_alignment_not_power_of_two : Warning<
8966   "aligned clause will be ignored because the requested alignment is not a power of 2">,
8967   InGroup<OpenMPClauses>;
8968 def err_omp_invalid_target_decl : Error<
8969   "%0 used in declare target directive is not a variable or a function name">;
8970 def err_omp_declare_target_multiple : Error<
8971   "%0 appears multiple times in clauses on the same declare target directive">;
8972 def err_omp_declare_target_to_and_link : Error<
8973   "%0 must not appear in both clauses 'to' and 'link'">;
8974 def warn_omp_not_in_target_context : Warning<
8975   "declaration is not declared in any declare target region">,
8976   InGroup<OpenMPTarget>;
8977 def err_omp_function_in_link_clause : Error<
8978   "function name is not allowed in 'link' clause">;
8979 def err_omp_aligned_expected_array_or_ptr : Error<
8980   "argument of aligned clause should be array"
8981   "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8982   ", not %0">;
8983 def err_omp_aligned_twice : Error<
8984   "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8985 def err_omp_local_var_in_threadprivate_init : Error<
8986   "variable with local storage in initial value of threadprivate variable">;
8987 def err_omp_loop_not_canonical_init : Error<
8988   "initialization clause of OpenMP for loop is not in canonical form "
8989   "('var = init' or 'T var = init')">;
8990 def ext_omp_loop_not_canonical_init : ExtWarn<
8991   "initialization clause of OpenMP for loop is not in canonical form "
8992   "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8993 def err_omp_loop_not_canonical_cond : Error<
8994   "condition of OpenMP for loop must be a relational comparison "
8995   "('<', '<=', '>', or '>=') of loop variable %0">;
8996 def err_omp_loop_not_canonical_incr : Error<
8997   "increment clause of OpenMP for loop must perform simple addition "
8998   "or subtraction on loop variable %0">;
8999 def err_omp_loop_variable_type : Error<
9000   "variable must be of integer or %select{pointer|random access iterator}0 type">;
9001 def err_omp_loop_incr_not_compatible : Error<
9002   "increment expression must cause %0 to %select{decrease|increase}1 "
9003   "on each iteration of OpenMP for loop">;
9004 def note_omp_loop_cond_requres_compatible_incr : Note<
9005   "loop step is expected to be %select{negative|positive}0 due to this condition">;
9006 def err_omp_loop_diff_cxx : Error<
9007   "could not calculate number of iterations calling 'operator-' with "
9008   "upper and lower loop bounds">;
9009 def err_omp_loop_cannot_use_stmt : Error<
9010   "'%0' statement cannot be used in OpenMP for loop">;
9011 def err_omp_simd_region_cannot_use_stmt : Error<
9012   "'%0' statement cannot be used in OpenMP simd region">;
9013 def warn_omp_loop_64_bit_var : Warning<
9014   "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
9015   InGroup<OpenMPLoopForm>;
9016 def err_omp_unknown_reduction_identifier : Error<
9017   "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
9018   "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
9019 def err_omp_not_resolved_reduction_identifier : Error<
9020   "unable to resolve declare reduction construct for type %0">;
9021 def err_omp_reduction_ref_type_arg : Error<
9022   "argument of OpenMP clause '%0' must reference the same object in all threads">;
9023 def err_omp_clause_not_arithmetic_type_arg : Error<
9024   "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
9025 def err_omp_clause_floating_type_arg : Error<
9026   "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
9027 def err_omp_once_referenced : Error<
9028   "variable can appear only once in OpenMP '%0' clause">;
9029 def err_omp_once_referenced_in_target_update : Error<
9030   "variable can appear only once in OpenMP 'target update' construct">;
9031 def note_omp_referenced : Note<
9032   "previously referenced here">;
9033 def err_omp_reduction_in_task : Error<
9034   "reduction variables may not be accessed in an explicit task">;
9035 def err_omp_reduction_id_not_compatible : Error<
9036   "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
9037 def err_omp_in_reduction_not_task_reduction : Error<
9038   "in_reduction variable must appear in a task_reduction clause">;
9039 def err_omp_reduction_identifier_mismatch : Error<
9040   "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
9041 def note_omp_previous_reduction_identifier : Note<
9042   "previously marked as task_reduction with different reduction operation">;
9043 def err_omp_prohibited_region : Error<
9044   "region cannot be%select{| closely}0 nested inside '%1' region"
9045   "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
9046   "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
9047   "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
9048   "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
9049 def err_omp_prohibited_region_simd : Error<
9050   "OpenMP constructs may not be nested inside a simd region">;
9051 def err_omp_prohibited_region_atomic : Error<
9052   "OpenMP constructs may not be nested inside an atomic region">;
9053 def err_omp_prohibited_region_critical_same_name : Error<
9054   "cannot nest 'critical' regions having the same name %0">;
9055 def note_omp_previous_critical_region : Note<
9056   "previous 'critical' region starts here">;
9057 def err_omp_sections_not_compound_stmt : Error<
9058   "the statement for '#pragma omp sections' must be a compound statement">;
9059 def err_omp_parallel_sections_not_compound_stmt : Error<
9060   "the statement for '#pragma omp parallel sections' must be a compound statement">;
9061 def err_omp_orphaned_section_directive : Error<
9062   "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
9063   " must be closely nested to a sections region%select{|, not a %1 region}0">;
9064 def err_omp_sections_substmt_not_section : Error<
9065   "statement in 'omp sections' directive must be enclosed into a section region">;
9066 def err_omp_parallel_sections_substmt_not_section : Error<
9067   "statement in 'omp parallel sections' directive must be enclosed into a section region">;
9068 def err_omp_parallel_reduction_in_task_firstprivate : Error<
9069   "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
9070 def err_omp_atomic_read_not_expression_statement : Error<
9071   "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
9072   " where v and x are both lvalue expressions with scalar type">;
9073 def note_omp_atomic_read_write: Note<
9074   "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
9075 def err_omp_atomic_write_not_expression_statement : Error<
9076   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
9077   " where x is a lvalue expression with scalar type">;
9078 def err_omp_atomic_update_not_expression_statement : Error<
9079   "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',"
9080   " where x is an l-value expression with scalar type">;
9081 def err_omp_atomic_not_expression_statement : Error<
9082   "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',"
9083   " where x is an l-value expression with scalar type">;
9084 def note_omp_atomic_update: Note<
9085   "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
9086   "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
9087   "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
9088 def err_omp_atomic_capture_not_expression_statement : Error<
9089   "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',"
9090   " where x and v are both l-value expressions with scalar type">;
9091 def err_omp_atomic_capture_not_compound_statement : Error<
9092   "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
9093   " '{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;}',"
9094   " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
9095   " where x is an l-value expression with scalar type">;
9096 def note_omp_atomic_capture: Note<
9097   "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
9098 def err_omp_atomic_several_clauses : Error<
9099   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
9100 def note_omp_atomic_previous_clause : Note<
9101   "'%0' clause used here">;
9102 def err_omp_target_contains_not_only_teams : Error<
9103   "target construct with nested teams region contains statements outside of the teams construct">;
9104 def note_omp_nested_teams_construct_here : Note<
9105   "nested teams construct here">;
9106 def note_omp_nested_statement_here : Note<
9107   "%select{statement|directive}0 outside teams construct here">;
9108 def err_omp_single_copyprivate_with_nowait : Error<
9109   "the 'copyprivate' clause must not be used with the 'nowait' clause">;
9110 def note_omp_nowait_clause_here : Note<
9111   "'nowait' clause is here">;
9112 def err_omp_single_decl_in_declare_simd : Error<
9113   "single declaration is expected after 'declare simd' directive">;
9114 def err_omp_function_expected : Error<
9115   "'#pragma omp declare simd' can only be applied to functions">;
9116 def err_omp_wrong_cancel_region : Error<
9117   "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
9118 def err_omp_parent_cancel_region_nowait : Error<
9119   "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
9120 def err_omp_parent_cancel_region_ordered : Error<
9121   "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
9122 def 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">;
9123 def 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">;
9124 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
9125 def err_omp_mapper_wrong_type : Error<
9126   "mapper type must be of struct, union or class type">;
9127 def err_omp_declare_mapper_wrong_var : Error<
9128   "only variable %0 is allowed in map clauses of this 'omp declare mapper' directive">;
9129 def err_omp_declare_mapper_redefinition : Error<
9130   "redefinition of user-defined mapper for type %0 with name %1">;
9131 def err_omp_invalid_mapper: Error<
9132   "cannot find a valid user-defined mapper for type %0 with name %1">;
9133 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
9134 def err_omp_typecheck_section_value : Error<
9135   "subscripted value is not an array or pointer">;
9136 def err_omp_typecheck_section_not_integer : Error<
9137   "array section %select{lower bound|length}0 is not an integer">;
9138 def err_omp_section_function_type : Error<
9139   "section of pointer to function type %0">;
9140 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
9141   InGroup<CharSubscript>, DefaultIgnore;
9142 def err_omp_section_incomplete_type : Error<
9143   "section of pointer to incomplete type %0">;
9144 def err_omp_section_not_subset_of_array : Error<
9145   "array section must be a subset of the original array">;
9146 def err_omp_section_length_negative : Error<
9147   "section length is evaluated to a negative value %0">;
9148 def err_omp_section_length_undefined : Error<
9149   "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
9150 def err_omp_wrong_linear_modifier : Error<
9151   "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
9152 def err_omp_wrong_linear_modifier_non_reference : Error<
9153   "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
9154 def err_omp_wrong_simdlen_safelen_values : Error<
9155   "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
9156 def err_omp_wrong_if_directive_name_modifier : Error<
9157   "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
9158 def err_omp_no_more_if_clause : Error<
9159   "no more 'if' clause is allowed">;
9160 def err_omp_unnamed_if_clause : Error<
9161   "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
9162 def note_omp_previous_named_if_clause : Note<
9163   "previous clause with directive name modifier specified here">;
9164 def err_omp_ordered_directive_with_param : Error<
9165   "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
9166 def err_omp_ordered_directive_without_param : Error<
9167   "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
9168 def note_omp_ordered_param : Note<
9169   "'ordered' clause with specified parameter">;
9170 def err_omp_expected_base_var_name : Error<
9171   "expected variable name as a base of the array %select{subscript|section}0">;
9172 def err_omp_map_shared_storage : Error<
9173   "variable already marked as mapped in current construct">;
9174 def err_omp_invalid_map_type_for_directive : Error<
9175   "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
9176 def err_omp_no_clause_for_directive : Error<
9177   "expected at least one %0 clause for '#pragma omp %1'">;
9178 def err_omp_threadprivate_in_clause : Error<
9179   "threadprivate variables are not allowed in '%0' clause">;
9180 def err_omp_wrong_ordered_loop_count : Error<
9181   "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
9182 def note_collapse_loop_count : Note<
9183   "parameter of the 'collapse' clause">;
9184 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
9185   "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
9186 def note_omp_previous_grainsize_num_tasks : Note<
9187   "'%0' clause is specified here">;
9188 def err_omp_hint_clause_no_name : Error<
9189   "the name of the construct must be specified in presence of 'hint' clause">;
9190 def err_omp_critical_with_hint : Error<
9191   "constructs with the same name must have a 'hint' clause with the same value">;
9192 def note_omp_critical_hint_here : Note<
9193   "%select{|previous }0'hint' clause with value '%1'">;
9194 def note_omp_critical_no_hint : Note<
9195   "%select{|previous }0directive with no 'hint' clause specified">;
9196 def err_omp_depend_clause_thread_simd : Error<
9197   "'depend' clauses cannot be mixed with '%0' clause">;
9198 def err_omp_depend_sink_expected_loop_iteration : Error<
9199   "expected%select{| %1}0 loop iteration variable">;
9200 def err_omp_depend_sink_unexpected_expr : Error<
9201   "unexpected expression: number of expressions is larger than the number of associated loops">;
9202 def err_omp_depend_sink_expected_plus_minus : Error<
9203   "expected '+' or '-' operation">;
9204 def err_omp_depend_sink_source_not_allowed : Error<
9205   "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
9206 def err_omp_linear_ordered : Error<
9207   "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
9208 def err_omp_unexpected_schedule_modifier : Error<
9209   "modifier '%0' cannot be used along with modifier '%1'">;
9210 def err_omp_schedule_nonmonotonic_static : Error<
9211   "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
9212 def err_omp_schedule_nonmonotonic_ordered : Error<
9213   "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
9214 def err_omp_ordered_simd : Error<
9215   "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
9216 def err_omp_variable_in_given_clause_and_dsa : Error<
9217   "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
9218 def err_omp_param_or_this_in_clause : Error<
9219   "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
9220 def err_omp_expected_uniform_param : Error<
9221   "expected a reference to a parameter specified in a 'uniform' clause">;
9222 def err_omp_expected_int_param : Error<
9223   "expected a reference to an integer-typed parameter">;
9224 def err_omp_at_least_one_motion_clause_required : Error<
9225   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
9226 def err_omp_usedeviceptr_not_a_pointer : Error<
9227   "expected pointer or reference to pointer in 'use_device_ptr' clause">;
9228 def err_omp_argument_type_isdeviceptr : Error <
9229   "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
9230 def warn_omp_nesting_simd : Warning<
9231   "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
9232   InGroup<SourceUsesOpenMP>;
9233 def err_omp_orphaned_device_directive : Error<
9234   "orphaned 'omp %0' directives are prohibited"
9235   "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
9236 def err_omp_reduction_non_addressable_expression : Error<
9237   "expected addressable reduction item for the task-based directives">;
9238 def err_omp_reduction_with_nogroup : Error<
9239   "'reduction' clause cannot be used with 'nogroup' clause">;
9240 def err_omp_reduction_vla_unsupported : Error<
9241   "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
9242 def err_omp_linear_distribute_var_non_loop_iteration : Error<
9243   "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
9244 def warn_omp_non_trivial_type_mapped : Warning<
9245   "Non-trivial type %0 is mapped, only trivial types are guaranteed to be mapped correctly">,
9246   InGroup<OpenMPTarget>;
9247 def err_omp_requires_clause_redeclaration : Error <
9248   "Only one %0 clause can appear on a requires directive in a single translation unit">;
9249 def note_omp_requires_previous_clause : Note <
9250   "%0 clause previously used here">;
9251 def err_omp_target_before_requires : Error <
9252   "target region encountered before requires directive with '%0' clause">;
9253 def note_omp_requires_encountered_target : Note <
9254   "target previously encountered here">;
9255 def err_omp_invalid_scope : Error <
9256   "'#pragma omp %0' directive must appear only in file scope">;
9257 def note_omp_invalid_length_on_this_ptr_mapping : Note <
9258   "expected length on mapping of 'this' array section expression to be '1'">;
9259 def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note <
9260   "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">;
9261 def note_omp_invalid_subscript_on_this_ptr_map : Note <
9262   "expected 'this' subscript expression on map clause to be 'this[0]'">;
9263 def err_omp_invalid_map_this_expr : Error <
9264   "invalid 'this' expression on 'map' clause">;
9265 def err_implied_omp_allocator_handle_t_not_found : Error<
9266   "omp_allocator_handle_t type not found; include <omp.h>">;
9267 def err_omp_expected_predefined_allocator : Error<
9268   "expected one of the predefined allocators for the variables with the static "
9269   "storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', "
9270   "'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', "
9271   "'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'">;
9272 def warn_omp_used_different_allocator : Warning<
9273   "allocate directive specifies %select{default|'%1'}0 allocator while "
9274   "previously used %select{default|'%3'}2">,
9275   InGroup<OpenMPClauses>;
9276 def note_omp_previous_allocator : Note<
9277   "previous allocator is specified here">;
9278 def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
9279   "inside of the target region; provide an 'allocator' clause or use 'requires'"
9280   " directive with the 'dynamic_allocators' clause">;
9281 def err_expected_allocator_expression : Error<"expected an allocator expression "
9282   "inside of the target region; provide an allocator expression or use 'requires'"
9283   " directive with the 'dynamic_allocators' clause">;
9284 def warn_omp_allocate_thread_on_task_target_directive : Warning<
9285   "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
9286   InGroup<OpenMPClauses>;
9287 def err_omp_expected_private_copy_for_allocate : Error<
9288   "the referenced item is not found in any private clause on the same directive">;
9289 def err_omp_stmt_depends_on_loop_counter : Error<
9290   "the loop %select{initializer|condition}0 expression depends on the current loop control variable">;
9291 def err_omp_invariant_or_linear_dependency : Error<
9292   "expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
9293 def err_omp_wrong_dependency_iterator_type : Error<
9294   "expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
9295 def err_omp_unsupported_type : Error <
9296   "host requires %0 bit size %1 type support, but device '%2' does not support it">;
9297 } // end of OpenMP category
9298
9299 let CategoryName = "Related Result Type Issue" in {
9300 // Objective-C related result type compatibility
9301 def warn_related_result_type_compatibility_class : Warning<
9302   "method is expected to return an instance of its class type "
9303   "%diff{$, but is declared to return $|"
9304   ", but is declared to return different type}0,1">;
9305 def warn_related_result_type_compatibility_protocol : Warning<
9306   "protocol method is expected to return an instance of the implementing "
9307   "class, but is declared to return %0">;
9308 def note_related_result_type_family : Note<
9309   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
9310   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
9311   "self}1' method family%select{| and is expected to return an instance of its "
9312   "class type}0">;
9313 def note_related_result_type_overridden : Note<
9314   "overridden method returns an instance of its class type">;
9315 def note_related_result_type_inferred : Note<
9316   "%select{class|instance}0 method %1 is assumed to return an instance of "
9317   "its receiver type (%2)">;
9318 def note_related_result_type_explicit : Note<
9319   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
9320   "%select{| and is expected to return an instance of its class type}0">;
9321 def err_invalid_type_for_program_scope_var : Error<
9322   "the %0 type cannot be used to declare a program scope variable">;
9323
9324 }
9325
9326 let CategoryName = "Modules Issue" in {
9327 def err_module_decl_in_module_map_module : Error<
9328   "'module' declaration found while building module from module map">;
9329 def err_module_decl_in_header_module : Error<
9330   "'module' declaration found while building header unit">;
9331 def err_module_interface_implementation_mismatch : Error<
9332   "missing 'export' specifier in module declaration while "
9333   "building module interface">;
9334 def err_current_module_name_mismatch : Error<
9335   "module name '%0' specified on command line does not match name of module">;
9336 def err_module_redefinition : Error<
9337   "redefinition of module '%0'">;
9338 def note_prev_module_definition : Note<"previously defined here">;
9339 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
9340 def err_module_not_defined : Error<
9341   "definition of module '%0' is not available; use -fmodule-file= to specify "
9342   "path to precompiled module interface">;
9343 def err_module_redeclaration : Error<
9344   "translation unit contains multiple module declarations">;
9345 def note_prev_module_declaration : Note<"previous module declaration is here">;
9346 def err_module_declaration_missing : Error<
9347   "missing 'export module' declaration in module interface unit">;
9348 def err_module_declaration_missing_after_global_module_introducer : Error<
9349   "missing 'module' declaration at end of global module fragment "
9350   "introduced here">;
9351 def err_module_private_specialization : Error<
9352   "%select{template|partial|member}0 specialization cannot be "
9353   "declared __module_private__">;
9354 def err_module_private_local : Error<
9355   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
9356   "__module_private__">;
9357 def err_module_private_local_class : Error<
9358   "local %select{struct|interface|union|class|enum}0 cannot be declared "
9359   "__module_private__">;
9360 def err_module_unimported_use : Error<
9361   "%select{declaration|definition|default argument|"
9362   "explicit specialization|partial specialization}0 of %1 must be imported "
9363   "from module '%2' before it is required">;
9364 def err_module_unimported_use_header : Error<
9365   "missing '#include %3'; "
9366   "%select{declaration|definition|default argument|"
9367   "explicit specialization|partial specialization}0 of %1 must be imported "
9368   "from module '%2' before it is required">;
9369 def err_module_unimported_use_global_module_fragment : Error<
9370   "%select{missing '#include'|missing '#include %3'}2; "
9371   "%select{||default argument of |explicit specialization of |"
9372   "partial specialization of }0%1 must be "
9373   "%select{declared|defined|defined|declared|declared}0 "
9374   "before it is used">;
9375 def err_module_unimported_use_multiple : Error<
9376   "%select{declaration|definition|default argument|"
9377   "explicit specialization|partial specialization}0 of %1 must be imported "
9378   "from one of the following modules before it is required:%2">;
9379 def ext_module_import_in_extern_c : ExtWarn<
9380   "import of C++ module '%0' appears within extern \"C\" language linkage "
9381   "specification">, DefaultError,
9382   InGroup<DiagGroup<"module-import-in-extern-c">>;
9383 def err_module_import_not_at_top_level_fatal : Error<
9384   "import of module '%0' appears within %1">, DefaultFatal;
9385 def ext_module_import_not_at_top_level_noop : ExtWarn<
9386   "redundant #include of module '%0' appears within %1">, DefaultError,
9387   InGroup<DiagGroup<"modules-import-nested-redundant">>;
9388 def note_module_import_not_at_top_level : Note<"%0 begins here">;
9389 def err_module_self_import : Error<
9390   "import of module '%0' appears within same top-level module '%1'">;
9391 def err_module_import_in_implementation : Error<
9392   "@import of module '%0' in implementation of '%1'; use #import">;
9393
9394 // C++ Modules
9395 def err_module_decl_not_at_start : Error<
9396   "module declaration must occur at the start of the translation unit">;
9397 def note_global_module_introducer_missing : Note<
9398   "add 'module;' to the start of the file to introduce a "
9399   "global module fragment">;
9400 def err_export_within_anonymous_namespace : Error<
9401   "export declaration appears within anonymous namespace">;
9402 def note_anonymous_namespace : Note<"anonymous namespace begins here">;
9403 def ext_export_no_name_block : ExtWarn<
9404   "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
9405   "to appear in an export block">, InGroup<ExportUnnamed>;
9406 def ext_export_no_names : ExtWarn<
9407   "ISO C++20 does not permit a declaration that does not introduce any names "
9408   "to be exported">, InGroup<ExportUnnamed>;
9409 def note_export : Note<"export block begins here">;
9410 def err_export_no_name : Error<
9411   "%select{empty|static_assert|asm}0 declaration cannot be exported">;
9412 def ext_export_using_directive : ExtWarn<
9413   "ISO C++20 does not permit using directive to be exported">,
9414   InGroup<DiagGroup<"export-using-directive">>;
9415 def err_export_within_export : Error<
9416   "export declaration appears within another export declaration">;
9417 def err_export_internal : Error<
9418   "declaration of %0 with internal linkage cannot be exported">;
9419 def err_export_using_internal : Error<
9420   "using declaration referring to %0 with internal linkage cannot be exported">;
9421 def err_export_not_in_module_interface : Error<
9422   "export declaration can only be used within a module interface unit"
9423   "%select{ after the module declaration|}0">;
9424 def err_export_in_private_module_fragment : Error<
9425   "export declaration cannot be used in a private module fragment">;
9426 def note_private_module_fragment : Note<
9427   "private module fragment begins here">;
9428 def err_private_module_fragment_not_module : Error<
9429   "private module fragment declaration with no preceding module declaration">;
9430 def err_private_module_fragment_redefined : Error<
9431   "private module fragment redefined">;
9432 def err_private_module_fragment_not_module_interface : Error<
9433   "private module fragment in module implementation unit">;
9434 def note_not_module_interface_add_export : Note<
9435   "add 'export' here if this is intended to be a module interface unit">;
9436
9437 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
9438   "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
9439   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
9440 def note_equivalent_internal_linkage_decl : Note<
9441   "declared here%select{ in module '%1'|}0">;
9442
9443 def note_redefinition_modules_same_file : Note<
9444   "'%0' included multiple times, additional include site in header from module '%1'">;
9445 def note_redefinition_include_same_file : Note<
9446   "'%0' included multiple times, additional include site here">;
9447 }
9448
9449 let CategoryName = "Coroutines Issue" in {
9450 def err_return_in_coroutine : Error<
9451   "return statement not allowed in coroutine; did you mean 'co_return'?">;
9452 def note_declared_coroutine_here : Note<
9453   "function is a coroutine due to use of '%0' here">;
9454 def err_coroutine_objc_method : Error<
9455   "Objective-C methods as coroutines are not yet supported">;
9456 def err_coroutine_unevaluated_context : Error<
9457   "'%0' cannot be used in an unevaluated context">;
9458 def err_coroutine_within_handler : Error<
9459   "'%0' cannot be used in the handler of a try block">;
9460 def err_coroutine_outside_function : Error<
9461   "'%0' cannot be used outside a function">;
9462 def err_coroutine_invalid_func_context : Error<
9463   "'%1' cannot be used in %select{a constructor|a destructor"
9464   "|the 'main' function|a constexpr function"
9465   "|a function with a deduced return type|a varargs function"
9466   "|a consteval function}0">;
9467 def err_implied_coroutine_type_not_found : Error<
9468   "%0 type was not found; include <experimental/coroutine> before defining "
9469   "a coroutine">;
9470 def err_implicit_coroutine_std_nothrow_type_not_found : Error<
9471   "std::nothrow was not found; include <new> before defining a coroutine which "
9472   "uses get_return_object_on_allocation_failure()">;
9473 def err_malformed_std_nothrow : Error<
9474   "std::nothrow must be a valid variable declaration">;
9475 def err_malformed_std_coroutine_handle : Error<
9476   "std::experimental::coroutine_handle must be a class template">;
9477 def err_coroutine_handle_missing_member : Error<
9478   "std::experimental::coroutine_handle missing a member named '%0'">;
9479 def err_malformed_std_coroutine_traits : Error<
9480   "'std::experimental::coroutine_traits' must be a class template">;
9481 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
9482   "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
9483 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
9484   "this function cannot be a coroutine: %0 is not a class">;
9485 def err_coroutine_promise_type_incomplete : Error<
9486   "this function cannot be a coroutine: %0 is an incomplete type">;
9487 def err_coroutine_type_missing_specialization : Error<
9488   "this function cannot be a coroutine: missing definition of "
9489   "specialization %0">;
9490 def err_coroutine_promise_incompatible_return_functions : Error<
9491   "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
9492 def err_coroutine_promise_requires_return_function : Error<
9493   "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
9494 def note_coroutine_promise_implicit_await_transform_required_here : Note<
9495   "call to 'await_transform' implicitly required by 'co_await' here">;
9496 def note_coroutine_promise_suspend_implicitly_required : Note<
9497   "call to '%select{initial_suspend|final_suspend}0' implicitly "
9498   "required by the %select{initial suspend point|final suspend point}0">;
9499 def err_coroutine_promise_unhandled_exception_required : Error<
9500   "%0 is required to declare the member 'unhandled_exception()'">;
9501 def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
9502   "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
9503   InGroup<CoroutineMissingUnhandledException>;
9504 def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
9505   "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
9506 def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
9507   "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
9508 def err_coroutine_promise_new_requires_nothrow : Error<
9509   "%0 is required to have a non-throwing noexcept specification when the promise "
9510    "type declares 'get_return_object_on_allocation_failure()'">;
9511 def note_coroutine_promise_call_implicitly_required : Note<
9512   "call to %0 implicitly required by coroutine function here">;
9513 def err_await_suspend_invalid_return_type : Error<
9514   "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
9515 >;
9516 def note_await_ready_no_bool_conversion : Note<
9517   "return type of 'await_ready' is required to be contextually convertible to 'bool'"
9518 >;
9519 }
9520
9521 let CategoryName = "Documentation Issue" in {
9522 def warn_not_a_doxygen_trailing_member_comment : Warning<
9523   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
9524 } // end of documentation issue category
9525
9526 let CategoryName = "Nullability Issue" in {
9527
9528 def warn_mismatched_nullability_attr : Warning<
9529   "nullability specifier %0 conflicts with existing specifier %1">,
9530   InGroup<Nullability>;
9531
9532 def warn_nullability_declspec : Warning<
9533   "nullability specifier %0 cannot be applied "
9534   "to non-pointer type %1; did you mean to apply the specifier to the "
9535   "%select{pointer|block pointer|member pointer|function pointer|"
9536   "member function pointer}2?">,
9537   InGroup<NullabilityDeclSpec>,
9538   DefaultError;
9539
9540 def note_nullability_here : Note<"%0 specified here">;
9541
9542 def err_nullability_nonpointer : Error<
9543   "nullability specifier %0 cannot be applied to non-pointer type %1">;
9544
9545 def warn_nullability_lost : Warning<
9546   "implicit conversion from nullable pointer %0 to non-nullable pointer "
9547   "type %1">,
9548   InGroup<NullableToNonNullConversion>, DefaultIgnore;
9549 def warn_zero_as_null_pointer_constant : Warning<
9550   "zero as null pointer constant">,
9551   InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
9552
9553 def err_nullability_cs_multilevel : Error<
9554   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
9555 def note_nullability_type_specifier : Note<
9556   "use nullability type specifier %0 to affect the innermost "
9557   "pointer type of %1">;
9558
9559 def warn_null_resettable_setter : Warning<
9560   "synthesized setter %0 for null_resettable property %1 does not handle nil">,
9561   InGroup<Nullability>;
9562
9563 def warn_nullability_missing : Warning<
9564   "%select{pointer|block pointer|member pointer}0 is missing a nullability "
9565   "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
9566   InGroup<NullabilityCompleteness>;
9567 def warn_nullability_missing_array : Warning<
9568   "array parameter is missing a nullability type specifier (_Nonnull, "
9569   "_Nullable, or _Null_unspecified)">,
9570   InGroup<NullabilityCompletenessOnArrays>;
9571 def note_nullability_fix_it : Note<
9572   "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
9573   "%select{pointer|block pointer|member pointer|array parameter}1 "
9574   "%select{should never be null|may be null|should not declare nullability}0">;
9575
9576 def warn_nullability_inferred_on_nested_type : Warning<
9577   "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
9578   "deprecated">,
9579   InGroup<NullabilityInferredOnNestedType>;
9580
9581 def err_objc_type_arg_explicit_nullability : Error<
9582   "type argument %0 cannot explicitly specify nullability">;
9583
9584 def err_objc_type_param_bound_explicit_nullability : Error<
9585   "type parameter %0 bound %1 cannot explicitly specify nullability">;
9586
9587 }
9588
9589 let CategoryName = "Generics Issue" in {
9590
9591 def err_objc_type_param_bound_nonobject : Error<
9592   "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
9593
9594 def err_objc_type_param_bound_missing_pointer : Error<
9595   "missing '*' in type bound %0 for type parameter %1">;
9596 def err_objc_type_param_bound_qualified : Error<
9597   "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
9598
9599 def err_objc_type_param_redecl : Error<
9600   "redeclaration of type parameter %0">;
9601
9602 def err_objc_type_param_arity_mismatch : Error<
9603   "%select{forward class declaration|class definition|category|extension}0 has "
9604   "too %select{few|many}1 type parameters (expected %2, have %3)">;
9605
9606 def err_objc_type_param_bound_conflict : Error<
9607   "type bound %0 for type parameter %1 conflicts with "
9608   "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
9609
9610 def err_objc_type_param_variance_conflict : Error<
9611   "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
9612   "%select{in|co|contra}2variant type parameter %3">;
9613
9614 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
9615
9616 def err_objc_type_param_bound_missing : Error<
9617   "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
9618
9619 def err_objc_parameterized_category_nonclass : Error<
9620   "%select{extension|category}0 of non-parameterized class %1 cannot have type "
9621   "parameters">;
9622
9623 def err_objc_parameterized_forward_class : Error<
9624   "forward declaration of non-parameterized class %0 cannot have type "
9625   "parameters">;
9626
9627 def err_objc_parameterized_forward_class_first : Error<
9628   "class %0 previously declared with type parameters">;
9629
9630 def err_objc_type_arg_missing_star : Error<
9631   "type argument %0 must be a pointer (requires a '*')">;
9632 def err_objc_type_arg_qualified : Error<
9633   "type argument %0 cannot be qualified with '%1'">;
9634
9635 def err_objc_type_arg_missing : Error<
9636   "no type or protocol named %0">;
9637
9638 def err_objc_type_args_and_protocols : Error<
9639   "angle brackets contain both a %select{type|protocol}0 (%1) and a "
9640   "%select{protocol|type}0 (%2)">;
9641
9642 def err_objc_type_args_non_class : Error<
9643   "type arguments cannot be applied to non-class type %0">;
9644
9645 def err_objc_type_args_non_parameterized_class : Error<
9646   "type arguments cannot be applied to non-parameterized class %0">;
9647
9648 def err_objc_type_args_specialized_class : Error<
9649   "type arguments cannot be applied to already-specialized class type %0">;
9650
9651 def err_objc_type_args_wrong_arity : Error<
9652   "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
9653 }
9654
9655 def err_objc_type_arg_not_id_compatible : Error<
9656   "type argument %0 is neither an Objective-C object nor a block type">;
9657
9658 def err_objc_type_arg_does_not_match_bound : Error<
9659   "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
9660
9661 def warn_objc_redundant_qualified_class_type : Warning<
9662   "parameterized class %0 already conforms to the protocols listed; did you "
9663   "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
9664
9665 def warn_block_literal_attributes_on_omitted_return_type : Warning<
9666   "attribute %0 ignored, because it cannot be applied to omitted return type">,
9667   InGroup<IgnoredAttributes>;
9668
9669 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
9670   "'%0' qualifier on omitted return type %1 has no effect">,
9671   InGroup<IgnoredQualifiers>;
9672
9673 def warn_shadow_field : Warning<
9674   "%select{parameter|non-static data member}3 %0 %select{|of %1 }3shadows "
9675   "member inherited from type %2">, InGroup<ShadowField>, DefaultIgnore;
9676 def note_shadow_field : Note<"declared here">;
9677
9678 def err_multiversion_required_in_redecl : Error<
9679   "function declaration is missing %select{'target'|'cpu_specific' or "
9680   "'cpu_dispatch'}0 attribute in a multiversioned function">;
9681 def note_multiversioning_caused_here : Note<
9682   "function multiversioning caused by this declaration">;
9683 def err_multiversion_after_used : Error<
9684   "function declaration cannot become a multiversioned function after first "
9685   "usage">;
9686 def err_bad_multiversion_option : Error<
9687   "function multiversioning doesn't support %select{feature|architecture}0 "
9688   "'%1'">;
9689 def err_multiversion_duplicate : Error<
9690   "multiversioned function redeclarations require identical target attributes">;
9691 def err_multiversion_noproto : Error<
9692   "multiversioned function must have a prototype">;
9693 def err_multiversion_no_other_attrs : Error<
9694   "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined"
9695   " with other attributes">;
9696 def err_multiversion_diff : Error<
9697   "multiversioned function declaration has a different %select{calling convention"
9698   "|return type|constexpr specification|inline specification|storage class|"
9699   "linkage}0">;
9700 def err_multiversion_doesnt_support : Error<
9701   "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not "
9702   "yet support %select{function templates|virtual functions|"
9703   "deduced return types|constructors|destructors|deleted functions|"
9704   "defaulted functions|constexpr functions|consteval function}1">;
9705 def err_multiversion_not_allowed_on_main : Error<
9706   "'main' cannot be a multiversioned function">;
9707 def err_multiversion_not_supported : Error<
9708  "function multiversioning is not supported on the current target">;
9709 def err_multiversion_types_mixed : Error<
9710   "multiversioning attributes cannot be combined">;
9711 def err_cpu_dispatch_mismatch : Error<
9712  "'cpu_dispatch' function redeclared with different CPUs">;
9713 def err_cpu_specific_multiple_defs : Error<
9714  "multiple 'cpu_specific' functions cannot specify the same CPU: %0">;
9715 def warn_multiversion_duplicate_entries : Warning<
9716  "CPU list contains duplicate entries; attribute ignored">,
9717   InGroup<FunctionMultiVersioning>;
9718 def warn_dispatch_body_ignored : Warning<
9719   "body of cpu_dispatch function will be ignored">,
9720   InGroup<FunctionMultiVersioning>;
9721
9722 // three-way comparison operator diagnostics
9723 def err_implied_comparison_category_type_not_found : Error<
9724   "cannot deduce return type of 'operator<=>' because type '%0' was not found; "
9725   "include <compare>">;
9726 def err_spaceship_argument_narrowing : Error<
9727   "argument to 'operator<=>' "
9728   "%select{cannot be narrowed from type %1 to %2|"
9729   "evaluates to %1, which cannot be narrowed to type %2}0">;
9730 def err_std_compare_type_not_supported : Error<
9731   "standard library implementation of %0 is not supported; "
9732    "%select{member '%2' does not have expected form|"
9733    "member '%2' is missing|"
9734    "the type is not trivially copyable|"
9735    "the type does not have the expected form}1">;
9736
9737 // Memory Tagging Extensions (MTE) diagnostics
9738 def err_memtag_arg_null_or_pointer : Error<
9739   "%0 argument of MTE builtin function must be a null or a pointer (%1 invalid)">;
9740 def err_memtag_any2arg_pointer : Error<
9741   "at least one argument of MTE builtin function must be a pointer (%0, %1 invalid)">;
9742 def err_memtag_arg_must_be_pointer : Error<
9743   "%0 argument of MTE builtin function must be a pointer (%1 invalid)">;
9744 def err_memtag_arg_must_be_integer : Error<
9745   "%0 argument of MTE builtin function must be an integer type (%1 invalid)">;
9746 def err_memtag_arg_must_be_unsigned : Error<
9747   "%0 argument  of MTE builtin function must be an unsigned integer type (%1 invalid)">;
9748
9749 def warn_dereference_of_noderef_type : Warning<
9750   "dereferencing %0; was declared with a 'noderef' type">, InGroup<NoDeref>;
9751 def warn_dereference_of_noderef_type_no_decl : Warning<
9752   "dereferencing expression marked as 'noderef'">, InGroup<NoDeref>;
9753 def warn_noderef_on_non_pointer_or_array : Warning<
9754   "'noderef' can only be used on an array or pointer type">, InGroup<IgnoredAttributes>;
9755 def warn_noderef_to_dereferenceable_pointer : Warning<
9756   "casting to dereferenceable pointer removes 'noderef' attribute">, InGroup<NoDeref>;
9757
9758 def err_builtin_launder_invalid_arg : Error<
9759   "%select{non-pointer|function pointer|void pointer}0 argument to "
9760   "'__builtin_launder' is not allowed">;
9761
9762 def err_bit_cast_non_trivially_copyable : Error<
9763   "__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
9764 def err_bit_cast_type_size_mismatch : Error<
9765   "__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
9766 } // end of sema component.