]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
MFV: file 5.33
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Basic / DiagnosticSemaKinds.td
1 //==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // Semantic Analysis
12 //===----------------------------------------------------------------------===//
13
14 let Component = "Sema" in {
15 let CategoryName = "Semantic Issue" in {
16
17 def note_previous_decl : Note<"%0 declared here">;
18 def note_entity_declared_at : Note<"%0 declared here">;
19 def note_callee_decl : Note<"%0 declared here">;
20 def note_defined_here : Note<"%0 defined here">;
21
22 // For loop analysis
23 def warn_variables_not_in_loop_body : Warning<
24   "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
25   "used in loop condition not modified in loop body">,
26   InGroup<ForLoopAnalysis>, DefaultIgnore;
27 def warn_redundant_loop_iteration : Warning<
28   "variable %0 is %select{decremented|incremented}1 both in the loop header "
29   "and in the loop body">,
30   InGroup<ForLoopAnalysis>, DefaultIgnore;
31 def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
32
33 def warn_duplicate_enum_values : Warning<
34   "element %0 has been implicitly assigned %1 which another element has "
35   "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
36 def note_duplicate_element : Note<"element %0 also has value %1">;
37
38 // Absolute value functions
39 def warn_unsigned_abs : Warning<
40   "taking the absolute value of unsigned type %0 has no effect">,
41   InGroup<AbsoluteValue>;
42 def note_remove_abs : Note<
43   "remove the call to '%0' since unsigned values cannot be negative">;
44 def warn_abs_too_small : Warning<
45   "absolute value function %0 given an argument of type %1 but has parameter "
46   "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>;
47 def warn_wrong_absolute_value_type : Warning<
48   "using %select{integer|floating point|complex}1 absolute value function %0 "
49   "when argument is of %select{integer|floating point|complex}2 type">,
50   InGroup<AbsoluteValue>;
51 def note_replace_abs_function : Note<"use function '%0' instead">;
52 def warn_pointer_abs : Warning<
53   "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">,
54   InGroup<AbsoluteValue>;
55
56 def warn_max_unsigned_zero : Warning<
57   "taking the max of "
58   "%select{a value and unsigned zero|unsigned zero and a value}0 "
59   "is always equal to the other value">,
60   InGroup<MaxUnsignedZero>;
61 def note_remove_max_call : Note<
62   "remove call to max function and unsigned zero argument">;
63
64 def warn_infinite_recursive_function : Warning<
65   "all paths through this function will call itself">,
66   InGroup<InfiniteRecursion>, DefaultIgnore;
67
68 def warn_comma_operator : Warning<"possible misuse of comma operator here">,
69   InGroup<DiagGroup<"comma">>, DefaultIgnore;
70 def note_cast_to_void : Note<"cast expression to void to silence warning">;
71
72 // Constant expressions
73 def err_expr_not_ice : Error<
74   "expression is not an %select{integer|integral}0 constant expression">;
75 def ext_expr_not_ice : Extension<
76   "expression is not an %select{integer|integral}0 constant expression; "
77   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
78 def err_typecheck_converted_constant_expression : Error<
79   "value of type %0 is not implicitly convertible to %1">;
80 def err_typecheck_converted_constant_expression_disallowed : Error<
81   "conversion from %0 to %1 is not allowed in a converted constant expression">;
82 def err_typecheck_converted_constant_expression_indirect : Error<
83   "conversion from %0 to %1 in converted constant expression would "
84   "bind reference to a temporary">;
85 def err_expr_not_cce : Error<
86   "%select{case value|enumerator value|non-type template argument|"
87   "array size|constexpr if condition}0 "
88   "is not a constant expression">;
89 def ext_cce_narrowing : ExtWarn<
90   "%select{case value|enumerator value|non-type template argument|"
91   "array size|constexpr if condition}0 "
92   "%select{cannot be narrowed from type %2 to %3|"
93   "evaluates to %2, which cannot be narrowed to type %3}1">,
94   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
95 def err_ice_not_integral : Error<
96   "integral constant expression must have integral or unscoped enumeration "
97   "type, not %0">;
98 def err_ice_incomplete_type : Error<
99   "integral constant expression has incomplete class type %0">;
100 def err_ice_explicit_conversion : Error<
101   "integral constant expression requires explicit conversion from %0 to %1">;
102 def note_ice_conversion_here : Note<
103   "conversion to %select{integral|enumeration}0 type %1 declared here">;
104 def err_ice_ambiguous_conversion : Error<
105   "ambiguous conversion from type %0 to an integral or unscoped "
106   "enumeration type">;
107 def err_ice_too_large : Error<
108   "integer constant expression evaluates to value %0 that cannot be "
109   "represented in a %1-bit %select{signed|unsigned}2 integer type">;
110 def err_expr_not_string_literal : Error<"expression is not a string literal">;
111
112 // Semantic analysis of constant literals.
113 def ext_predef_outside_function : Warning<
114   "predefined identifier is only valid inside function">,
115   InGroup<DiagGroup<"predefined-identifier-outside-function">>;
116 def warn_float_overflow : Warning<
117   "magnitude of floating-point constant too large for type %0; maximum is %1">,
118    InGroup<LiteralRange>;
119 def warn_float_underflow : Warning<
120   "magnitude of floating-point constant too small for type %0; minimum is %1">,
121   InGroup<LiteralRange>;
122 def warn_double_const_requires_fp64 : Warning<
123   "double precision constant requires cl_khr_fp64, casting to single precision">;
124 def err_half_const_requires_fp16 : Error<
125   "half precision constant requires cl_khr_fp16">;
126
127 // C99 variable-length arrays
128 def ext_vla : Extension<"variable length arrays are a C99 feature">,
129   InGroup<VLAExtension>;
130 def warn_vla_used : Warning<"variable length array used">,
131   InGroup<VLA>, DefaultIgnore;
132 def err_vla_in_sfinae : Error<
133   "variable length array cannot be formed during template argument deduction">;
134 def err_array_star_in_function_definition : Error<
135   "variable length array must be bound in function definition">;
136 def err_vla_decl_in_file_scope : Error<
137   "variable length array declaration not allowed at file scope">;
138 def err_vla_decl_has_static_storage : Error<
139   "variable length array declaration cannot have 'static' storage duration">;
140 def err_vla_decl_has_extern_linkage : Error<
141   "variable length array declaration cannot have 'extern' linkage">;
142 def ext_vla_folded_to_constant : Extension<
143   "variable length array folded to constant array as an extension">, InGroup<GNUFoldingConstant>;
144 def err_vla_unsupported : Error<
145   "variable length arrays are not supported for the current target">;
146 def note_vla_unsupported : Note<
147   "variable length arrays are not supported for the current target">;
148
149 // C99 variably modified types
150 def err_variably_modified_template_arg : Error<
151   "variably modified type %0 cannot be used as a template argument">;
152 def err_variably_modified_nontype_template_param : Error<
153   "non-type template parameter of variably modified type %0">;
154 def err_variably_modified_new_type : Error<
155   "'new' cannot allocate object of variably modified type %0">;
156
157 // C99 Designated Initializers
158 def ext_designated_init : Extension<
159   "designated initializers are a C99 feature">, InGroup<C99>;
160 def err_array_designator_negative : Error<
161   "array designator value '%0' is negative">;
162 def err_array_designator_empty_range : Error<
163   "array designator range [%0, %1] is empty">;
164 def err_array_designator_non_array : Error<
165   "array designator cannot initialize non-array type %0">;
166 def err_array_designator_too_large : Error<
167   "array designator index (%0) exceeds array bounds (%1)">;
168 def err_field_designator_non_aggr : Error<
169   "field designator cannot initialize a "
170   "%select{non-struct, non-union|non-class}0 type %1">;
171 def err_field_designator_unknown : Error<
172   "field designator %0 does not refer to any field in type %1">;
173 def err_field_designator_nonfield : Error<
174   "field designator %0 does not refer to a non-static data member">;
175 def note_field_designator_found : Note<"field designator refers here">;
176 def err_designator_for_scalar_init : Error<
177   "designator in initializer for scalar type %0">;
178 def warn_subobject_initializer_overrides : Warning<
179   "subobject initialization overrides initialization of other fields "
180   "within its enclosing subobject">, InGroup<InitializerOverrides>;
181 def warn_initializer_overrides : Warning<
182   "initializer overrides prior initialization of this subobject">,
183   InGroup<InitializerOverrides>;
184 def note_previous_initializer : Note<
185   "previous initialization %select{|with side effects }0is here"
186   "%select{| (side effects may not occur at run time)}0">;
187 def err_designator_into_flexible_array_member : Error<
188   "designator into flexible array member subobject">;
189 def note_flexible_array_member : Note<
190   "initialized flexible array member %0 is here">;
191 def ext_flexible_array_init : Extension<
192   "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
193
194 // Declarations.
195 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
196   InGroup<DuplicateDeclSpecifier>;
197 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
198   InGroup<DuplicateDeclSpecifier>;
199 def ext_plain_complex : ExtWarn<
200   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
201 def ext_imaginary_constant : Extension<
202   "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>;
203 def ext_integer_complex : Extension<
204   "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
205
206 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
207 def err_invalid_width_spec : Error<
208   "'%select{|short|long|long long}0 %1' is invalid">;
209 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
210 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
211
212 def ext_auto_type_specifier : ExtWarn<
213   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
214 def warn_auto_storage_class : Warning<
215   "'auto' storage class specifier is redundant and incompatible with C++11">,
216   InGroup<CXX11Compat>, DefaultIgnore;
217
218 def warn_deprecated_register : Warning<
219   "'register' storage class specifier is deprecated "
220   "and incompatible with C++17">, InGroup<DeprecatedRegister>;
221 def ext_register_storage_class : ExtWarn<
222   "ISO C++17 does not allow 'register' storage class specifier">,
223   DefaultError, InGroup<Register>;
224
225 def err_invalid_decl_spec_combination : Error<
226   "cannot combine with previous '%0' declaration specifier">;
227 def err_invalid_vector_decl_spec_combination : Error<
228   "cannot combine with previous '%0' declaration specifier. "
229   "'__vector' must be first">;
230 def err_invalid_pixel_decl_spec_combination : Error<
231   "'__pixel' must be preceded by '__vector'.  "
232   "'%0' declaration specifier not allowed here">;
233 def err_invalid_vector_bool_decl_spec : Error<
234   "cannot use '%0' with '__vector bool'">;
235 def err_invalid_vector_long_decl_spec : Error<
236   "cannot use 'long' with '__vector'">;
237 def err_invalid_vector_float_decl_spec : Error<
238   "cannot use 'float' with '__vector'">;
239 def err_invalid_vector_double_decl_spec : Error <
240   "use of 'double' with '__vector' requires VSX support to be enabled "
241   "(available on POWER7 or later)">;
242 def err_invalid_vector_long_long_decl_spec : Error <
243   "use of 'long long' with '__vector bool' requires VSX support (available on "
244   "POWER7 or later) or extended Altivec support (available on POWER8 or later) " 
245   "to be enabled">;
246 def err_invalid_vector_long_double_decl_spec : Error<
247   "cannot use 'long double' with '__vector'">;
248 def warn_vector_long_decl_spec_combination : Warning<
249   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
250
251 def err_use_of_tag_name_without_tag : Error<
252   "must use '%1' tag to refer to type %0%select{| in this scope}2">;
253
254 def err_redeclaration_different_type : Error<
255   "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
256 def err_bad_variable_name : Error<
257   "%0 cannot be the name of a variable or data member">;
258 def err_bad_parameter_name : Error<
259   "%0 cannot be the name of a parameter">;
260 def err_parameter_name_omitted : Error<"parameter name omitted">;
261 def err_anyx86_interrupt_attribute : Error<
262   "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
263   "have %select{a 'void' return type|"
264   "only a pointer parameter optionally followed by an integer parameter|"
265   "a pointer as the first parameter|a %2 type as the second parameter}1">;
266 def err_anyx86_interrupt_called : Error<
267   "interrupt service routine cannot be called directly">;
268 def warn_arm_interrupt_calling_convention : Warning<
269    "call to function without interrupt attribute could clobber interruptee's VFP registers">,
270    InGroup<Extra>;
271 def warn_mips_interrupt_attribute : Warning<
272    "MIPS 'interrupt' attribute only applies to functions that have "
273    "%select{no parameters|a 'void' return type}0">,
274    InGroup<IgnoredAttributes>;
275 def warn_unused_parameter : Warning<"unused parameter %0">,
276   InGroup<UnusedParameter>, DefaultIgnore;
277 def warn_unused_variable : Warning<"unused variable %0">,
278   InGroup<UnusedVariable>, DefaultIgnore;
279 def warn_unused_local_typedef : Warning<
280   "unused %select{typedef|type alias}0 %1">,
281   InGroup<UnusedLocalTypedef>, DefaultIgnore;
282 def warn_unused_property_backing_ivar : 
283   Warning<"ivar %0 which backs the property is not "
284   "referenced in this property's accessor">,
285   InGroup<UnusedPropertyIvar>, DefaultIgnore;
286 def warn_unused_const_variable : Warning<"unused variable %0">,
287   InGroup<UnusedConstVariable>, DefaultIgnore;
288 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
289   InGroup<UnusedExceptionParameter>, DefaultIgnore;
290 def warn_decl_in_param_list : Warning<
291   "declaration of %0 will not be visible outside of this function">,
292   InGroup<Visibility>;
293 def warn_redefinition_in_param_list : Warning<
294   "redefinition of %0 will not be visible outside of this function">,
295   InGroup<Visibility>;
296 def warn_empty_parens_are_function_decl : Warning<
297   "empty parentheses interpreted as a function declaration">,
298   InGroup<VexingParse>;
299 def warn_parens_disambiguated_as_function_declaration : Warning<
300   "parentheses were disambiguated as a function declaration">,
301   InGroup<VexingParse>;
302 def warn_parens_disambiguated_as_variable_declaration : Warning<
303   "parentheses were disambiguated as redundant parentheses around declaration "
304   "of variable named %0">, InGroup<VexingParse>;
305 def warn_redundant_parens_around_declarator : Warning<
306   "redundant parentheses surrounding declarator">,
307   InGroup<DiagGroup<"redundant-parens">>, DefaultIgnore;
308 def note_additional_parens_for_variable_declaration : Note<
309   "add a pair of parentheses to declare a variable">;
310 def note_raii_guard_add_name : Note<
311   "add a variable name to declare a %0 initialized with %1">;
312 def note_function_style_cast_add_parentheses : Note<
313   "add enclosing parentheses to perform a function-style cast">;
314 def note_remove_parens_for_variable_declaration : Note<
315   "remove parentheses to silence this warning">;
316 def note_empty_parens_function_call : Note<
317   "change this ',' to a ';' to call %0">;
318 def note_empty_parens_default_ctor : Note<
319   "remove parentheses to declare a variable">;
320 def note_empty_parens_zero_initialize : Note<
321   "replace parentheses with an initializer to declare a variable">;
322 def warn_unused_function : Warning<"unused function %0">,
323   InGroup<UnusedFunction>, DefaultIgnore;
324 def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
325   InGroup<UnusedTemplate>, DefaultIgnore;
326 def warn_unused_member_function : Warning<"unused member function %0">,
327   InGroup<UnusedMemberFunction>, DefaultIgnore;
328 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
329   InGroup<UsedButMarkedUnused>, DefaultIgnore;
330 def warn_unneeded_internal_decl : Warning<
331   "%select{function|variable}0 %1 is not needed and will not be emitted">,
332   InGroup<UnneededInternalDecl>, DefaultIgnore;
333 def warn_unneeded_static_internal_decl : Warning<
334   "'static' function %0 declared in header file "
335   "should be declared 'static inline'">,
336   InGroup<UnneededInternalDecl>, DefaultIgnore;
337 def warn_unneeded_member_function : Warning<
338   "member function %0 is not needed and will not be emitted">,
339   InGroup<UnneededMemberFunction>, DefaultIgnore;
340 def warn_unused_private_field: Warning<"private field %0 is not used">,
341   InGroup<UnusedPrivateField>, DefaultIgnore;
342 def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
343   "%select{used|required to be captured for this use}1">,
344   InGroup<UnusedLambdaCapture>, DefaultIgnore;
345
346 def warn_parameter_size: Warning<
347   "%0 is a large (%1 bytes) pass-by-value argument; "
348   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
349 def warn_return_value_size: Warning<
350   "return value of %0 is a large (%1 bytes) pass-by-value object; "
351   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
352 def warn_return_value_udt: Warning<
353   "%0 has C-linkage specified, but returns user-defined type %1 which is "
354   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
355 def warn_return_value_udt_incomplete: Warning<
356   "%0 has C-linkage specified, but returns incomplete type %1 which could be "
357   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
358 def warn_implicit_function_decl : Warning<
359   "implicit declaration of function %0">,
360   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
361 def ext_implicit_function_decl : ExtWarn<
362   "implicit declaration of function %0 is invalid in %select{C99|OpenCL}1">,
363   InGroup<ImplicitFunctionDeclare>;
364 def note_function_suggestion : Note<"did you mean %0?">;
365
366 def err_ellipsis_first_param : Error<
367   "ISO C requires a named parameter before '...'">;
368 def err_declarator_need_ident : Error<"declarator requires an identifier">;
369 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
370 def err_language_linkage_spec_not_ascii : Error<
371   "string literal in language linkage specifier cannot have an "
372   "encoding-prefix">;
373 def ext_use_out_of_scope_declaration : ExtWarn<
374   "use of out-of-scope declaration of %0%select{| whose type is not "
375   "compatible with that of an implicit declaration}1">,
376   InGroup<DiagGroup<"out-of-scope-function">>;
377 def err_inline_non_function : Error<
378   "'inline' can only appear on functions%select{| and non-local variables}0">;
379 def err_noreturn_non_function : Error<
380   "'_Noreturn' can only appear on functions">;
381 def warn_qual_return_type : Warning< 
382   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
383   InGroup<IgnoredQualifiers>, DefaultIgnore;
384 def warn_deprecated_redundant_constexpr_static_def : Warning<
385   "out-of-line definition of constexpr static data member is redundant "
386   "in C++17 and is deprecated">,
387   InGroup<Deprecated>, DefaultIgnore;
388
389 def warn_decl_shadow :
390   Warning<"declaration shadows a %select{"
391           "local variable|"
392           "variable in %2|"
393           "static data member of %2|"
394           "field of %2|"
395           "typedef in %2|"
396           "type alias in %2}1">,
397   InGroup<Shadow>, DefaultIgnore;
398 def warn_decl_shadow_uncaptured_local :
399   Warning<warn_decl_shadow.Text>,
400   InGroup<ShadowUncapturedLocal>, DefaultIgnore;
401 def warn_ctor_parm_shadows_field:
402   Warning<"constructor parameter %0 shadows the field %1 of %2">,
403   InGroup<ShadowFieldInConstructor>, DefaultIgnore;
404 def warn_modifying_shadowing_decl :
405   Warning<"modifying constructor parameter %0 that shadows a "
406           "field of %1">,
407   InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
408
409 // C++ decomposition declarations
410 def err_decomp_decl_context : Error<
411   "decomposition declaration not permitted in this context">;
412 def warn_cxx14_compat_decomp_decl : Warning<
413   "decomposition declarations are incompatible with "
414   "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
415 def ext_decomp_decl : ExtWarn<
416   "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
417 def ext_decomp_decl_cond : ExtWarn<
418   "ISO C++17 does not permit structured binding declaration in a condition">,
419   InGroup<DiagGroup<"binding-in-condition">>;
420 def err_decomp_decl_spec : Error<
421   "decomposition declaration cannot be declared "
422   "%plural{1:'%1'|:with '%1' specifiers}0">;
423 def err_decomp_decl_type : Error<
424   "decomposition declaration cannot be declared with type %0; "
425   "declared type must be 'auto' or reference to 'auto'">;
426 def err_decomp_decl_parens : Error<
427   "decomposition declaration cannot be declared with parentheses">;
428 def err_decomp_decl_template : Error<
429   "decomposition declaration template not supported">;
430 def err_decomp_decl_not_alone : Error<
431   "decomposition declaration must be the only declaration in its group">;
432 def err_decomp_decl_requires_init : Error<
433   "decomposition declaration %0 requires an initializer">;
434 def err_decomp_decl_wrong_number_bindings : Error<
435   "type %0 decomposes into %2 elements, but %select{only |}3%1 "
436   "names were provided">;
437 def err_decomp_decl_unbindable_type : Error<
438   "cannot decompose %select{union|non-class, non-array}1 type %2">;
439 def err_decomp_decl_multiple_bases_with_members : Error<
440   "cannot decompose class type %1: "
441   "%select{its base classes %2 and|both it and its base class}0 %3 "
442   "have non-static data members">;
443 def err_decomp_decl_ambiguous_base : Error<
444   "cannot decompose members of ambiguous base class %1 of %0:%2">;
445 def err_decomp_decl_non_public_base : Error<
446   "cannot decompose members of non-public base class %1 of %0">;
447 def err_decomp_decl_non_public_member : Error<
448   "cannot decompose non-public member %0 of %1">;
449 def err_decomp_decl_anon_union_member : Error<
450   "cannot decompose class type %0 because it has an anonymous "
451   "%select{struct|union}1 member">;
452 def err_decomp_decl_std_tuple_element_not_specialized : Error<
453   "cannot decompose this type; 'std::tuple_element<%0>::type' "
454   "does not name a type">;
455 def err_decomp_decl_std_tuple_size_not_constant : Error<
456   "cannot decompose this type; 'std::tuple_size<%0>::value' "
457   "is not a valid integral constant expression">;
458 def note_in_binding_decl_init : Note<
459   "in implicit initialization of binding declaration %0">;
460
461 def err_std_type_trait_not_class_template : Error<
462   "unsupported standard library implementation: "
463   "'std::%0' is not a class template">;
464
465 // C++ using declarations
466 def err_using_requires_qualname : Error<
467   "using declaration requires a qualified name">;
468 def err_using_typename_non_type : Error<
469   "'typename' keyword used on a non-type">;
470 def err_using_dependent_value_is_type : Error<
471   "dependent using declaration resolved to type without 'typename'">;
472 def err_using_decl_nested_name_specifier_is_not_class : Error<
473   "using declaration in class refers into '%0', which is not a class">;
474 def err_using_decl_nested_name_specifier_is_current_class : Error<
475   "using declaration refers to its own class">;
476 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
477   "using declaration refers into '%0', which is not a base class of %1">;
478 def err_using_decl_constructor_not_in_direct_base : Error<
479   "%0 is not a direct base of %1, cannot inherit constructors">;
480 def err_using_decl_can_not_refer_to_class_member : Error<
481   "using declaration cannot refer to class member">;
482 def err_ambiguous_inherited_constructor : Error<
483   "constructor of %0 inherited from multiple base class subobjects">;
484 def note_ambiguous_inherited_constructor_using : Note<
485   "inherited from base class %0 here">;
486 def note_using_decl_class_member_workaround : Note<
487   "use %select{an alias declaration|a typedef declaration|a reference|"
488   "a const variable|a constexpr variable}0 instead">;
489 def err_using_decl_can_not_refer_to_namespace : Error<
490   "using declaration cannot refer to a namespace">;
491 def err_using_decl_can_not_refer_to_scoped_enum : Error<
492   "using declaration cannot refer to a scoped enumerator">;
493 def err_using_decl_constructor : Error<
494   "using declaration cannot refer to a constructor">;
495 def warn_cxx98_compat_using_decl_constructor : Warning<
496   "inheriting constructors are incompatible with C++98">,
497   InGroup<CXX98Compat>, DefaultIgnore;
498 def err_using_decl_destructor : Error<
499   "using declaration cannot refer to a destructor">;
500 def err_using_decl_template_id : Error<
501   "using declaration cannot refer to a template specialization">;
502 def note_using_decl_target : Note<"target of using declaration">;
503 def note_using_decl_conflict : Note<"conflicting declaration">;
504 def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
505 def err_using_decl_conflict : Error<
506   "target of using declaration conflicts with declaration already in scope">;
507 def err_using_decl_conflict_reverse : Error<
508   "declaration conflicts with target of using declaration already in scope">;
509 def note_using_decl : Note<"%select{|previous }0using declaration">;
510 def err_using_decl_redeclaration_expansion : Error<
511   "using declaration pack expansion at block scope produces multiple values">;
512
513 def warn_access_decl_deprecated : Warning<
514   "access declarations are deprecated; use using declarations instead">,
515   InGroup<Deprecated>;
516 def err_access_decl : Error<
517   "ISO C++11 does not allow access declarations; "
518   "use using declarations instead">;
519 def ext_dynamic_exception_spec : ExtWarn<
520   "ISO C++17 does not allow dynamic exception specifications">,
521   InGroup<DynamicExceptionSpec>, DefaultError;
522 def warn_exception_spec_deprecated : Warning<
523   "dynamic exception specifications are deprecated">,
524   InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
525 def note_exception_spec_deprecated : Note<"use '%0' instead">;
526 def warn_deprecated_copy_operation : Warning<
527   "definition of implicit copy %select{constructor|assignment operator}1 "
528   "for %0 is deprecated because it has a user-declared "
529   "%select{copy %select{assignment operator|constructor}1|destructor}2">,
530   InGroup<Deprecated>, DefaultIgnore;
531 def warn_cxx17_compat_exception_spec_in_signature : Warning<
532   "mangled name of %0 will change in C++17 due to non-throwing exception "
533   "specification in function signature">, InGroup<CXX17CompatMangling>;
534
535 def warn_global_constructor : Warning<
536   "declaration requires a global constructor">,
537   InGroup<GlobalConstructors>, DefaultIgnore;
538 def warn_global_destructor : Warning<
539   "declaration requires a global destructor">,
540    InGroup<GlobalConstructors>, DefaultIgnore;
541 def warn_exit_time_destructor : Warning<
542   "declaration requires an exit-time destructor">,
543   InGroup<ExitTimeDestructors>, DefaultIgnore;
544
545 def err_invalid_thread : Error<
546   "'%0' is only allowed on variable declarations">;
547 def err_thread_non_global : Error<
548   "'%0' variables must have global storage">;
549 def err_thread_unsupported : Error<
550   "thread-local storage is not supported for the current target">;
551
552 def warn_maybe_falloff_nonvoid_function : Warning<
553   "control may reach end of non-void function">,
554   InGroup<ReturnType>;
555 def warn_falloff_nonvoid_function : Warning<
556   "control reaches end of non-void function">,
557   InGroup<ReturnType>;
558 def err_maybe_falloff_nonvoid_block : Error<
559   "control may reach end of non-void block">;
560 def err_falloff_nonvoid_block : Error<
561   "control reaches end of non-void block">;
562 def warn_maybe_falloff_nonvoid_coroutine : Warning<
563   "control may reach end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
564   InGroup<ReturnType>;
565 def warn_falloff_nonvoid_coroutine : Warning<
566   "control reaches end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
567   InGroup<ReturnType>;
568 def warn_suggest_noreturn_function : Warning<
569   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
570   InGroup<MissingNoreturn>, DefaultIgnore;
571 def warn_suggest_noreturn_block : Warning<
572   "block could be declared with attribute 'noreturn'">,
573   InGroup<MissingNoreturn>, DefaultIgnore;
574
575 // Unreachable code.
576 def warn_unreachable : Warning<
577   "code will never be executed">,
578   InGroup<UnreachableCode>, DefaultIgnore;
579 def warn_unreachable_break : Warning<
580   "'break' will never be executed">,
581   InGroup<UnreachableCodeBreak>, DefaultIgnore;
582 def warn_unreachable_return : Warning<
583   "'return' will never be executed">,
584   InGroup<UnreachableCodeReturn>, DefaultIgnore;
585 def warn_unreachable_loop_increment : Warning<
586   "loop will run at most once (loop increment never executed)">,
587   InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
588 def note_unreachable_silence : Note<
589   "silence by adding parentheses to mark code as explicitly dead">;
590
591 /// Built-in functions.
592 def ext_implicit_lib_function_decl : ExtWarn<
593   "implicitly declaring library function '%0' with type %1">,
594   InGroup<ImplicitFunctionDeclare>;
595 def note_include_header_or_declare : Note<
596   "include the header <%0> or explicitly provide a declaration for '%1'">;
597 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
598 def warn_implicit_decl_requires_sysheader : Warning<
599   "declaration of built-in function '%1' requires inclusion of the header <%0>">,
600   InGroup<BuiltinRequiresHeader>;
601 def warn_redecl_library_builtin : Warning<
602   "incompatible redeclaration of library function %0">,
603   InGroup<DiagGroup<"incompatible-library-redeclaration">>;
604 def err_builtin_definition : Error<"definition of builtin function %0">;
605 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
606 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
607 def err_invalid_cpu_is : Error<"invalid cpu name for builtin">;
608 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
609 def err_function_needs_feature
610     : Error<"always_inline function %1 requires target feature '%2', but would "
611             "be inlined into function %0 that is compiled without support for "
612             "'%2'">;
613 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
614   InGroup<ImplicitFunctionDeclare>, DefaultError;
615 def warn_dyn_class_memaccess : Warning<
616   "%select{destination for|source of|first operand of|second operand of}0 this "
617   "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
618   "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
619   InGroup<DiagGroup<"dynamic-class-memaccess">>;
620 def note_bad_memaccess_silence : Note<
621   "explicitly cast the pointer to silence this warning">;
622 def warn_sizeof_pointer_expr_memaccess : Warning<
623   "'%0' call operates on objects of type %1 while the size is based on a " 
624   "different type %2">, 
625   InGroup<SizeofPointerMemaccess>;
626 def warn_sizeof_pointer_expr_memaccess_note : Note<
627   "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
628   "it by the number of elements)|remove the addressof in the argument to "
629   "'sizeof' (and multiply it by the number of elements)|provide an explicit "
630   "length}0?">;
631 def warn_sizeof_pointer_type_memaccess : Warning<
632   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
633   "%select{destination|source}2; expected %3 or an explicit length">,
634   InGroup<SizeofPointerMemaccess>;
635 def warn_strlcpycat_wrong_size : Warning<
636   "size argument in %0 call appears to be size of the source; "
637   "expected the size of the destination">,
638   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
639 def note_strlcpycat_wrong_size : Note<
640   "change size argument to be the size of the destination">;
641 def warn_memsize_comparison : Warning<
642   "size argument in %0 call is a comparison">,
643   InGroup<DiagGroup<"memsize-comparison">>;
644 def note_memsize_comparison_paren : Note<
645   "did you mean to compare the result of %0 instead?">;
646 def note_memsize_comparison_cast_silence : Note<
647   "explicitly cast the argument to size_t to silence this warning">;
648   
649 def warn_strncat_large_size : Warning<
650   "the value of the size argument in 'strncat' is too large, might lead to a " 
651   "buffer overflow">, InGroup<StrncatSize>;
652 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " 
653   "to be size of the source">, InGroup<StrncatSize>;
654 def warn_strncat_wrong_size : Warning<
655   "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
656 def note_strncat_wrong_size : Note<
657   "change the argument to be the free space in the destination buffer minus " 
658   "the terminating null byte">;
659
660 def warn_assume_side_effects : Warning<
661   "the argument to %0 has side effects that will be discarded">,
662   InGroup<DiagGroup<"assume">>;
663
664 def warn_memcpy_chk_overflow : Warning<
665   "%0 will always overflow destination buffer">,
666   InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
667
668 /// main()
669 // static main() is not an error in C, just in C++.
670 def warn_static_main : Warning<"'main' should not be declared static">,
671     InGroup<Main>;
672 def err_static_main : Error<"'main' is not allowed to be declared static">;
673 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
674 def ext_variadic_main : ExtWarn<
675   "'main' is not allowed to be declared variadic">, InGroup<Main>;
676 def ext_noreturn_main : ExtWarn<
677   "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
678 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
679 def err_constexpr_main : Error<
680   "'main' is not allowed to be declared constexpr">;
681 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
682 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
683 def err_main_returns_nonint : Error<"'main' must return 'int'">;
684 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
685     InGroup<MainReturnType>;
686 def note_main_change_return_type : Note<"change return type to 'int'">;
687 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
688     "must be 0, 2, or 3">;
689 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
690     InGroup<Main>;
691 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
692     "parameter of 'main' (%select{argument count|argument array|environment|"
693     "platform-specific data}0) must be of type %1">;
694 def warn_main_returns_bool_literal : Warning<"bool literal returned from "
695     "'main'">, InGroup<Main>;
696 def err_main_global_variable :
697     Error<"main cannot be declared as global variable">;
698 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
699     "has undefined behavior">, InGroup<Main>;
700 def ext_main_used : Extension<
701   "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
702
703 /// parser diagnostics
704 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
705   InGroup<MissingDeclarations>;
706 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
707   InGroup<MissingDeclarations>;
708 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
709 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
710   " of anonymous type, but linkage was already computed">;
711 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
712   "linkage prior to definition">;
713 def err_statically_allocated_object : Error<
714   "interface type cannot be statically allocated">;
715 def err_object_cannot_be_passed_returned_by_value : Error<
716   "interface type %1 cannot be %select{returned|passed}0 by value"
717   "; did you forget * in %1?">;
718 def err_parameters_retval_cannot_have_fp16_type : Error<
719   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
720 def err_opencl_half_load_store : Error<
721   "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
722   "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
723 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
724 def err_opencl_half_declaration : Error<
725   "declaring variable of type %0 is not allowed">;
726 def err_opencl_half_param : Error<
727   "declaring function parameter of type %0 is not allowed; did you forget * ?">;
728 def err_opencl_invalid_return : Error<
729   "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
730 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
731 def warn_pragma_options_align_reset_failed : Warning<
732   "#pragma options align=reset failed: %0">,
733   InGroup<IgnoredPragmas>;
734 def err_pragma_options_align_mac68k_target_unsupported : Error<
735   "mac68k alignment pragma is not supported on this target">;
736 def warn_pragma_pack_invalid_alignment : Warning<
737   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
738   InGroup<IgnoredPragmas>;
739 def warn_pragma_pack_non_default_at_include : Warning<
740   "non-default #pragma pack value changes the alignment of struct or union "
741   "members in the included file">, InGroup<PragmaPackSuspiciousInclude>,
742   DefaultIgnore;
743 def warn_pragma_pack_modified_after_include : Warning<
744   "the current #pragma pack aligment value is modified in the included "
745   "file">, InGroup<PragmaPack>;
746 def warn_pragma_pack_no_pop_eof : Warning<"unterminated "
747   "'#pragma pack (push, ...)' at end of file">, InGroup<PragmaPack>;
748 def note_pragma_pack_here : Note<
749   "previous '#pragma pack' directive that modifies alignment is here">;
750 def note_pragma_pack_pop_instead_reset : Note<
751   "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">;
752 // Follow the Microsoft implementation.
753 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
754 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
755   "specifying both a name and alignment to 'pop' is undefined">;
756 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
757   InGroup<IgnoredPragmas>;
758 def warn_cxx_ms_struct :
759   Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
760           "with base classes or virtual functions">,
761   DefaultError, InGroup<IncompatibleMSStruct>;
762 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
763 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
764 def err_invalid_super_scope : Error<"invalid use of '__super', "
765   "this keyword can only be used inside class or member function scope">;
766 def err_super_in_lambda_unsupported : Error<
767   "use of '__super' inside a lambda is unsupported">;
768
769 def warn_pragma_unused_undeclared_var : Warning<
770   "undeclared variable %0 used as an argument for '#pragma unused'">,
771   InGroup<IgnoredPragmas>;
772 def warn_atl_uuid_deprecated : Warning<
773   "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
774   InGroup<DeprecatedDeclarations>;
775 def warn_pragma_unused_expected_var_arg : Warning<
776   "only variables can be arguments to '#pragma unused'">,
777   InGroup<IgnoredPragmas>;
778 def err_pragma_push_visibility_mismatch : Error<
779   "#pragma visibility push with no matching #pragma visibility pop">;
780 def note_surrounding_namespace_ends_here : Note<
781   "surrounding namespace with visibility attribute ends here">;
782 def err_pragma_pop_visibility_mismatch : Error<
783   "#pragma visibility pop with no matching #pragma visibility push">;
784 def note_surrounding_namespace_starts_here : Note<
785   "surrounding namespace with visibility attribute starts here">;
786 def err_pragma_loop_invalid_argument_type : Error<
787   "invalid argument of type %0; expected an integer type">;
788 def err_pragma_loop_invalid_argument_value : Error<
789   "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
790 def err_pragma_loop_compatibility : Error<
791   "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
792 def err_pragma_loop_precedes_nonloop : Error<
793   "expected a for, while, or do-while loop to follow '%0'">;
794
795 def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
796   "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
797   "those declarations">;
798 def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
799   "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
800 def err_pragma_attribute_invalid_matchers : Error<
801   "attribute %0 can't be applied to %1">;
802 def err_pragma_attribute_stack_mismatch : Error<
803   "'#pragma clang attribute pop' with no matching '#pragma clang attribute push'">;
804 def warn_pragma_attribute_unused : Warning<
805   "unused attribute %0 in '#pragma clang attribute push' region">,
806   InGroup<PragmaClangAttribute>;
807 def note_pragma_attribute_region_ends_here : Note<
808   "'#pragma clang attribute push' regions ends here">;
809 def err_pragma_attribute_no_pop_eof : Error<"unterminated "
810   "'#pragma clang attribute push' at end of file">;
811 def note_pragma_attribute_applied_decl_here : Note<
812   "when applied to this declaration">;
813
814 /// Objective-C parser diagnostics
815 def err_duplicate_class_def : Error<
816   "duplicate interface definition for class %0">;
817 def err_undef_superclass : Error<
818   "cannot find interface declaration for %0, superclass of %1">;
819 def err_forward_superclass : Error<
820   "attempting to use the forward class %0 as superclass of %1">;
821 def err_no_nsconstant_string_class : Error<
822   "cannot find interface declaration for %0">;
823 def err_recursive_superclass : Error<
824   "trying to recursively use %0 as superclass of %1">;
825 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
826 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
827 def warn_duplicate_protocol_def : Warning<
828   "duplicate protocol definition of %0 is ignored">,
829   InGroup<DiagGroup<"duplicate-protocol">>;
830 def err_protocol_has_circular_dependency : Error<
831   "protocol has circular dependency">;
832 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
833 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
834 def warn_atprotocol_protocol : Warning<
835   "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
836 def warn_readonly_property : Warning<
837   "attribute 'readonly' of property %0 restricts attribute "
838   "'readwrite' of property inherited from %1">,
839   InGroup<PropertyAttr>;
840
841 def warn_property_attribute : Warning<
842   "'%1' attribute on property %0 does not match the property inherited from %2">,
843   InGroup<PropertyAttr>;
844 def warn_property_types_are_incompatible : Warning<
845   "property type %0 is incompatible with type %1 inherited from %2">,
846   InGroup<DiagGroup<"incompatible-property-type">>;
847 def warn_protocol_property_mismatch : Warning<
848   "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
849   "getter %1|with setter %1}0 was selected for synthesis">,
850   InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
851 def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
852 def err_undef_interface : Error<"cannot find interface declaration for %0">;
853 def err_category_forward_interface : Error<
854   "cannot define %select{category|class extension}0 for undefined class %1">;
855 def err_class_extension_after_impl : Error<
856   "cannot declare class extension for %0 after class implementation">;
857 def note_implementation_declared : Note<
858   "class implementation is declared here">;
859 def note_while_in_implementation : Note<
860   "detected while default synthesizing properties in class implementation">;
861 def note_class_declared : Note<
862   "class is declared here">;
863 def note_receiver_class_declared : Note<
864   "receiver is instance of class declared here">;
865 def note_receiver_expr_here : Note<
866   "receiver expression is here">;
867 def note_receiver_is_id : Note<
868   "receiver is treated with 'id' type for purpose of method lookup">;
869 def note_suppressed_class_declare : Note<
870   "class with specified objc_requires_property_definitions attribute is declared here">;
871 def err_objc_root_class_subclass : Error<
872   "objc_root_class attribute may only be specified on a root class declaration">;
873 def err_restricted_superclass_mismatch : Error<
874   "cannot subclass a class that was declared with the "
875   "'objc_subclassing_restricted' attribute">;
876 def warn_objc_root_class_missing : Warning<
877   "class %0 defined without specifying a base class">,
878   InGroup<ObjCRootClass>;
879 def err_objc_runtime_visible_category : Error<
880   "cannot implement a category for class %0 that is only visible via the "
881   "Objective-C runtime">;
882 def err_objc_runtime_visible_subclass : Error<
883   "cannot implement subclass %0 of a superclass %1 that is only visible via the "
884   "Objective-C runtime">;
885 def note_objc_needs_superclass : Note<
886   "add a super class to fix this problem">;
887 def warn_dup_category_def : Warning<
888   "duplicate definition of category %1 on interface %0">;
889 def err_conflicting_super_class : Error<"conflicting super class name %0">;
890 def err_dup_implementation_class : Error<"reimplementation of class %0">;
891 def err_dup_implementation_category : Error<
892   "reimplementation of category %1 for class %0">;
893 def err_conflicting_ivar_type : Error<
894   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
895 def err_duplicate_ivar_declaration : Error<
896   "instance variable is already declared">;
897 def warn_on_superclass_use : Warning<
898   "class implementation may not have super class">;
899 def err_conflicting_ivar_bitwidth : Error<
900   "instance variable %0 has conflicting bit-field width">;
901 def err_conflicting_ivar_name : Error<
902   "conflicting instance variable names: %0 vs %1">;
903 def err_inconsistent_ivar_count : Error<
904   "inconsistent number of instance variables specified">;
905 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
906   InGroup<DiagGroup<"incomplete-implementation">>;
907
908 def warn_conflicting_overriding_ret_types : Warning<
909   "conflicting return type in "
910   "declaration of %0%diff{: $ vs $|}1,2">,
911   InGroup<OverridingMethodMismatch>, DefaultIgnore;
912
913 def warn_conflicting_ret_types : Warning<
914   "conflicting return type in "
915   "implementation of %0%diff{: $ vs $|}1,2">,
916   InGroup<MismatchedReturnTypes>;
917
918 def warn_conflicting_overriding_ret_type_modifiers : Warning<
919   "conflicting distributed object modifiers on return type "
920   "in declaration of %0">,
921   InGroup<OverridingMethodMismatch>, DefaultIgnore;
922
923 def warn_conflicting_ret_type_modifiers : Warning<
924   "conflicting distributed object modifiers on return type "
925   "in implementation of %0">,
926   InGroup<DistributedObjectModifiers>;
927
928 def warn_non_covariant_overriding_ret_types : Warning<
929   "conflicting return type in "
930   "declaration of %0: %1 vs %2">,
931   InGroup<OverridingMethodMismatch>, DefaultIgnore;
932
933 def warn_non_covariant_ret_types : Warning<
934   "conflicting return type in "
935   "implementation of %0: %1 vs %2">,
936   InGroup<MethodSignatures>, DefaultIgnore;
937
938 def warn_conflicting_overriding_param_types : Warning<
939   "conflicting parameter types in "
940   "declaration of %0%diff{: $ vs $|}1,2">,
941   InGroup<OverridingMethodMismatch>, DefaultIgnore;
942
943 def warn_conflicting_param_types : Warning<
944   "conflicting parameter types in "
945   "implementation of %0%diff{: $ vs $|}1,2">,
946   InGroup<MismatchedParameterTypes>;
947
948 def warn_conflicting_param_modifiers : Warning<
949   "conflicting distributed object modifiers on parameter type "
950   "in implementation of %0">,
951   InGroup<DistributedObjectModifiers>;
952
953 def warn_conflicting_overriding_param_modifiers : Warning<
954   "conflicting distributed object modifiers on parameter type "
955   "in declaration of %0">,
956   InGroup<OverridingMethodMismatch>, DefaultIgnore;
957
958 def warn_non_contravariant_overriding_param_types : Warning<
959   "conflicting parameter types in "
960   "declaration of %0: %1 vs %2">,
961   InGroup<OverridingMethodMismatch>, DefaultIgnore;
962
963 def warn_non_contravariant_param_types : Warning<
964   "conflicting parameter types in "
965   "implementation of %0: %1 vs %2">,
966   InGroup<MethodSignatures>, DefaultIgnore;
967
968 def warn_conflicting_overriding_variadic :Warning<
969   "conflicting variadic declaration of method and its "
970   "implementation">,
971   InGroup<OverridingMethodMismatch>, DefaultIgnore;
972
973 def warn_conflicting_variadic :Warning<
974   "conflicting variadic declaration of method and its "
975   "implementation">;
976
977 def warn_category_method_impl_match:Warning<
978   "category is implementing a method which will also be implemented"
979   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
980
981 def warn_implements_nscopying : Warning<
982 "default assign attribute on property %0 which implements "
983 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
984
985 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
986   InGroup<ObjCMultipleMethodNames>;
987 def warn_strict_multiple_method_decl : Warning<
988   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
989 def warn_accessor_property_type_mismatch : Warning<
990   "type of property %0 does not match type of accessor %1">;
991 def note_conv_function_declared_at : Note<"type conversion function declared here">;
992 def note_method_declared_at : Note<"method %0 declared here">;
993 def note_property_attribute : Note<"property %0 is declared "
994   "%select{deprecated|unavailable|partial}1 here">;
995 def err_setter_type_void : Error<"type of setter must be void">;
996 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
997 def warn_duplicate_method_decl : 
998   Warning<"multiple declarations of method %0 found and ignored">, 
999   InGroup<MethodDuplicate>, DefaultIgnore;
1000 def warn_objc_cdirective_format_string :
1001   Warning<"using %0 directive in %select{NSString|CFString}1 "
1002           "which is being passed as a formatting argument to the formatting "
1003           "%select{method|CFfunction}2">,
1004   InGroup<ObjCCStringFormat>, DefaultIgnore;
1005 def err_objc_var_decl_inclass : 
1006     Error<"cannot declare variable inside @interface or @protocol">;
1007 def err_missing_method_context : Error<
1008   "missing context for method declaration">;
1009 def err_objc_property_attr_mutually_exclusive : Error<
1010   "property attributes '%0' and '%1' are mutually exclusive">;
1011 def err_objc_property_requires_object : Error<
1012   "property with '%0' attribute must be of object type">;
1013 def warn_objc_property_no_assignment_attribute : Warning<
1014   "no 'assign', 'retain', or 'copy' attribute is specified - "
1015   "'assign' is assumed">,
1016   InGroup<ObjCPropertyNoAttribute>;
1017 def warn_objc_isa_use : Warning<
1018   "direct access to Objective-C's isa is deprecated in favor of "
1019   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
1020 def warn_objc_isa_assign : Warning<
1021   "assignment to Objective-C's isa is deprecated in favor of "
1022   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
1023 def warn_objc_pointer_masking : Warning<
1024   "bitmasking for introspection of Objective-C object pointers is strongly "
1025   "discouraged">,
1026   InGroup<ObjCPointerIntrospect>;
1027 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
1028   InGroup<ObjCPointerIntrospectPerformSelector>;
1029 def warn_objc_property_default_assign_on_object : Warning<
1030   "default property attribute 'assign' not appropriate for non-GC object">,
1031   InGroup<ObjCPropertyNoAttribute>;
1032 def warn_property_attr_mismatch : Warning<
1033   "property attribute in class extension does not match the primary class">,
1034   InGroup<PropertyAttr>;
1035 def warn_property_implicitly_mismatched : Warning <
1036   "primary property declaration is implicitly strong while redeclaration "
1037   "in class extension is weak">,
1038   InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1039 def warn_objc_property_copy_missing_on_block : Warning<
1040     "'copy' attribute must be specified for the block property "
1041     "when -fobjc-gc-only is specified">;
1042 def warn_objc_property_retain_of_block : Warning<
1043     "retain'ed block property does not copy the block "
1044     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1045 def warn_objc_readonly_property_has_setter : Warning<
1046     "setter cannot be specified for a readonly property">,
1047     InGroup<ObjCReadonlyPropertyHasSetter>;
1048 def warn_atomic_property_rule : Warning<
1049   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1050   "with a user defined %select{getter|setter}2">,
1051   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1052 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1053   "synthesized, or both be user defined,or the property must be nonatomic">;
1054 def err_atomic_property_nontrivial_assign_op : Error<
1055   "atomic property of reference type %0 cannot have non-trivial assignment"
1056   " operator">;
1057 def warn_cocoa_naming_owned_rule : Warning<
1058   "property follows Cocoa naming"
1059   " convention for returning 'owned' objects">,
1060   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1061 def err_cocoa_naming_owned_rule : Error<
1062   "property follows Cocoa naming"
1063   " convention for returning 'owned' objects">;
1064 def note_cocoa_naming_declare_family : Note<
1065   "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1066   "object">;
1067 def warn_auto_synthesizing_protocol_property :Warning<
1068   "auto property synthesis will not synthesize property %0"
1069   " declared in protocol %1">,
1070   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1071 def note_add_synthesize_directive : Note<
1072   "add a '@synthesize' directive">;
1073 def warn_no_autosynthesis_shared_ivar_property : Warning <
1074   "auto property synthesis will not synthesize property "
1075   "%0 because it cannot share an ivar with another synthesized property">,
1076   InGroup<ObjCNoPropertyAutoSynthesis>;
1077 def warn_no_autosynthesis_property : Warning<
1078   "auto property synthesis will not synthesize property "
1079   "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1080   "via another property">,
1081   InGroup<ObjCNoPropertyAutoSynthesis>;
1082 def warn_autosynthesis_property_in_superclass : Warning<
1083   "auto property synthesis will not synthesize property "
1084   "%0; it will be implemented by its superclass, use @dynamic to "
1085   "acknowledge intention">,
1086   InGroup<ObjCNoPropertyAutoSynthesis>;
1087 def warn_autosynthesis_property_ivar_match :Warning<
1088   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1089   "%2, not existing instance variable %3">,
1090   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1091 def warn_missing_explicit_synthesis : Warning <
1092   "auto property synthesis is synthesizing property not explicitly synthesized">,
1093   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1094 def warn_property_getter_owning_mismatch : Warning<
1095   "property declared as returning non-retained objects"
1096   "; getter returning retained objects">;
1097 def warn_property_redecl_getter_mismatch : Warning<
1098   "getter name mismatch between property redeclaration (%1) and its original "
1099   "declaration (%0)">, InGroup<PropertyAttr>;
1100 def err_property_setter_ambiguous_use : Error<
1101   "synthesized properties %0 and %1 both claim setter %2 -"
1102   " use of this setter will cause unexpected behavior">;
1103 def warn_default_atomic_custom_getter_setter : Warning<
1104   "atomic by default property %0 has a user defined %select{getter|setter}1 "
1105   "(property should be marked 'atomic' if this is intended)">,
1106   InGroup<CustomAtomic>, DefaultIgnore;
1107 def err_use_continuation_class : Error<
1108   "illegal redeclaration of property in class extension %0"
1109   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1110 def err_type_mismatch_continuation_class : Error<
1111   "type of property %0 in class extension does not match "
1112   "property type in primary class">;
1113 def err_use_continuation_class_redeclaration_readwrite : Error<
1114   "illegal redeclaration of 'readwrite' property in class extension %0"
1115   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1116   "'readonly' public property?)">;
1117 def err_continuation_class : Error<"class extension has no primary class">;
1118 def err_property_type : Error<"property cannot have array or function type %0">;
1119 def err_missing_property_context : Error<
1120   "missing context for property implementation declaration">;
1121 def err_bad_property_decl : Error<
1122   "property implementation must have its declaration in interface %0 or one of "
1123   "its extensions">;
1124 def err_category_property : Error<
1125   "property declared in category %0 cannot be implemented in "
1126   "class implementation">;
1127 def note_property_declare : Note<
1128   "property declared here">;
1129 def note_protocol_property_declare : Note<
1130   "it could also be property "
1131   "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1132   "%1|with setter %1}0 declared here">;
1133 def note_property_synthesize : Note<
1134   "property synthesized here">;
1135 def err_synthesize_category_decl : Error<
1136   "@synthesize not allowed in a category's implementation">;
1137 def err_synthesize_on_class_property : Error<
1138   "@synthesize not allowed on a class property %0">;
1139 def err_missing_property_interface : Error<
1140   "property implementation in a category with no category declaration">;
1141 def err_bad_category_property_decl : Error<
1142   "property implementation must have its declaration in the category %0">;
1143 def err_bad_property_context : Error<
1144   "property implementation must be in a class or category implementation">;
1145 def err_missing_property_ivar_decl : Error<
1146   "synthesized property %0 must either be named the same as a compatible"
1147   " instance variable or must explicitly name an instance variable">;
1148 def err_arc_perform_selector_retains : Error<
1149   "performSelector names a selector which retains the object">;
1150 def warn_arc_perform_selector_leaks : Warning<
1151   "performSelector may cause a leak because its selector is unknown">,
1152   InGroup<DiagGroup<"arc-performSelector-leaks">>;
1153 def warn_dealloc_in_category : Warning<
1154 "-dealloc is being overridden in a category">,
1155 InGroup<DeallocInCategory>;
1156 def err_gc_weak_property_strong_type : Error<
1157   "weak attribute declared on a __strong type property in GC mode">;
1158 def warn_arc_repeated_use_of_weak : Warning <
1159   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1160   "accessed multiple times in this %select{function|method|block|lambda}2 "
1161   "but may be unpredictably set to nil; assign to a strong variable to keep "
1162   "the object alive">,
1163   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1164 def warn_implicitly_retains_self : Warning <
1165   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1166   "this is intended behavior">,
1167   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1168 def warn_arc_possible_repeated_use_of_weak : Warning <
1169   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1170   "be accessed multiple times in this %select{function|method|block|lambda}2 "
1171   "and may be unpredictably set to nil; assign to a strong variable to keep "
1172   "the object alive">,
1173   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1174 def note_arc_weak_also_accessed_here : Note<
1175   "also accessed here">;
1176 def err_incomplete_synthesized_property : Error<
1177   "cannot synthesize property %0 with incomplete type %1">;
1178
1179 def err_property_ivar_type : Error<
1180   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1181 def err_property_accessor_type : Error<
1182   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1183 def err_ivar_in_superclass_use : Error<
1184   "property %0 attempting to use instance variable %1 declared in super class %2">;
1185 def err_weak_property : Error<
1186   "existing instance variable %1 for __weak property %0 must be __weak">;
1187 def err_strong_property : Error<
1188   "existing instance variable %1 for strong property %0 may not be __weak">;
1189 def err_dynamic_property_ivar_decl : Error<
1190   "dynamic property cannot have instance variable specification">;
1191 def err_duplicate_ivar_use : Error<
1192   "synthesized properties %0 and %1 both claim instance variable %2">;
1193 def err_property_implemented : Error<"property %0 is already implemented">;
1194 def warn_objc_missing_super_call : Warning<
1195   "method possibly missing a [super %0] call">,
1196   InGroup<ObjCMissingSuperCalls>;
1197 def err_dealloc_bad_result_type : Error<
1198   "dealloc return type must be correctly specified as 'void' under ARC, "
1199   "instead of %0">;
1200 def warn_undeclared_selector : Warning<
1201   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1202 def warn_undeclared_selector_with_typo : Warning<
1203   "undeclared selector %0; did you mean %1?">,
1204   InGroup<UndeclaredSelector>, DefaultIgnore;
1205 def warn_implicit_atomic_property : Warning<
1206   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1207 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1208   "property should be changed to be readwrite">;
1209 def warn_auto_readonly_iboutlet_property : Warning<
1210   "readonly IBOutlet property %0 when auto-synthesized may "
1211   "not work correctly with 'nib' loader">,
1212   InGroup<DiagGroup<"readonly-iboutlet-property">>;
1213 def warn_auto_implicit_atomic_property : Warning<
1214   "property is assumed atomic when auto-synthesizing the property">,
1215   InGroup<ImplicitAtomic>, DefaultIgnore;
1216 def warn_unimplemented_selector:  Warning<
1217   "no method with selector %0 is implemented in this translation unit">, 
1218   InGroup<Selector>, DefaultIgnore;
1219 def warn_unimplemented_protocol_method : Warning<
1220   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1221 def warn_multiple_selectors: Warning<
1222   "several methods with selector %0 of mismatched types are found "
1223   "for the @selector expression">,
1224   InGroup<SelectorTypeMismatch>, DefaultIgnore;
1225
1226 def err_objc_kindof_nonobject : Error<
1227   "'__kindof' specifier cannot be applied to non-object type %0">;
1228 def err_objc_kindof_wrong_position : Error<
1229   "'__kindof' type specifier must precede the declarator">;
1230
1231 def err_objc_method_unsupported_param_ret_type : Error<
1232   "%0 %select{parameter|return}1 type is unsupported; "
1233   "support for vector types for this target is introduced in %2">;
1234
1235 def warn_messaging_unqualified_id : Warning<
1236   "messaging unqualified id">, DefaultIgnore,
1237   InGroup<DiagGroup<"objc-messaging-id">>;
1238
1239 // C++ declarations
1240 def err_static_assert_expression_is_not_constant : Error<
1241   "static_assert expression is not an integral constant expression">;
1242 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1243 def err_static_assert_requirement_failed : Error<
1244   "static_assert failed due to requirement '%0'%select{ %2|}1">;
1245 def ext_static_assert_no_message : ExtWarn<
1246   "static_assert with no message is a C++17 extension">, InGroup<CXX17>;
1247 def warn_cxx14_compat_static_assert_no_message : Warning<
1248   "static_assert with no message is incompatible with C++ standards before C++17">,
1249   DefaultIgnore, InGroup<CXXPre17Compat>;
1250
1251 def ext_inline_variable : ExtWarn<
1252   "inline variables are a C++17 extension">, InGroup<CXX17>;
1253 def warn_cxx14_compat_inline_variable : Warning<
1254   "inline variables are incompatible with C++ standards before C++17">,
1255   DefaultIgnore, InGroup<CXXPre17Compat>;
1256
1257 def warn_inline_namespace_reopened_noninline : Warning<
1258   "inline namespace reopened as a non-inline namespace">;
1259 def err_inline_namespace_mismatch : Error<
1260   "non-inline namespace cannot be reopened as inline">;
1261
1262 def err_unexpected_friend : Error<
1263   "friends can only be classes or functions">;
1264 def ext_enum_friend : ExtWarn<
1265   "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1266 def warn_cxx98_compat_enum_friend : Warning<
1267   "befriending enumeration type %0 is incompatible with C++98">,
1268   InGroup<CXX98Compat>, DefaultIgnore;
1269 def ext_nonclass_type_friend : ExtWarn<
1270   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1271 def warn_cxx98_compat_nonclass_type_friend : Warning<
1272   "non-class friend type %0 is incompatible with C++98">,
1273   InGroup<CXX98Compat>, DefaultIgnore;
1274 def err_friend_is_member : Error<
1275   "friends cannot be members of the declaring class">;
1276 def warn_cxx98_compat_friend_is_member : Warning<
1277   "friend declaration naming a member of the declaring class is incompatible "
1278   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1279 def ext_unelaborated_friend_type : ExtWarn<
1280   "unelaborated friend declaration is a C++11 extension; specify "
1281   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1282   InGroup<CXX11>;
1283 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1284   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1285   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1286 def err_qualified_friend_not_found : Error<
1287   "no function named %0 with type %1 was found in the specified scope">;
1288 def err_introducing_special_friend : Error<
1289   "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1290   " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1291   "as a friend">;
1292 def err_tagless_friend_type_template : Error<
1293   "friend type templates must use an elaborated type">;
1294 def err_no_matching_local_friend : Error<
1295   "no matching function found in local scope">;
1296 def err_no_matching_local_friend_suggest : Error<
1297   "no matching function %0 found in local scope; did you mean %3?">;
1298 def err_partial_specialization_friend : Error<
1299   "partial specialization cannot be declared as a friend">;
1300 def err_qualified_friend_def : Error<
1301   "friend function definition cannot be qualified with '%0'">;
1302 def err_friend_def_in_local_class : Error<
1303   "friend function cannot be defined in a local class">;
1304 def err_friend_not_first_in_declaration : Error<
1305   "'friend' must appear first in a non-function declaration">;
1306 def err_using_decl_friend : Error<
1307   "cannot befriend target of using declaration">;
1308 def warn_template_qualified_friend_unsupported : Warning<
1309   "dependent nested name specifier '%0' for friend class declaration is "
1310   "not supported; turning off access control for %1">,
1311   InGroup<UnsupportedFriend>;
1312 def warn_template_qualified_friend_ignored : Warning<
1313   "dependent nested name specifier '%0' for friend template declaration is "
1314   "not supported; ignoring this friend declaration">,
1315   InGroup<UnsupportedFriend>;
1316 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1317   "unqualified friend declaration referring to type outside of the nearest "
1318   "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1319   InGroup<MicrosoftUnqualifiedFriend>;
1320 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1321
1322 def err_invalid_member_in_interface : Error<
1323   "%select{data member |non-public member function |static member function |"
1324           "user-declared constructor|user-declared destructor|operator |"
1325           "nested class }0%1 is not permitted within an interface type">;
1326 def err_invalid_base_in_interface : Error<
1327   "interface type cannot inherit from "
1328   "%select{'struct|non-public 'interface|'class}0 %1'">;
1329
1330 def err_abstract_type_in_decl : Error<
1331   "%select{return|parameter|variable|field|instance variable|"
1332   "synthesized instance variable}0 type %1 is an abstract class">;
1333 def err_allocation_of_abstract_type : Error<
1334   "allocating an object of abstract class type %0">;
1335 def err_throw_abstract_type : Error<
1336   "cannot throw an object of abstract type %0">;
1337 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1338 def err_capture_of_abstract_type : Error<
1339   "by-copy capture of value of abstract type %0">;
1340 def err_capture_of_incomplete_type : Error<
1341   "by-copy capture of variable %0 with incomplete type %1">;
1342 def err_capture_default_non_local : Error<
1343   "non-local lambda expression cannot have a capture-default">;
1344
1345 def err_multiple_final_overriders : Error<
1346   "virtual function %q0 has more than one final overrider in %1">; 
1347 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1348
1349 def err_type_defined_in_type_specifier : Error<
1350   "%0 cannot be defined in a type specifier">;
1351 def err_type_defined_in_result_type : Error<
1352   "%0 cannot be defined in the result type of a function">;
1353 def err_type_defined_in_param_type : Error<
1354   "%0 cannot be defined in a parameter type">;
1355 def err_type_defined_in_alias_template : Error<
1356   "%0 cannot be defined in a type alias template">;
1357 def err_type_defined_in_condition : Error<
1358   "%0 cannot be defined in a condition">;
1359 def err_type_defined_in_enum : Error<
1360   "%0 cannot be defined in an enumeration">;
1361
1362 def note_pure_virtual_function : Note<
1363   "unimplemented pure virtual method %0 in %1">;
1364
1365 def note_pure_qualified_call_kext : Note<
1366   "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1367
1368 def err_deleted_decl_not_first : Error<
1369   "deleted definition must be first declaration">;
1370
1371 def err_deleted_override : Error<
1372   "deleted function %0 cannot override a non-deleted function">;
1373
1374 def err_non_deleted_override : Error<
1375   "non-deleted function %0 cannot override a deleted function">;
1376
1377 def warn_weak_vtable : Warning<
1378   "%0 has no out-of-line virtual method definitions; its vtable will be "
1379   "emitted in every translation unit">,
1380   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1381 def warn_weak_template_vtable : Warning<
1382   "explicit template instantiation %0 will emit a vtable in every "
1383   "translation unit">,
1384   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1385
1386 def ext_using_undefined_std : ExtWarn<
1387   "using directive refers to implicitly-defined namespace 'std'">;
1388   
1389 // C++ exception specifications
1390 def err_exception_spec_in_typedef : Error<
1391   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1392 def err_distant_exception_spec : Error<
1393   "exception specifications are not allowed beyond a single level "
1394   "of indirection">;
1395 def err_incomplete_in_exception_spec : Error<
1396   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1397   "in exception specification">;
1398 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1399   InGroup<MicrosoftExceptionSpec>;
1400 def err_rref_in_exception_spec : Error<
1401   "rvalue reference type %0 is not allowed in exception specification">;
1402 def err_mismatched_exception_spec : Error<
1403   "exception specification in declaration does not match previous declaration">;
1404 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1405   InGroup<MicrosoftExceptionSpec>;
1406 def err_override_exception_spec : Error<
1407   "exception specification of overriding function is more lax than "
1408   "base version">;
1409 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1410   InGroup<MicrosoftExceptionSpec>;
1411 def err_incompatible_exception_specs : Error<
1412   "target exception specification is not superset of source">;
1413 def warn_incompatible_exception_specs : Warning<
1414   err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1415 def err_deep_exception_specs_differ : Error<
1416   "exception specifications of %select{return|argument}0 types differ">;
1417 def warn_deep_exception_specs_differ : Warning<
1418   err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1419 def err_missing_exception_specification : Error<
1420   "%0 is missing exception specification '%1'">;
1421 def ext_missing_exception_specification : ExtWarn<
1422   err_missing_exception_specification.Text>,
1423   InGroup<DiagGroup<"missing-exception-spec">>;
1424 def ext_ms_missing_exception_specification : ExtWarn<
1425   err_missing_exception_specification.Text>,
1426   InGroup<MicrosoftExceptionSpec>;
1427 def err_noexcept_needs_constant_expression : Error<
1428   "argument to noexcept specifier must be a constant expression">;
1429 def err_exception_spec_not_parsed : Error<
1430   "exception specification is not available until end of class definition">;
1431
1432 // C++ access checking
1433 def err_class_redeclared_with_different_access : Error<
1434   "%0 redeclared with '%1' access">;
1435 def err_access : Error<
1436   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1437 def ext_ms_using_declaration_inaccessible : ExtWarn<
1438   "using declaration referring to inaccessible member '%0' (which refers "
1439   "to accessible member '%1') is a Microsoft compatibility extension">,
1440     AccessControl, InGroup<MicrosoftUsingDecl>;
1441 def err_access_ctor : Error<
1442   "calling a %select{private|protected}0 constructor of class %2">, 
1443   AccessControl;
1444 def ext_rvalue_to_reference_access_ctor : Extension<
1445   "C++98 requires an accessible copy constructor for class %2 when binding "
1446   "a reference to a temporary; was %select{private|protected}0">,
1447   AccessControl, InGroup<BindToTemporaryCopy>;
1448 def err_access_base_ctor : Error<
1449   // The ERRORs represent other special members that aren't constructors, in
1450   // hopes that someone will bother noticing and reporting if they appear
1451   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1452   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1453   "|*ERROR*|}2constructor">, AccessControl;
1454 def err_access_field_ctor : Error<
1455   // The ERRORs represent other special members that aren't constructors, in
1456   // hopes that someone will bother noticing and reporting if they appear
1457   "field of type %0 has %select{private|protected}2 "
1458   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1459   AccessControl;
1460 def err_access_friend_function : Error<
1461   "friend function %1 is a %select{private|protected}0 member of %3">,
1462   AccessControl;
1463
1464 def err_access_dtor : Error<
1465   "calling a %select{private|protected}1 destructor of class %0">, 
1466   AccessControl;
1467 def err_access_dtor_base :
1468     Error<"base class %0 has %select{private|protected}1 destructor">,
1469     AccessControl;
1470 def err_access_dtor_vbase :
1471     Error<"inherited virtual base class %1 has "
1472     "%select{private|protected}2 destructor">,
1473     AccessControl;
1474 def err_access_dtor_temp :
1475     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1476     AccessControl;
1477 def err_access_dtor_exception :
1478     Error<"exception object of type %0 has %select{private|protected}1 "
1479           "destructor">, AccessControl;
1480 def err_access_dtor_field :
1481     Error<"field of type %1 has %select{private|protected}2 destructor">,
1482     AccessControl;
1483 def err_access_dtor_var :
1484     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1485     AccessControl;
1486 def err_access_dtor_ivar :
1487     Error<"instance variable of type %0 has %select{private|protected}1 "
1488           "destructor">,
1489     AccessControl;
1490 def note_previous_access_declaration : Note<
1491   "previously declared '%1' here">;
1492 def note_access_natural : Note<
1493   "%select{|implicitly }1declared %select{private|protected}0 here">;
1494 def note_access_constrained_by_path : Note<
1495   "constrained by %select{|implicitly }1%select{private|protected}0"
1496   " inheritance here">;
1497 def note_access_protected_restricted_noobject : Note<
1498   "must name member using the type of the current context %0">;
1499 def note_access_protected_restricted_ctordtor : Note<
1500   "protected %select{constructor|destructor}0 can only be used to "
1501   "%select{construct|destroy}0 a base class subobject">;
1502 def note_access_protected_restricted_object : Note<
1503   "can only access this member on an object of type %0">;
1504 def warn_cxx98_compat_sfinae_access_control : Warning<
1505   "substitution failure due to access control is incompatible with C++98">,
1506   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1507   
1508 // C++ name lookup
1509 def err_incomplete_nested_name_spec : Error<
1510   "incomplete type %0 named in nested name specifier">;
1511 def err_dependent_nested_name_spec : Error<
1512   "nested name specifier for a declaration cannot depend on a template "
1513   "parameter">;
1514 def err_nested_name_member_ref_lookup_ambiguous : Error<
1515   "lookup of %0 in member access expression is ambiguous">;
1516 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1517   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1518   InGroup<AmbigMemberTemplate>;
1519 def note_ambig_member_ref_object_type : Note<
1520   "lookup in the object type %0 refers here">;
1521 def note_ambig_member_ref_scope : Note<
1522   "lookup from the current scope refers here">;
1523 def err_qualified_member_nonclass : Error<
1524   "qualified member access refers to a member in %0">;
1525 def err_incomplete_member_access : Error<
1526   "member access into incomplete type %0">;
1527 def err_incomplete_type : Error<
1528   "incomplete type %0 where a complete type is required">;
1529 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1530   "enumeration type in nested name specifier is incompatible with C++98">,
1531   InGroup<CXX98Compat>, DefaultIgnore;
1532 def err_nested_name_spec_is_not_class : Error<
1533   "%0 cannot appear before '::' because it is not a class"
1534   "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1535 def ext_nested_name_spec_is_enum : ExtWarn<
1536   "use of enumeration in a nested name specifier is a C++11 extension">,
1537   InGroup<CXX11>;
1538 def err_out_of_line_qualified_id_type_names_constructor : Error<
1539   "qualified reference to %0 is a constructor name rather than a "
1540   "%select{template name|type}1 in this context">;
1541 def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1542   "ISO C++ specifies that "
1543   "qualified reference to %0 is a constructor name rather than a "
1544   "%select{template name|type}1 in this context, despite preceding "
1545   "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1546   InGroup<DiagGroup<"injected-class-name">>;
1547
1548 // C++ class members
1549 def err_storageclass_invalid_for_member : Error<
1550   "storage class specified for a member declaration">;
1551 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1552 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1553 def ext_mutable_reference : ExtWarn<
1554   "'mutable' on a reference type is a Microsoft extension">,
1555   InGroup<MicrosoftMutableReference>;
1556 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1557 def err_mutable_nonmember : Error<
1558   "'mutable' can only be applied to member variables">;
1559 def err_virtual_in_union : Error<
1560   "unions cannot have virtual functions">;
1561 def err_virtual_non_function : Error<
1562   "'virtual' can only appear on non-static member functions">;
1563 def err_virtual_out_of_class : Error<
1564   "'virtual' can only be specified inside the class definition">;
1565 def err_virtual_member_function_template : Error<
1566   "'virtual' cannot be specified on member function templates">;
1567 def err_static_overrides_virtual : Error<
1568   "'static' member function %0 overrides a virtual function in a base class">;
1569 def err_explicit_non_function : Error<
1570   "'explicit' can only appear on non-static member functions">;
1571 def err_explicit_out_of_class : Error<
1572   "'explicit' can only be specified inside the class definition">;
1573 def err_explicit_non_ctor_or_conv_function : Error<
1574   "'explicit' can only be applied to a constructor or conversion function">;
1575 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1576 def err_static_out_of_line : Error<
1577   "'static' can only be specified inside the class definition">;
1578 def err_storage_class_for_static_member : Error<
1579   "static data member definition cannot specify a storage class">;
1580 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1581 def err_not_integral_type_bitfield : Error<
1582   "bit-field %0 has non-integral type %1">;
1583 def err_not_integral_type_anon_bitfield : Error<
1584   "anonymous bit-field has non-integral type %0">;
1585 def err_member_function_initialization : Error<
1586   "initializer on function does not look like a pure-specifier">;
1587 def err_non_virtual_pure : Error<
1588   "%0 is not virtual and cannot be declared pure">;
1589 def ext_pure_function_definition : ExtWarn<
1590   "function definition with pure-specifier is a Microsoft extension">,
1591   InGroup<MicrosoftPureDefinition>;
1592 def err_qualified_member_of_unrelated : Error<
1593   "%q0 is not a member of class %1">;
1594
1595 def err_member_function_call_bad_cvr : Error<
1596   "'this' argument to member function %0 has type %1, but function is not marked "
1597   "%select{const|restrict|const or restrict|volatile|const or volatile|"
1598   "volatile or restrict|const, volatile, or restrict}2">;
1599 def err_member_function_call_bad_ref : Error<
1600   "'this' argument to member function %0 is an %select{lvalue|rvalue}1, "
1601   "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">;
1602 def err_member_function_call_bad_type : Error<
1603   "cannot initialize object parameter of type %0 with an expression "
1604   "of type %1">;
1605
1606 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1607   "call to pure virtual member function %0 has undefined behavior; "
1608   "overrides of %0 in subclasses are not available in the "
1609   "%select{constructor|destructor}1 of %2">;
1610
1611 def note_member_declared_at : Note<"member is declared here">;
1612 def note_ivar_decl : Note<"instance variable is declared here">;
1613 def note_bitfield_decl : Note<"bit-field is declared here">;
1614 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1615 def note_member_synthesized_at : Note<
1616   "in implicit %select{default constructor|copy constructor|move constructor|"
1617   "copy assignment operator|move assignment operator|destructor}0 for %1 "
1618   "first required here">;
1619 def err_missing_default_ctor : Error<
1620   "%select{constructor for %1 must explicitly initialize the|"
1621   "implicit default constructor for %1 must explicitly initialize the|"
1622   "cannot use constructor inherited from base class %4;}0 "
1623   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1624   "does not have a default constructor">;
1625 def note_due_to_dllexported_class : Note<
1626   "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
1627
1628 def err_illegal_union_or_anon_struct_member : Error<
1629   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1630   "%select{constructor|copy constructor|move constructor|copy assignment "
1631   "operator|move assignment operator|destructor}2">;
1632 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1633   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1634   "%select{constructor|copy constructor|move constructor|copy assignment "
1635   "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1636   InGroup<CXX98Compat>, DefaultIgnore;
1637
1638 def note_nontrivial_virtual_dtor : Note<
1639   "destructor for %0 is not trivial because it is virtual">;
1640 def note_nontrivial_has_virtual : Note<
1641   "because type %0 has a virtual %select{member function|base class}1">;
1642 def note_nontrivial_no_def_ctor : Note<
1643   "because %select{base class of |field of |}0type %1 has no "
1644   "default constructor">;
1645 def note_user_declared_ctor : Note<
1646   "implicit default constructor suppressed by user-declared constructor">;
1647 def note_nontrivial_no_copy : Note<
1648   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1649   "assignment operator|<<ERROR>>}2 can be used to "
1650   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1651   "%select{base class|field|an object}0 of type %3">;
1652 def note_nontrivial_user_provided : Note<
1653   "because %select{base class of |field of |}0type %1 has a user-provided "
1654   "%select{default constructor|copy constructor|move constructor|"
1655   "copy assignment operator|move assignment operator|destructor}2">;
1656 def note_nontrivial_in_class_init : Note<
1657   "because field %0 has an initializer">;
1658 def note_nontrivial_param_type : Note<
1659   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1660 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1661 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1662 def note_nontrivial_subobject : Note<
1663   "because the function selected to %select{construct|copy|move|copy|move|"
1664   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1665 def note_nontrivial_objc_ownership : Note<
1666   "because type %0 has a member with %select{no|no|__strong|__weak|"
1667   "__autoreleasing}1 ownership">;
1668
1669 def err_static_data_member_not_allowed_in_anon_struct : Error<
1670   "static data member %0 not allowed in anonymous struct">;
1671 def ext_static_data_member_in_union : ExtWarn<
1672   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1673 def warn_cxx98_compat_static_data_member_in_union : Warning<
1674   "static data member %0 in union is incompatible with C++98">,
1675   InGroup<CXX98Compat>, DefaultIgnore;
1676 def ext_union_member_of_reference_type : ExtWarn<
1677   "union member %0 has reference type %1, which is a Microsoft extension">,
1678   InGroup<MicrosoftUnionMemberReference>;
1679 def err_union_member_of_reference_type : Error<
1680   "union member %0 has reference type %1">;
1681 def ext_anonymous_struct_union_qualified : Extension<
1682   "anonymous %select{struct|union}0 cannot be '%1'">;
1683 def err_different_return_type_for_overriding_virtual_function : Error<
1684   "virtual function %0 has a different return type "
1685   "%diff{($) than the function it overrides (which has return type $)|"
1686   "than the function it overrides}1,2">;
1687 def note_overridden_virtual_function : Note<
1688   "overridden virtual function is here">;
1689 def err_conflicting_overriding_cc_attributes : Error<
1690   "virtual function %0 has different calling convention attributes "
1691   "%diff{($) than the function it overrides (which has calling convention $)|"
1692   "than the function it overrides}1,2">;
1693 def warn_overriding_method_missing_noescape : Warning<
1694   "parameter of overriding method should be annotated with "
1695   "__attribute__((noescape))">, InGroup<MissingNoEscape>;
1696 def note_overridden_marked_noescape : Note<
1697   "parameter of overridden method is annotated with __attribute__((noescape))">;
1698
1699 def err_covariant_return_inaccessible_base : Error<
1700   "invalid covariant return for virtual function: %1 is a "
1701   "%select{private|protected}2 base class of %0">, AccessControl;
1702 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1703   "return type of virtual function %3 is not covariant with the return type of "
1704   "the function it overrides (ambiguous conversion from derived class "
1705   "%0 to base class %1:%2)">;
1706 def err_covariant_return_not_derived : Error<
1707   "return type of virtual function %0 is not covariant with the return type of "
1708   "the function it overrides (%1 is not derived from %2)">;
1709 def err_covariant_return_incomplete : Error<
1710   "return type of virtual function %0 is not covariant with the return type of "
1711   "the function it overrides (%1 is incomplete)">;
1712 def err_covariant_return_type_different_qualifications : Error<
1713   "return type of virtual function %0 is not covariant with the return type of "
1714   "the function it overrides (%1 has different qualifiers than %2)">;
1715 def err_covariant_return_type_class_type_more_qualified : Error<
1716   "return type of virtual function %0 is not covariant with the return type of "
1717   "the function it overrides (class type %1 is more qualified than class "
1718   "type %2">;
1719
1720 // C++ implicit special member functions
1721 def note_in_declaration_of_implicit_special_member : Note<
1722   "while declaring the implicit "
1723   "%select{default constructor|copy constructor|move constructor|"
1724   "copy assignment operator|move assignment operator|destructor}1"
1725   " for %0">;
1726
1727 // C++ constructors
1728 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1729 def err_invalid_qualified_constructor : Error<
1730   "'%0' qualifier is not allowed on a constructor">;
1731 def err_ref_qualifier_constructor : Error<
1732   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1733
1734 def err_constructor_return_type : Error<
1735   "constructor cannot have a return type">;
1736 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1737 def err_constructor_byvalue_arg : Error<
1738   "copy constructor must pass its first argument by reference">;
1739 def warn_no_constructor_for_refconst : Warning<
1740   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1741   "constructor to initialize its non-modifiable members">;
1742 def note_refconst_member_not_initialized : Note<
1743   "%select{const|reference}0 member %1 will never be initialized">;
1744 def ext_ms_explicit_constructor_call : ExtWarn<
1745   "explicit constructor calls are a Microsoft extension">,
1746   InGroup<MicrosoftExplicitConstructorCall>;
1747
1748 // C++ destructors
1749 def err_destructor_not_member : Error<
1750   "destructor must be a non-static member function">;
1751 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1752 def err_invalid_qualified_destructor : Error<
1753   "'%0' qualifier is not allowed on a destructor">;
1754 def err_ref_qualifier_destructor : Error<
1755   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1756 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1757 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1758 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1759 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1760 def err_destructor_typedef_name : Error<
1761   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1762 def err_destructor_name : Error<
1763   "expected the class name after '~' to name the enclosing class">;
1764 def err_destructor_class_name : Error<
1765   "expected the class name after '~' to name a destructor">;
1766 def err_ident_in_dtor_not_a_type : Error<
1767   "identifier %0 in object destruction expression does not name a type">;
1768 def err_destructor_expr_type_mismatch : Error<
1769   "destructor type %0 in object destruction expression does not match the "
1770   "type %1 of the object being destroyed">;
1771 def note_destructor_type_here : Note<
1772   "type %0 is declared here">;
1773
1774 def err_destructor_template : Error<
1775   "destructor cannot be declared as a template">;
1776
1777 // C++ initialization
1778 def err_init_conversion_failed : Error<
1779   "cannot initialize %select{a variable|a parameter|return object|an "
1780   "exception object|a member subobject|an array element|a new value|a value|a "
1781   "base class|a constructor delegation|a vector element|a block element|a "
1782   "block element|a complex element|a lambda capture|a compound literal "
1783   "initializer|a related result|a parameter of CF audited function}0 "
1784   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1785   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1786   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1787   "|: different number of parameters (%5 vs %6)"
1788   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1789   "|: different return type%diff{ ($ vs $)|}5,6"
1790   "|: different qualifiers ("
1791   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1792   "volatile and restrict|const, volatile, and restrict}5 vs "
1793   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1794   "volatile and restrict|const, volatile, and restrict}6)"
1795   "|: different exception specifications}4">;
1796
1797 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1798   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1799 def err_lvalue_reference_bind_to_initlist : Error<
1800   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1801   "initializer list temporary">;
1802 def err_lvalue_reference_bind_to_temporary : Error<
1803   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1804   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1805 def err_lvalue_reference_bind_to_unrelated : Error<
1806   "%select{non-const|volatile}0 lvalue reference "
1807   "%diff{to type $ cannot bind to a value of unrelated type $|"
1808   "cannot bind to a value of unrelated type}1,2">;
1809 def err_reference_bind_drops_quals : Error<
1810   "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1811   "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1812   "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1813   "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1814 def err_reference_bind_failed : Error<
1815   "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1816   "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1817 def err_reference_bind_init_list : Error<
1818   "reference to type %0 cannot bind to an initializer list">;
1819 def warn_temporary_array_to_pointer_decay : Warning<
1820   "pointer is initialized by a temporary array, which will be destroyed at the "
1821   "end of the full-expression">,
1822   InGroup<DiagGroup<"address-of-array-temporary">>;
1823 def err_init_list_bad_dest_type : Error<
1824   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1825   "list">;
1826
1827 def err_reference_bind_to_bitfield : Error<
1828   "%select{non-const|volatile}0 reference cannot bind to "
1829   "bit-field%select{| %1}2">;
1830 def err_reference_bind_to_vector_element : Error<
1831   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1832 def err_reference_var_requires_init : Error<
1833   "declaration of reference variable %0 requires an initializer">;
1834 def err_reference_without_init : Error<
1835   "reference to type %0 requires an initializer">;
1836 def note_value_initialization_here : Note<
1837   "in value-initialization of type %0 here">;
1838 def err_reference_has_multiple_inits : Error<
1839   "reference cannot be initialized with multiple values">;
1840 def err_init_non_aggr_init_list : Error<
1841   "initialization of non-aggregate type %0 with an initializer list">;
1842 def err_init_reference_member_uninitialized : Error<
1843   "reference member of type %0 uninitialized">;
1844 def note_uninit_reference_member : Note<
1845   "uninitialized reference member is here">;
1846 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1847   InGroup<Uninitialized>;
1848 def warn_base_class_is_uninit : Warning<
1849   "base class %0 is uninitialized when used here to access %q1">,
1850   InGroup<Uninitialized>;
1851 def warn_reference_field_is_uninit : Warning<
1852   "reference %0 is not yet bound to a value when used here">,
1853   InGroup<Uninitialized>;
1854 def note_uninit_in_this_constructor : Note<
1855   "during field initialization in %select{this|the implicit default}0 "
1856   "constructor">;
1857 def warn_static_self_reference_in_init : Warning<
1858   "static variable %0 is suspiciously used within its own initialization">,
1859   InGroup<UninitializedStaticSelfInit>;
1860 def warn_uninit_self_reference_in_init : Warning<
1861   "variable %0 is uninitialized when used within its own initialization">,
1862   InGroup<Uninitialized>;
1863 def warn_uninit_self_reference_in_reference_init : Warning<
1864   "reference %0 is not yet bound to a value when used within its own"
1865   " initialization">,
1866   InGroup<Uninitialized>;
1867 def warn_uninit_var : Warning<
1868   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1869   InGroup<Uninitialized>, DefaultIgnore;
1870 def warn_sometimes_uninit_var : Warning<
1871   "variable %0 is %select{used|captured}1 uninitialized whenever "
1872   "%select{'%3' condition is %select{true|false}4|"
1873   "'%3' loop %select{is entered|exits because its condition is false}4|"
1874   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1875   "switch %3 is taken|"
1876   "its declaration is reached|"
1877   "%3 is called}2">,
1878   InGroup<UninitializedSometimes>, DefaultIgnore;
1879 def warn_maybe_uninit_var : Warning<
1880   "variable %0 may be uninitialized when "
1881   "%select{used here|captured by block}1">,
1882   InGroup<UninitializedMaybe>, DefaultIgnore;
1883 def note_var_declared_here : Note<"variable %0 is declared here">;
1884 def note_uninit_var_use : Note<
1885   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1886 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1887   "block pointer variable %0 is uninitialized when captured by block">,
1888   InGroup<Uninitialized>, DefaultIgnore;
1889 def note_block_var_fixit_add_initialization : Note<
1890   "did you mean to use __block %0?">;
1891 def note_in_omitted_aggregate_initializer : Note<
1892   "in implicit initialization of %select{"
1893   "array element %1 with omitted initializer|"
1894   "field %1 with omitted initializer|"
1895   "trailing array elements in runtime-sized array new}0">;
1896 def note_in_reference_temporary_list_initializer : Note<
1897   "in initialization of temporary of type %0 created to "
1898   "list-initialize this reference">;
1899 def note_var_fixit_add_initialization : Note<
1900   "initialize the variable %0 to silence this warning">;
1901 def note_uninit_fixit_remove_cond : Note<
1902   "remove the %select{'%1' if its condition|condition if it}0 "
1903   "is always %select{false|true}2">;
1904 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1905 def err_list_init_in_parens : Error<
1906   "cannot initialize %select{non-class|reference}0 type %1 with a "
1907   "parenthesized initializer list">;
1908
1909 def warn_unsequenced_mod_mod : Warning<
1910   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1911 def warn_unsequenced_mod_use : Warning<
1912   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1913
1914 def err_temp_copy_no_viable : Error<
1915   "no viable constructor %select{copying variable|copying parameter|"
1916   "returning object|throwing object|copying member subobject|copying array "
1917   "element|allocating object|copying temporary|initializing base subobject|"
1918   "initializing vector element|capturing value}0 of type %1">;
1919 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1920   "no viable constructor %select{copying variable|copying parameter|"
1921   "returning object|throwing object|copying member subobject|copying array "
1922   "element|allocating object|copying temporary|initializing base subobject|"
1923   "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1924   "constructor when binding a reference to a temporary">,
1925   InGroup<BindToTemporaryCopy>;
1926 def err_temp_copy_ambiguous : Error<
1927   "ambiguous constructor call when %select{copying variable|copying "
1928   "parameter|returning object|throwing object|copying member subobject|copying "
1929   "array element|allocating object|copying temporary|initializing base subobject|"
1930   "initializing vector element|capturing value}0 of type %1">;
1931 def err_temp_copy_deleted : Error<
1932   "%select{copying variable|copying parameter|returning object|throwing "
1933   "object|copying member subobject|copying array element|allocating object|"
1934   "copying temporary|initializing base subobject|initializing vector element|"
1935   "capturing value}0 of type %1 invokes deleted constructor">;
1936 def err_temp_copy_incomplete : Error<
1937   "copying a temporary object of incomplete type %0">;
1938 def warn_cxx98_compat_temp_copy : Warning<
1939   "%select{copying variable|copying parameter|returning object|throwing "
1940   "object|copying member subobject|copying array element|allocating object|"
1941   "copying temporary|initializing base subobject|initializing vector element}1 "
1942   "of type %2 when binding a reference to a temporary would %select{invoke "
1943   "an inaccessible constructor|find no viable constructor|find ambiguous "
1944   "constructors|invoke a deleted constructor}0 in C++98">,
1945   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1946 def err_selected_explicit_constructor : Error<
1947   "chosen constructor is explicit in copy-initialization">;
1948 def note_explicit_ctor_deduction_guide_here : Note<
1949   "explicit %select{constructor|deduction guide}0 declared here">;
1950
1951 // C++11 decltype
1952 def err_decltype_in_declarator : Error<
1953     "'decltype' cannot be used to name a declaration">;
1954     
1955 // C++11 auto
1956 def warn_cxx98_compat_auto_type_specifier : Warning<
1957   "'auto' type specifier is incompatible with C++98">,
1958   InGroup<CXX98Compat>, DefaultIgnore;
1959 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1960   "variable %0 declared with deduced type %1 "
1961   "cannot appear in its own initializer">;
1962 def err_binding_cannot_appear_in_own_initializer : Error<
1963   "binding %0 cannot appear in the initializer of its own "
1964   "decomposition declaration">;
1965 def err_illegal_decl_array_of_auto : Error<
1966   "'%0' declared as array of %1">;
1967 def err_new_array_of_auto : Error<
1968   "cannot allocate array of 'auto'">;
1969 def err_auto_not_allowed : Error<
1970   "%select{'auto'|'decltype(auto)'|'__auto_type'|"
1971   "use of "
1972   "%select{class template|function template|variable template|alias template|"
1973   "template template parameter|template}2 %3 requires template arguments; "
1974   "argument deduction}0 not allowed "
1975   "%select{in function prototype"
1976   "|in non-static struct member|in struct member"
1977   "|in non-static union member|in union member"
1978   "|in non-static class member|in interface member"
1979   "|in exception declaration|in template parameter until C++17|in block literal"
1980   "|in template argument|in typedef|in type alias|in function return type"
1981   "|in conversion function type|here|in lambda parameter"
1982   "|in type allocated by 'new'|in K&R-style function parameter"
1983   "|in template parameter|in friend declaration}1">;
1984 def err_dependent_deduced_tst : Error<
1985   "typename specifier refers to "
1986   "%select{class template|function template|variable template|alias template|"
1987   "template template parameter|template}0 member in %1; "
1988   "argument deduction not allowed here">;
1989 def err_auto_not_allowed_var_inst : Error<
1990   "'auto' variable template instantiation is not allowed">;
1991 def err_auto_var_requires_init : Error<
1992   "declaration of variable %0 with deduced type %1 requires an initializer">;
1993 def err_auto_new_requires_ctor_arg : Error<
1994   "new expression for type %0 requires a constructor argument">;
1995 def ext_auto_new_list_init : Extension<
1996   "ISO C++ standards before C++17 do not allow new expression for "
1997   "type %0 to use list-initialization">, InGroup<CXX17>;
1998 def err_auto_var_init_no_expression : Error<
1999   "initializer for variable %0 with type %1 is empty">;
2000 def err_auto_var_init_multiple_expressions : Error<
2001   "initializer for variable %0 with type %1 contains multiple expressions">;
2002 def err_auto_var_init_paren_braces : Error<
2003   "cannot deduce type for variable %1 with type %2 from "
2004   "%select{parenthesized|nested}0 initializer list">;
2005 def err_auto_new_ctor_multiple_expressions : Error<
2006   "new expression for type %0 contains multiple constructor arguments">;
2007 def err_auto_missing_trailing_return : Error<
2008   "'auto' return without trailing return type; deduced return types are a "
2009   "C++14 extension">;
2010 def err_deduced_return_type : Error<
2011   "deduced return types are a C++14 extension">;
2012 def err_trailing_return_without_auto : Error<
2013   "function with trailing return type must specify return type 'auto', not %0">;
2014 def err_trailing_return_in_parens : Error<
2015   "trailing return type may not be nested within parentheses">;
2016 def err_auto_var_deduction_failure : Error<
2017   "variable %0 with type %1 has incompatible initializer of type %2">;
2018 def err_auto_var_deduction_failure_from_init_list : Error<
2019   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
2020 def err_auto_new_deduction_failure : Error<
2021   "new expression for type %0 has incompatible constructor argument of type %1">;
2022 def err_auto_inconsistent_deduction : Error<
2023   "deduced conflicting types %diff{($ vs $) |}0,1"
2024   "for initializer list element type">;
2025 def err_auto_different_deductions : Error<
2026   "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
2027   "deduced as %1 in declaration of %2 and "
2028   "deduced as %3 in declaration of %4">;
2029 def err_auto_non_deduced_not_alone : Error<
2030   "%select{function with deduced return type|"
2031   "declaration with trailing return type}0 "
2032   "must be the only declaration in its group">;
2033 def err_implied_std_initializer_list_not_found : Error<
2034   "cannot deduce type of initializer list because std::initializer_list was "
2035   "not found; include <initializer_list>">;
2036 def err_malformed_std_initializer_list : Error<
2037   "std::initializer_list must be a class template with a single type parameter">;
2038 def warn_dangling_std_initializer_list : Warning<
2039   "array backing the initializer list will be destroyed at the end of "
2040   "%select{the full-expression|the constructor}0">,
2041   InGroup<DiagGroup<"dangling-initializer-list">>;
2042 def err_auto_init_list_from_c : Error<
2043   "cannot use __auto_type with initializer list in C">;
2044 def err_auto_bitfield : Error<
2045   "cannot pass bit-field as __auto_type initializer in C">;
2046
2047 // C++1y decltype(auto) type
2048 def err_decltype_auto_invalid : Error<
2049   "'decltype(auto)' not allowed here">;
2050 def err_decltype_auto_cannot_be_combined : Error<
2051   "'decltype(auto)' cannot be combined with other type specifiers">;
2052 def err_decltype_auto_function_declarator_not_declaration : Error<
2053   "'decltype(auto)' can only be used as a return type "
2054   "in a function declaration">;
2055 def err_decltype_auto_compound_type : Error<
2056   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
2057 def err_decltype_auto_initializer_list : Error<
2058   "cannot deduce 'decltype(auto)' from initializer list">;
2059
2060 // C++17 deduced class template specialization types
2061 def err_deduced_class_template_compound_type : Error<
2062   "cannot %select{form pointer to|form reference to|form array of|"
2063   "form function returning|use parentheses when declaring variable with}0 "
2064   "deduced class template specialization type">;
2065 def err_deduced_non_class_template_specialization_type : Error<
2066   "%select{<error>|function template|variable template|alias template|"
2067   "template template parameter|template}0 %1 requires template arguments; "
2068   "argument deduction only allowed for class templates">;
2069 def err_deduced_class_template_ctor_ambiguous : Error<
2070   "ambiguous deduction for template arguments of %0">;
2071 def err_deduced_class_template_ctor_no_viable : Error<
2072   "no viable constructor or deduction guide for deduction of "
2073   "template arguments of %0">;
2074 def err_deduced_class_template_incomplete : Error<
2075   "template %0 has no definition and no %select{|viable }1deduction guides "
2076   "for deduction of template arguments">;
2077 def err_deduced_class_template_deleted : Error<
2078   "class template argument deduction for %0 selected a deleted constructor">;
2079 def err_deduced_class_template_explicit : Error<
2080   "class template argument deduction for %0 selected an explicit "
2081   "%select{constructor|deduction guide}1 for copy-list-initialization">;
2082 def err_deduction_guide_no_trailing_return_type : Error<
2083   "deduction guide declaration without trailing return type">;
2084 def err_deduction_guide_bad_trailing_return_type : Error<
2085   "deduced type %1 of deduction guide is not %select{|written as }2"
2086   "a specialization of template %0">;
2087 def err_deduction_guide_with_complex_decl : Error<
2088   "cannot specify any part of a return type in the "
2089   "declaration of a deduction guide">;
2090 def err_deduction_guide_invalid_specifier : Error<
2091   "deduction guide cannot be declared '%0'">;
2092 def err_deduction_guide_name_not_class_template : Error<
2093   "cannot specify deduction guide for "
2094   "%select{<error>|function template|variable template|alias template|"
2095   "template template parameter|dependent template name}0 %1">;
2096 def err_deduction_guide_wrong_scope : Error<
2097   "deduction guide must be declared in the same scope as template %q0">;
2098 def err_deduction_guide_defines_function : Error<
2099   "deduction guide cannot have a function definition">;
2100 def err_deduction_guide_explicit_mismatch : Error<
2101   "deduction guide is %select{not |}0declared 'explicit' but "
2102   "previous declaration was%select{ not|}0">;
2103 def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2104   "%select{explicitly instantiated|explicitly specialized}0">;
2105 def err_deduction_guide_template_not_deducible : Error<
2106     "deduction guide template contains "
2107     "%select{a template parameter|template parameters}0 that cannot be "
2108     "deduced">;
2109
2110 // C++1y deduced return types
2111 def err_auto_fn_deduction_failure : Error<
2112   "cannot deduce return type %0 from returned value of type %1">;
2113 def err_auto_fn_different_deductions : Error<
2114   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2115   "deduced as %2 in earlier return statement">;
2116 def err_auto_fn_used_before_defined : Error<
2117   "function %0 with deduced return type cannot be used before it is defined">;
2118 def err_auto_fn_no_return_but_not_auto : Error<
2119   "cannot deduce return type %0 for function with no return statements">;
2120 def err_auto_fn_return_void_but_not_auto : Error<
2121   "cannot deduce return type %0 from omitted return expression">;
2122 def err_auto_fn_return_init_list : Error<
2123   "cannot deduce return type from initializer list">;
2124 def err_auto_fn_virtual : Error<
2125   "function with deduced return type cannot be virtual">;
2126
2127 // C++11 override control
2128 def override_keyword_only_allowed_on_virtual_member_functions : Error<
2129   "only virtual member functions can be marked '%0'">;
2130 def override_keyword_hides_virtual_member_function : Error<
2131   "non-virtual member function marked '%0' hides virtual member "
2132   "%select{function|functions}1">;
2133 def err_function_marked_override_not_overriding : Error<
2134   "%0 marked 'override' but does not override any member functions">;
2135 def warn_destructor_marked_not_override_overriding : Warning <
2136   "%0 overrides a destructor but is not marked 'override'">,
2137   InGroup<CXX11WarnOverrideDestructor>, DefaultIgnore;
2138 def warn_function_marked_not_override_overriding : Warning <
2139   "%0 overrides a member function but is not marked 'override'">,
2140   InGroup<CXX11WarnOverrideMethod>;
2141 def err_class_marked_final_used_as_base : Error<
2142   "base %0 is marked '%select{final|sealed}1'">;
2143 def warn_abstract_final_class : Warning<
2144   "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2145
2146 // C++11 attributes
2147 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2148
2149 // C++11 final
2150 def err_final_function_overridden : Error<
2151   "declaration of %0 overrides a '%select{final|sealed}1' function">;
2152
2153 // C++11 scoped enumerations
2154 def err_enum_invalid_underlying : Error<
2155   "non-integral type %0 is an invalid underlying type">;
2156 def err_enumerator_too_large : Error<
2157   "enumerator value is not representable in the underlying type %0">;
2158 def ext_enumerator_too_large : Extension<
2159   "enumerator value is not representable in the underlying type %0">,
2160   InGroup<MicrosoftEnumValue>;
2161 def err_enumerator_wrapped : Error<
2162   "enumerator value %0 is not representable in the underlying type %1">;
2163 def err_enum_redeclare_type_mismatch : Error<
2164   "enumeration redeclared with different underlying type %0 (was %1)">;
2165 def err_enum_redeclare_fixed_mismatch : Error<
2166   "enumeration previously declared with %select{non|}0fixed underlying type">;
2167 def err_enum_redeclare_scoped_mismatch : Error<
2168   "enumeration previously declared as %select{un|}0scoped">;
2169 def err_enum_class_reference : Error<
2170   "reference to %select{|scoped }0enumeration must use 'enum' "
2171   "not 'enum class'">;
2172 def err_only_enums_have_underlying_types : Error<
2173   "only enumeration types have underlying types">;
2174 def err_underlying_type_of_incomplete_enum : Error<
2175   "cannot determine underlying type of incomplete enumeration type %0">;
2176
2177 // C++11 delegating constructors
2178 def err_delegating_ctor : Error<
2179   "delegating constructors are permitted only in C++11">;
2180 def warn_cxx98_compat_delegating_ctor : Warning<
2181   "delegating constructors are incompatible with C++98">,
2182   InGroup<CXX98Compat>, DefaultIgnore;
2183 def err_delegating_initializer_alone : Error<
2184   "an initializer for a delegating constructor must appear alone">;
2185 def warn_delegating_ctor_cycle : Warning<
2186   "constructor for %0 creates a delegation cycle">, DefaultError,
2187   InGroup<DelegatingCtorCycles>;
2188 def note_it_delegates_to : Note<"it delegates to">;
2189 def note_which_delegates_to : Note<"which delegates to">;
2190
2191 // C++11 range-based for loop
2192 def err_for_range_decl_must_be_var : Error<
2193   "for range declaration must declare a variable">;
2194 def err_for_range_storage_class : Error<
2195   "loop variable %0 may not be declared %select{'extern'|'static'|"
2196   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2197 def err_type_defined_in_for_range : Error<
2198   "types may not be defined in a for range declaration">;
2199 def err_for_range_deduction_failure : Error<
2200   "cannot use type %0 as a range">;
2201 def err_for_range_incomplete_type : Error<
2202   "cannot use incomplete type %0 as a range">;
2203 def err_for_range_iter_deduction_failure : Error<
2204   "cannot use type %0 as an iterator">;
2205 def err_for_range_member_begin_end_mismatch : Error<
2206   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
2207 def ext_for_range_begin_end_types_differ : ExtWarn<
2208   "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2209   InGroup<CXX17>;
2210 def warn_for_range_begin_end_types_differ : Warning<
2211   "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2212   "with C++ standards before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
2213 def note_in_for_range: Note<
2214   "when looking up '%select{begin|end}0' function for range expression "
2215   "of type %1">;
2216 def err_for_range_invalid: Error<
2217   "invalid range expression of type %0; no viable '%select{begin|end}1' "
2218   "function available">;
2219 def err_range_on_array_parameter : Error<
2220   "cannot build range expression with array function parameter %0 since "
2221   "parameter with array type %1 is treated as pointer type %2">;
2222 def err_for_range_dereference : Error<
2223   "invalid range expression of type %0; did you mean to dereference it "
2224   "with '*'?">;
2225 def note_for_range_invalid_iterator : Note <
2226   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2227 def note_for_range_begin_end : Note<
2228   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2229 def warn_for_range_const_reference_copy : Warning<
2230   "loop variable %0 "
2231   "%diff{has type $ but is initialized with type $"
2232   "| is initialized with a value of a different type}1,2 resulting in a copy">,
2233   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2234 def note_use_type_or_non_reference : Note<
2235   "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2236 def warn_for_range_variable_always_copy : Warning<
2237   "loop variable %0 is always a copy because the range of type %1 does not "
2238   "return a reference">,
2239   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2240 def note_use_non_reference_type : Note<"use non-reference type %0">;
2241 def warn_for_range_copy : Warning<
2242   "loop variable %0 of type %1 creates a copy from type %2">,
2243   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2244 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2245
2246 // C++11 constexpr
2247 def warn_cxx98_compat_constexpr : Warning<
2248   "'constexpr' specifier is incompatible with C++98">,
2249   InGroup<CXX98Compat>, DefaultIgnore;
2250 // FIXME: Maybe this should also go in -Wc++14-compat?
2251 def warn_cxx14_compat_constexpr_not_const : Warning<
2252   "'constexpr' non-static member function will not be implicitly 'const' "
2253   "in C++14; add 'const' to avoid a change in behavior">,
2254   InGroup<DiagGroup<"constexpr-not-const">>;
2255 def err_invalid_constexpr : Error<
2256   "%select{function parameter|typedef|non-static data member}0 "
2257   "cannot be constexpr">;
2258 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2259   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2260 def err_constexpr_tag : Error<
2261   "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
2262 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
2263 def err_constexpr_no_declarators : Error<
2264   "constexpr can only be used in variable and function declarations">;
2265 def err_invalid_constexpr_var_decl : Error<
2266   "constexpr variable declaration must be a definition">;
2267 def err_constexpr_static_mem_var_requires_init : Error<
2268   "declaration of constexpr static data member %0 requires an initializer">;
2269 def err_constexpr_var_non_literal : Error<
2270   "constexpr variable cannot have non-literal type %0">;
2271 def err_constexpr_var_requires_const_init : Error<
2272   "constexpr variable %0 must be initialized by a constant expression">;
2273 def err_constexpr_redecl_mismatch : Error<
2274   "%select{non-constexpr declaration of %0 follows constexpr declaration"
2275   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
2276 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2277 def err_constexpr_virtual_base : Error<
2278   "constexpr %select{member function|constructor}0 not allowed in "
2279   "%select{struct|interface|class}1 with virtual base "
2280   "%plural{1:class|:classes}2">;
2281 def note_non_literal_incomplete : Note<
2282   "incomplete type %0 is not a literal type">;
2283 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2284   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2285 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2286 def err_constexpr_non_literal_return : Error<
2287   "constexpr function's return type %0 is not a literal type">;
2288 def err_constexpr_non_literal_param : Error<
2289   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
2290   "not a literal type">;
2291 def err_constexpr_body_invalid_stmt : Error<
2292   "statement not allowed in constexpr %select{function|constructor}0">;
2293 def ext_constexpr_body_invalid_stmt : ExtWarn<
2294   "use of this statement in a constexpr %select{function|constructor}0 "
2295   "is a C++14 extension">, InGroup<CXX14>;
2296 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2297   "use of this statement in a constexpr %select{function|constructor}0 "
2298   "is incompatible with C++ standards before C++14">,
2299   InGroup<CXXPre14Compat>, DefaultIgnore;
2300 def ext_constexpr_type_definition : ExtWarn<
2301   "type definition in a constexpr %select{function|constructor}0 "
2302   "is a C++14 extension">, InGroup<CXX14>;
2303 def warn_cxx11_compat_constexpr_type_definition : Warning<
2304   "type definition in a constexpr %select{function|constructor}0 "
2305   "is incompatible with C++ standards before C++14">,
2306   InGroup<CXXPre14Compat>, DefaultIgnore;
2307 def err_constexpr_vla : Error<
2308   "variably-modified type %0 cannot be used in a constexpr "
2309   "%select{function|constructor}1">;
2310 def ext_constexpr_local_var : ExtWarn<
2311   "variable declaration in a constexpr %select{function|constructor}0 "
2312   "is a C++14 extension">, InGroup<CXX14>;
2313 def warn_cxx11_compat_constexpr_local_var : Warning<
2314   "variable declaration in a constexpr %select{function|constructor}0 "
2315   "is incompatible with C++ standards before C++14">,
2316   InGroup<CXXPre14Compat>, DefaultIgnore;
2317 def err_constexpr_local_var_static : Error<
2318   "%select{static|thread_local}1 variable not permitted in a constexpr "
2319   "%select{function|constructor}0">;
2320 def err_constexpr_local_var_non_literal_type : Error<
2321   "variable of non-literal type %1 cannot be defined in a constexpr "
2322   "%select{function|constructor}0">;
2323 def err_constexpr_local_var_no_init : Error<
2324   "variables defined in a constexpr %select{function|constructor}0 must be "
2325   "initialized">;
2326 def ext_constexpr_function_never_constant_expr : ExtWarn<
2327   "constexpr %select{function|constructor}0 never produces a "
2328   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2329 def err_attr_cond_never_constant_expr : Error<
2330   "%0 attribute expression never produces a constant expression">;
2331 def err_diagnose_if_invalid_diagnostic_type : Error<
2332   "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2333   "instead">;
2334 def err_constexpr_body_no_return : Error<
2335   "no return statement in constexpr function">;
2336 def err_constexpr_return_missing_expr : Error<
2337   "non-void constexpr function %0 should return a value">;
2338 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2339   "constexpr function with no return statements is incompatible with C++ "
2340   "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2341 def ext_constexpr_body_multiple_return : ExtWarn<
2342   "multiple return statements in constexpr function is a C++14 extension">,
2343   InGroup<CXX14>;
2344 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2345   "multiple return statements in constexpr function "
2346   "is incompatible with C++ standards before C++14">,
2347   InGroup<CXXPre14Compat>, DefaultIgnore;
2348 def note_constexpr_body_previous_return : Note<
2349   "previous return statement is here">;
2350 def err_constexpr_function_try_block : Error<
2351   "function try block not allowed in constexpr %select{function|constructor}0">;
2352 def err_constexpr_union_ctor_no_init : Error<
2353   "constexpr union constructor does not initialize any member">;
2354 def err_constexpr_ctor_missing_init : Error<
2355   "constexpr constructor must initialize all members">;
2356 def note_constexpr_ctor_missing_init : Note<
2357   "member not initialized by constructor">;
2358 def note_non_literal_no_constexpr_ctors : Note<
2359   "%0 is not literal because it is not an aggregate and has no constexpr "
2360   "constructors other than copy or move constructors">;
2361 def note_non_literal_base_class : Note<
2362   "%0 is not literal because it has base class %1 of non-literal type">;
2363 def note_non_literal_field : Note<
2364   "%0 is not literal because it has data member %1 of "
2365   "%select{non-literal|volatile}3 type %2">;
2366 def note_non_literal_user_provided_dtor : Note<
2367   "%0 is not literal because it has a user-provided destructor">;
2368 def note_non_literal_nontrivial_dtor : Note<
2369   "%0 is not literal because it has a non-trivial destructor">;
2370 def warn_private_extern : Warning<
2371   "use of __private_extern__ on a declaration may not produce external symbol "
2372   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2373 def note_private_extern : Note<
2374   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2375
2376 // C++ Concepts TS
2377 def err_concept_wrong_decl_kind : Error<
2378   "'concept' can only appear on the definition of a function template or variable template">;
2379 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2380   "concept declarations may only appear in namespace scope">;
2381 def err_function_concept_not_defined : Error<
2382   "function concept declaration must be a definition">;
2383 def err_var_concept_not_initialized : Error<
2384   "variable concept declaration must be initialized">;
2385 def err_function_concept_exception_spec : Error<
2386   "function concept cannot have exception specification">;
2387 def err_concept_decl_invalid_specifiers : Error<
2388   "%select{variable|function}0 concept cannot be declared "
2389   "'%select{thread_local|inline|friend|constexpr}1'">;
2390 def err_function_concept_with_params : Error<
2391   "function concept cannot have any parameters">;
2392 def err_function_concept_bool_ret : Error<
2393   "declared return type of function concept must be 'bool'">;
2394 def err_variable_concept_bool_decl : Error<
2395   "declared type of variable concept must be 'bool'">;
2396 def err_concept_specified_specialization : Error<
2397   "'concept' cannot be applied on an "
2398   "%select{explicit instantiation|explicit specialization|partial specialization}0">;
2399 def err_concept_specialized : Error<
2400   "%select{function|variable}0 concept cannot be "
2401   "%select{explicitly instantiated|explicitly specialized|partially specialized}1">;
2402
2403 def err_template_different_associated_constraints : Error<
2404   "associated constraints differ in template redeclaration">;
2405
2406 // C++11 char16_t/char32_t
2407 def warn_cxx98_compat_unicode_type : Warning<
2408   "'%0' type specifier is incompatible with C++98">,
2409   InGroup<CXX98Compat>, DefaultIgnore;
2410
2411 // __make_integer_seq
2412 def err_integer_sequence_negative_length : Error<
2413   "integer sequences must have non-negative sequence length">;
2414 def err_integer_sequence_integral_element_type : Error<
2415   "integer sequences must have integral element type">;
2416
2417 // __type_pack_element
2418 def err_type_pack_element_out_of_bounds : Error<
2419   "a parameter pack may not be accessed at an out of bounds index">;
2420
2421 // Objective-C++
2422 def err_objc_decls_may_only_appear_in_global_scope : Error<
2423   "Objective-C declarations may only appear in global scope">;
2424 def warn_auto_var_is_id : Warning<
2425   "'auto' deduced as 'id' in declaration of %0">,
2426   InGroup<DiagGroup<"auto-var-id">>;
2427
2428 // Attributes
2429 def err_nsobject_attribute : Error<
2430   "'NSObject' attribute is for pointer types only">;
2431 def err_attributes_are_not_compatible : Error<
2432   "%0 and %1 attributes are not compatible">;
2433 def err_attribute_wrong_number_arguments : Error<
2434   "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2435   ":requires exactly %1 arguments}1">;
2436 def err_attribute_too_many_arguments : Error<
2437   "%0 attribute takes no more than %1 argument%s1">;
2438 def err_attribute_too_few_arguments : Error<
2439   "%0 attribute takes at least %1 argument%s1">;
2440 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2441 def err_attribute_bad_neon_vector_size : Error<
2442   "Neon vector size must be 64 or 128 bits">;
2443 def err_attribute_requires_positive_integer : Error<
2444   "%0 attribute requires a positive integral compile time constant expression">;
2445 def err_attribute_requires_opencl_version : Error<
2446   "%0 attribute requires OpenCL version %1%select{| or above}2">;
2447 def warn_unsupported_target_attribute
2448     : Warning<"ignoring %select{unsupported|duplicate}0"
2449               "%select{| architecture}1 '%2' in the target attribute string">,
2450       InGroup<IgnoredAttributes>;
2451 def err_attribute_unsupported
2452     : Error<"%0 attribute is not supported for this target">;
2453 // The err_*_attribute_argument_not_int are separate because they're used by
2454 // VerifyIntegerConstantExpression.
2455 def err_aligned_attribute_argument_not_int : Error<
2456   "'aligned' attribute requires integer constant">;
2457 def err_align_value_attribute_argument_not_int : Error<
2458   "'align_value' attribute requires integer constant">;
2459 def err_alignas_attribute_wrong_decl_type : Error<
2460   "%0 attribute cannot be applied to a %select{function parameter|"
2461   "variable with 'register' storage class|'catch' variable|bit-field}1">;
2462 def err_alignas_missing_on_definition : Error<
2463   "%0 must be specified on definition if it is specified on any declaration">;
2464 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2465 def err_alignas_mismatch : Error<
2466   "redeclaration has different alignment requirement (%1 vs %0)">;
2467 def err_alignas_underaligned : Error<
2468   "requested alignment is less than minimum alignment of %1 for type %0">;
2469 def err_attribute_argument_n_type : Error<
2470   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2471   "constant|a string|an identifier}2">;
2472 def err_attribute_argument_type : Error<
2473   "%0 attribute requires %select{int or bool|an integer "
2474   "constant|a string|an identifier}1">;
2475 def err_attribute_argument_outof_range : Error<
2476   "%0 attribute requires integer constant between %1 and %2 inclusive">;
2477 def err_init_priority_object_attr : Error<
2478   "can only use 'init_priority' attribute on file-scope definitions "
2479   "of objects of class type">;
2480 def err_attribute_argument_vec_type_hint : Error<
2481   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2482 def err_attribute_argument_out_of_bounds : Error<
2483   "%0 attribute parameter %1 is out of bounds">;
2484 def err_attribute_only_once_per_parameter : Error<
2485   "%0 attribute can only be applied once per parameter">;
2486 def err_attribute_uuid_malformed_guid : Error<
2487   "uuid attribute contains a malformed GUID">;
2488 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2489 def note_previous_uuid : Note<"previous uuid specified here">;
2490 def warn_attribute_pointers_only : Warning<
2491   "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2492   InGroup<IgnoredAttributes>;
2493 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2494 def err_attribute_integers_only : Error<
2495   "%0 attribute argument may only refer to a function parameter of integer "
2496   "type">;
2497 def warn_attribute_return_pointers_only : Warning<
2498   "%0 attribute only applies to return values that are pointers">,
2499   InGroup<IgnoredAttributes>;
2500 def warn_attribute_return_pointers_refs_only : Warning<
2501   "%0 attribute only applies to return values that are pointers or references">,
2502   InGroup<IgnoredAttributes>;
2503 def warn_attribute_pointer_or_reference_only : Warning<
2504   "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2505   InGroup<IgnoredAttributes>;
2506 def err_attribute_no_member_pointers : Error<
2507   "%0 attribute cannot be used with pointers to members">;
2508 def err_attribute_invalid_implicit_this_argument : Error<
2509   "%0 attribute is invalid for the implicit this argument">;
2510 def err_ownership_type : Error<
2511   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2512 def err_ownership_returns_index_mismatch : Error<
2513   "'ownership_returns' attribute index does not match; here it is %0">;
2514 def note_ownership_returns_index_mismatch : Note<
2515   "declared with index %0 here">;
2516 def err_format_strftime_third_parameter : Error<
2517   "strftime format attribute requires 3rd parameter to be 0">;
2518 def err_format_attribute_requires_variadic : Error<
2519   "format attribute requires variadic function">;
2520 def err_format_attribute_not : Error<"format argument not %0">;
2521 def err_format_attribute_result_not : Error<"function does not return %0">;
2522 def err_format_attribute_implicit_this_format_string : Error<
2523   "format attribute cannot specify the implicit this argument as the format "
2524   "string">;
2525 def err_init_method_bad_return_type : Error<
2526   "init methods must return an object pointer type, not %0">;
2527 def err_attribute_invalid_size : Error<
2528   "vector size not an integral multiple of component size">;
2529 def err_attribute_zero_size : Error<"zero vector size">;
2530 def err_attribute_size_too_large : Error<"vector size too large">;
2531 def err_typecheck_vector_not_convertable_implict_truncation : Error<
2532    "cannot convert between %select{scalar|vector}0 type %1 and vector type"
2533    " %2 as implicit conversion would cause truncation">;
2534 def err_typecheck_vector_not_convertable : Error<
2535   "cannot convert between vector values of different size (%0 and %1)">;
2536 def err_typecheck_vector_not_convertable_non_scalar : Error<
2537   "cannot convert between vector and non-scalar values (%0 and %1)">;
2538 def err_typecheck_vector_lengths_not_equal : Error<
2539   "vector operands do not have the same number of elements (%0 and %1)">;
2540 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2541   "vector operands do not have the same elements sizes (%0 and %1)">,
2542   InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2543 def err_ext_vector_component_exceeds_length : Error<
2544   "vector component access exceeds type %0">;
2545 def err_ext_vector_component_name_illegal : Error<
2546   "illegal vector component name '%0'">;
2547 def err_attribute_address_space_negative : Error<
2548   "address space is negative">;
2549 def err_attribute_address_space_too_high : Error<
2550   "address space is larger than the maximum supported (%0)">;
2551 def err_attribute_address_multiple_qualifiers : Error<
2552   "multiple address spaces specified for type">;
2553 def err_attribute_address_function_type : Error<
2554   "function type may not be qualified with an address space">;
2555 def err_as_qualified_auto_decl : Error<
2556   "automatic variable qualified with an%select{| invalid}0 address space">;
2557 def err_arg_with_address_space : Error<
2558   "parameter may not be qualified with an address space">;
2559 def err_field_with_address_space : Error<
2560   "field may not be qualified with an address space">;
2561 def err_attr_objc_ownership_redundant : Error<
2562   "the type %0 is already explicitly ownership-qualified">;
2563 def err_invalid_nsnumber_type : Error<
2564   "%0 is not a valid literal type for NSNumber">;
2565 def err_objc_illegal_boxed_expression_type : Error<
2566   "illegal type %0 used in a boxed expression">;
2567 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2568   "non-trivially copyable type %0 cannot be used in a boxed expression">;
2569 def err_objc_incomplete_boxed_expression_type : Error<
2570   "incomplete type %0 used in a boxed expression">;
2571 def err_undeclared_objc_literal_class : Error<
2572   "definition of class %0 must be available to use Objective-C "
2573   "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2574   "string literals}1">;
2575 def err_undeclared_boxing_method : Error<
2576   "declaration of %0 is missing in %1 class">;
2577 def err_objc_literal_method_sig : Error<
2578   "literal construction method %0 has incompatible signature">;
2579 def note_objc_literal_method_param : Note<
2580   "%select{first|second|third}0 parameter has unexpected type %1 "
2581   "(should be %2)">;
2582 def note_objc_literal_method_return : Note<
2583   "method returns unexpected type %0 (should be an object type)">;
2584 def err_invalid_collection_element : Error<
2585   "collection element of type %0 is not an Objective-C object">;
2586 def err_box_literal_collection : Error<
2587   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2588   "in a collection">;
2589 def warn_objc_literal_comparison : Warning<
2590   "direct comparison of %select{an array literal|a dictionary literal|"
2591   "a numeric literal|a boxed expression|}0 has undefined behavior">,
2592   InGroup<ObjCLiteralComparison>;
2593 def err_missing_atsign_prefix : Error<
2594   "string literal must be prefixed by '@' ">;
2595 def warn_objc_string_literal_comparison : Warning<
2596   "direct comparison of a string literal has undefined behavior">, 
2597   InGroup<ObjCStringComparison>;
2598 def warn_concatenated_nsarray_literal : Warning<
2599   "concatenated NSString literal for an NSArray expression - "
2600   "possibly missing a comma">,
2601   InGroup<ObjCStringConcatenation>;
2602 def note_objc_literal_comparison_isequal : Note<
2603   "use 'isEqual:' instead">;
2604 def warn_objc_collection_literal_element : Warning<
2605   "object of type %0 is not compatible with "
2606   "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2607   InGroup<ObjCLiteralConversion>;
2608 def err_swift_param_attr_not_swiftcall : Error<
2609   "'%0' parameter can only be used with swiftcall calling convention">;
2610 def err_swift_indirect_result_not_first : Error<
2611   "'swift_indirect_result' parameters must be first parameters of function">;
2612 def err_swift_error_result_not_after_swift_context : Error<
2613   "'swift_error_result' parameter must follow 'swift_context' parameter">;
2614 def err_swift_abi_parameter_wrong_type : Error<
2615   "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2616   "type here is %2">;
2617
2618 def err_attribute_argument_invalid : Error<
2619   "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2620   "min must not be greater than max}1">;
2621 def err_attribute_argument_is_zero : Error<
2622   "%0 attribute must be greater than 0">;
2623 def warn_attribute_argument_n_negative : Warning<
2624   "%0 attribute parameter %1 is negative and will be ignored">,
2625   InGroup<CudaCompat>;
2626 def err_property_function_in_objc_container : Error<
2627   "use of Objective-C property in function nested in Objective-C "
2628   "container not supported, move function outside its container">;
2629
2630 let CategoryName = "Cocoa API Issue" in {
2631 def warn_objc_redundant_literal_use : Warning<
2632   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2633 }
2634
2635 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2636   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2637
2638 def err_tls_var_aligned_over_maximum : Error<
2639   "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2640   "alignment (%2) for a thread-local variable on this target">;
2641
2642 def err_only_annotate_after_access_spec : Error<
2643   "access specifier can only have annotation attributes">;
2644
2645 def err_attribute_section_invalid_for_target : Error<
2646   "argument to 'section' attribute is not valid for this target: %0">;
2647 def warn_mismatched_section : Warning<
2648   "section does not match previous declaration">, InGroup<Section>;
2649 def warn_attribute_section_on_redeclaration : Warning<
2650   "section attribute is specified on redeclared variable">, InGroup<Section>;
2651
2652 def err_anonymous_property: Error<
2653   "anonymous property is not supported">;
2654 def err_property_is_variably_modified : Error<
2655   "property %0 has a variably modified type">;
2656 def err_no_accessor_for_property : Error<
2657   "no %select{getter|setter}0 defined for property %1">;
2658 def err_cannot_find_suitable_accessor : Error<
2659   "cannot find suitable %select{getter|setter}0 for property %1">;
2660
2661 def warn_alloca_align_alignof : Warning<
2662   "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2663   InGroup<DiagGroup<"alloca-with-align-alignof">>;
2664
2665 def err_alignment_too_small : Error<
2666   "requested alignment must be %0 or greater">;
2667 def err_alignment_too_big : Error<
2668   "requested alignment must be %0 or smaller">;
2669 def err_alignment_not_power_of_two : Error<
2670   "requested alignment is not a power of 2">;
2671 def err_alignment_dependent_typedef_name : Error<
2672   "requested alignment is dependent but declaration is not dependent">;
2673
2674 def err_attribute_aligned_too_great : Error<
2675   "requested alignment must be %0 bytes or smaller">;
2676 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2677   "%q0 redeclared without %1 attribute: previous %1 ignored">,
2678   InGroup<MicrosoftInconsistentDllImport>;
2679 def warn_redeclaration_without_import_attribute : Warning<
2680   "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2681   InGroup<MicrosoftInconsistentDllImport>;
2682 def warn_dllimport_dropped_from_inline_function : Warning<
2683   "%q0 redeclared inline; %1 attribute ignored">,
2684   InGroup<IgnoredAttributes>;
2685 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2686   InGroup<IgnoredAttributes>;
2687 def warn_attribute_ignored_on_inline :
2688   Warning<"%0 attribute ignored on inline function">,
2689   InGroup<IgnoredAttributes>;
2690 def warn_attribute_after_definition_ignored : Warning<
2691   "attribute %0 after definition is ignored">,
2692    InGroup<IgnoredAttributes>;
2693 def warn_unknown_attribute_ignored : Warning<
2694   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2695 def warn_cxx11_gnu_attribute_on_type : Warning<
2696   "attribute %0 ignored, because it cannot be applied to a type">,
2697   InGroup<IgnoredAttributes>;
2698 def warn_unhandled_ms_attribute_ignored : Warning<
2699   "__declspec attribute %0 is not supported">, 
2700   InGroup<IgnoredAttributes>;
2701 def err_decl_attribute_invalid_on_stmt : Error<
2702   "%0 attribute cannot be applied to a statement">;
2703 def err_stmt_attribute_invalid_on_decl : Error<
2704   "%0 attribute cannot be applied to a declaration">;
2705 def warn_declspec_attribute_ignored : Warning<
2706   "attribute %0 is ignored, place it after "
2707   "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2708   "type declaration">, InGroup<IgnoredAttributes>;
2709 def warn_attribute_precede_definition : Warning<
2710   "attribute declaration must precede definition">,
2711   InGroup<IgnoredAttributes>;
2712 def warn_attribute_void_function_method : Warning<
2713   "attribute %0 cannot be applied to "
2714   "%select{functions|Objective-C method}1 without return value">,
2715   InGroup<IgnoredAttributes>;
2716 def warn_attribute_weak_on_field : Warning<
2717   "__weak attribute cannot be specified on a field declaration">,
2718   InGroup<IgnoredAttributes>;
2719 def warn_gc_attribute_weak_on_local : Warning<
2720   "Objective-C GC does not allow weak variables on the stack">,
2721   InGroup<IgnoredAttributes>;
2722 def warn_nsobject_attribute : Warning<
2723   "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2724   InGroup<NSobjectAttribute>;
2725 def warn_independentclass_attribute : Warning<
2726   "'objc_independent_class' attribute may be put on a typedef only; "
2727   "attribute is ignored">,
2728   InGroup<IndependentClassAttribute>;
2729 def warn_ptr_independentclass_attribute : Warning<
2730   "'objc_independent_class' attribute may be put on Objective-C object "
2731   "pointer type only; attribute is ignored">,
2732   InGroup<IndependentClassAttribute>;
2733 def warn_attribute_weak_on_local : Warning<
2734   "__weak attribute cannot be specified on an automatic variable when ARC "
2735   "is not enabled">,
2736   InGroup<IgnoredAttributes>;
2737 def warn_weak_identifier_undeclared : Warning<
2738   "weak identifier %0 never declared">;
2739 def err_attribute_weak_static : Error<
2740   "weak declaration cannot have internal linkage">;
2741 def err_attribute_selectany_non_extern_data : Error<
2742   "'selectany' can only be applied to data items with external linkage">;
2743 def err_declspec_thread_on_thread_variable : Error<
2744   "'__declspec(thread)' applied to variable that already has a "
2745   "thread-local storage specifier">;
2746 def err_attribute_dll_not_extern : Error<
2747   "%q0 must have external linkage when declared %q1">;
2748 def err_attribute_dll_thread_local : Error<
2749   "%q0 cannot be thread local when declared %q1">;
2750 def err_attribute_dll_lambda : Error<
2751   "lambda cannot be declared %0">;
2752 def warn_attribute_invalid_on_definition : Warning<
2753   "'%0' attribute cannot be specified on a definition">,
2754   InGroup<IgnoredAttributes>;
2755 def err_attribute_dll_redeclaration : Error<
2756   "redeclaration of %q0 cannot add %q1 attribute">;
2757 def warn_attribute_dll_redeclaration : Warning<
2758   "redeclaration of %q0 should not add %q1 attribute">,
2759   InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2760 def err_attribute_dllimport_function_definition : Error<
2761   "dllimport cannot be applied to non-inline function definition">;
2762 def err_attribute_dll_deleted : Error<
2763   "attribute %q0 cannot be applied to a deleted function">;
2764 def err_attribute_dllimport_data_definition : Error<
2765   "definition of dllimport data">;
2766 def err_attribute_dllimport_static_field_definition : Error<
2767   "definition of dllimport static field not allowed">;
2768 def warn_attribute_dllimport_static_field_definition : Warning<
2769   "definition of dllimport static field">,
2770   InGroup<DiagGroup<"dllimport-static-field-def">>;
2771 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2772   "explicit instantiation declaration should not be 'dllexport'">,
2773   InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2774 def warn_invalid_initializer_from_system_header : Warning<
2775   "invalid constructor form class in system header, should not be explicit">,
2776   InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2777 def note_used_in_initialization_here : Note<"used in initialization here">;
2778 def err_attribute_dll_member_of_dll_class : Error<
2779   "attribute %q0 cannot be applied to member of %q1 class">;
2780 def warn_attribute_dll_instantiated_base_class : Warning<
2781   "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2782   "base class template without dll attribute is not supported">,
2783   InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2784 def err_attribute_dll_ambiguous_default_ctor : Error<
2785   "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2786 def err_attribute_weakref_not_static : Error<
2787   "weakref declaration must have internal linkage">;
2788 def err_attribute_weakref_not_global_context : Error<
2789   "weakref declaration of %0 must be in a global context">;
2790 def err_attribute_weakref_without_alias : Error<
2791   "weakref declaration of %0 must also have an alias attribute">;
2792 def err_alias_not_supported_on_darwin : Error <
2793   "aliases are not supported on darwin">;
2794 def err_alias_to_undefined : Error<
2795   "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">;
2796 def warn_alias_to_weak_alias : Warning<
2797   "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">,
2798   InGroup<IgnoredAttributes>;
2799 def warn_alias_with_section : Warning<
2800   "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">,
2801   InGroup<IgnoredAttributes>;
2802 def err_duplicate_mangled_name : Error<
2803   "definition with same mangled name as another definition">;
2804 def err_cyclic_alias : Error<
2805   "%select{alias|ifunc}0 definition is part of a cycle">;
2806 def err_ifunc_resolver_return : Error<
2807   "ifunc resolver function must return a pointer">;
2808 def err_ifunc_resolver_params : Error<
2809   "ifunc resolver function must have no parameters">;
2810 def warn_attribute_wrong_decl_type_str : Warning<
2811   "%0 attribute only applies to %1">, InGroup<IgnoredAttributes>;
2812 def err_attribute_wrong_decl_type_str : Error<
2813   warn_attribute_wrong_decl_type_str.Text>;
2814 def warn_attribute_wrong_decl_type : Warning<
2815   "%0 attribute only applies to %select{"
2816   "functions"
2817   "|unions"
2818   "|variables and functions"
2819   "|functions and methods"
2820   "|functions, methods and blocks"
2821   "|functions, methods, and parameters"
2822   "|variables"
2823   "|variables and fields"
2824   "|variables, data members and tag types"
2825   "|types and namespaces"
2826   "|variables, functions and classes"
2827   "|kernel functions"
2828   "|non-K&R-style functions"
2829   "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members}1">,
2830   InGroup<IgnoredAttributes>;
2831 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2832 def warn_type_attribute_wrong_type : Warning<
2833   "'%0' only applies to %select{function|pointer|"
2834   "Objective-C object or block pointer}1 types; type here is %2">,
2835   InGroup<IgnoredAttributes>;
2836 def warn_incomplete_encoded_type : Warning<
2837   "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2838   InGroup<DiagGroup<"encode-type">>;
2839 def warn_gnu_inline_attribute_requires_inline : Warning<
2840   "'gnu_inline' attribute requires function to be marked 'inline',"
2841   " attribute ignored">,
2842   InGroup<IgnoredAttributes>;
2843 def err_attribute_vecreturn_only_vector_member : Error<
2844   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2845 def err_attribute_vecreturn_only_pod_record : Error<
2846   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2847 def err_cconv_change : Error<
2848   "function declared '%0' here was previously declared "
2849   "%select{'%2'|without calling convention}1">;
2850 def warn_cconv_ignored : Warning<
2851   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2852 def err_cconv_knr : Error<
2853   "function with no prototype cannot use the %0 calling convention">;
2854 def warn_cconv_knr : Warning<
2855   err_cconv_knr.Text>,
2856   InGroup<DiagGroup<"missing-prototype-for-cc">>;
2857 def err_cconv_varargs : Error<
2858   "variadic function cannot use %0 calling convention">;
2859 def warn_cconv_varargs : Warning<
2860   "%0 calling convention ignored on variadic function">,
2861   InGroup<IgnoredAttributes>;
2862 def warn_cconv_structors : Warning<
2863   "%0 calling convention ignored on constructor/destructor">,
2864   InGroup<IgnoredAttributes>;
2865 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2866   "attribute was previously declared "
2867   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2868 def err_function_attribute_mismatch : Error<
2869   "function declared with %0 attribute "
2870   "was previously declared without the %0 attribute">;
2871 def err_objc_precise_lifetime_bad_type : Error<
2872   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2873 def warn_objc_precise_lifetime_meaningless : Error<
2874   "objc_precise_lifetime is not meaningful for "
2875   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2876 def err_invalid_pcs : Error<"invalid PCS type">;
2877 def warn_attribute_not_on_decl : Warning<
2878   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2879 def err_base_specifier_attribute : Error<
2880   "%0 attribute cannot be applied to a base specifier">;
2881 def err_invalid_attribute_on_virtual_function : Error<
2882   "%0 attribute cannot be applied to virtual functions">;
2883
2884 // Availability attribute
2885 def warn_availability_unknown_platform : Warning<
2886   "unknown platform %0 in availability macro">, InGroup<Availability>;
2887 def warn_availability_version_ordering : Warning<
2888   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2889   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2890   "attribute ignored">, InGroup<Availability>;
2891 def warn_mismatched_availability: Warning<
2892   "availability does not match previous declaration">, InGroup<Availability>;
2893 def warn_mismatched_availability_override : Warning<
2894   "%select{|overriding }4method %select{introduced after|"
2895   "deprecated before|obsoleted before}0 "
2896   "%select{the protocol method it implements|overridden method}4 "
2897   "on %1 (%2 vs. %3)">, InGroup<Availability>;
2898 def warn_mismatched_availability_override_unavail : Warning<
2899   "%select{|overriding }1method cannot be unavailable on %0 when "
2900   "%select{the protocol method it implements|its overridden method}1 is "
2901   "available">,
2902   InGroup<Availability>;
2903 def note_overridden_method : Note<
2904   "overridden method is here">;
2905 def note_protocol_method : Note<
2906   "protocol method is here">;
2907
2908 def warn_unguarded_availability :
2909   Warning<"%0 is only available on %1 %2 or newer">,
2910   InGroup<UnguardedAvailability>, DefaultIgnore;
2911 def warn_unguarded_availability_new :
2912   Warning<warn_unguarded_availability.Text>,
2913   InGroup<UnguardedAvailabilityNew>;
2914 def note_decl_unguarded_availability_silence : Note<
2915   "annotate %select{%1|anonymous %1}0 with an availability attribute to silence this warning">;
2916 def note_unguarded_available_silence : Note<
2917   "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
2918   " this warning">;
2919 def warn_at_available_unchecked_use : Warning<
2920   "%select{@available|__builtin_available}0 does not guard availability here; "
2921   "use if (%select{@available|__builtin_available}0) instead">,
2922   InGroup<DiagGroup<"unsupported-availability-guard">>;
2923
2924 // Thread Safety Attributes
2925 def warn_invalid_capability_name : Warning<
2926   "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2927   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2928 def warn_thread_attribute_ignored : Warning<
2929   "ignoring %0 attribute because its argument is invalid">,
2930   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2931 def warn_thread_attribute_argument_not_lockable : Warning<
2932   "%0 attribute requires arguments whose type is annotated "
2933   "with 'capability' attribute; type here is %1">,
2934   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2935 def warn_thread_attribute_decl_not_lockable : Warning<
2936   "%0 attribute can only be applied in a context annotated "
2937   "with 'capability(\"mutex\")' attribute">,
2938   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2939 def warn_thread_attribute_decl_not_pointer : Warning<
2940   "%0 only applies to pointer types; type here is %1">,
2941   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2942 def err_attribute_argument_out_of_range : Error<
2943   "%0 attribute parameter %1 is out of bounds: "
2944   "%plural{0:no parameters to index into|"
2945   "1:can only be 1, since there is one parameter|"
2946   ":must be between 1 and %2}2">;
2947
2948 // Thread Safety Analysis   
2949 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
2950   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2951 def warn_unlock_kind_mismatch : Warning<
2952   "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
2953   "%select{shared|exclusive}3 access">,
2954   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2955 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
2956   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2957 def warn_no_unlock : Warning<
2958   "%0 '%1' is still held at the end of function">,
2959   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2960 def warn_expecting_locked : Warning<
2961   "expecting %0 '%1' to be held at the end of function">,
2962   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;  
2963 // FIXME: improve the error message about locks not in scope
2964 def warn_lock_some_predecessors : Warning<
2965   "%0 '%1' is not held on every path through here">,
2966   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2967 def warn_expecting_lock_held_on_loop : Warning<
2968   "expecting %0 '%1' to be held at start of each loop">,
2969   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2970 def note_locked_here : Note<"%0 acquired here">;
2971 def warn_lock_exclusive_and_shared : Warning<
2972   "%0 '%1' is acquired exclusively and shared in the same scope">,
2973   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2974 def note_lock_exclusive_and_shared : Note<
2975   "the other acquisition of %0 '%1' is here">;
2976 def warn_variable_requires_any_lock : Warning<
2977   "%select{reading|writing}1 variable '%0' requires holding "
2978   "%select{any mutex|any mutex exclusively}1">,
2979   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2980 def warn_var_deref_requires_any_lock : Warning<
2981   "%select{reading|writing}1 the value pointed to by '%0' requires holding "
2982   "%select{any mutex|any mutex exclusively}1">,
2983   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2984 def warn_fun_excludes_mutex : Warning<
2985   "cannot call function '%1' while %0 '%2' is held">,
2986   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2987 def warn_cannot_resolve_lock : Warning<
2988   "cannot resolve lock expression">,
2989   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2990 def warn_acquired_before : Warning<
2991   "%0 '%1' must be acquired before '%2'">,
2992   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2993 def warn_acquired_before_after_cycle : Warning<
2994   "Cycle in acquired_before/after dependencies, starting with '%0'">,
2995   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2996
2997
2998 // Thread safety warnings negative capabilities
2999 def warn_acquire_requires_negative_cap : Warning<
3000   "acquiring %0 '%1' requires negative capability '%2'">,
3001   InGroup<ThreadSafetyNegative>, DefaultIgnore;
3002
3003 // Thread safety warnings on pass by reference
3004 def warn_guarded_pass_by_reference : Warning<
3005   "passing variable '%1' by reference requires holding %0 "
3006   "%select{'%2'|'%2' exclusively}3">,
3007   InGroup<ThreadSafetyReference>, DefaultIgnore;
3008 def warn_pt_guarded_pass_by_reference : Warning<
3009   "passing the value that '%1' points to by reference requires holding %0 "
3010   "%select{'%2'|'%2' exclusively}3">,
3011   InGroup<ThreadSafetyReference>, DefaultIgnore;
3012
3013 // Imprecise thread safety warnings
3014 def warn_variable_requires_lock : Warning<
3015   "%select{reading|writing}3 variable '%1' requires holding %0 "
3016   "%select{'%2'|'%2' exclusively}3">,
3017   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3018 def warn_var_deref_requires_lock : Warning<
3019   "%select{reading|writing}3 the value pointed to by '%1' requires "
3020   "holding %0 %select{'%2'|'%2' exclusively}3">,
3021   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3022 def warn_fun_requires_lock : Warning<
3023   "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
3024   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3025
3026 // Precise thread safety warnings
3027 def warn_variable_requires_lock_precise :
3028   Warning<warn_variable_requires_lock.Text>,
3029   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3030 def warn_var_deref_requires_lock_precise :
3031   Warning<warn_var_deref_requires_lock.Text>,
3032   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3033 def warn_fun_requires_lock_precise :
3034   Warning<warn_fun_requires_lock.Text>,
3035   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3036 def note_found_mutex_near_match : Note<"found near match '%0'">;
3037
3038 // Verbose thread safety warnings
3039 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, 
3040   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3041 def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
3042 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
3043
3044 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
3045 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, 
3046   InGroup<ThreadSafetyBeta>, DefaultIgnore;
3047
3048 // Consumed warnings
3049 def warn_use_in_invalid_state : Warning<
3050   "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3051   "state">, InGroup<Consumed>, DefaultIgnore;
3052 def warn_use_of_temp_in_invalid_state : Warning<
3053   "invalid invocation of method '%0' on a temporary object while it is in the "
3054   "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3055 def warn_attr_on_unconsumable_class : Warning<
3056   "consumed analysis attribute is attached to member of class '%0' which isn't "
3057   "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3058 def warn_return_typestate_for_unconsumable_type : Warning<
3059   "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3060   DefaultIgnore;
3061 def warn_return_typestate_mismatch : Warning<
3062   "return value not in expected state; expected '%0', observed '%1'">,
3063   InGroup<Consumed>, DefaultIgnore;
3064 def warn_loop_state_mismatch : Warning<
3065   "state of variable '%0' must match at the entry and exit of loop">,
3066   InGroup<Consumed>, DefaultIgnore;
3067 def warn_param_return_typestate_mismatch : Warning<
3068   "parameter '%0' not in expected state when the function returns: expected "
3069   "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3070 def warn_param_typestate_mismatch : Warning<
3071   "argument not in expected state; expected '%0', observed '%1'">,
3072   InGroup<Consumed>, DefaultIgnore;
3073
3074 // no_sanitize attribute
3075 def warn_unknown_sanitizer_ignored : Warning<
3076   "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3077
3078 def warn_impcast_vector_scalar : Warning<
3079   "implicit conversion turns vector to scalar: %0 to %1">,
3080   InGroup<Conversion>, DefaultIgnore;
3081 def warn_impcast_complex_scalar : Warning<
3082   "implicit conversion discards imaginary component: %0 to %1">,
3083   InGroup<Conversion>, DefaultIgnore;
3084 def err_impcast_complex_scalar : Error<
3085   "implicit conversion from %0 to %1 is not permitted in C++">;
3086 def warn_impcast_float_precision : Warning<
3087   "implicit conversion loses floating-point precision: %0 to %1">,
3088   InGroup<Conversion>, DefaultIgnore;
3089 def warn_impcast_double_promotion : Warning<
3090   "implicit conversion increases floating-point precision: %0 to %1">,
3091   InGroup<DoublePromotion>, DefaultIgnore;
3092 def warn_impcast_integer_sign : Warning<
3093   "implicit conversion changes signedness: %0 to %1">,
3094   InGroup<SignConversion>, DefaultIgnore;
3095 def warn_impcast_integer_sign_conditional : Warning<
3096   "operand of ? changes signedness: %0 to %1">,
3097   InGroup<SignConversion>, DefaultIgnore;
3098 def warn_impcast_integer_precision : Warning<
3099   "implicit conversion loses integer precision: %0 to %1">,
3100   InGroup<Conversion>, DefaultIgnore;
3101 def warn_impcast_integer_64_32 : Warning<
3102   "implicit conversion loses integer precision: %0 to %1">,
3103   InGroup<Shorten64To32>, DefaultIgnore;
3104 def warn_impcast_integer_precision_constant : Warning<
3105   "implicit conversion from %2 to %3 changes value from %0 to %1">,
3106   InGroup<ConstantConversion>;
3107 def warn_impcast_bitfield_precision_constant : Warning<
3108   "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3109   InGroup<BitFieldConstantConversion>;
3110
3111 def warn_impcast_literal_float_to_integer : Warning<
3112   "implicit conversion from %0 to %1 changes value from %2 to %3">,
3113   InGroup<LiteralConversion>;
3114 def warn_impcast_float_integer : Warning<
3115   "implicit conversion turns floating-point number into integer: %0 to %1">,
3116   InGroup<FloatConversion>, DefaultIgnore;
3117
3118 def warn_impcast_float_to_integer : Warning<
3119   "implicit conversion of out of range value from %0 to %1 changes value "
3120   "from %2 to %3">,
3121   InGroup<FloatOverflowConversion>, DefaultIgnore;
3122 def warn_impcast_float_to_integer_zero : Warning<
3123   "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3124   InGroup<FloatZeroConversion>, DefaultIgnore;
3125
3126 def warn_impcast_string_literal_to_bool : Warning<
3127   "implicit conversion turns string literal into bool: %0 to %1">,
3128   InGroup<StringConversion>, DefaultIgnore;
3129 def warn_impcast_different_enum_types : Warning<
3130   "implicit conversion from enumeration type %0 to different enumeration type "
3131   "%1">, InGroup<EnumConversion>;
3132 def warn_impcast_bool_to_null_pointer : Warning<
3133     "initialization of pointer of type %0 to null from a constant boolean "
3134     "expression">, InGroup<BoolConversion>;
3135 def warn_non_literal_null_pointer : Warning<
3136     "expression which evaluates to zero treated as a null pointer constant of "
3137     "type %0">, InGroup<NonLiteralNullConversion>;
3138 def warn_impcast_null_pointer_to_integer : Warning<
3139     "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3140     InGroup<NullConversion>;
3141 def warn_impcast_floating_point_to_bool : Warning<
3142     "implicit conversion turns floating-point number into bool: %0 to %1">,
3143     InGroup<ImplicitConversionFloatingPointToBool>;
3144 def ext_ms_impcast_fn_obj : ExtWarn<
3145   "implicit conversion between pointer-to-function and pointer-to-object is a "
3146   "Microsoft extension">, InGroup<MicrosoftCast>;
3147
3148 def warn_impcast_pointer_to_bool : Warning<
3149     "address of%select{| function| array}0 '%1' will always evaluate to "
3150     "'true'">,
3151     InGroup<PointerBoolConversion>;
3152 def warn_cast_nonnull_to_bool : Warning<
3153     "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3154     "'true' on first encounter">,
3155     InGroup<PointerBoolConversion>;
3156 def warn_this_bool_conversion : Warning<
3157   "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3158   "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3159 def warn_address_of_reference_bool_conversion : Warning<
3160   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3161   "code; pointer may be assumed to always convert to true">,
3162   InGroup<UndefinedBoolConversion>;
3163
3164 def warn_null_pointer_compare : Warning<
3165     "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3166     "equal to a null pointer is always %select{true|false}2">,
3167     InGroup<TautologicalPointerCompare>;
3168 def warn_nonnull_expr_compare : Warning<
3169     "comparison of nonnull %select{function call|parameter}0 '%1' "
3170     "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3171     "encounter">,
3172     InGroup<TautologicalPointerCompare>;
3173 def warn_this_null_compare : Warning<
3174   "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3175   "assumed to always evaluate to %select{true|false}0">,
3176   InGroup<TautologicalUndefinedCompare>;
3177 def warn_address_of_reference_null_compare : Warning<
3178   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3179   "code; comparison may be assumed to always evaluate to "
3180   "%select{true|false}0">,
3181   InGroup<TautologicalUndefinedCompare>;
3182 def note_reference_is_return_value : Note<"%0 returns a reference">;
3183
3184 def note_function_warning_silence : Note<
3185     "prefix with the address-of operator to silence this warning">;
3186 def note_function_to_function_call : Note<
3187     "suffix with parentheses to turn this into a function call">;
3188 def warn_impcast_objective_c_literal_to_bool : Warning<
3189     "implicit boolean conversion of Objective-C object literal always "
3190     "evaluates to true">,
3191     InGroup<ObjCLiteralConversion>;
3192
3193 def warn_cast_align : Warning<
3194   "cast from %0 to %1 increases required alignment from %2 to %3">,
3195   InGroup<CastAlign>, DefaultIgnore;
3196 def warn_old_style_cast : Warning<
3197   "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3198
3199 // Separate between casts to void* and non-void* pointers.
3200 // Some APIs use (abuse) void* for something like a user context,
3201 // and often that value is an integer even if it isn't a pointer itself.
3202 // Having a separate warning flag allows users to control the warning
3203 // for their workflow.
3204 def warn_int_to_pointer_cast : Warning<
3205   "cast to %1 from smaller integer type %0">,
3206   InGroup<IntToPointerCast>;
3207 def warn_int_to_void_pointer_cast : Warning<
3208   "cast to %1 from smaller integer type %0">,
3209   InGroup<IntToVoidPointerCast>;
3210
3211 def warn_attribute_ignored_for_field_of_type : Warning<
3212   "%0 attribute ignored for field of type %1">,
3213   InGroup<IgnoredAttributes>;
3214 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3215   "enums in the Microsoft ABI are signed integers by default; consider giving "
3216   "the enum %0 an unsigned underlying type to make this code portable">,
3217   InGroup<SignedEnumBitfield>, DefaultIgnore;
3218 def warn_attribute_packed_for_bitfield : Warning<
3219   "'packed' attribute was ignored on bit-fields with single-byte alignment "
3220   "in older versions of GCC and Clang">,
3221   InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3222 def warn_transparent_union_attribute_field_size_align : Warning<
3223   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3224   "%select{alignment|size}0 of the first field in transparent union; "
3225   "transparent_union attribute ignored">,
3226   InGroup<IgnoredAttributes>;
3227 def note_transparent_union_first_field_size_align : Note<
3228   "%select{alignment|size}0 of first field is %1 bits">;
3229 def warn_transparent_union_attribute_not_definition : Warning<
3230   "transparent_union attribute can only be applied to a union definition; "
3231   "attribute ignored">,
3232   InGroup<IgnoredAttributes>;
3233 def warn_transparent_union_attribute_floating : Warning<
3234   "first field of a transparent union cannot have %select{floating point|"
3235   "vector}0 type %1; transparent_union attribute ignored">,
3236   InGroup<IgnoredAttributes>;
3237 def warn_transparent_union_attribute_zero_fields : Warning<
3238   "transparent union definition must contain at least one field; "
3239   "transparent_union attribute ignored">,
3240   InGroup<IgnoredAttributes>;
3241 def warn_attribute_type_not_supported : Warning<
3242   "%0 attribute argument not supported: %1">,
3243   InGroup<IgnoredAttributes>;
3244 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3245   InGroup<IgnoredAttributes>;
3246 def warn_attribute_protected_visibility :
3247   Warning<"target does not support 'protected' visibility; using 'default'">,
3248   InGroup<DiagGroup<"unsupported-visibility">>;
3249 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3250 def note_previous_attribute : Note<"previous attribute is here">;
3251 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3252 def note_attribute : Note<"attribute is here">;
3253 def err_mismatched_ms_inheritance : Error<
3254   "inheritance model does not match %select{definition|previous declaration}0">;
3255 def warn_ignored_ms_inheritance : Warning<
3256   "inheritance model ignored on %select{primary template|partial specialization}0">,
3257   InGroup<IgnoredAttributes>;
3258 def note_previous_ms_inheritance : Note<
3259   "previous inheritance model specified here">;
3260 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3261 def err_mode_not_primitive : Error<
3262   "mode attribute only supported for integer and floating-point types">;
3263 def err_mode_wrong_type : Error<
3264   "type of machine mode does not match type of base type">;
3265 def warn_vector_mode_deprecated : Warning<
3266   "specifying vector types with the 'mode' attribute is deprecated; "
3267   "use the 'vector_size' attribute instead">,
3268   InGroup<DeprecatedAttributes>;
3269 def err_complex_mode_vector_type : Error<
3270   "type of machine mode does not support base vector types">;
3271 def err_enum_mode_vector_type : Error<
3272   "mode %0 is not supported for enumeration types">;
3273 def warn_attribute_nonnull_no_pointers : Warning<
3274   "'nonnull' attribute applied to function with no pointer arguments">,
3275   InGroup<IgnoredAttributes>;
3276 def warn_attribute_nonnull_parm_no_args : Warning<
3277   "'nonnull' attribute when used on parameters takes no arguments">,
3278   InGroup<IgnoredAttributes>;
3279 def note_declared_nonnull : Note<
3280   "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3281 def warn_attribute_sentinel_named_arguments : Warning<
3282   "'sentinel' attribute requires named arguments">,
3283   InGroup<IgnoredAttributes>;
3284 def warn_attribute_sentinel_not_variadic : Warning<
3285   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3286   InGroup<IgnoredAttributes>;
3287 def err_attribute_sentinel_less_than_zero : Error<
3288   "'sentinel' parameter 1 less than zero">;
3289 def err_attribute_sentinel_not_zero_or_one : Error<
3290   "'sentinel' parameter 2 not 0 or 1">;
3291 def warn_cleanup_ext : Warning<
3292   "GCC does not allow the 'cleanup' attribute argument to be anything other "
3293   "than a simple identifier">, 
3294   InGroup<GccCompat>;
3295 def err_attribute_cleanup_arg_not_function : Error<
3296   "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3297 def err_attribute_cleanup_func_must_take_one_arg : Error<
3298   "'cleanup' function %0 must take 1 parameter">;
3299 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3300   "'cleanup' function %0 parameter has "
3301   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3302 def err_attribute_regparm_wrong_platform : Error<
3303   "'regparm' is not valid on this platform">;
3304 def err_attribute_regparm_invalid_number : Error<
3305   "'regparm' parameter must be between 0 and %0 inclusive">;
3306 def err_attribute_not_supported_in_lang : Error<
3307   "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3308 def err_attribute_not_supported_on_arch
3309     : Error<"%0 attribute is not supported on '%1'">;
3310
3311 // Clang-Specific Attributes
3312 def warn_attribute_iboutlet : Warning<
3313   "%0 attribute can only be applied to instance variables or properties">,
3314   InGroup<IgnoredAttributes>;
3315 def err_iboutletcollection_type : Error<
3316   "invalid type %0 as argument of iboutletcollection attribute">;
3317 def err_iboutletcollection_builtintype : Error<
3318   "type argument of iboutletcollection attribute cannot be a builtin type">;
3319 def warn_iboutlet_object_type : Warning<
3320   "%select{instance variable|property}2 with %0 attribute must "
3321   "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3322 def warn_iboutletcollection_property_assign : Warning<
3323   "IBOutletCollection properties should be copy/strong and not assign">,
3324   InGroup<ObjCInvalidIBOutletProperty>;
3325   
3326 def err_attribute_overloadable_mismatch : Error<
3327   "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
3328 def note_attribute_overloadable_prev_overload : Note<
3329   "previous %select{unmarked |}0overload of function is here">;
3330 def err_attribute_overloadable_no_prototype : Error<
3331   "'overloadable' function %0 must have a prototype">;
3332 def err_attribute_overloadable_multiple_unmarked_overloads : Error<
3333   "at most one overload for a given name may lack the 'overloadable' "
3334   "attribute">;
3335 def warn_ns_attribute_wrong_return_type : Warning<
3336   "%0 attribute only applies to %select{functions|methods|properties}1 that "
3337   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3338   InGroup<IgnoredAttributes>;
3339 def err_ns_attribute_wrong_parameter_type : Error<
3340   "%0 attribute only applies to "
3341   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3342 def warn_ns_attribute_wrong_parameter_type : Warning<
3343   "%0 attribute only applies to "
3344   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
3345   InGroup<IgnoredAttributes>;
3346 def warn_objc_requires_super_protocol : Warning<
3347   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3348   InGroup<DiagGroup<"requires-super-attribute">>;
3349 def note_protocol_decl : Note<
3350   "protocol is declared here">;
3351 def note_protocol_decl_undefined : Note<
3352   "protocol %0 has no definition">;
3353
3354 // objc_designated_initializer attribute diagnostics.
3355 def warn_objc_designated_init_missing_super_call : Warning<
3356   "designated initializer missing a 'super' call to a designated initializer of the super class">,
3357   InGroup<ObjCDesignatedInit>;
3358 def note_objc_designated_init_marked_here : Note<
3359   "method marked as designated initializer of the class here">;
3360 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3361   "designated initializer should only invoke a designated initializer on 'super'">,
3362   InGroup<ObjCDesignatedInit>;
3363 def warn_objc_designated_init_non_designated_init_call : Warning<
3364   "designated initializer invoked a non-designated initializer">,
3365   InGroup<ObjCDesignatedInit>;
3366 def warn_objc_secondary_init_super_init_call : Warning<
3367   "convenience initializer should not invoke an initializer on 'super'">,
3368   InGroup<ObjCDesignatedInit>;
3369 def warn_objc_secondary_init_missing_init_call : Warning<
3370   "convenience initializer missing a 'self' call to another initializer">,
3371   InGroup<ObjCDesignatedInit>;
3372 def warn_objc_implementation_missing_designated_init_override : Warning<
3373   "method override for the designated initializer of the superclass %objcinstance0 not found">,
3374   InGroup<ObjCDesignatedInit>;
3375
3376 // objc_bridge attribute diagnostics.
3377 def err_objc_attr_not_id : Error<
3378   "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3379 def err_objc_attr_typedef_not_id : Error<
3380   "parameter of %0 attribute must be 'id' when used on a typedef">;
3381 def err_objc_attr_typedef_not_void_pointer : Error<
3382   "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3383 def err_objc_cf_bridged_not_interface : Error<
3384   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3385 def err_objc_ns_bridged_invalid_cfobject : Error<
3386   "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3387 def warn_objc_invalid_bridge : Warning<
3388   "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3389 def warn_objc_invalid_bridge_to_cf : Warning<
3390   "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3391
3392 // objc_bridge_related attribute diagnostics.
3393 def err_objc_bridged_related_invalid_class : Error<
3394   "could not find Objective-C class %0 to convert %1 to %2">;
3395 def err_objc_bridged_related_invalid_class_name : Error<
3396   "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3397 def err_objc_bridged_related_known_method : Error<
3398  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3399  "method for this conversion">;
3400
3401 def err_objc_attr_protocol_requires_definition : Error<
3402   "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3403
3404 // Function Parameter Semantic Analysis.
3405 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3406 def err_void_only_param : Error<
3407   "'void' must be the first and only parameter if specified">;
3408 def err_void_param_qualified : Error<
3409   "'void' as parameter must not have type qualifiers">;
3410 def err_ident_list_in_fn_declaration : Error<
3411   "a parameter list without types is only allowed in a function definition">;
3412 def ext_param_not_declared : Extension<
3413   "parameter %0 was not declared, defaulting to type 'int'">;
3414 def err_param_default_argument : Error<
3415   "C does not support default arguments">;
3416 def err_param_default_argument_redefinition : Error<
3417   "redefinition of default argument">;
3418 def ext_param_default_argument_redefinition : ExtWarn<
3419   err_param_default_argument_redefinition.Text>,
3420   InGroup<MicrosoftDefaultArgRedefinition>;
3421 def err_param_default_argument_missing : Error<
3422   "missing default argument on parameter">;
3423 def err_param_default_argument_missing_name : Error<
3424   "missing default argument on parameter %0">;
3425 def err_param_default_argument_references_param : Error<
3426   "default argument references parameter %0">;
3427 def err_param_default_argument_references_local : Error<
3428   "default argument references local variable %0 of enclosing function">;
3429 def err_param_default_argument_references_this : Error<
3430   "default argument references 'this'">;
3431 def err_param_default_argument_nonfunc : Error<
3432   "default arguments can only be specified for parameters in a function "
3433   "declaration">;
3434 def err_param_default_argument_template_redecl : Error<
3435   "default arguments cannot be added to a function template that has already "
3436   "been declared">;
3437 def err_param_default_argument_member_template_redecl : Error<
3438   "default arguments cannot be added to an out-of-line definition of a member "
3439   "of a %select{class template|class template partial specialization|nested "
3440   "class in a template}0">;
3441 def err_param_default_argument_on_parameter_pack : Error<
3442   "parameter pack cannot have a default argument">;
3443 def err_uninitialized_member_for_assign : Error<
3444   "cannot define the implicit copy assignment operator for %0, because "
3445   "non-static %select{reference|const}1 member %2 cannot use copy "
3446   "assignment operator">;
3447 def err_uninitialized_member_in_ctor : Error<
3448   "%select{constructor for %1|"
3449   "implicit default constructor for %1|"
3450   "cannot use constructor inherited from %1:}0 must explicitly "
3451   "initialize the %select{reference|const}2 member %3">;
3452 def err_default_arg_makes_ctor_special : Error<
3453   "addition of default argument on redeclaration makes this constructor a "
3454   "%select{default|copy|move}0 constructor">;
3455
3456 def err_use_of_default_argument_to_function_declared_later : Error<
3457   "use of default argument to function %0 that is declared later in class %1">;
3458 def note_default_argument_declared_here : Note<
3459   "default argument declared here">;
3460 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3461
3462 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3463   "%diff{promoted type $ of K&R function parameter is not compatible with the "
3464   "parameter type $|promoted type of K&R function parameter is not compatible "
3465   "with parameter type}0,1 declared in a previous prototype">,
3466   InGroup<KNRPromotedParameter>;
3467
3468
3469 // C++ Overloading Semantic Analysis.
3470 def err_ovl_diff_return_type : Error<
3471   "functions that differ only in their return type cannot be overloaded">;
3472 def err_ovl_static_nonstatic_member : Error<
3473   "static and non-static member functions with the same parameter types "
3474   "cannot be overloaded">;
3475
3476 def err_ovl_no_viable_function_in_call : Error<
3477   "no matching function for call to %0">;
3478 def err_ovl_no_viable_member_function_in_call : Error<
3479   "no matching member function for call to %0">;
3480 def err_ovl_ambiguous_call : Error<
3481   "call to %0 is ambiguous">;
3482 def err_ovl_deleted_call : Error<
3483   "call to %select{unavailable|deleted}0 function %1%2">;
3484 def err_ovl_ambiguous_member_call : Error<
3485   "call to member function %0 is ambiguous">;
3486 def err_ovl_deleted_member_call : Error<
3487   "call to %select{unavailable|deleted}0 member function %1%2">;
3488 def note_ovl_too_many_candidates : Note<
3489     "remaining %0 candidate%s0 omitted; "
3490     "pass -fshow-overloads=all to show them">;
3491 def note_ovl_candidate : Note<"candidate "
3492     "%select{function|function|constructor|"
3493     "function |function |constructor |"
3494     "is the implicit default constructor|"
3495     "is the implicit copy constructor|"
3496     "is the implicit move constructor|"
3497     "is the implicit copy assignment operator|"
3498     "is the implicit move assignment operator|"
3499     "inherited constructor|"
3500     "inherited constructor }0%2"
3501     "%select{| has different class%diff{ (expected $ but has $)|}4,5"
3502     "| has different number of parameters (expected %4 but has %5)"
3503     "| has type mismatch at %ordinal4 parameter"
3504     "%diff{ (expected $ but has $)|}5,6"
3505     "| has different return type%diff{ ($ expected but has $)|}4,5"
3506     "| has different qualifiers (expected "
3507     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3508     "|volatile and restrict|const, volatile, and restrict}4 but found "
3509     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3510     "|volatile and restrict|const, volatile, and restrict}5)"
3511     "| has different exception specification}3">;
3512
3513 def note_ovl_candidate_inherited_constructor : Note<
3514     "constructor from base class %0 inherited here">;
3515 def note_ovl_candidate_inherited_constructor_slice : Note<
3516     "candidate %select{constructor|template}0 ignored: "
3517     "inherited constructor cannot be used to %select{copy|move}1 object">;
3518 def note_ovl_candidate_illegal_constructor : Note<
3519     "candidate %select{constructor|template}0 ignored: "
3520     "instantiation %select{takes|would take}0 its own class type by value">;
3521 def note_ovl_candidate_bad_deduction : Note<
3522     "candidate template ignored: failed template argument deduction">;
3523 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3524     "couldn't infer template argument %0">;
3525 def note_ovl_candidate_inconsistent_deduction : Note<
3526     "candidate template ignored: deduced conflicting %select{types|values|"
3527     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3528 def note_ovl_candidate_inconsistent_deduction_types : Note<
3529     "candidate template ignored: deduced values %diff{"
3530     "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3531     "%1 and %3 of conflicting types for parameter %0}2,4">;
3532 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3533     "candidate template ignored: invalid explicitly-specified argument "
3534     "for template parameter %0">;
3535 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3536     "candidate template ignored: invalid explicitly-specified argument "
3537     "for %ordinal0 template parameter">;
3538 def note_ovl_candidate_instantiation_depth : Note<
3539     "candidate template ignored: substitution exceeded maximum template "
3540     "instantiation depth">;
3541 def note_ovl_candidate_underqualified : Note<
3542     "candidate template ignored: cannot deduce a type for %0 that would "
3543     "make %2 equal %1">;
3544 def note_ovl_candidate_substitution_failure : Note<
3545     "candidate template ignored: substitution failure%0%1">;
3546 def note_ovl_candidate_disabled_by_enable_if : Note<
3547     "candidate template ignored: disabled by %0%1">;
3548 def note_ovl_candidate_disabled_by_requirement : Note<
3549     "candidate template ignored: requirement '%0' was not satisfied%1">;
3550 def note_ovl_candidate_has_pass_object_size_params: Note<
3551     "candidate address cannot be taken because parameter %0 has "
3552     "pass_object_size attribute">;
3553 def err_diagnose_if_succeeded : Error<"%0">;
3554 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3555     ShowInSystemHeader;
3556 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3557     "candidate disabled: %0">;
3558 def note_ovl_candidate_disabled_by_extension : Note<
3559     "candidate disabled due to OpenCL extension">;
3560 def err_addrof_function_disabled_by_enable_if_attr : Error<
3561     "cannot take address of function %0 because it has one or more "
3562     "non-tautological enable_if conditions">;
3563 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3564     "candidate function made ineligible by enable_if">;
3565 def note_ovl_candidate_deduced_mismatch : Note<
3566     "candidate template ignored: deduced type "
3567     "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3568     "adjusted type $ of %select{|element of }4argument"
3569     "|of %select{|element of }4%ordinal0 parameter does not match "
3570     "adjusted type of %select{|element of }4argument}1,2%3">;
3571 def note_ovl_candidate_non_deduced_mismatch : Note<
3572     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3573 // This note is needed because the above note would sometimes print two
3574 // different types with the same name.  Remove this note when the above note
3575 // can handle that case properly.
3576 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3577     "candidate template ignored: could not match %q0 against %q1">;
3578
3579 // Note that we don't treat templates differently for this diagnostic.
3580 def note_ovl_candidate_arity : Note<"candidate "
3581     "%select{function|function|constructor|function|function|constructor|"
3582     "constructor (the implicit default constructor)|"
3583     "constructor (the implicit copy constructor)|"
3584     "constructor (the implicit move constructor)|"
3585     "function (the implicit copy assignment operator)|"
3586     "function (the implicit move assignment operator)|"
3587     "inherited constructor|"
3588     "inherited constructor}0 %select{|template }1"
3589     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
3590     "%plural{1:was|:were}4 provided">;
3591
3592 def note_ovl_candidate_arity_one : Note<"candidate "
3593     "%select{function|function|constructor|function|function|constructor|"
3594     "constructor (the implicit default constructor)|"
3595     "constructor (the implicit copy constructor)|"
3596     "constructor (the implicit move constructor)|"
3597     "function (the implicit copy assignment operator)|"
3598     "function (the implicit move assignment operator)|"
3599     "inherited constructor|"
3600     "inherited constructor}0 %select{|template }1not viable: "
3601     "%select{requires at least|allows at most single|requires single}2 "
3602     "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
3603
3604 def note_ovl_candidate_deleted : Note<
3605     "candidate %select{function|function|constructor|"
3606     "function |function |constructor |"
3607     "constructor (the implicit default constructor)|"
3608     "constructor (the implicit copy constructor)|"
3609     "constructor (the implicit move constructor)|"
3610     "function (the implicit copy assignment operator)|"
3611     "function (the implicit move assignment operator)|"
3612     "inherited constructor|"
3613     "inherited constructor }0%1 has been "
3614     "%select{explicitly made unavailable|explicitly deleted|"
3615     "implicitly deleted}2">;
3616
3617 // Giving the index of the bad argument really clutters this message, and
3618 // it's relatively unimportant because 1) it's generally obvious which
3619 // argument(s) are of the given object type and 2) the fix is usually
3620 // to complete the type, which doesn't involve changes to the call line
3621 // anyway.  If people complain, we can change it.
3622 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
3623     "%select{function|function|constructor|"
3624     "function |function |constructor |"
3625     "constructor (the implicit default constructor)|"
3626     "constructor (the implicit copy constructor)|"
3627     "constructor (the implicit move constructor)|"
3628     "function (the implicit copy assignment operator)|"
3629     "function (the implicit move assignment operator)|"
3630     "inherited constructor|"
3631     "inherited constructor }0%1 "
3632     "not viable: cannot convert argument of incomplete type "
3633     "%diff{$ to $|to parameter type}2,3 for "
3634     "%select{%ordinal5 argument|object argument}4"
3635     "%select{|; dereference the argument with *|"
3636     "; take the address of the argument with &|"
3637     "; remove *|"
3638     "; remove &}6">;
3639 def note_ovl_candidate_bad_list_argument : Note<"candidate "
3640     "%select{function|function|constructor|"
3641     "function |function |constructor |"
3642     "constructor (the implicit default constructor)|"
3643     "constructor (the implicit copy constructor)|"
3644     "constructor (the implicit move constructor)|"
3645     "function (the implicit copy assignment operator)|"
3646     "function (the implicit move assignment operator)|"
3647     "inherited constructor|"
3648     "inherited constructor }0%1 "
3649     "not viable: cannot convert initializer list argument to %3">;
3650 def note_ovl_candidate_bad_overload : Note<"candidate "
3651     "%select{function|function|constructor|"
3652     "function |function |constructor |"
3653     "constructor (the implicit default constructor)|"
3654     "constructor (the implicit copy constructor)|"
3655     "constructor (the implicit move constructor)|"
3656     "function (the implicit copy assignment operator)|"
3657     "function (the implicit move assignment operator)|"
3658     "inherited constructor|"
3659     "inherited constructor }0%1"
3660     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
3661 def note_ovl_candidate_bad_conv : Note<"candidate "
3662     "%select{function|function|constructor|"
3663     "function |function |constructor |"
3664     "constructor (the implicit default constructor)|"
3665     "constructor (the implicit copy constructor)|"
3666     "constructor (the implicit move constructor)|"
3667     "function (the implicit copy assignment operator)|"
3668     "function (the implicit move assignment operator)|"
3669     "inherited constructor|"
3670     "inherited constructor }0%1"
3671     " not viable: no known conversion "
3672     "%diff{from $ to $|from argument type to parameter type}2,3 for "
3673     "%select{%ordinal5 argument|object argument}4"
3674     "%select{|; dereference the argument with *|"
3675     "; take the address of the argument with &|"
3676     "; remove *|"
3677     "; remove &}6">;
3678 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
3679     "%select{function|function|constructor|"
3680     "function |function |constructor |"
3681     "constructor (the implicit default constructor)|"
3682     "constructor (the implicit copy constructor)|"
3683     "constructor (the implicit move constructor)|"
3684     "function (the implicit copy assignment operator)|"
3685     "function (the implicit move assignment operator)|"
3686     "inherited constructor|"
3687     "inherited constructor }0%1"
3688     " not viable: cannot implicitly convert argument "
3689     "%diff{of type $ to $|type to parameter type}2,3 for "
3690     "%select{%ordinal5 argument|object argument}4 under ARC">;
3691 def note_ovl_candidate_bad_lvalue : Note<"candidate "
3692     "%select{function|function|constructor|"
3693     "function |function |constructor |"
3694     "constructor (the implicit default constructor)|"
3695     "constructor (the implicit copy constructor)|"
3696     "constructor (the implicit move constructor)|"
3697     "function (the implicit copy assignment operator)|"
3698     "function (the implicit move assignment operator)|"
3699     "inherited constructor|"
3700     "inherited constructor }0%1"
3701     " not viable: expects an l-value for "
3702     "%select{%ordinal3 argument|object argument}2">;
3703 def note_ovl_candidate_bad_addrspace : Note<"candidate "
3704     "%select{function|function|constructor|"
3705     "function |function |constructor |"
3706     "constructor (the implicit default constructor)|"
3707     "constructor (the implicit copy constructor)|"
3708     "constructor (the implicit move constructor)|"
3709     "function (the implicit copy assignment operator)|"
3710     "function (the implicit move assignment operator)|"
3711     "inherited constructor|"
3712     "inherited constructor }0%1 not viable: "
3713     "%select{%ordinal6|'this'}5 argument (%2) is in "
3714     "address space %3, but parameter must be in address space %4">;
3715 def note_ovl_candidate_bad_gc : Note<"candidate "
3716     "%select{function|function|constructor|"
3717     "function |function |constructor |"
3718     "constructor (the implicit default constructor)|"
3719     "constructor (the implicit copy constructor)|"
3720     "constructor (the implicit move constructor)|"
3721     "function (the implicit copy assignment operator)|"
3722     "function (the implicit move assignment operator)|"
3723     "inherited constructor|"
3724     "inherited constructor }0%1 not viable: "
3725     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
3726     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
3727 def note_ovl_candidate_bad_ownership : Note<"candidate "
3728     "%select{function|function|constructor|"
3729     "function |function |constructor |"
3730     "constructor (the implicit default constructor)|"
3731     "constructor (the implicit copy constructor)|"
3732     "constructor (the implicit move constructor)|"
3733     "function (the implicit copy assignment operator)|"
3734     "function (the implicit move assignment operator)|"
3735     "inherited constructor|"
3736     "inherited constructor }0%1 not viable: "
3737     "%select{%ordinal6|'this'}5 argument (%2) has "
3738     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
3739     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3740     "__autoreleasing}4 ownership">;
3741 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
3742     "%select{|function|||function|||||"
3743     "function (the implicit copy assignment operator)|"
3744     "function (the implicit move assignment operator)||}0 not viable: "
3745     "'this' argument has type %2, but method is not marked "
3746     "%select{const|restrict|const or restrict|volatile|const or volatile|"
3747     "volatile or restrict|const, volatile, or restrict}3">;
3748 def note_ovl_candidate_bad_cvr : Note<"candidate "
3749     "%select{function|function|constructor|"
3750     "function |function |constructor |"
3751     "constructor (the implicit default constructor)|"
3752     "constructor (the implicit copy constructor)|"
3753     "constructor (the implicit move constructor)|"
3754     "function (the implicit copy assignment operator)|"
3755     "function (the implicit move assignment operator)|"
3756     "inherited constructor|"
3757     "inherited constructor }0%1 not viable: "
3758     "%ordinal4 argument (%2) would lose "
3759     "%select{const|restrict|const and restrict|volatile|const and volatile|"
3760     "volatile and restrict|const, volatile, and restrict}3 qualifier"
3761     "%select{||s||s|s|s}3">;
3762 def note_ovl_candidate_bad_unaligned : Note<"candidate "
3763     "%select{function|function|constructor|"
3764     "function |function |constructor |"
3765     "constructor (the implicit default constructor)|"
3766     "constructor (the implicit copy constructor)|"
3767     "constructor (the implicit move constructor)|"
3768     "function (the implicit copy assignment operator)|"
3769     "function (the implicit move assignment operator)|"
3770     "inherited constructor|"
3771     "inherited constructor }0%1 not viable: "
3772     "%ordinal4 argument (%2) would lose __unaligned qualifier">;
3773 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
3774     "%select{function|function|constructor|"
3775     "function |function |constructor |"
3776     "constructor (the implicit default constructor)|"
3777     "constructor (the implicit copy constructor)|"
3778     "constructor (the implicit move constructor)|"
3779     "function (the implicit copy assignment operator)|"
3780     "function (the implicit move assignment operator)|"
3781     "inherited constructor|"
3782     "inherited constructor }0%1 not viable: "
3783     "cannot %select{convert from|convert from|bind}2 "
3784     "%select{base class pointer|superclass|base class object of type}2 %3 to "
3785     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
3786     "%ordinal5 argument">;
3787 def note_ovl_candidate_bad_target : Note<
3788     "candidate %select{function|function|constructor|"
3789     "function|function|constructor|"
3790     "constructor (the implicit default constructor)|"
3791     "constructor (the implicit copy constructor)|"
3792     "constructor (the implicit move constructor)|"
3793     "function (the implicit copy assignment operator)|"
3794     "function (the implicit move assignment operator)|"
3795     "inherited constructor|"
3796     "inherited constructor}0 not viable: "
3797     "call to "
3798     "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from"
3799     " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">;
3800 def note_implicit_member_target_infer_collision : Note<
3801     "implicit %select{"
3802     "default constructor|"
3803     "copy constructor|"
3804     "move constructor|"
3805     "copy assignment operator|"
3806     "move assignment operator|"
3807     "destructor}0 inferred target collision: call to both "
3808     "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3809     "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3810
3811 def note_ambiguous_type_conversion: Note<
3812     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3813 def note_ovl_builtin_binary_candidate : Note<
3814     "built-in candidate %0">;
3815 def note_ovl_builtin_unary_candidate : Note<
3816     "built-in candidate %0">;
3817 def err_ovl_no_viable_function_in_init : Error<
3818   "no matching constructor for initialization of %0">;
3819 def err_ovl_no_conversion_in_cast : Error<
3820   "cannot convert %1 to %2 without a conversion operator">;
3821 def err_ovl_no_viable_conversion_in_cast : Error<
3822   "no matching conversion for %select{|static_cast|reinterpret_cast|"
3823   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3824 def err_ovl_ambiguous_conversion_in_cast : Error<
3825   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3826   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3827 def err_ovl_deleted_conversion_in_cast : Error<
3828   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3829   "functional-style cast}0 from %1 to %2 uses deleted function">;
3830 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3831 def err_ref_init_ambiguous : Error<
3832   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3833 def err_ovl_deleted_init : Error<
3834   "call to %select{unavailable|deleted}0 constructor of %1">;
3835 def err_ovl_deleted_special_init : Error<
3836   "call to implicitly-deleted %select{default constructor|copy constructor|"
3837   "move constructor|copy assignment operator|move assignment operator|"
3838   "destructor|function}0 of %1">;
3839 def err_ovl_ambiguous_oper_unary : Error<
3840   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3841 def err_ovl_ambiguous_oper_binary : Error<
3842   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3843 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3844 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3845 def err_ovl_deleted_oper : Error<
3846   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3847 def err_ovl_deleted_special_oper : Error<
3848   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3849   "assigned|destroyed}1 because its %select{default constructor|"
3850   "copy constructor|move constructor|copy assignment operator|"
3851   "move assignment operator|destructor}1 is implicitly deleted">;
3852 def err_ovl_no_viable_subscript :
3853     Error<"no viable overloaded operator[] for type %0">;
3854 def err_ovl_no_oper :
3855     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3856 def err_ovl_unresolvable : Error<
3857   "reference to overloaded function could not be resolved; "
3858   "did you mean to call it%select{| with no arguments}0?">;
3859 def err_bound_member_function : Error<
3860   "reference to non-static member function must be called"
3861   "%select{|; did you mean to call it with no arguments?}0">;
3862 def note_possible_target_of_call : Note<"possible target for call">;
3863
3864 def err_ovl_no_viable_object_call : Error<
3865   "no matching function for call to object of type %0">;
3866 def err_ovl_ambiguous_object_call : Error<
3867   "call to object of type %0 is ambiguous">;
3868 def err_ovl_deleted_object_call : Error<
3869   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3870 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3871 def err_member_call_without_object : Error<
3872   "call to non-static member function without an object argument">;
3873
3874 // C++ Address of Overloaded Function
3875 def err_addr_ovl_no_viable : Error<
3876   "address of overloaded function %0 does not match required type %1">;
3877 def err_addr_ovl_ambiguous : Error<
3878   "address of overloaded function %0 is ambiguous">;
3879 def err_addr_ovl_not_func_ptrref : Error<
3880   "address of overloaded function %0 cannot be converted to type %1">;
3881 def err_addr_ovl_no_qualifier : Error<
3882   "cannot form member pointer of type %0 without '&' and class name">;
3883
3884 // C++11 Literal Operators
3885 def err_ovl_no_viable_literal_operator : Error<
3886   "no matching literal operator for call to %0"
3887   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3888   "%select{| or 'const char *'}4"
3889   "%select{|, and no matching literal operator template}5">;
3890
3891 // C++ Template Declarations
3892 def err_template_param_shadow : Error<
3893   "declaration of %0 shadows template parameter">;
3894 def note_template_param_here : Note<"template parameter is declared here">;
3895 def warn_template_export_unsupported : Warning<
3896   "exported templates are unsupported">;
3897 def err_template_outside_namespace_or_class_scope : Error<
3898   "templates can only be declared in namespace or class scope">;
3899 def err_template_inside_local_class : Error<
3900   "templates cannot be declared inside of a local class">;
3901 def err_template_linkage : Error<"templates must have C++ linkage">;
3902 def err_template_typedef : Error<"a typedef cannot be a template">;
3903 def err_template_unnamed_class : Error<
3904   "cannot declare a class template with no name">;
3905 def err_template_param_list_different_arity : Error<
3906   "%select{too few|too many}0 template parameters in template "
3907   "%select{|template parameter }1redeclaration">;
3908 def note_template_param_list_different_arity : Note<
3909   "%select{too few|too many}0 template parameters in template template "
3910   "argument">;
3911 def note_template_prev_declaration : Note<
3912   "previous template %select{declaration|template parameter}0 is here">;
3913 def err_template_param_different_kind : Error<
3914   "template parameter has a different kind in template "
3915   "%select{|template parameter }0redeclaration">;
3916 def note_template_param_different_kind : Note<
3917   "template parameter has a different kind in template argument">;
3918
3919 def err_invalid_decl_specifier_in_nontype_parm : Error<
3920   "invalid declaration specifier in template non-type parameter">;
3921   
3922 def err_template_nontype_parm_different_type : Error<
3923   "template non-type parameter has a different type %0 in template "
3924   "%select{|template parameter }1redeclaration">;
3925
3926 def note_template_nontype_parm_different_type : Note<
3927   "template non-type parameter has a different type %0 in template argument">;
3928 def note_template_nontype_parm_prev_declaration : Note<
3929   "previous non-type template parameter with type %0 is here">;
3930 def err_template_nontype_parm_bad_type : Error<
3931   "a non-type template parameter cannot have type %0">;
3932 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3933   "non-type template parameters declared with %0 are incompatible with C++ "
3934   "standards before C++17">,
3935   DefaultIgnore, InGroup<CXXPre17Compat>;
3936 def err_template_param_default_arg_redefinition : Error<
3937   "template parameter redefines default argument">;
3938 def note_template_param_prev_default_arg : Note<
3939   "previous default template argument defined here">;
3940 def err_template_param_default_arg_missing : Error<
3941   "template parameter missing a default argument">;
3942 def ext_template_parameter_default_in_function_template : ExtWarn<
3943   "default template arguments for a function template are a C++11 extension">,
3944   InGroup<CXX11>;
3945 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3946   "default template arguments for a function template are incompatible with C++98">,
3947   InGroup<CXX98Compat>, DefaultIgnore;
3948 def err_template_parameter_default_template_member : Error<
3949   "cannot add a default template argument to the definition of a member of a "
3950   "class template">;
3951 def err_template_parameter_default_friend_template : Error<
3952   "default template argument not permitted on a friend template">;
3953 def err_template_template_parm_no_parms : Error<
3954   "template template parameter must have its own template parameters">;
3955
3956 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3957   InGroup<CXX14>;
3958 def warn_cxx11_compat_variable_template : Warning<
3959   "variable templates are incompatible with C++ standards before C++14">,
3960   InGroup<CXXPre14Compat>, DefaultIgnore;
3961 def err_template_variable_noparams : Error<
3962   "extraneous 'template<>' in declaration of variable %0">;
3963 def err_template_member : Error<"member %0 declared as a template">;
3964 def err_template_member_noparams : Error<
3965   "extraneous 'template<>' in declaration of member %0">;
3966 def err_template_tag_noparams : Error<
3967   "extraneous 'template<>' in declaration of %0 %1">;
3968 def err_template_decl_ref : Error<
3969   "cannot refer to %select{class|variable}0 template %1 without a template argument list">;
3970
3971 // C++ Template Argument Lists
3972 def err_template_missing_args : Error<
3973   "use of "
3974   "%select{class template|function template|variable template|alias template|"
3975   "template template parameter|template}0 %1 requires template arguments">;
3976 def err_template_arg_list_different_arity : Error<
3977   "%select{too few|too many}0 template arguments for "
3978   "%select{class template|function template|variable template|alias template|"
3979   "template template parameter|template}1 %2">;
3980 def note_template_decl_here : Note<"template is declared here">;
3981 def err_template_arg_must_be_type : Error<
3982   "template argument for template type parameter must be a type">;
3983 def err_template_arg_must_be_type_suggest : Error<
3984   "template argument for template type parameter must be a type; "
3985   "did you forget 'typename'?">;
3986 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3987   "template argument for template type parameter must be a type; "
3988   "omitted 'typename' is a Microsoft extension">,
3989   InGroup<MicrosoftTemplate>;
3990 def err_template_arg_must_be_expr : Error<
3991   "template argument for non-type template parameter must be an expression">;
3992 def err_template_arg_nontype_ambig : Error<
3993   "template argument for non-type template parameter is treated as function type %0">;
3994 def err_template_arg_must_be_template : Error<
3995   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3996 def ext_template_arg_local_type : ExtWarn<
3997   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3998 def ext_template_arg_unnamed_type : ExtWarn<
3999   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
4000 def warn_cxx98_compat_template_arg_local_type : Warning<
4001   "local type %0 as template argument is incompatible with C++98">,
4002   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
4003 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
4004   "unnamed type as template argument is incompatible with C++98">,
4005   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
4006 def note_template_unnamed_type_here : Note<
4007   "unnamed type used in template argument was declared here">;
4008 def err_template_arg_overload_type : Error<
4009   "template argument is the type of an unresolved overloaded function">;
4010 def err_template_arg_not_valid_template : Error<
4011   "template argument does not refer to a class or alias template, or template "
4012   "template parameter">;
4013 def note_template_arg_refers_here_func : Note<
4014   "template argument refers to function template %0, here">;
4015 def err_template_arg_template_params_mismatch : Error<
4016   "template template argument has different template parameters than its "
4017   "corresponding template template parameter">;
4018 def err_template_arg_not_integral_or_enumeral : Error<
4019   "non-type template argument of type %0 must have an integral or enumeration"
4020   " type">;
4021 def err_template_arg_not_ice : Error<
4022   "non-type template argument of type %0 is not an integral constant "
4023   "expression">;
4024 def err_template_arg_not_address_constant : Error<
4025   "non-type template argument of type %0 is not a constant expression">;
4026 def warn_cxx98_compat_template_arg_null : Warning<
4027   "use of null pointer as non-type template argument is incompatible with "
4028   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4029 def err_template_arg_untyped_null_constant : Error<
4030   "null non-type template argument must be cast to template parameter type %0">;
4031 def err_template_arg_wrongtype_null_constant : Error<
4032   "null non-type template argument of type %0 does not match template parameter "
4033   "of type %1">;
4034 def err_non_type_template_parm_type_deduction_failure : Error<
4035   "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4036 def err_deduced_non_type_template_arg_type_mismatch : Error<
4037   "deduced non-type template argument does not have the same type as the "
4038   "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4039 def err_non_type_template_arg_subobject : Error<
4040   "non-type template argument refers to subobject '%0'">;
4041 def err_non_type_template_arg_addr_label_diff : Error<
4042   "template argument / label address difference / what did you expect?">;
4043 def err_template_arg_not_convertible : Error<
4044   "non-type template argument of type %0 cannot be converted to a value "
4045   "of type %1">;
4046 def warn_template_arg_negative : Warning<
4047   "non-type template argument with value '%0' converted to '%1' for unsigned "
4048   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4049 def warn_template_arg_too_large : Warning<
4050   "non-type template argument value '%0' truncated to '%1' for "
4051   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4052 def err_template_arg_no_ref_bind : Error<
4053   "non-type template parameter of reference type "
4054   "%diff{$ cannot bind to template argument of type $"
4055   "|cannot bind to template of incompatible argument type}0,1">;
4056 def err_template_arg_ref_bind_ignores_quals : Error<
4057   "reference binding of non-type template parameter "
4058   "%diff{of type $ to template argument of type $|to template argument}0,1 "
4059   "ignores qualifiers">;
4060 def err_template_arg_not_decl_ref : Error<
4061   "non-type template argument does not refer to any declaration">;
4062 def err_template_arg_not_address_of : Error<
4063   "non-type template argument for template parameter of pointer type %0 must "
4064   "have its address taken">;
4065 def err_template_arg_address_of_non_pointer : Error<
4066   "address taken in non-type template argument for template parameter of "
4067   "reference type %0">;
4068 def err_template_arg_reference_var : Error<
4069   "non-type template argument of reference type %0 is not an object">;
4070 def err_template_arg_field : Error<
4071   "non-type template argument refers to non-static data member %0">;
4072 def err_template_arg_method : Error<
4073   "non-type template argument refers to non-static member function %0">;
4074 def err_template_arg_object_no_linkage : Error<
4075   "non-type template argument refers to %select{function|object}0 %1 that "
4076   "does not have linkage">;
4077 def warn_cxx98_compat_template_arg_object_internal : Warning<
4078   "non-type template argument referring to %select{function|object}0 %1 with "
4079   "internal linkage is incompatible with C++98">,
4080   InGroup<CXX98Compat>, DefaultIgnore;
4081 def ext_template_arg_object_internal : ExtWarn<
4082   "non-type template argument referring to %select{function|object}0 %1 with "
4083   "internal linkage is a C++11 extension">, InGroup<CXX11>;
4084 def err_template_arg_thread_local : Error<
4085   "non-type template argument refers to thread-local object">;
4086 def note_template_arg_internal_object : Note<
4087   "non-type template argument refers to %select{function|object}0 here">;
4088 def note_template_arg_refers_here : Note<
4089   "non-type template argument refers here">;
4090 def err_template_arg_not_object_or_func : Error<
4091   "non-type template argument does not refer to an object or function">;
4092 def err_template_arg_not_pointer_to_member_form : Error<
4093   "non-type template argument is not a pointer to member constant">;
4094 def err_template_arg_member_ptr_base_derived_not_supported : Error<
4095   "sorry, non-type template argument of pointer-to-member type %1 that refers "
4096   "to member %q0 of a different class is not supported yet">;
4097 def ext_template_arg_extra_parens : ExtWarn<
4098   "address non-type template argument cannot be surrounded by parentheses">;
4099 def warn_cxx98_compat_template_arg_extra_parens : Warning<
4100   "redundant parentheses surrounding address non-type template argument are "
4101   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4102 def err_pointer_to_member_type : Error<
4103   "invalid use of pointer to member type after %select{.*|->*}0">;
4104 def err_pointer_to_member_call_drops_quals : Error<
4105   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4106 def err_pointer_to_member_oper_value_classify: Error<
4107   "pointer-to-member function type %0 can only be called on an "
4108   "%select{rvalue|lvalue}1">;
4109 def ext_pointer_to_const_ref_member_on_rvalue : Extension<
4110   "invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension">,
4111   InGroup<CXX2a>, SFINAEFailure;
4112 def warn_cxx17_compat_pointer_to_const_ref_member_on_rvalue : Warning<
4113   "invoking a pointer to a 'const &' member function on an rvalue is "
4114   "incompatible with C++ standards before C++2a">,
4115   InGroup<CXXPre2aCompatPedantic>, DefaultIgnore;
4116 def ext_ms_deref_template_argument: ExtWarn<
4117   "non-type template argument containing a dereference operation is a "
4118   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4119 def ext_ms_delayed_template_argument: ExtWarn<
4120   "using the undeclared type %0 as a default template argument is a "
4121   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4122 def err_template_arg_deduced_incomplete_pack : Error<
4123   "deduced incomplete pack %0 for template parameter %1">;
4124
4125 // C++ template specialization
4126 def err_template_spec_unknown_kind : Error<
4127   "can only provide an explicit specialization for a class template, function "
4128   "template, variable template, or a member function, static data member, "
4129   "%select{or member class|member class, or member enumeration}0 of a "
4130   "class template">;
4131 def note_specialized_entity : Note<
4132   "explicitly specialized declaration is here">;
4133 def note_explicit_specialization_declared_here : Note<
4134   "explicit specialization declared here">;
4135 def err_template_spec_decl_function_scope : Error<
4136   "explicit specialization of %0 in function scope">;
4137 def err_template_spec_decl_class_scope : Error<
4138   "explicit specialization of %0 in class scope">;
4139 def err_template_spec_decl_friend : Error<
4140   "cannot declare an explicit specialization in a friend">;
4141 def err_template_spec_decl_out_of_scope_global : Error<
4142   "%select{class template|class template partial|variable template|"
4143   "variable template partial|function template|member function|"
4144   "static data member|member class|member enumeration}0 "
4145   "specialization of %1 must originally be declared in the global scope">;
4146 def err_template_spec_decl_out_of_scope : Error<
4147   "%select{class template|class template partial|variable template|"
4148   "variable template partial|function template|member "
4149   "function|static data member|member class|member enumeration}0 "
4150   "specialization of %1 must originally be declared in namespace %2">;
4151 def ext_template_spec_decl_out_of_scope : ExtWarn<
4152   "first declaration of %select{class template|class template partial|"
4153   "variable template|variable template partial|"
4154   "function template|member function|static data member|member class|"
4155   "member enumeration}0 specialization of %1 outside namespace %2 is a "
4156   "C++11 extension">, InGroup<CXX11>;
4157 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
4158   "%select{class template|class template partial|variable template|"
4159   "variable template partial|function template|member "
4160   "function|static data member|member class|member enumeration}0 "
4161   "specialization of %1 outside namespace %2 is incompatible with C++98">,
4162   InGroup<CXX98Compat>, DefaultIgnore;
4163 def err_template_spec_redecl_out_of_scope : Error<
4164   "%select{class template|class template partial|variable template|"
4165   "variable template partial|function template|member "
4166   "function|static data member|member class|member enumeration}0 "
4167   "specialization of %1 not in a namespace enclosing %2">;
4168 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4169   "%select{class template|class template partial|variable template|"
4170   "variable template partial|function template|member "
4171   "function|static data member|member class|member enumeration}0 "
4172   "specialization of %1 outside namespace enclosing %2 "
4173   "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4174 def err_template_spec_redecl_global_scope : Error<
4175   "%select{class template|class template partial|variable template|"
4176   "variable template partial|function template|member "
4177   "function|static data member|member class|member enumeration}0 "
4178   "specialization of %1 must occur at global scope">;
4179 def err_spec_member_not_instantiated : Error<
4180   "specialization of member %q0 does not specialize an instantiated member">;
4181 def note_specialized_decl : Note<"attempt to specialize declaration here">;
4182 def err_specialization_after_instantiation : Error<
4183   "explicit specialization of %0 after instantiation">;
4184 def note_instantiation_required_here : Note<
4185   "%select{implicit|explicit}0 instantiation first required here">;
4186 def err_template_spec_friend : Error<
4187   "template specialization declaration cannot be a friend">;
4188 def err_template_spec_default_arg : Error<
4189   "default argument not permitted on an explicit "
4190   "%select{instantiation|specialization}0 of function %1">;
4191 def err_not_class_template_specialization : Error<
4192   "cannot specialize a %select{dependent template|template template "
4193   "parameter}0">;
4194 def err_function_specialization_in_class : Error<
4195   "cannot specialize a function %0 within class scope">;
4196 def ext_function_specialization_in_class : ExtWarn<
4197   "explicit specialization of %0 within class scope is a Microsoft extension">,
4198   InGroup<MicrosoftTemplate>;
4199 def ext_explicit_specialization_storage_class : ExtWarn<
4200   "explicit specialization cannot have a storage class">;
4201 def err_explicit_specialization_inconsistent_storage_class : Error<
4202   "explicit specialization has extraneous, inconsistent storage class "
4203   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4204
4205 // C++ class template specializations and out-of-line definitions
4206 def err_template_spec_needs_header : Error<
4207   "template specialization requires 'template<>'">;
4208 def err_template_spec_needs_template_parameters : Error<
4209   "template specialization or definition requires a template parameter list "
4210   "corresponding to the nested type %0">;
4211 def err_template_param_list_matches_nontemplate : Error<
4212   "template parameter list matching the non-templated nested type %0 should "
4213   "be empty ('template<>')">;
4214 def err_alias_template_extra_headers : Error<
4215   "extraneous template parameter list in alias template declaration">;
4216 def err_template_spec_extra_headers : Error<
4217   "extraneous template parameter list in template specialization or "
4218   "out-of-line template definition">;
4219 def warn_template_spec_extra_headers : Warning<
4220   "extraneous template parameter list in template specialization">;
4221 def note_explicit_template_spec_does_not_need_header : Note<
4222   "'template<>' header not required for explicitly-specialized class %0 "
4223   "declared here">;
4224 def err_template_qualified_declarator_no_match : Error<
4225   "nested name specifier '%0' for declaration does not refer into a class, "
4226   "class template or class template partial specialization">;
4227 def err_specialize_member_of_template : Error<
4228   "cannot specialize %select{|(with 'template<>') }0a member of an "
4229   "unspecialized template">;
4230
4231 // C++ Class Template Partial Specialization
4232 def err_default_arg_in_partial_spec : Error<
4233     "default template argument in a class template partial specialization">;
4234 def err_dependent_non_type_arg_in_partial_spec : Error<
4235     "type of specialized non-type template argument depends on a template "
4236     "parameter of the partial specialization">;
4237 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4238     "template parameter is used in default argument declared here">;
4239 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4240     "non-type template argument specializes a template parameter with "
4241     "dependent type %0">;
4242 def err_partial_spec_args_match_primary_template : Error<
4243     "%select{class|variable}0 template partial specialization does not "
4244     "specialize any template argument; to %select{declare|define}1 the "
4245     "primary template, remove the template argument list">; 
4246 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4247     "%select{class|variable}0 template partial specialization is not "
4248     "more specialized than the primary template">, DefaultError,
4249     InGroup<DiagGroup<"invalid-partial-specialization">>;
4250 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4251 def ext_partial_specs_not_deducible : ExtWarn<
4252     "%select{class|variable}0 template partial specialization contains "
4253     "%select{a template parameter|template parameters}1 that cannot be "
4254     "deduced; this partial specialization will never be used">,
4255     DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4256 def note_non_deducible_parameter : Note<
4257     "non-deducible template parameter %0">;
4258 def err_partial_spec_ordering_ambiguous : Error<
4259     "ambiguous partial specializations of %0">;
4260 def note_partial_spec_match : Note<"partial specialization matches %0">;
4261 def err_partial_spec_redeclared : Error<
4262   "class template partial specialization %0 cannot be redeclared">;
4263 def note_partial_specialization_declared_here : Note<
4264   "explicit specialization declared here">;
4265 def note_prev_partial_spec_here : Note<
4266   "previous declaration of class template partial specialization %0 is here">;
4267 def err_partial_spec_fully_specialized : Error<
4268   "partial specialization of %0 does not use any of its template parameters">;
4269
4270 // C++ Variable Template Partial Specialization
4271 def err_var_partial_spec_redeclared : Error<
4272   "variable template partial specialization %0 cannot be redefined">;
4273 def note_var_prev_partial_spec_here : Note<
4274   "previous declaration of variable template partial specialization is here">;
4275 def err_var_spec_no_template : Error<
4276   "no variable template matches%select{| partial}0 specialization">;
4277 def err_var_spec_no_template_but_method : Error<
4278   "no variable template matches specialization; "
4279   "did you mean to use %0 as function template instead?">;
4280   
4281 // C++ Function template specializations
4282 def err_function_template_spec_no_match : Error<
4283     "no function template matches function template specialization %0">;
4284 def err_function_template_spec_ambiguous : Error<
4285     "function template specialization %0 ambiguously refers to more than one "
4286     "function template; explicitly specify%select{| additional}1 template "
4287     "arguments to identify a particular function template">;
4288 def note_function_template_spec_matched : Note<
4289     "function template %q0 matches specialization %1">;
4290 def err_function_template_partial_spec : Error<
4291     "function template partial specialization is not allowed">;
4292
4293 // C++ Template Instantiation
4294 def err_template_recursion_depth_exceeded : Error<
4295   "recursive template instantiation exceeded maximum depth of %0">,
4296   DefaultFatal, NoSFINAE;
4297 def note_template_recursion_depth : Note<
4298   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4299
4300 def err_template_instantiate_within_definition : Error<
4301   "%select{implicit|explicit}0 instantiation of template %1 within its"
4302   " own definition">;
4303 def err_template_instantiate_undefined : Error<
4304   "%select{implicit|explicit}0 instantiation of undefined template %1">;
4305 def err_implicit_instantiate_member_undefined : Error<
4306   "implicit instantiation of undefined member %0">;
4307 def note_template_class_instantiation_was_here : Note<
4308   "class template %0 was instantiated here">;
4309 def note_template_class_explicit_specialization_was_here : Note<
4310   "class template %0 was explicitly specialized here">;
4311 def note_template_class_instantiation_here : Note<
4312   "in instantiation of template class %q0 requested here">;
4313 def note_template_member_class_here : Note<
4314   "in instantiation of member class %q0 requested here">;
4315 def note_template_member_function_here : Note<
4316   "in instantiation of member function %q0 requested here">;
4317 def note_function_template_spec_here : Note<
4318   "in instantiation of function template specialization %q0 requested here">;
4319 def note_template_static_data_member_def_here : Note<
4320   "in instantiation of static data member %q0 requested here">;
4321 def note_template_variable_def_here : Note<
4322   "in instantiation of variable template specialization %q0 requested here">;
4323 def note_template_enum_def_here : Note<
4324   "in instantiation of enumeration %q0 requested here">;
4325 def note_template_nsdmi_here : Note<
4326   "in instantiation of default member initializer %q0 requested here">;
4327 def note_template_type_alias_instantiation_here : Note<
4328   "in instantiation of template type alias %0 requested here">;
4329 def note_template_exception_spec_instantiation_here : Note<
4330   "in instantiation of exception specification for %0 requested here">;
4331 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4332   "required here, but no definition is available">,
4333   InGroup<UndefinedVarTemplate>;
4334 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4335   "required here, but no definition is available">,
4336   InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4337 def note_forward_template_decl : Note<
4338   "forward declaration of template entity is here">;
4339 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4340   "declaration to suppress this warning if %q0 is explicitly instantiated in "
4341   "another translation unit">;
4342
4343 def note_default_arg_instantiation_here : Note<
4344   "in instantiation of default argument for '%0' required here">;
4345 def note_default_function_arg_instantiation_here : Note<
4346   "in instantiation of default function argument expression "
4347   "for '%0' required here">;
4348 def note_explicit_template_arg_substitution_here : Note<
4349   "while substituting explicitly-specified template arguments into function "
4350   "template %0 %1">;
4351 def note_function_template_deduction_instantiation_here : Note<
4352   "while substituting deduced template arguments into function template %0 "
4353   "%1">;
4354 def note_deduced_template_arg_substitution_here : Note<
4355   "during template argument deduction for %select{class|variable}0 template "
4356   "%select{partial specialization |}1%2 %3">;
4357 def note_prior_template_arg_substitution : Note<
4358   "while substituting prior template arguments into %select{non-type|template}0"
4359   " template parameter%1 %2">;
4360 def note_template_default_arg_checking : Note<
4361   "while checking a default template argument used here">;
4362 def note_instantiation_contexts_suppressed : Note<
4363   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4364   "see all)">;
4365
4366 def err_field_instantiates_to_function : Error<
4367   "data member instantiated with function type %0">;
4368 def err_variable_instantiates_to_function : Error<
4369   "%select{variable|static data member}0 instantiated with function type %1">;
4370 def err_nested_name_spec_non_tag : Error<
4371   "type %0 cannot be used prior to '::' because it has no members">;
4372
4373 def err_using_pack_expansion_empty : Error<
4374   "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4375
4376 // C++ Explicit Instantiation
4377 def err_explicit_instantiation_duplicate : Error<
4378     "duplicate explicit instantiation of %0">;
4379 def ext_explicit_instantiation_duplicate : ExtWarn<
4380     "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4381     InGroup<MicrosoftTemplate>;
4382 def note_previous_explicit_instantiation : Note<
4383     "previous explicit instantiation is here">;
4384 def warn_explicit_instantiation_after_specialization : Warning<
4385   "explicit instantiation of %0 that occurs after an explicit "
4386   "specialization has no effect">,
4387   InGroup<DiagGroup<"instantiation-after-specialization">>;
4388 def note_previous_template_specialization : Note<
4389     "previous template specialization is here">;
4390 def err_explicit_instantiation_nontemplate_type : Error<
4391     "explicit instantiation of non-templated type %0">;
4392 def note_nontemplate_decl_here : Note<
4393     "non-templated declaration is here">;
4394 def err_explicit_instantiation_in_class : Error<
4395   "explicit instantiation of %0 in class scope">;
4396 def err_explicit_instantiation_out_of_scope : Error<
4397   "explicit instantiation of %0 not in a namespace enclosing %1">;
4398 def err_explicit_instantiation_must_be_global : Error<
4399   "explicit instantiation of %0 must occur at global scope">;
4400 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4401   "explicit instantiation of %0 not in a namespace enclosing %1">, 
4402   InGroup<CXX11Compat>, DefaultIgnore;
4403 def warn_explicit_instantiation_must_be_global_0x : Warning<
4404   "explicit instantiation of %0 must occur at global scope">, 
4405   InGroup<CXX11Compat>, DefaultIgnore;
4406   
4407 def err_explicit_instantiation_requires_name : Error<
4408   "explicit instantiation declaration requires a name">;
4409 def err_explicit_instantiation_of_typedef : Error<
4410   "explicit instantiation of typedef %0">;
4411 def err_explicit_instantiation_storage_class : Error<
4412   "explicit instantiation cannot have a storage class">;
4413 def err_explicit_instantiation_not_known : Error<
4414   "explicit instantiation of %0 does not refer to a function template, "
4415   "variable template, member function, member class, or static data member">;
4416 def note_explicit_instantiation_here : Note<
4417   "explicit instantiation refers here">;
4418 def err_explicit_instantiation_data_member_not_instantiated : Error<
4419   "explicit instantiation refers to static data member %q0 that is not an "
4420   "instantiation">;
4421 def err_explicit_instantiation_member_function_not_instantiated : Error<
4422   "explicit instantiation refers to member function %q0 that is not an "
4423   "instantiation">;
4424 def err_explicit_instantiation_ambiguous : Error<
4425   "partial ordering for explicit instantiation of %0 is ambiguous">;
4426 def note_explicit_instantiation_candidate : Note<
4427   "explicit instantiation candidate function %q0 template here %1">;
4428 def err_explicit_instantiation_inline : Error<
4429   "explicit instantiation cannot be 'inline'">;
4430 def warn_explicit_instantiation_inline_0x : Warning<
4431   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4432   DefaultIgnore;
4433 def err_explicit_instantiation_constexpr : Error<
4434   "explicit instantiation cannot be 'constexpr'">;
4435 def ext_explicit_instantiation_without_qualified_id : Extension<
4436   "qualifier in explicit instantiation of %q0 requires a template-id "
4437   "(a typedef is not permitted)">;
4438 def err_explicit_instantiation_without_template_id : Error<
4439   "explicit instantiation of %q0 must specify a template argument list">;
4440 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4441   "explicit instantiation of %q0 must occur in namespace %1">;
4442 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4443   "explicit instantiation of %q0 must occur in namespace %1">,
4444   InGroup<CXX11Compat>, DefaultIgnore;
4445 def err_explicit_instantiation_undefined_member : Error<
4446   "explicit instantiation of undefined %select{member class|member function|"
4447   "static data member}0 %1 of class template %2">;
4448 def err_explicit_instantiation_undefined_func_template : Error<
4449   "explicit instantiation of undefined function template %0">;
4450 def err_explicit_instantiation_undefined_var_template : Error<
4451   "explicit instantiation of undefined variable template %q0">;
4452 def err_explicit_instantiation_declaration_after_definition : Error<
4453   "explicit instantiation declaration (with 'extern') follows explicit "
4454   "instantiation definition (without 'extern')">;
4455 def note_explicit_instantiation_definition_here : Note<
4456   "explicit instantiation definition is here">;
4457 def err_invalid_var_template_spec_type : Error<"type %2 "
4458   "of %select{explicit instantiation|explicit specialization|"
4459   "partial specialization|redeclaration}0 of %1 does not match"
4460   " expected type %3">;
4461 def err_mismatched_exception_spec_explicit_instantiation : Error<
4462   "exception specification in explicit instantiation does not match "
4463   "instantiated one">;
4464 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4465   err_mismatched_exception_spec_explicit_instantiation.Text>,
4466   InGroup<MicrosoftExceptionSpec>;
4467   
4468 // C++ typename-specifiers
4469 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4470 def err_typename_nested_not_found_enable_if : Error<
4471   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4472   "this declaration">;
4473 def err_typename_nested_not_found_requirement : Error<
4474   "failed requirement '%0'; 'enable_if' cannot be used to disable this "
4475   "declaration">;
4476 def err_typename_nested_not_type : Error<
4477     "typename specifier refers to non-type member %0 in %1">;
4478 def note_typename_refers_here : Note<
4479     "referenced member %0 is declared here">;
4480 def err_typename_missing : Error<
4481   "missing 'typename' prior to dependent type name '%0%1'">;
4482 def err_typename_missing_template : Error<
4483   "missing 'typename' prior to dependent type template name '%0%1'">;
4484 def ext_typename_missing : ExtWarn<
4485   "missing 'typename' prior to dependent type name '%0%1'">,
4486   InGroup<DiagGroup<"typename-missing">>;
4487 def ext_typename_outside_of_template : ExtWarn<
4488   "'typename' occurs outside of a template">, InGroup<CXX11>;
4489 def warn_cxx98_compat_typename_outside_of_template : Warning<
4490   "use of 'typename' outside of a template is incompatible with C++98">,
4491   InGroup<CXX98Compat>, DefaultIgnore;
4492 def err_typename_refers_to_using_value_decl : Error<
4493   "typename specifier refers to a dependent using declaration for a value "
4494   "%0 in %1">;
4495 def note_using_value_decl_missing_typename : Note<
4496   "add 'typename' to treat this using declaration as a type">;
4497
4498 def err_template_kw_refers_to_non_template : Error<
4499   "%0 following the 'template' keyword does not refer to a template">;
4500 def err_template_kw_refers_to_class_template : Error<
4501   "'%0%1' instantiated to a class template, not a function template">;
4502 def note_referenced_class_template : Note<
4503   "class template declared here">;
4504 def err_template_kw_missing : Error<
4505   "missing 'template' keyword prior to dependent template name '%0%1'">;
4506 def ext_template_outside_of_template : ExtWarn<
4507   "'template' keyword outside of a template">, InGroup<CXX11>;
4508 def warn_cxx98_compat_template_outside_of_template : Warning<
4509   "use of 'template' keyword outside of a template is incompatible with C++98">,
4510   InGroup<CXX98Compat>, DefaultIgnore;
4511
4512 def err_non_type_template_in_nested_name_specifier : Error<
4513   "qualified name refers into a specialization of %select{function|variable}0 "
4514   "template %1">;
4515 def err_template_id_not_a_type : Error<
4516   "template name refers to non-type template %0">;
4517 def note_template_declared_here : Note<
4518   "%select{function template|class template|variable template"
4519   "|type alias template|template template parameter}0 "
4520   "%1 declared here">;
4521 def err_alias_template_expansion_into_fixed_list : Error<
4522   "pack expansion used as argument for non-pack parameter of alias template">;
4523 def note_parameter_type : Note<
4524   "parameter of type %0 is declared here">;
4525
4526 // C++11 Variadic Templates
4527 def err_template_param_pack_default_arg : Error<
4528   "template parameter pack cannot have a default argument">;
4529 def err_template_param_pack_must_be_last_template_parameter : Error<
4530   "template parameter pack must be the last template parameter">;
4531
4532 def err_template_parameter_pack_non_pack : Error<
4533   "%select{template type|non-type template|template template}0 parameter"
4534   "%select{| pack}1 conflicts with previous %select{template type|"
4535   "non-type template|template template}0 parameter%select{ pack|}1">;
4536 def note_template_parameter_pack_non_pack : Note<
4537   "%select{template type|non-type template|template template}0 parameter"
4538   "%select{| pack}1 does not match %select{template type|non-type template"
4539   "|template template}0 parameter%select{ pack|}1 in template argument">;
4540 def note_template_parameter_pack_here : Note<
4541   "previous %select{template type|non-type template|template template}0 "
4542   "parameter%select{| pack}1 declared here">;
4543   
4544 def err_unexpanded_parameter_pack : Error<
4545   "%select{expression|base type|declaration type|data member type|bit-field "
4546   "size|static assertion|fixed underlying type|enumerator value|"
4547   "using declaration|friend declaration|qualifier|initializer|default argument|"
4548   "non-type template parameter type|exception type|partial specialization|"
4549   "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4550   "%plural{0: an|:}1 unexpanded parameter pack"
4551   "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4552
4553 def err_pack_expansion_without_parameter_packs : Error<
4554   "pack expansion does not contain any unexpanded parameter packs">;
4555 def err_pack_expansion_length_conflict : Error<
4556   "pack expansion contains parameter packs %0 and %1 that have different "
4557   "lengths (%2 vs. %3)">;
4558 def err_pack_expansion_length_conflict_multilevel : Error<
4559   "pack expansion contains parameter pack %0 that has a different "
4560   "length (%1 vs. %2) from outer parameter packs">;
4561 def err_pack_expansion_member_init : Error<
4562   "pack expansion for initialization of member %0">;
4563
4564 def err_function_parameter_pack_without_parameter_packs : Error<
4565   "type %0 of function parameter pack does not contain any unexpanded "
4566   "parameter packs">;
4567 def err_ellipsis_in_declarator_not_parameter : Error<
4568   "only function and template parameters can be parameter packs">;
4569
4570 def err_sizeof_pack_no_pack_name : Error<
4571   "%0 does not refer to the name of a parameter pack">;
4572
4573 def err_fold_expression_packs_both_sides : Error<
4574   "binary fold expression has unexpanded parameter packs in both operands">;
4575 def err_fold_expression_empty : Error<
4576   "unary fold expression has empty expansion for operator '%0' "
4577   "with no fallback value">;
4578 def err_fold_expression_bad_operand : Error<
4579   "expression not permitted as operand of fold expression">;
4580
4581 def err_unexpected_typedef : Error<
4582   "unexpected type name %0: expected expression">;
4583 def err_unexpected_namespace : Error<
4584   "unexpected namespace name %0: expected expression">;
4585 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4586 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4587   "use of undeclared identifier %0; "
4588   "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4589   InGroup<MicrosoftTemplate>;
4590 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4591   "found via unqualified lookup into dependent bases of class templates is a "
4592   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4593 def note_dependent_var_use : Note<"must qualify identifier to find this "
4594     "declaration in dependent base class">;
4595 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4596     "visible in the template definition nor found by argument-dependent lookup">;
4597 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4598     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4599 def err_undeclared_use : Error<"use of undeclared %0">;
4600 def warn_deprecated : Warning<"%0 is deprecated">,
4601     InGroup<DeprecatedDeclarations>;
4602 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4603 def warn_property_method_deprecated :
4604     Warning<"property access is using %0 method which is deprecated">,
4605     InGroup<DeprecatedDeclarations>;
4606 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4607     InGroup<DeprecatedDeclarations>;
4608 def warn_deprecated_anonymous_namespace : Warning<
4609   "'deprecated' attribute on anonymous namespace ignored">,
4610   InGroup<IgnoredAttributes>;
4611 def warn_deprecated_fwdclass_message : Warning<
4612     "%0 may be deprecated because the receiver type is unknown">,
4613     InGroup<DeprecatedDeclarations>;
4614 def warn_deprecated_def : Warning<
4615   "implementing deprecated %select{method|class|category}0">,
4616   InGroup<DeprecatedImplementations>, DefaultIgnore;
4617 def warn_unavailable_def : Warning<
4618   "implementing unavailable method">,
4619   InGroup<DeprecatedImplementations>, DefaultIgnore;
4620 def err_unavailable : Error<"%0 is unavailable">;
4621 def err_property_method_unavailable :
4622     Error<"property access is using %0 method which is unavailable">;
4623 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4624 def warn_unavailable_fwdclass_message : Warning<
4625     "%0 may be unavailable because the receiver type is unknown">,
4626     InGroup<UnavailableDeclarations>;
4627 def note_availability_specified_here : Note<
4628   "%0 has been explicitly marked "
4629   "%select{unavailable|deleted|deprecated|partial}1 here">;
4630 def note_implicitly_deleted : Note<
4631   "explicitly defaulted function was implicitly deleted here">;
4632 def warn_not_enough_argument : Warning<
4633   "not enough variable arguments in %0 declaration to fit a sentinel">,
4634   InGroup<Sentinel>;
4635 def warn_missing_sentinel : Warning <
4636   "missing sentinel in %select{function call|method dispatch|block call}0">,
4637   InGroup<Sentinel>;
4638 def note_sentinel_here : Note<
4639   "%select{function|method|block}0 has been explicitly marked sentinel here">;
4640 def warn_missing_prototype : Warning<
4641   "no previous prototype for function %0">,
4642   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4643 def note_declaration_not_a_prototype : Note<
4644   "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; 
4645 def warn_strict_prototypes : Warning<
4646   "this %select{function declaration is not|block declaration is not|"
4647   "old-style function definition is not preceded by}0 a prototype">,
4648   InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4649 def warn_missing_variable_declarations : Warning<
4650   "no previous extern declaration for non-static variable %0">,
4651   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4652 def err_static_data_member_reinitialization :
4653   Error<"static data member %0 already has an initializer">;
4654 def err_redefinition : Error<"redefinition of %0">;
4655 def err_alias_after_tentative :
4656   Error<"alias definition of %0 after tentative definition">;
4657 def err_alias_is_definition :
4658   Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4659 def err_definition_of_implicitly_declared_member : Error<
4660   "definition of implicitly declared %select{default constructor|copy "
4661   "constructor|move constructor|copy assignment operator|move assignment "
4662   "operator|destructor|function}1">;
4663 def err_definition_of_explicitly_defaulted_member : Error<
4664   "definition of explicitly defaulted %select{default constructor|copy "
4665   "constructor|move constructor|copy assignment operator|move assignment "
4666   "operator|destructor|function}0">;
4667 def err_redefinition_extern_inline : Error<
4668   "redefinition of a 'extern inline' function %0 is not supported in "
4669   "%select{C99 mode|C++}1">;
4670 def warn_attr_abi_tag_namespace : Warning<
4671   "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4672   InGroup<IgnoredAttributes>;
4673 def err_abi_tag_on_redeclaration : Error<
4674   "cannot add 'abi_tag' attribute in a redeclaration">;
4675 def err_new_abi_tag_on_redeclaration : Error<
4676   "'abi_tag' %0 missing in original declaration">;
4677 def note_use_ifdef_guards : Note<
4678   "unguarded header; consider using #ifdef guards or #pragma once">;
4679
4680 def note_deleted_dtor_no_operator_delete : Note<
4681   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4682 def note_deleted_special_member_class_subobject : Note<
4683   "%select{default constructor of|copy constructor of|move constructor of|"
4684   "copy assignment operator of|move assignment operator of|destructor of|"
4685   "constructor inherited by}0 "
4686   "%1 is implicitly deleted because "
4687   "%select{base class %3|%select{||||variant }4field %3}2 has "
4688   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4689   "%select{%select{default constructor|copy constructor|move constructor|copy "
4690   "assignment operator|move assignment operator|destructor|"
4691   "%select{default|corresponding|default|default|default}4 constructor}0|"
4692   "destructor}5"
4693   "%select{||s||}4">;
4694 def note_deleted_default_ctor_uninit_field : Note<
4695   "%select{default constructor of|constructor inherited by}0 "
4696   "%1 is implicitly deleted because field %2 of "
4697   "%select{reference|const-qualified}4 type %3 would not be initialized">;
4698 def note_deleted_default_ctor_all_const : Note<
4699   "%select{default constructor of|constructor inherited by}0 "
4700   "%1 is implicitly deleted because all "
4701   "%select{data members|data members of an anonymous union member}2"
4702   " are const-qualified">;
4703 def note_deleted_copy_ctor_rvalue_reference : Note<
4704   "copy constructor of %0 is implicitly deleted because field %1 is of "
4705   "rvalue reference type %2">;
4706 def note_deleted_copy_user_declared_move : Note<
4707   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4708   " %1 has a user-declared move %select{constructor|assignment operator}2">;
4709 def note_deleted_assign_field : Note<
4710   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4711   "because field %2 is of %select{reference|const-qualified}4 type %3">;
4712
4713 // These should be errors.
4714 def warn_undefined_internal : Warning<
4715   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4716   InGroup<DiagGroup<"undefined-internal">>;
4717 def err_undefined_internal_type : Error<
4718   "%select{function|variable}0 %q1 is used but not defined in this "
4719   "translation unit, and cannot be defined in any other translation unit "
4720   "because its type does not have linkage">;
4721 def ext_undefined_internal_type : Extension<
4722   "ISO C++ requires a definition in this translation unit for "
4723   "%select{function|variable}0 %q1 because its type does not have linkage">,
4724   InGroup<DiagGroup<"undefined-internal-type">>;
4725 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4726   InGroup<DiagGroup<"undefined-inline">>;
4727 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4728 def note_used_here : Note<"used here">;
4729
4730 def err_internal_linkage_redeclaration : Error<
4731   "'internal_linkage' attribute does not appear on the first declaration of %0">;
4732 def warn_internal_linkage_local_storage : Warning<
4733   "'internal_linkage' attribute on a non-static local variable is ignored">,
4734   InGroup<IgnoredAttributes>;
4735
4736 def ext_internal_in_extern_inline : ExtWarn<
4737   "static %select{function|variable}0 %1 is used in an inline function with "
4738   "external linkage">, InGroup<StaticInInline>;
4739 def ext_internal_in_extern_inline_quiet : Extension<
4740   "static %select{function|variable}0 %1 is used in an inline function with "
4741   "external linkage">, InGroup<StaticInInline>;
4742 def warn_static_local_in_extern_inline : Warning<
4743   "non-constant static local variable in inline function may be different "
4744   "in different files">, InGroup<StaticLocalInInline>;
4745 def note_convert_inline_to_static : Note<
4746   "use 'static' to give inline function %0 internal linkage">;
4747
4748 def ext_redefinition_of_typedef : ExtWarn<
4749   "redefinition of typedef %0 is a C11 feature">,
4750   InGroup<DiagGroup<"typedef-redefinition"> >;
4751 def err_redefinition_variably_modified_typedef : Error<
4752   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4753
4754 def err_inline_decl_follows_def : Error<
4755   "inline declaration of %0 follows non-inline definition">;
4756 def err_inline_declaration_block_scope : Error<
4757   "inline declaration of %0 not allowed in block scope">;
4758 def err_static_non_static : Error<
4759   "static declaration of %0 follows non-static declaration">;
4760 def err_different_language_linkage : Error<
4761   "declaration of %0 has a different language linkage">;
4762 def ext_retained_language_linkage : Extension<
4763   "friend function %0 retaining previous language linkage is an extension">,
4764   InGroup<DiagGroup<"retained-language-linkage">>;
4765 def err_extern_c_global_conflict : Error<
4766   "declaration of %1 %select{with C language linkage|in global scope}0 "
4767   "conflicts with declaration %select{in global scope|with C language linkage}0">;
4768 def note_extern_c_global_conflict : Note<
4769   "declared %select{in global scope|with C language linkage}0 here">;
4770 def note_extern_c_begins_here : Note<
4771   "extern \"C\" language linkage specification begins here">;
4772 def warn_weak_import : Warning <
4773   "an already-declared variable is made a weak_import declaration %0">;
4774 def ext_static_non_static : Extension<
4775   "redeclaring non-static %0 as static is a Microsoft extension">,
4776   InGroup<MicrosoftRedeclareStatic>;
4777 def err_non_static_static : Error<
4778   "non-static declaration of %0 follows static declaration">;
4779 def err_extern_non_extern : Error<
4780   "extern declaration of %0 follows non-extern declaration">;
4781 def err_non_extern_extern : Error<
4782   "non-extern declaration of %0 follows extern declaration">;
4783 def err_non_thread_thread : Error<
4784   "non-thread-local declaration of %0 follows thread-local declaration">;
4785 def err_thread_non_thread : Error<
4786   "thread-local declaration of %0 follows non-thread-local declaration">;
4787 def err_thread_thread_different_kind : Error<
4788   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4789   "follows declaration with %select{dynamic|static}1 initialization">;
4790 def err_mismatched_owning_module : Error<
4791   "declaration of %0 in %select{the global module|module %2}1 follows "
4792   "declaration in %select{the global module|module %4}3">;
4793 def err_redefinition_different_type : Error<
4794   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4795 def err_redefinition_different_kind : Error<
4796   "redefinition of %0 as different kind of symbol">;
4797 def err_redefinition_different_namespace_alias : Error<
4798   "redefinition of %0 as an alias for a different namespace">;
4799 def note_previous_namespace_alias : Note<
4800   "previously defined as an alias for %0">;
4801 def warn_forward_class_redefinition : Warning<
4802   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4803   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4804 def err_redefinition_different_typedef : Error<
4805   "%select{typedef|type alias|type alias template}0 "
4806   "redefinition with different types%diff{ ($ vs $)|}1,2">;
4807 def err_tag_reference_non_tag : Error<
4808   "%select{non-struct type|non-class type|non-union type|non-enum "
4809   "type|typedef|type alias|template|type alias template|template "
4810   "template argument}1 %0 cannot be referenced with a "
4811   "%select{struct|interface|union|class|enum}2 specifier">;
4812 def err_tag_reference_conflict : Error<
4813   "implicit declaration introduced by elaborated type conflicts with a "
4814   "%select{non-struct type|non-class type|non-union type|non-enum "
4815   "type|typedef|type alias|template|type alias template|template "
4816   "template argument}0 of the same name">;
4817 def err_dependent_tag_decl : Error<
4818   "%select{declaration|definition}0 of "
4819   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4820 def err_tag_definition_of_typedef : Error<
4821   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4822 def err_conflicting_types : Error<"conflicting types for %0">;
4823 def err_different_pass_object_size_params : Error<
4824   "conflicting pass_object_size attributes on parameters">;
4825 def err_late_asm_label_name : Error<
4826   "cannot apply asm label to %select{variable|function}0 after its first use">;
4827 def err_different_asm_label : Error<"conflicting asm label">;
4828 def err_nested_redefinition : Error<"nested redefinition of %0">;
4829 def err_use_with_wrong_tag : Error<
4830   "use of %0 with tag type that does not match previous declaration">;
4831 def warn_struct_class_tag_mismatch : Warning<
4832     "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4833     "declared as a %select{struct|interface|class}3%select{| template}1">,
4834     InGroup<MismatchedTags>, DefaultIgnore;
4835 def warn_struct_class_previous_tag_mismatch : Warning<
4836     "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4837     "here but previously declared as "
4838     "%select{a struct|an interface|a class}3%select{| template}1">,
4839      InGroup<MismatchedTags>, DefaultIgnore;
4840 def note_struct_class_suggestion : Note<
4841     "did you mean %select{struct|interface|class}0 here?">;
4842 def ext_forward_ref_enum : Extension<
4843   "ISO C forbids forward references to 'enum' types">;
4844 def err_forward_ref_enum : Error<
4845   "ISO C++ forbids forward references to 'enum' types">;
4846 def ext_ms_forward_ref_enum : ExtWarn<
4847   "forward references to 'enum' types are a Microsoft extension">,
4848   InGroup<MicrosoftEnumForwardReference>;
4849 def ext_forward_ref_enum_def : Extension<
4850   "redeclaration of already-defined enum %0 is a GNU extension">,
4851   InGroup<GNURedeclaredEnum>;
4852   
4853 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4854 def err_duplicate_member : Error<"duplicate member %0">;
4855 def err_misplaced_ivar : Error<
4856   "instance variables may not be placed in %select{categories|class extension}0">;
4857 def warn_ivars_in_interface : Warning<
4858   "declaration of instance variables in the interface is deprecated">,
4859   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4860 def ext_enum_value_not_int : Extension<
4861   "ISO C restricts enumerator values to range of 'int' (%0 is too "
4862   "%select{small|large}1)">;
4863 def ext_enum_too_large : ExtWarn<
4864   "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4865 def ext_enumerator_increment_too_large : ExtWarn<
4866   "incremented enumerator value %0 is not representable in the "
4867   "largest integer type">, InGroup<EnumTooLarge>;
4868 def warn_flag_enum_constant_out_of_range : Warning<
4869   "enumeration value %0 is out of range of flags in enumeration type %1">,
4870   InGroup<FlagEnum>;
4871   
4872 def warn_illegal_constant_array_size : Extension<
4873   "size of static array must be an integer constant expression">;
4874 def err_vm_decl_in_file_scope : Error<
4875   "variably modified type declaration not allowed at file scope">;
4876 def err_vm_decl_has_extern_linkage : Error<
4877   "variably modified type declaration cannot have 'extern' linkage">;
4878 def err_typecheck_field_variable_size : Error<
4879   "fields must have a constant size: 'variable length array in structure' "
4880   "extension will never be supported">;
4881 def err_vm_func_decl : Error<
4882   "function declaration cannot have variably modified type">;
4883 def err_array_too_large : Error<
4884   "array is too large (%0 elements)">;
4885
4886 // -Wpadded, -Wpacked
4887 def warn_padded_struct_field : Warning<
4888   "padding %select{struct|interface|class}0 %1 with %2 "
4889   "%select{byte|bit}3%s2 to align %4">,
4890   InGroup<Padded>, DefaultIgnore;
4891 def warn_padded_struct_anon_field : Warning<
4892   "padding %select{struct|interface|class}0 %1 with %2 "
4893   "%select{byte|bit}3%s2 to align anonymous bit-field">,
4894   InGroup<Padded>, DefaultIgnore;
4895 def warn_padded_struct_size : Warning<
4896   "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4897   InGroup<Padded>, DefaultIgnore;
4898 def warn_unnecessary_packed : Warning<
4899   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4900
4901 def err_typecheck_negative_array_size : Error<"array size is negative">;
4902 def warn_typecheck_function_qualifiers_ignored : Warning<
4903   "'%0' qualifier on function type %1 has no effect">,
4904   InGroup<IgnoredQualifiers>;
4905 def warn_typecheck_function_qualifiers_unspecified : Warning<
4906   "'%0' qualifier on function type %1 has unspecified behavior">;
4907 def warn_typecheck_reference_qualifiers : Warning<
4908   "'%0' qualifier on reference type %1 has no effect">,
4909   InGroup<IgnoredQualifiers>;
4910 def err_typecheck_invalid_restrict_not_pointer : Error<
4911   "restrict requires a pointer or reference (%0 is invalid)">;
4912 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4913   "restrict requires a pointer or reference">;
4914 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4915   "pointer to function type %0 may not be 'restrict' qualified">;
4916 def ext_typecheck_zero_array_size : Extension<
4917   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4918 def err_typecheck_zero_array_size : Error<
4919   "zero-length arrays are not permitted in C++">;
4920 def warn_typecheck_zero_static_array_size : Warning<
4921   "'static' has no effect on zero-length arrays">,
4922   InGroup<ArrayBounds>;
4923 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4924 def err_init_element_not_constant : Error<
4925   "initializer element is not a compile-time constant">;
4926 def ext_aggregate_init_not_constant : Extension<
4927   "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4928 def err_local_cant_init : Error<
4929   "'__local' variable cannot have an initializer">;
4930 def err_block_extern_cant_init : Error<
4931   "'extern' variable cannot have an initializer">;
4932 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4933   InGroup<DiagGroup<"extern-initializer">>;
4934 def err_variable_object_no_init : Error<
4935   "variable-sized object may not be initialized">;
4936 def err_excess_initializers : Error<
4937   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4938 def ext_excess_initializers : ExtWarn<
4939   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4940 def err_excess_initializers_in_char_array_initializer : Error<
4941   "excess elements in char array initializer">;
4942 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4943   "excess elements in char array initializer">;
4944 def err_initializer_string_for_char_array_too_long : Error<
4945   "initializer-string for char array is too long">;
4946 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4947   "initializer-string for char array is too long">;
4948 def warn_missing_field_initializers : Warning<
4949   "missing field %0 initializer">,
4950   InGroup<MissingFieldInitializers>, DefaultIgnore;
4951 def warn_braces_around_scalar_init : Warning<
4952   "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4953 def ext_many_braces_around_scalar_init : ExtWarn<
4954   "too many braces around scalar initializer">,
4955   InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4956 def ext_complex_component_init : Extension<
4957   "complex initialization specifying real and imaginary components "
4958   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4959 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4960 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4961   "scalar initialized from empty initializer list is incompatible with C++98">,
4962   InGroup<CXX98Compat>, DefaultIgnore;
4963 def warn_cxx98_compat_reference_list_init : Warning<
4964   "reference initialized from initializer list is incompatible with C++98">,
4965   InGroup<CXX98Compat>, DefaultIgnore;
4966 def warn_cxx98_compat_initializer_list_init : Warning<
4967   "initialization of initializer_list object is incompatible with C++98">,
4968   InGroup<CXX98Compat>, DefaultIgnore;
4969 def warn_cxx98_compat_ctor_list_init : Warning<
4970   "constructor call from initializer list is incompatible with C++98">,
4971   InGroup<CXX98Compat>, DefaultIgnore;
4972 def err_illegal_initializer : Error<
4973   "illegal initializer (only variables can be initialized)">;
4974 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4975 def ext_init_list_type_narrowing : ExtWarn<
4976   "type %0 cannot be narrowed to %1 in initializer list">, 
4977   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4978 def ext_init_list_variable_narrowing : ExtWarn<
4979   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4980   "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4981 def ext_init_list_constant_narrowing : ExtWarn<
4982   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4983   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4984 def warn_init_list_type_narrowing : Warning<
4985   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4986   InGroup<CXX11Narrowing>, DefaultIgnore;
4987 def warn_init_list_variable_narrowing : Warning<
4988   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4989   "initializer list in C++11">,
4990   InGroup<CXX11Narrowing>, DefaultIgnore;
4991 def warn_init_list_constant_narrowing : Warning<
4992   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4993   "C++11">,
4994   InGroup<CXX11Narrowing>, DefaultIgnore;
4995 def note_init_list_narrowing_silence : Note<
4996   "insert an explicit cast to silence this issue">;
4997 def err_init_objc_class : Error<
4998   "cannot initialize Objective-C class type %0">;
4999 def err_implicit_empty_initializer : Error<
5000   "initializer for aggregate with no elements requires explicit braces">;
5001 def err_bitfield_has_negative_width : Error<
5002   "bit-field %0 has negative width (%1)">;
5003 def err_anon_bitfield_has_negative_width : Error<
5004   "anonymous bit-field has negative width (%0)">;
5005 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
5006 def err_bitfield_width_exceeds_type_width : Error<
5007   "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
5008   "of its type (%3 bit%s3)">;
5009 def err_anon_bitfield_width_exceeds_type_width : Error<
5010   "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
5011   "of its type (%2 bit%s2)">;
5012 def err_incorrect_number_of_vector_initializers : Error<
5013   "number of elements must be either one or match the size of the vector">;
5014
5015 // Used by C++ which allows bit-fields that are wider than the type.
5016 def warn_bitfield_width_exceeds_type_width: Warning<
5017   "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
5018   "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
5019 def warn_anon_bitfield_width_exceeds_type_width : Warning<
5020   "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
5021   "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
5022 def warn_bitfield_too_small_for_enum : Warning<
5023   "bit-field %0 is not wide enough to store all enumerators of %1">,
5024   InGroup<BitFieldEnumConversion>, DefaultIgnore;
5025 def note_widen_bitfield : Note<
5026   "widen this field to %0 bits to store all values of %1">;
5027 def warn_unsigned_bitfield_assigned_signed_enum : Warning<
5028   "assigning value of signed enum type %1 to unsigned bit-field %0; "
5029   "negative enumerators of enum %1 will be converted to positive values">,
5030   InGroup<BitFieldEnumConversion>, DefaultIgnore;
5031 def warn_signed_bitfield_enum_conversion : Warning<
5032   "signed bit-field %0 needs an extra bit to represent the largest positive "
5033   "enumerators of %1">,
5034   InGroup<BitFieldEnumConversion>, DefaultIgnore;
5035 def note_change_bitfield_sign : Note<
5036   "consider making the bitfield type %select{unsigned|signed}0">;
5037
5038 def warn_missing_braces : Warning<
5039   "suggest braces around initialization of subobject">,
5040   InGroup<MissingBraces>, DefaultIgnore;
5041
5042 def err_redefinition_of_label : Error<"redefinition of label %0">;
5043 def err_undeclared_label_use : Error<"use of undeclared label %0">;
5044 def err_goto_ms_asm_label : Error<
5045   "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5046 def note_goto_ms_asm_label : Note<
5047   "inline assembly label %0 declared here">;
5048 def warn_unused_label : Warning<"unused label %0">,
5049   InGroup<UnusedLabel>, DefaultIgnore;
5050
5051 def err_goto_into_protected_scope : Error<
5052   "cannot jump from this goto statement to its label">;
5053 def ext_goto_into_protected_scope : ExtWarn<
5054   "jump from this goto statement to its label is a Microsoft extension">,
5055   InGroup<MicrosoftGoto>;
5056 def warn_cxx98_compat_goto_into_protected_scope : Warning<
5057   "jump from this goto statement to its label is incompatible with C++98">,
5058   InGroup<CXX98Compat>, DefaultIgnore;
5059 def err_switch_into_protected_scope : Error<
5060   "cannot jump from switch statement to this case label">;
5061 def warn_cxx98_compat_switch_into_protected_scope : Warning<
5062   "jump from switch statement to this case label is incompatible with C++98">,
5063   InGroup<CXX98Compat>, DefaultIgnore;
5064 def err_indirect_goto_without_addrlabel : Error<
5065   "indirect goto in function with no address-of-label expressions">;
5066 def err_indirect_goto_in_protected_scope : Error<
5067   "cannot jump from this indirect goto statement to one of its possible targets">;
5068 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5069   "jump from this indirect goto statement to one of its possible targets "
5070   "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5071 def note_indirect_goto_target : Note<
5072   "possible target of indirect goto statement">;
5073 def note_protected_by_variable_init : Note<
5074   "jump bypasses variable initialization">;
5075 def note_protected_by_variable_nontriv_destructor : Note<
5076   "jump bypasses variable with a non-trivial destructor">;
5077 def note_protected_by_variable_non_pod : Note<
5078   "jump bypasses initialization of non-POD variable">;
5079 def note_protected_by_cleanup : Note<
5080   "jump bypasses initialization of variable with __attribute__((cleanup))">;
5081 def note_protected_by_vla_typedef : Note<
5082   "jump bypasses initialization of VLA typedef">;
5083 def note_protected_by_vla_type_alias : Note<
5084   "jump bypasses initialization of VLA type alias">;
5085 def note_protected_by_constexpr_if : Note<
5086   "jump enters controlled statement of constexpr if">;
5087 def note_protected_by_if_available : Note<
5088   "jump enters controlled statement of if available">;
5089 def note_protected_by_vla : Note<
5090   "jump bypasses initialization of variable length array">;
5091 def note_protected_by_objc_fast_enumeration : Note<
5092   "jump enters Objective-C fast enumeration loop">;
5093 def note_protected_by_objc_try : Note<
5094   "jump bypasses initialization of @try block">;
5095 def note_protected_by_objc_catch : Note<
5096   "jump bypasses initialization of @catch block">;
5097 def note_protected_by_objc_finally : Note<
5098   "jump bypasses initialization of @finally block">;
5099 def note_protected_by_objc_synchronized : Note<
5100   "jump bypasses initialization of @synchronized block">;
5101 def note_protected_by_objc_autoreleasepool : Note<
5102   "jump bypasses auto release push of @autoreleasepool block">;
5103 def note_protected_by_cxx_try : Note<
5104   "jump bypasses initialization of try block">;
5105 def note_protected_by_cxx_catch : Note<
5106   "jump bypasses initialization of catch block">;
5107 def note_protected_by_seh_try : Note<
5108   "jump bypasses initialization of __try block">;
5109 def note_protected_by_seh_except : Note<
5110   "jump bypasses initialization of __except block">;
5111 def note_protected_by_seh_finally : Note<
5112   "jump bypasses initialization of __finally block">;
5113 def note_protected_by___block : Note<
5114   "jump bypasses setup of __block variable">;
5115 def note_protected_by_objc_strong_init : Note<
5116   "jump bypasses initialization of __strong variable">;
5117 def note_protected_by_objc_weak_init : Note<
5118   "jump bypasses initialization of __weak variable">;
5119 def note_enters_block_captures_cxx_obj : Note<
5120   "jump enters lifetime of block which captures a destructible C++ object">;
5121 def note_enters_block_captures_strong : Note<
5122   "jump enters lifetime of block which strongly captures a variable">;
5123 def note_enters_block_captures_weak : Note<
5124   "jump enters lifetime of block which weakly captures a variable">;
5125
5126 def note_exits_cleanup : Note<
5127   "jump exits scope of variable with __attribute__((cleanup))">;
5128 def note_exits_dtor : Note<
5129   "jump exits scope of variable with non-trivial destructor">;
5130 def note_exits_temporary_dtor : Note<
5131   "jump exits scope of lifetime-extended temporary with non-trivial "
5132   "destructor">;
5133 def note_exits___block : Note<
5134   "jump exits scope of __block variable">;
5135 def note_exits_objc_try : Note<
5136   "jump exits @try block">;
5137 def note_exits_objc_catch : Note<
5138   "jump exits @catch block">;
5139 def note_exits_objc_finally : Note<
5140   "jump exits @finally block">;
5141 def note_exits_objc_synchronized : Note<
5142   "jump exits @synchronized block">;
5143 def note_exits_cxx_try : Note<
5144   "jump exits try block">;
5145 def note_exits_cxx_catch : Note<
5146   "jump exits catch block">;
5147 def note_exits_seh_try : Note<
5148   "jump exits __try block">;
5149 def note_exits_seh_except : Note<
5150   "jump exits __except block">;
5151 def note_exits_seh_finally : Note<
5152   "jump exits __finally block">;
5153 def note_exits_objc_autoreleasepool : Note<
5154   "jump exits autoreleasepool block">;
5155 def note_exits_objc_strong : Note<
5156   "jump exits scope of __strong variable">;
5157 def note_exits_objc_weak : Note<
5158   "jump exits scope of __weak variable">;
5159 def note_exits_block_captures_cxx_obj : Note<
5160   "jump exits lifetime of block which captures a destructible C++ object">;
5161 def note_exits_block_captures_strong : Note<
5162   "jump exits lifetime of block which strongly captures a variable">;
5163 def note_exits_block_captures_weak : Note<
5164   "jump exits lifetime of block which weakly captures a variable">;
5165
5166 def err_func_returning_qualified_void : ExtWarn<
5167   "function cannot return qualified void type %0">,
5168   InGroup<DiagGroup<"qualified-void-return-type">>;
5169 def err_func_returning_array_function : Error<
5170   "function cannot return %select{array|function}0 type %1">;
5171 def err_field_declared_as_function : Error<"field %0 declared as a function">;
5172 def err_field_incomplete : Error<"field has incomplete type %0">;
5173 def ext_variable_sized_type_in_struct : ExtWarn<
5174   "field %0 with variable sized type %1 not at the end of a struct or class is"
5175   " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5176
5177 def ext_c99_flexible_array_member : Extension<
5178   "flexible array members are a C99 feature">, InGroup<C99>;
5179 def err_flexible_array_virtual_base : Error<
5180   "flexible array member %0 not allowed in "
5181   "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5182 def err_flexible_array_empty_aggregate : Error<
5183   "flexible array member %0 not allowed in otherwise empty "
5184   "%select{struct|interface|union|class|enum}1">;
5185 def err_flexible_array_has_nontrivial_dtor : Error<
5186   "flexible array member %0 of type %1 with non-trivial destruction">;
5187 def ext_flexible_array_in_struct : Extension<
5188   "%0 may not be nested in a struct due to flexible array member">,
5189   InGroup<FlexibleArrayExtensions>;
5190 def ext_flexible_array_in_array : Extension<
5191   "%0 may not be used as an array element due to flexible array member">,
5192   InGroup<FlexibleArrayExtensions>;
5193 def err_flexible_array_init : Error<
5194   "initialization of flexible array member is not allowed">;
5195 def ext_flexible_array_empty_aggregate_ms : Extension<
5196   "flexible array member %0 in otherwise empty "
5197   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5198   InGroup<MicrosoftFlexibleArray>;
5199 def err_flexible_array_union : Error<
5200   "flexible array member %0 in a union is not allowed">;
5201 def ext_flexible_array_union_ms : Extension<
5202   "flexible array member %0 in a union is a Microsoft extension">,
5203   InGroup<MicrosoftFlexibleArray>;
5204 def ext_flexible_array_empty_aggregate_gnu : Extension<
5205   "flexible array member %0 in otherwise empty "
5206   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5207   InGroup<GNUEmptyStruct>;
5208 def ext_flexible_array_union_gnu : Extension<
5209   "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5210
5211 def err_flexible_array_not_at_end : Error<
5212   "flexible array member %0 with type %1 is not at the end of"
5213   " %select{struct|interface|union|class|enum}2">;
5214 def err_objc_variable_sized_type_not_at_end : Error<
5215   "field %0 with variable sized type %1 is not at the end of class">;
5216 def note_next_field_declaration : Note<
5217   "next field declaration is here">;
5218 def note_next_ivar_declaration : Note<
5219   "next %select{instance variable declaration|synthesized instance variable}0"
5220   " is here">;
5221 def err_synthesize_variable_sized_ivar : Error<
5222   "synthesized property with variable size type %0"
5223   " requires an existing instance variable">;
5224 def err_flexible_array_arc_retainable : Error<
5225   "ARC forbids flexible array members with retainable object type">;
5226 def warn_variable_sized_ivar_visibility : Warning<
5227   "field %0 with variable sized type %1 is not visible to subclasses and"
5228   " can conflict with their instance variables">, InGroup<ObjCFlexibleArray>;
5229 def warn_superclass_variable_sized_type_not_at_end : Warning<
5230   "field %0 can overwrite instance variable %1 with variable sized type %2"
5231   " in superclass %3">, InGroup<ObjCFlexibleArray>;
5232
5233 let CategoryName = "ARC Semantic Issue" in {
5234
5235 // ARC-mode diagnostics.
5236
5237 let CategoryName = "ARC Weak References" in {
5238
5239 def err_arc_weak_no_runtime : Error<
5240   "cannot create __weak reference because the current deployment target "
5241   "does not support weak references">;
5242 def err_arc_weak_disabled : Error<
5243   "cannot create __weak reference in file using manual reference counting">;
5244 def err_synthesizing_arc_weak_property_disabled : Error<
5245   "cannot synthesize weak property in file using manual reference counting">;
5246 def err_synthesizing_arc_weak_property_no_runtime : Error<
5247   "cannot synthesize weak property because the current deployment target "
5248   "does not support weak references">;
5249 def err_arc_unsupported_weak_class : Error<
5250   "class is incompatible with __weak references">;
5251 def err_arc_weak_unavailable_assign : Error<
5252   "assignment of a weak-unavailable object to a __weak object">;
5253 def err_arc_weak_unavailable_property : Error<
5254   "synthesizing __weak instance variable of type %0, which does not "
5255   "support weak references">;
5256 def note_implemented_by_class : Note<
5257   "when implemented by class %0">;
5258 def err_arc_convesion_of_weak_unavailable : Error<
5259   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5260   " a __weak object of type %2">;
5261
5262 } // end "ARC Weak References" category
5263
5264 let CategoryName = "ARC Restrictions" in {
5265
5266 def err_unavailable_in_arc : Error<
5267   "%0 is unavailable in ARC">;
5268 def note_arc_forbidden_type : Note<
5269   "declaration uses type that is ill-formed in ARC">;
5270 def note_performs_forbidden_arc_conversion : Note<
5271   "inline function performs a conversion which is forbidden in ARC">;
5272 def note_arc_init_returns_unrelated : Note<
5273   "init method must return a type related to its receiver type">;
5274 def note_arc_weak_disabled : Note<
5275   "declaration uses __weak, but ARC is disabled">;
5276 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5277   "the current deployment target does not support">;
5278 def note_arc_field_with_ownership : Note<
5279   "field has non-trivial ownership qualification">;
5280
5281 def err_arc_illegal_explicit_message : Error<
5282   "ARC forbids explicit message send of %0">;
5283 def err_arc_unused_init_message : Error<
5284   "the result of a delegate init call must be immediately returned "
5285   "or assigned to 'self'">;
5286 def err_arc_mismatched_cast : Error<
5287   "%select{implicit conversion|cast}0 of "
5288   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5289   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5290   " to %3 is disallowed with ARC">;
5291 def err_arc_nolifetime_behavior : Error<
5292   "explicit ownership qualifier on cast result has no effect">;
5293 def err_arc_objc_object_in_tag : Error<
5294   "ARC forbids %select{Objective-C objects|blocks}0 in "
5295   "%select{struct|interface|union|<<ERROR>>|enum}1">;
5296 def err_arc_objc_property_default_assign_on_object : Error<
5297   "ARC forbids synthesizing a property of an Objective-C object "
5298   "with unspecified ownership or storage attribute">;
5299 def err_arc_illegal_selector : Error<
5300   "ARC forbids use of %0 in a @selector">;
5301 def err_arc_illegal_method_def : Error<
5302   "ARC forbids %select{implementation|synthesis}0 of %1">;
5303 def warn_arc_strong_pointer_objc_pointer : Warning<
5304   "method parameter of type %0 with no explicit ownership">,
5305   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5306   
5307 } // end "ARC Restrictions" category
5308   
5309 def err_arc_lost_method_convention : Error<
5310   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5311   "method, but its implementation doesn't match because %select{"
5312   "its result type is not an object pointer|"
5313   "its result type is unrelated to its receiver type}1">;
5314 def note_arc_lost_method_convention : Note<"declaration in interface">;
5315 def err_arc_gained_method_convention : Error<
5316   "method implementation does not match its declaration">;
5317 def note_arc_gained_method_convention : Note<
5318   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5319   "family because %select{its result type is not an object pointer|"
5320   "its result type is unrelated to its receiver type}1">;
5321 def err_typecheck_arc_assign_self : Error<
5322   "cannot assign to 'self' outside of a method in the init family">;
5323 def err_typecheck_arc_assign_self_class_method : Error<
5324   "cannot assign to 'self' in a class method">;
5325 def err_typecheck_arr_assign_enumeration : Error<
5326   "fast enumeration variables cannot be modified in ARC by default; "
5327   "declare the variable __strong to allow this">;
5328 def warn_arc_retained_assign : Warning<
5329   "assigning retained object to %select{weak|unsafe_unretained}0 "
5330   "%select{property|variable}1"
5331   "; object will be released after assignment">,
5332   InGroup<ARCUnsafeRetainedAssign>;
5333 def warn_arc_retained_property_assign : Warning<
5334   "assigning retained object to unsafe property"
5335   "; object will be released after assignment">,
5336   InGroup<ARCUnsafeRetainedAssign>;
5337 def warn_arc_literal_assign : Warning<
5338   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5339   " to a weak %select{property|variable}1"
5340   "; object will be released after assignment">,
5341   InGroup<ARCUnsafeRetainedAssign>;
5342 def err_arc_new_array_without_ownership : Error<
5343   "'new' cannot allocate an array of %0 with no explicit ownership">;
5344 def err_arc_autoreleasing_var : Error<
5345   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5346   "__autoreleasing ownership">;
5347 def err_arc_autoreleasing_capture : Error<
5348   "cannot capture __autoreleasing variable in a "
5349   "%select{block|lambda by copy}0">;
5350 def err_arc_thread_ownership : Error<
5351   "thread-local variable has non-trivial ownership: type is %0">;
5352 def err_arc_indirect_no_ownership : Error<
5353   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5354 def err_arc_array_param_no_ownership : Error<
5355   "must explicitly describe intended ownership of an object array parameter">;
5356 def err_arc_pseudo_dtor_inconstant_quals : Error<
5357   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5358   "type %1">;
5359 def err_arc_init_method_unrelated_result_type : Error<
5360   "init methods must return a type related to the receiver type">;
5361 def err_arc_nonlocal_writeback : Error<
5362   "passing address of %select{non-local|non-scalar}0 object to "
5363   "__autoreleasing parameter for write-back">;
5364 def err_arc_method_not_found : Error<
5365   "no known %select{instance|class}1 method for selector %0">;
5366 def err_arc_receiver_forward_class : Error<
5367   "receiver %0 for class message is a forward declaration">;
5368 def err_arc_may_not_respond : Error<
5369   "no visible @interface for %0 declares the selector %1">;
5370 def err_arc_receiver_forward_instance : Error<
5371   "receiver type %0 for instance message is a forward declaration">;
5372 def warn_receiver_forward_instance : Warning<
5373   "receiver type %0 for instance message is a forward declaration">,
5374   InGroup<ForwardClassReceiver>, DefaultIgnore;
5375 def err_arc_collection_forward : Error<
5376   "collection expression type %0 is a forward declaration">;
5377 def err_arc_multiple_method_decl : Error< 
5378   "multiple methods named %0 found with mismatched result, "
5379   "parameter type or attributes">;
5380 def warn_arc_lifetime_result_type : Warning<
5381   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5382   "lifetime qualifier on return type is ignored">,
5383   InGroup<IgnoredQualifiers>;
5384
5385 let CategoryName = "ARC Retain Cycle" in {
5386
5387 def warn_arc_retain_cycle : Warning<
5388   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5389   InGroup<ARCRetainCycles>;
5390 def note_arc_retain_cycle_owner : Note<
5391   "block will be retained by %select{the captured object|an object strongly "
5392   "retained by the captured object}0">;
5393
5394 } // end "ARC Retain Cycle" category
5395
5396 def warn_arc_object_memaccess : Warning<
5397   "%select{destination for|source of}0 this %1 call is a pointer to "
5398   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5399
5400 let CategoryName = "ARC and @properties" in {
5401
5402 def err_arc_strong_property_ownership : Error<
5403   "existing instance variable %1 for strong property %0 may not be "
5404   "%select{|__unsafe_unretained||__weak}2">;
5405 def err_arc_assign_property_ownership : Error<
5406   "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5407   "attribute must be __unsafe_unretained">;
5408 def err_arc_inconsistent_property_ownership : Error<
5409   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5410   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5411
5412 } // end "ARC and @properties" category
5413
5414 def warn_block_capture_autoreleasing : Warning<
5415   "block captures an autoreleasing out-parameter, which may result in "
5416   "use-after-free bugs">,
5417   InGroup<BlockCaptureAutoReleasing>;
5418 def note_declare_parameter_autoreleasing : Note<
5419   "declare the parameter __autoreleasing explicitly to suppress this warning">;
5420 def note_declare_parameter_strong : Note<
5421   "declare the parameter __strong or capture a __block __strong variable to "
5422   "keep values alive across autorelease pools">;
5423
5424 def err_arc_atomic_ownership : Error<
5425   "cannot perform atomic operation on a pointer to type %0: type has "
5426   "non-trivial ownership">;
5427
5428 let CategoryName = "ARC Casting Rules" in {
5429
5430 def err_arc_bridge_cast_incompatible : Error<
5431   "incompatible types casting %0 to %1 with a %select{__bridge|"
5432   "__bridge_transfer|__bridge_retained}2 cast">;
5433 def err_arc_bridge_cast_wrong_kind : Error<
5434   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5435   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5436   "__bridge_transfer|__bridge_retained}4">;
5437 def err_arc_cast_requires_bridge : Error<
5438   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5439   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5440   "requires a bridged cast">;
5441 def note_arc_bridge : Note<
5442   "use __bridge to convert directly (no change in ownership)">;
5443 def note_arc_cstyle_bridge : Note<
5444   "use __bridge with C-style cast to convert directly (no change in ownership)">;
5445 def note_arc_bridge_transfer : Note<
5446   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5447   "ownership of a +1 %0 into ARC">;
5448 def note_arc_cstyle_bridge_transfer : Note<
5449   "use __bridge_transfer with C-style cast to transfer "
5450   "ownership of a +1 %0 into ARC">;
5451 def note_arc_bridge_retained : Note<
5452   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5453   "ARC object available as a +1 %0">;
5454 def note_arc_cstyle_bridge_retained : Note<
5455   "use __bridge_retained with C-style cast to make an "
5456   "ARC object available as a +1 %0">;
5457
5458 } // ARC Casting category
5459
5460 } // ARC category name
5461
5462 def err_flexible_array_init_needs_braces : Error<
5463   "flexible array requires brace-enclosed initializer">;
5464 def err_illegal_decl_array_of_functions : Error<
5465   "'%0' declared as array of functions of type %1">;
5466 def err_illegal_decl_array_incomplete_type : Error<
5467   "array has incomplete element type %0">;
5468 def err_illegal_message_expr_incomplete_type : Error<
5469   "Objective-C message has incomplete result type %0">;
5470 def err_illegal_decl_array_of_references : Error<
5471   "'%0' declared as array of references of type %1">;
5472 def err_decl_negative_array_size : Error<
5473   "'%0' declared as an array with a negative size">;
5474 def err_array_static_outside_prototype : Error<
5475   "%0 used in array declarator outside of function prototype">;
5476 def err_array_static_not_outermost : Error<
5477   "%0 used in non-outermost array type derivation">;
5478 def err_array_star_outside_prototype : Error<
5479   "star modifier used outside of function prototype">;
5480 def err_illegal_decl_pointer_to_reference : Error<
5481   "'%0' declared as a pointer to a reference of type %1">;
5482 def err_illegal_decl_mempointer_to_reference : Error<
5483   "'%0' declared as a member pointer to a reference of type %1">;
5484 def err_illegal_decl_mempointer_to_void : Error<
5485   "'%0' declared as a member pointer to void">;
5486 def err_illegal_decl_mempointer_in_nonclass : Error<
5487   "'%0' does not point into a class">;
5488 def err_mempointer_in_nonclass_type : Error<
5489   "member pointer refers into non-class type %0">;
5490 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5491 def err_nonfunction_block_type : Error<
5492   "block pointer to non-function type is invalid">;
5493 def err_return_block_has_expr : Error<"void block should not return a value">;
5494 def err_block_return_missing_expr : Error<
5495   "non-void block should return a value">;
5496 def err_func_def_incomplete_result : Error<
5497   "incomplete result type %0 in function definition">;
5498 def err_atomic_specifier_bad_type : Error<
5499   "_Atomic cannot be applied to "
5500   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5501   "%1 %select{||||||which is not trivially copyable}0">;
5502
5503 // Expressions.
5504 def ext_sizeof_alignof_function_type : Extension<
5505   "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
5506   "function type">, InGroup<PointerArith>;
5507 def ext_sizeof_alignof_void_type : Extension<
5508   "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
5509   "type">, InGroup<PointerArith>;
5510 def err_opencl_sizeof_alignof_type : Error<
5511   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
5512 def err_sizeof_alignof_incomplete_type : Error<
5513   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
5514   "incomplete type %1">;
5515 def err_sizeof_alignof_function_type : Error<
5516   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
5517   "function type">;
5518 def err_openmp_default_simd_align_expr : Error<
5519   "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5520 def err_sizeof_alignof_typeof_bitfield : Error<
5521   "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5522 def err_alignof_member_of_incomplete_type : Error<
5523   "invalid application of 'alignof' to a field of a class still being defined">;
5524 def err_vecstep_non_scalar_vector_type : Error<
5525   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5526 def err_offsetof_incomplete_type : Error<
5527   "offsetof of incomplete type %0">;
5528 def err_offsetof_record_type : Error<
5529   "offsetof requires struct, union, or class type, %0 invalid">;
5530 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5531 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5532   InGroup<InvalidOffsetof>;
5533 def ext_offsetof_non_standardlayout_type : ExtWarn<
5534   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5535 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5536 def err_offsetof_field_of_virtual_base : Error<
5537   "invalid application of 'offsetof' to a field of a virtual base">;
5538 def warn_sub_ptr_zero_size_types : Warning<
5539   "subtraction of pointers to type %0 of zero size has undefined behavior">,
5540   InGroup<PointerArith>;
5541 def warn_pointer_arith_null_ptr : Warning<
5542   "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">,
5543   InGroup<NullPointerArithmetic>, DefaultIgnore;
5544 def warn_gnu_null_ptr_arith : Warning<
5545   "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">,
5546   InGroup<NullPointerArithmetic>, DefaultIgnore;
5547
5548 def warn_floatingpoint_eq : Warning<
5549   "comparing floating point with == or != is unsafe">,
5550   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5551
5552 def warn_remainder_division_by_zero : Warning<
5553   "%select{remainder|division}0 by zero is undefined">,
5554   InGroup<DivZero>;
5555 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5556   InGroup<DiagGroup<"shift-negative-value">>;
5557 def warn_shift_negative : Warning<"shift count is negative">,
5558   InGroup<DiagGroup<"shift-count-negative">>;
5559 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5560   InGroup<DiagGroup<"shift-count-overflow">>;
5561 def warn_shift_result_gt_typewidth : Warning<
5562   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5563   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5564 def warn_shift_result_sets_sign_bit : Warning<
5565   "signed shift result (%0) sets the sign bit of the shift expression's "
5566   "type (%1) and becomes negative">,
5567   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5568
5569 def warn_precedence_bitwise_rel : Warning<
5570   "%0 has lower precedence than %1; %1 will be evaluated first">,
5571   InGroup<Parentheses>;
5572 def note_precedence_bitwise_first : Note<
5573   "place parentheses around the %0 expression to evaluate it first">;
5574 def note_precedence_silence : Note<
5575   "place parentheses around the '%0' expression to silence this warning">;
5576
5577 def warn_precedence_conditional : Warning<
5578   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5579   InGroup<Parentheses>;
5580 def note_precedence_conditional_first : Note<
5581   "place parentheses around the '?:' expression to evaluate it first">;
5582
5583 def warn_logical_instead_of_bitwise : Warning<
5584   "use of logical '%0' with constant operand">,
5585   InGroup<DiagGroup<"constant-logical-operand">>;
5586 def note_logical_instead_of_bitwise_change_operator : Note<
5587   "use '%0' for a bitwise operation">;
5588 def note_logical_instead_of_bitwise_remove_constant : Note<
5589   "remove constant to silence this warning">;
5590
5591 def warn_bitwise_op_in_bitwise_op : Warning<
5592   "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5593
5594 def warn_logical_and_in_logical_or : Warning<
5595   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5596
5597 def warn_overloaded_shift_in_comparison :Warning<
5598   "overloaded operator %select{>>|<<}0 has higher precedence than "
5599   "comparison operator">,
5600   InGroup<OverloadedShiftOpParentheses>;
5601 def note_evaluate_comparison_first :Note<
5602   "place parentheses around comparison expression to evaluate it first">;
5603
5604 def warn_addition_in_bitshift : Warning<
5605   "operator '%0' has lower precedence than '%1'; "
5606   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5607
5608 def warn_self_assignment : Warning<
5609   "explicitly assigning value of variable of type %0 to itself">,
5610   InGroup<SelfAssignment>, DefaultIgnore;
5611 def warn_self_move : Warning<
5612   "explicitly moving variable of type %0 to itself">,
5613   InGroup<SelfMove>, DefaultIgnore;
5614
5615 def warn_redundant_move_on_return : Warning<
5616   "redundant move in return statement">,
5617   InGroup<RedundantMove>, DefaultIgnore;
5618 def warn_pessimizing_move_on_return : Warning<
5619   "moving a local object in a return statement prevents copy elision">,
5620   InGroup<PessimizingMove>, DefaultIgnore;
5621 def warn_pessimizing_move_on_initialization : Warning<
5622   "moving a temporary object prevents copy elision">,
5623   InGroup<PessimizingMove>, DefaultIgnore;
5624 def note_remove_move : Note<"remove std::move call here">;
5625
5626 def warn_string_plus_int : Warning<
5627   "adding %0 to a string does not append to the string">,
5628   InGroup<StringPlusInt>;
5629 def warn_string_plus_char : Warning<
5630   "adding %0 to a string pointer does not append to the string">,
5631   InGroup<StringPlusChar>;
5632 def note_string_plus_scalar_silence : Note<
5633   "use array indexing to silence this warning">;
5634
5635 def warn_sizeof_array_param : Warning<
5636   "sizeof on array function parameter will return size of %0 instead of %1">,
5637   InGroup<SizeofArrayArgument>;
5638
5639 def warn_sizeof_array_decay : Warning<
5640   "sizeof on pointer operation will return size of %0 instead of %1">,
5641   InGroup<SizeofArrayDecay>;
5642
5643 def err_sizeof_nonfragile_interface : Error<
5644   "application of '%select{alignof|sizeof}1' to interface %0 is "
5645   "not supported on this architecture and platform">;
5646 def err_atdef_nonfragile_interface : Error<
5647   "use of @defs is not supported on this architecture and platform">;
5648 def err_subscript_nonfragile_interface : Error<
5649   "subscript requires size of interface %0, which is not constant for "
5650   "this architecture and platform">;
5651
5652 def err_arithmetic_nonfragile_interface : Error<
5653   "arithmetic on pointer to interface %0, which is not a constant size for "
5654   "this architecture and platform">;
5655
5656
5657 def ext_subscript_non_lvalue : Extension<
5658   "ISO C90 does not allow subscripting non-lvalue array">;
5659 def err_typecheck_subscript_value : Error<
5660   "subscripted value is not an array, pointer, or vector">;
5661 def err_typecheck_subscript_not_integer : Error<
5662   "array subscript is not an integer">;
5663 def err_subscript_function_type : Error<
5664   "subscript of pointer to function type %0">;
5665 def err_subscript_incomplete_type : Error<
5666   "subscript of pointer to incomplete type %0">;
5667 def err_dereference_incomplete_type : Error<
5668   "dereference of pointer to incomplete type %0">;
5669 def ext_gnu_subscript_void_type : Extension<
5670   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5671 def err_typecheck_member_reference_struct_union : Error<
5672   "member reference base type %0 is not a structure or union">;
5673 def err_typecheck_member_reference_ivar : Error<
5674   "%0 does not have a member named %1">;
5675 def err_arc_weak_ivar_access : Error<
5676   "dereferencing a __weak pointer is not allowed due to possible "
5677   "null value caused by race condition, assign it to strong variable first">;
5678 def err_typecheck_member_reference_arrow : Error<
5679   "member reference type %0 is not a pointer">;
5680 def err_typecheck_member_reference_suggestion : Error<
5681   "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5682 def note_typecheck_member_reference_suggestion : Note<
5683   "did you mean to use '.' instead?">;
5684 def note_member_reference_arrow_from_operator_arrow : Note<
5685   "'->' applied to return value of the operator->() declared here">;
5686 def err_typecheck_member_reference_type : Error<
5687   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5688 def err_typecheck_member_reference_unknown : Error<
5689   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5690 def err_member_reference_needs_call : Error<
5691   "base of member reference is a function; perhaps you meant to call "
5692   "it%select{| with no arguments}0?">;
5693 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5694   InGroup<CharSubscript>, DefaultIgnore;
5695
5696 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5697 def err_no_member : Error<"no member named %0 in %1">;
5698 def err_no_member_overloaded_arrow : Error<
5699   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5700
5701 def err_member_not_yet_instantiated : Error<
5702   "no member %0 in %1; it has not yet been instantiated">;
5703 def note_non_instantiated_member_here : Note<
5704   "not-yet-instantiated member is declared here">;
5705
5706 def err_enumerator_does_not_exist : Error<
5707   "enumerator %0 does not exist in instantiation of %1">;
5708 def note_enum_specialized_here : Note<
5709   "enum %0 was explicitly specialized here">;
5710
5711 def err_specialization_not_primary_template : Error<
5712   "cannot reference member of primary template because deduced class "
5713   "template specialization %0 is %select{instantiated from a partial|"
5714   "an explicit}1 specialization">;
5715
5716 def err_member_redeclared : Error<"class member cannot be redeclared">;
5717 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5718   InGroup<RedeclaredClassMember>;
5719 def err_member_redeclared_in_instantiation : Error<
5720   "multiple overloads of %0 instantiate to the same signature %1">;
5721 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5722 def err_member_def_undefined_record : Error<
5723   "out-of-line definition of %0 from class %1 without definition">;
5724 def err_member_decl_does_not_match : Error<
5725   "out-of-line %select{declaration|definition}2 of %0 "
5726   "does not match any declaration in %1">;
5727 def err_friend_decl_with_def_arg_must_be_def : Error<
5728   "friend declaration specifying a default argument must be a definition">;
5729 def err_friend_decl_with_def_arg_redeclared : Error<
5730   "friend declaration specifying a default argument must be the only declaration">;
5731 def err_friend_decl_does_not_match : Error<
5732   "friend declaration of %0 does not match any declaration in %1">;
5733 def err_member_decl_does_not_match_suggest : Error<
5734   "out-of-line %select{declaration|definition}2 of %0 "
5735   "does not match any declaration in %1; did you mean %3?">;
5736 def err_member_def_does_not_match_ret_type : Error<
5737   "return type of out-of-line definition of %q0 differs from "
5738   "that in the declaration">;
5739 def err_nonstatic_member_out_of_line : Error<
5740   "non-static data member defined out-of-line">;
5741 def err_qualified_typedef_declarator : Error<
5742   "typedef declarator cannot be qualified">;
5743 def err_qualified_param_declarator : Error<
5744   "parameter declarator cannot be qualified">;
5745 def ext_out_of_line_declaration : ExtWarn<
5746   "out-of-line declaration of a member must be a definition">,
5747   InGroup<OutOfLineDeclaration>, DefaultError;
5748 def err_member_extra_qualification : Error<
5749   "extra qualification on member %0">;
5750 def warn_member_extra_qualification : Warning<
5751   err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5752 def warn_namespace_member_extra_qualification : Warning<
5753   "extra qualification on member %0">,
5754   InGroup<DiagGroup<"extra-qualification">>;
5755 def err_member_qualification : Error<
5756   "non-friend class member %0 cannot have a qualified name">;  
5757 def note_member_def_close_match : Note<"member declaration nearly matches">;
5758 def note_member_def_close_const_match : Note<
5759   "member declaration does not match because "
5760   "it %select{is|is not}0 const qualified">;
5761 def note_member_def_close_param_match : Note<
5762   "type of %ordinal0 parameter of member declaration does not match definition"
5763   "%diff{ ($ vs $)|}1,2">;
5764 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5765 def note_local_decl_close_param_match : Note<
5766   "type of %ordinal0 parameter of local declaration does not match definition"
5767   "%diff{ ($ vs $)|}1,2">;
5768 def err_typecheck_ivar_variable_size : Error<
5769   "instance variables must have a constant size">;
5770 def err_ivar_reference_type : Error<
5771   "instance variables cannot be of reference type">;
5772 def err_typecheck_illegal_increment_decrement : Error<
5773   "cannot %select{decrement|increment}1 value of type %0">;
5774 def err_typecheck_expect_int : Error<
5775   "used type %0 where integer is required">;
5776 def err_typecheck_arithmetic_incomplete_type : Error<
5777   "arithmetic on a pointer to an incomplete type %0">;
5778 def err_typecheck_pointer_arith_function_type : Error<
5779   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5780   "function type%select{|s}2 %1%select{| and %3}2">;
5781 def err_typecheck_pointer_arith_void_type : Error<
5782   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5783 def err_typecheck_decl_incomplete_type : Error<
5784   "variable has incomplete type %0">;
5785 def ext_typecheck_decl_incomplete_type : ExtWarn<
5786   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5787   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5788 def err_tentative_def_incomplete_type : Error<
5789   "tentative definition has type %0 that is never completed">;
5790 def warn_tentative_incomplete_array : Warning<
5791   "tentative array definition assumed to have one element">;
5792 def err_typecheck_incomplete_array_needs_initializer : Error<
5793   "definition of variable with array type needs an explicit size "
5794   "or an initializer">;
5795 def err_array_init_not_init_list : Error<
5796   "array initializer must be an initializer "
5797   "list%select{| or string literal| or wide string literal}0">;
5798 def err_array_init_narrow_string_into_wchar : Error<
5799   "initializing wide char array with non-wide string literal">;
5800 def err_array_init_wide_string_into_char : Error<
5801   "initializing char array with wide string literal">;
5802 def err_array_init_incompat_wide_string_into_wchar : Error<
5803   "initializing wide char array with incompatible wide string literal">;
5804 def err_array_init_different_type : Error<
5805   "cannot initialize array %diff{of type $ with array of type $|"
5806   "with different type of array}0,1">;
5807 def err_array_init_non_constant_array : Error<
5808   "cannot initialize array %diff{of type $ with non-constant array of type $|"
5809   "with different type of array}0,1">;
5810 def ext_array_init_copy : Extension<
5811   "initialization of an array "
5812   "%diff{of type $ from a compound literal of type $|"
5813   "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5814 // This is intentionally not disabled by -Wno-gnu.
5815 def ext_array_init_parens : ExtWarn<
5816   "parenthesized initialization of a member array is a GNU extension">,
5817   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5818 def warn_deprecated_string_literal_conversion : Warning<
5819   "conversion from string literal to %0 is deprecated">,
5820   InGroup<CXX11CompatDeprecatedWritableStr>;
5821 def ext_deprecated_string_literal_conversion : ExtWarn<
5822   "ISO C++11 does not allow conversion from string literal to %0">,
5823   InGroup<WritableStrings>, SFINAEFailure;
5824 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5825 def err_typecheck_sclass_fscope : Error<
5826   "illegal storage class on file-scoped variable">;
5827 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5828   InGroup<MissingDeclarations>;
5829 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5830   "of a type">, InGroup<MissingDeclarations>;
5831 def err_standalone_class_nested_name_specifier : Error<
5832   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5833   "have a nested name specifier">;
5834 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5835 def err_static_block_func : Error<
5836   "function declared in block scope cannot have 'static' storage class">;
5837 def err_typecheck_address_of : Error<"address of %select{bit-field"
5838   "|vector element|property expression|register variable}0 requested">;
5839 def ext_typecheck_addrof_void : Extension<
5840   "ISO C forbids taking the address of an expression of type 'void'">;
5841 def err_unqualified_pointer_member_function : Error<
5842   "must explicitly qualify name of member function when taking its address">;
5843 def err_invalid_form_pointer_member_function : Error<
5844   "cannot create a non-constant pointer to member function">;
5845 def err_address_of_function_with_pass_object_size_params: Error<
5846   "cannot take address of function %0 because parameter %1 has "
5847   "pass_object_size attribute">;
5848 def err_parens_pointer_member_function : Error<
5849   "cannot parenthesize the name of a method when forming a member pointer">;
5850 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5851   "extra '&' taking address of overloaded function">;
5852 def err_typecheck_invalid_lvalue_addrof : Error<
5853   "cannot take the address of an rvalue of type %0">;
5854 def ext_typecheck_addrof_temporary : ExtWarn<
5855   "taking the address of a temporary object of type %0">, 
5856   InGroup<AddressOfTemporary>, DefaultError;
5857 def err_typecheck_addrof_temporary : Error<
5858   "taking the address of a temporary object of type %0">;
5859 def err_typecheck_addrof_dtor : Error<
5860   "taking the address of a destructor">;
5861 def err_typecheck_unary_expr : Error<
5862   "invalid argument type %0 to unary expression">;
5863 def err_typecheck_indirection_requires_pointer : Error<
5864   "indirection requires pointer operand (%0 invalid)">;
5865 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5866   "ISO C++ does not allow indirection on operand of type %0">,
5867   InGroup<DiagGroup<"void-ptr-dereference">>;
5868 def warn_indirection_through_null : Warning<
5869   "indirection of non-volatile null pointer will be deleted, not trap">,
5870   InGroup<NullDereference>;
5871 def warn_binding_null_to_reference : Warning<
5872   "binding dereferenced null pointer to reference has undefined behavior">,
5873   InGroup<NullDereference>;
5874 def note_indirection_through_null : Note<
5875   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5876 def warn_pointer_indirection_from_incompatible_type : Warning<
5877   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5878   "behavior">,
5879   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5880 def warn_taking_address_of_packed_member : Warning<
5881   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5882   InGroup<DiagGroup<"address-of-packed-member">>;
5883
5884 def err_objc_object_assignment : Error<
5885   "cannot assign to class object (%0 invalid)">;
5886 def err_typecheck_invalid_operands : Error<
5887   "invalid operands to binary expression (%0 and %1)">;
5888 def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
5889   "logical expression with vector %select{type %1 and non-vector type %2|types"
5890   " %1 and %2}0 is only supported in C++">;
5891 def err_typecheck_sub_ptr_compatible : Error<
5892   "%diff{$ and $ are not pointers to compatible types|"
5893   "pointers to incompatible types}0,1">;
5894 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5895   "ordered comparison between pointer and integer (%0 and %1)">;
5896 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5897   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5898 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5899   "ordered comparison between pointer and zero (%0 and %1)">;
5900 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5901   "ordered comparison of function pointers (%0 and %1)">;
5902 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5903   "equality comparison between function pointer and void pointer (%0 and %1)">;
5904 def err_typecheck_comparison_of_fptr_to_void : Error<
5905   "equality comparison between function pointer and void pointer (%0 and %1)">;
5906 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5907   "comparison between pointer and integer (%0 and %1)">;
5908 def err_typecheck_comparison_of_pointer_integer : Error<
5909   "comparison between pointer and integer (%0 and %1)">;
5910 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5911   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5912   InGroup<CompareDistinctPointerType>;
5913 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5914   "incompatible operand types (%0 and %1)">;
5915 def err_cond_voidptr_arc : Error <
5916   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5917   "in ARC mode">;
5918 def err_typecheck_comparison_of_distinct_pointers : Error<
5919   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5920 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5921   "%select{comparison between %diff{ ($ and $)|}0,1"
5922   "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
5923   "|conditional operator with the second and third operands of type "
5924   "%diff{ ($ and $)|}0,1}2"
5925   " which are pointers to non-overlapping address spaces">;
5926
5927 def err_typecheck_assign_const : Error<
5928   "%select{"
5929   "cannot assign to return value because function %1 returns a const value|"
5930   "cannot assign to variable %1 with const-qualified type %2|"
5931   "cannot assign to %select{non-|}1static data member %2 "
5932   "with const-qualified type %3|"
5933   "cannot assign to non-static data member within const member function %1|"
5934   "cannot assign to %select{variable %2|non-static data member %2|lvalue}1 "
5935   "with %select{|nested }3const-qualified data member %4|"
5936   "read-only variable is not assignable}0">;
5937
5938 def note_typecheck_assign_const : Note<
5939   "%select{"
5940   "function %1 which returns const-qualified type %2 declared here|"
5941   "variable %1 declared const here|"
5942   "%select{non-|}1static data member %2 declared const here|"
5943   "member function %q1 is declared const here|"
5944   "%select{|nested }1data member %2 declared const here}0">;
5945
5946 def warn_unsigned_always_true_comparison : Warning<
5947   "result of comparison of %select{%3|unsigned expression}0 %2 "
5948   "%select{unsigned expression|%3}0 is always %4">,
5949   InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore;
5950 def warn_unsigned_enum_always_true_comparison : Warning<
5951   "result of comparison of %select{%3|unsigned enum expression}0 %2 "
5952   "%select{unsigned enum expression|%3}0 is always %4">,
5953   InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore;
5954 def warn_tautological_constant_compare : Warning<
5955   "result of comparison %select{%3|%1}0 %2 "
5956   "%select{%1|%3}0 is always %4">,
5957   InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
5958
5959 def warn_mixed_sign_comparison : Warning<
5960   "comparison of integers of different signs: %0 and %1">,
5961   InGroup<SignCompare>, DefaultIgnore;
5962 def warn_out_of_range_compare : Warning<
5963   "result of comparison of %select{constant %0|true|false}1 with " 
5964   "%select{expression of type %2|boolean expression}3 is always %4">,
5965   InGroup<TautologicalOutOfRangeCompare>;
5966 def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
5967   InGroup<TautologicalConstantCompare>;
5968 def warn_comparison_of_mixed_enum_types : Warning<
5969   "comparison of two values with different enumeration types"
5970   "%diff{ ($ and $)|}0,1">,
5971   InGroup<EnumCompare>;
5972 def warn_comparison_of_mixed_enum_types_switch : Warning<
5973   "comparison of two values with different enumeration types in switch statement"
5974   "%diff{ ($ and $)|}0,1">,
5975   InGroup<EnumCompareSwitch>;
5976 def warn_null_in_arithmetic_operation : Warning<
5977   "use of NULL in arithmetic operation">,
5978   InGroup<NullArithmetic>;
5979 def warn_null_in_comparison_operation : Warning<
5980   "comparison between NULL and non-pointer "
5981   "%select{(%1 and NULL)|(NULL and %1)}0">,
5982   InGroup<NullArithmetic>;
5983 def err_shift_rhs_only_vector : Error<
5984   "requested shift is a vector of type %0 but the first operand is not a "
5985   "vector (%1)">;
5986
5987 def warn_logical_not_on_lhs_of_check : Warning<
5988   "logical not is only applied to the left hand side of this "
5989   "%select{comparison|bitwise operator}0">,
5990   InGroup<LogicalNotParentheses>;
5991 def note_logical_not_fix : Note<
5992   "add parentheses after the '!' to evaluate the "
5993   "%select{comparison|bitwise operator}0 first">;
5994 def note_logical_not_silence_with_parens : Note<
5995   "add parentheses around left hand side expression to silence this warning">;
5996
5997 def err_invalid_this_use : Error<
5998   "invalid use of 'this' outside of a non-static member function">;
5999 def err_this_static_member_func : Error<
6000   "'this' cannot be%select{| implicitly}0 used in a static member function "
6001   "declaration">;
6002 def err_invalid_member_use_in_static_method : Error<
6003   "invalid use of member %0 in static member function">;
6004 def err_invalid_qualified_function_type : Error<
6005   "%select{non-member function|static member function|deduction guide}0 "
6006   "%select{of type %2 |}1cannot have '%3' qualifier">;
6007 def err_compound_qualified_function_type : Error<
6008   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
6009   "cannot have '%3' qualifier">;
6010
6011 def err_ref_qualifier_overload : Error<
6012   "cannot overload a member function %select{without a ref-qualifier|with "
6013   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
6014   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
6015
6016 def err_invalid_non_static_member_use : Error<
6017   "invalid use of non-static data member %0">;
6018 def err_nested_non_static_member_use : Error<
6019   "%select{call to non-static member function|use of non-static data member}0 "
6020   "%2 of %1 from nested type %3">;
6021 def warn_cxx98_compat_non_static_member_use : Warning<
6022   "use of non-static data member %0 in an unevaluated context is "
6023   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
6024 def err_invalid_incomplete_type_use : Error<
6025   "invalid use of incomplete type %0">;
6026 def err_builtin_func_cast_more_than_one_arg : Error<
6027   "function-style cast to a builtin type can only take one argument">;
6028 def err_value_init_for_array_type : Error<
6029   "array types cannot be value-initialized">;
6030 def err_init_for_function_type : Error<
6031   "cannot create object of function type %0">;
6032 def warn_format_nonliteral_noargs : Warning<
6033   "format string is not a string literal (potentially insecure)">,
6034   InGroup<FormatSecurity>;
6035 def warn_format_nonliteral : Warning<
6036   "format string is not a string literal">,
6037   InGroup<FormatNonLiteral>, DefaultIgnore;
6038
6039 def err_unexpected_interface : Error<
6040   "unexpected interface name %0: expected expression">;
6041 def err_ref_non_value : Error<"%0 does not refer to a value">;
6042 def err_ref_vm_type : Error<
6043   "cannot refer to declaration with a variably modified type inside block">;
6044 def err_ref_flexarray_type : Error<
6045   "cannot refer to declaration of structure variable with flexible array member "
6046   "inside block">;
6047 def err_ref_array_type : Error<
6048   "cannot refer to declaration with an array type inside block">;
6049 def err_property_not_found : Error<
6050   "property %0 not found on object of type %1">;
6051 def err_invalid_property_name : Error<
6052   "%0 is not a valid property name (accessing an object of type %1)">;
6053 def err_getter_not_found : Error<
6054   "no getter method for read from property">;
6055 def err_objc_subscript_method_not_found : Error<
6056   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
6057   "found on object of type %0">;
6058 def err_objc_subscript_index_type : Error<
6059   "method index parameter type %0 is not integral type">;
6060 def err_objc_subscript_key_type : Error<
6061   "method key parameter type %0 is not object type">;
6062 def err_objc_subscript_dic_object_type : Error<
6063   "method object parameter type %0 is not object type">;
6064 def err_objc_subscript_object_type : Error<
6065   "cannot assign to this %select{dictionary|array}1 because assigning method's "
6066   "2nd parameter of type %0 is not an Objective-C pointer type">;
6067 def err_objc_subscript_base_type : Error<
6068   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
6069 def err_objc_multiple_subscript_type_conversion : Error<
6070   "indexing expression is invalid because subscript type %0 has "
6071   "multiple type conversion functions">;
6072 def err_objc_subscript_type_conversion : Error<
6073   "indexing expression is invalid because subscript type %0 is not an integral"
6074   " or Objective-C pointer type">;
6075 def err_objc_subscript_pointer : Error<
6076   "indexing expression is invalid because subscript type %0 is not an"
6077   " Objective-C pointer">;
6078 def err_objc_indexing_method_result_type : Error<
6079   "method for accessing %select{dictionary|array}1 element must have Objective-C"
6080   " object return type instead of %0">;
6081 def err_objc_index_incomplete_class_type : Error<
6082   "Objective-C index expression has incomplete class type %0">;
6083 def err_illegal_container_subscripting_op : Error<
6084   "illegal operation on Objective-C container subscripting">;
6085 def err_property_not_found_forward_class : Error<
6086   "property %0 cannot be found in forward class object %1">;
6087 def err_property_not_as_forward_class : Error<
6088   "property %0 refers to an incomplete Objective-C class %1 "
6089   "(with no @interface available)">;
6090 def note_forward_class : Note<
6091   "forward declaration of class here">;
6092 def err_duplicate_property : Error<
6093   "property has a previous declaration">;
6094 def ext_gnu_void_ptr : Extension<
6095   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
6096   InGroup<PointerArith>;
6097 def ext_gnu_ptr_func_arith : Extension<
6098   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
6099   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
6100   InGroup<PointerArith>;
6101 def err_readonly_message_assignment : Error<
6102   "assigning to 'readonly' return result of an Objective-C message not allowed">;
6103 def ext_integer_increment_complex : Extension<
6104   "ISO C does not support '++'/'--' on complex integer type %0">;
6105 def ext_integer_complement_complex : Extension<
6106   "ISO C does not support '~' for complex conjugation of %0">;
6107 def err_nosetter_property_assignment : Error<
6108   "%select{assignment to readonly property|"
6109   "no setter method %1 for assignment to property}0">;
6110 def err_nosetter_property_incdec : Error<
6111   "%select{%select{increment|decrement}1 of readonly property|"
6112   "no setter method %2 for %select{increment|decrement}1 of property}0">;
6113 def err_nogetter_property_compound_assignment : Error<
6114   "a getter method is needed to perform a compound assignment on a property">;
6115 def err_nogetter_property_incdec : Error<
6116   "no getter method %1 for %select{increment|decrement}0 of property">;
6117 def err_no_subobject_property_setting : Error<
6118   "expression is not assignable">;
6119 def err_qualified_objc_access : Error<
6120   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
6121   
6122 def ext_freestanding_complex : Extension<
6123   "complex numbers are an extension in a freestanding C99 implementation">;
6124
6125 // FIXME: Remove when we support imaginary.
6126 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
6127
6128 // Obj-c expressions
6129 def warn_root_inst_method_not_found : Warning<
6130   "instance method %0 is being used on 'Class' which is not in the root class">,
6131   InGroup<MethodAccess>;
6132 def warn_class_method_not_found : Warning<
6133   "class method %objcclass0 not found (return type defaults to 'id')">,
6134   InGroup<MethodAccess>;
6135 def warn_instance_method_on_class_found : Warning<
6136   "instance method %0 found instead of class method %1">,
6137   InGroup<MethodAccess>;
6138 def warn_inst_method_not_found : Warning<
6139   "instance method %objcinstance0 not found (return type defaults to 'id')">,
6140   InGroup<MethodAccess>;
6141 def warn_instance_method_not_found_with_typo : Warning<
6142   "instance method %objcinstance0 not found (return type defaults to 'id')"
6143   "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6144 def warn_class_method_not_found_with_typo : Warning<
6145   "class method %objcclass0 not found (return type defaults to 'id')"
6146   "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6147 def err_method_not_found_with_typo : Error<
6148   "%select{instance|class}1 method %0 not found "
6149   "; did you mean %2?">;
6150 def err_no_super_class_message : Error<
6151   "no @interface declaration found in class messaging of %0">;
6152 def err_root_class_cannot_use_super : Error<
6153   "%0 cannot use 'super' because it is a root class">;
6154 def err_invalid_receiver_to_message_super : Error<
6155   "'super' is only valid in a method body">;
6156 def err_invalid_receiver_class_message : Error<
6157   "receiver type %0 is not an Objective-C class">;
6158 def err_missing_open_square_message_send : Error<
6159   "missing '[' at start of message send expression">;
6160 def warn_bad_receiver_type : Warning<
6161   "receiver type %0 is not 'id' or interface pointer, consider "
6162   "casting it to 'id'">,InGroup<ObjCReceiver>;
6163 def err_bad_receiver_type : Error<"bad receiver type %0">;
6164 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6165 def err_unknown_receiver_suggest : Error<
6166   "unknown receiver %0; did you mean %1?">;
6167 def err_objc_throw_expects_object : Error<
6168   "@throw requires an Objective-C object type (%0 invalid)">;
6169 def err_objc_synchronized_expects_object : Error<
6170   "@synchronized requires an Objective-C object type (%0 invalid)">;
6171 def err_rethrow_used_outside_catch : Error<
6172   "@throw (rethrow) used outside of a @catch block">;
6173 def err_attribute_multiple_objc_gc : Error<
6174   "multiple garbage collection attributes specified for type">;
6175 def err_catch_param_not_objc_type : Error<
6176   "@catch parameter is not a pointer to an interface type">;
6177 def err_illegal_qualifiers_on_catch_parm : Error<
6178   "illegal qualifiers on @catch parameter">;
6179 def err_storage_spec_on_catch_parm : Error<
6180   "@catch parameter cannot have storage specifier '%0'">;
6181 def warn_register_objc_catch_parm : Warning<
6182   "'register' storage specifier on @catch parameter will be ignored">;
6183 def err_qualified_objc_catch_parm : Error<
6184   "@catch parameter declarator cannot be qualified">;
6185 def warn_objc_pointer_cxx_catch_fragile : Warning<
6186   "cannot catch an exception thrown with @throw in C++ in the non-unified "
6187   "exception model">, InGroup<ObjCNonUnifiedException>;
6188 def err_objc_object_catch : Error<
6189   "cannot catch an Objective-C object by value">;
6190 def err_incomplete_type_objc_at_encode : Error<
6191   "'@encode' of incomplete type %0">;
6192 def warn_objc_circular_container : Warning<
6193   "adding '%0' to '%1' might cause circular dependency in container">,
6194   InGroup<DiagGroup<"objc-circular-container">>;
6195 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
6196 def warn_objc_unsafe_perform_selector : Warning<
6197   "%0 is incompatible with selectors that return a "
6198   "%select{struct|union|vector}1 type">,
6199   InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
6200 def note_objc_unsafe_perform_selector_method_declared_here :  Note<
6201   "method %0 that returns %1 declared here">;
6202
6203 def warn_setter_getter_impl_required : Warning<
6204   "property %0 requires method %1 to be defined - "
6205   "use @synthesize, @dynamic or provide a method implementation "
6206   "in this class implementation">,
6207   InGroup<ObjCPropertyImpl>;
6208 def warn_setter_getter_impl_required_in_category : Warning<
6209   "property %0 requires method %1 to be defined - "
6210   "use @dynamic or provide a method implementation in this category">,
6211   InGroup<ObjCPropertyImpl>;
6212 def note_parameter_named_here : Note<
6213   "passing argument to parameter %0 here">;
6214 def note_parameter_here : Note<
6215   "passing argument to parameter here">;
6216 def note_method_return_type_change : Note<
6217   "compiler has implicitly changed method %0 return type">;
6218
6219 def warn_impl_required_for_class_property : Warning<
6220   "class property %0 requires method %1 to be defined - "
6221   "use @dynamic or provide a method implementation "
6222   "in this class implementation">,
6223   InGroup<ObjCPropertyImpl>;
6224 def warn_impl_required_in_category_for_class_property : Warning<
6225   "class property %0 requires method %1 to be defined - "
6226   "use @dynamic or provide a method implementation in this category">,
6227   InGroup<ObjCPropertyImpl>;
6228
6229 // C++ casts
6230 // These messages adhere to the TryCast pattern: %0 is an int specifying the
6231 // cast type, %1 is the source type, %2 is the destination type.
6232 def err_bad_reinterpret_cast_overload : Error<
6233   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
6234
6235 def warn_reinterpret_different_from_static : Warning<
6236   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
6237   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
6238   "'static_cast'">, InGroup<ReinterpretBaseClass>;
6239 def note_reinterpret_updowncast_use_static: Note<
6240   "use 'static_cast' to adjust the pointer correctly while "
6241   "%select{upcasting|downcasting}0">;
6242
6243 def err_bad_static_cast_overload : Error<
6244   "address of overloaded function %0 cannot be static_cast to type %1">;
6245
6246 def err_bad_cstyle_cast_overload : Error<
6247   "address of overloaded function %0 cannot be cast to type %1">;
6248
6249
6250 def err_bad_cxx_cast_generic : Error<
6251   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6252   "functional-style cast}0 from %1 to %2 is not allowed">;
6253 def err_bad_cxx_cast_unrelated_class : Error<
6254   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6255   "functional-style cast}0 from %1 to %2, which are not related by "
6256   "inheritance, is not allowed">;
6257 def note_type_incomplete : Note<"%0 is incomplete">;
6258 def err_bad_cxx_cast_rvalue : Error<
6259   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6260   "functional-style cast}0 from rvalue to reference type %2">;
6261 def err_bad_cxx_cast_bitfield : Error<
6262   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6263   "functional-style cast}0 from bit-field lvalue to reference type %2">;
6264 def err_bad_cxx_cast_qualifiers_away : Error<
6265   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6266   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
6267 def err_bad_const_cast_dest : Error<
6268   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
6269   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
6270 def ext_cast_fn_obj : Extension<
6271   "cast between pointer-to-function and pointer-to-object is an extension">;
6272 def ext_ms_cast_fn_obj : ExtWarn<
6273   "static_cast between pointer-to-function and pointer-to-object is a "
6274   "Microsoft extension">, InGroup<MicrosoftCast>;
6275 def warn_cxx98_compat_cast_fn_obj : Warning<
6276   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
6277   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6278 def err_bad_reinterpret_cast_small_int : Error<
6279   "cast from pointer to smaller type %2 loses information">;
6280 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
6281   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6282   "to scalar %2 of different size">;
6283 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6284   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
6285   "to vector %2 of different size">;
6286 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6287   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6288   "to vector %2 of different size">;
6289 def err_bad_lvalue_to_rvalue_cast : Error<
6290   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6291   "not compatible">;
6292 def err_bad_rvalue_to_rvalue_cast : Error<
6293   "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6294   "not compatible">;
6295 def err_bad_static_cast_pointer_nonpointer : Error<
6296   "cannot cast from type %1 to pointer type %2">;
6297 def err_bad_static_cast_member_pointer_nonmp : Error<
6298   "cannot cast from type %1 to member pointer type %2">;
6299 def err_bad_cxx_cast_member_pointer_size : Error<
6300   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6301   "type %1 to member pointer type %2 of different size">;
6302 def err_bad_reinterpret_cast_reference : Error<
6303   "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6304 def warn_undefined_reinterpret_cast : Warning<
6305   "reinterpret_cast from %0 to %1 has undefined behavior">,
6306   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6307
6308 // These messages don't adhere to the pattern.
6309 // FIXME: Display the path somehow better.
6310 def err_ambiguous_base_to_derived_cast : Error<
6311   "ambiguous cast from base %0 to derived %1:%2">;
6312 def err_static_downcast_via_virtual : Error<
6313   "cannot cast %0 to %1 via virtual base %2">;
6314 def err_downcast_from_inaccessible_base : Error<
6315   "cannot cast %select{private|protected}2 base class %1 to %0">;
6316 def err_upcast_to_inaccessible_base : Error<
6317   "cannot cast %0 to its %select{private|protected}2 base class %1">;
6318 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6319   "%0 is not a reference or pointer">;
6320 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6321 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6322 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6323 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6324
6325 // Other C++ expressions
6326 def err_need_header_before_typeid : Error<
6327   "you need to include <typeinfo> before using the 'typeid' operator">;
6328 def err_need_header_before_ms_uuidof : Error<
6329   "you need to include <guiddef.h> before using the '__uuidof' operator">;
6330 def err_ms___leave_not_in___try : Error<
6331   "'__leave' statement not in __try block">;
6332 def err_uuidof_without_guid : Error<
6333   "cannot call operator __uuidof on a type with no GUID">;
6334 def err_uuidof_with_multiple_guids : Error<
6335   "cannot call operator __uuidof on a type with multiple GUIDs">;
6336 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6337 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6338 def err_static_illegal_in_new : Error<
6339   "the 'static' modifier for the array size is not legal in new expressions">;
6340 def err_array_new_needs_size : Error<
6341   "array size must be specified in new expressions">;
6342 def err_bad_new_type : Error<
6343   "cannot allocate %select{function|reference}1 type %0 with new">;
6344 def err_new_incomplete_type : Error<
6345   "allocation of incomplete type %0">;
6346 def err_new_array_nonconst : Error<
6347   "only the first dimension of an allocated array may have dynamic size">;
6348 def err_new_array_init_args : Error<
6349   "array 'new' cannot have initialization arguments">;
6350 def ext_new_paren_array_nonconst : ExtWarn<
6351   "when type is in parentheses, array cannot have dynamic size">;
6352 def err_placement_new_non_placement_delete : Error<
6353   "'new' expression with placement arguments refers to non-placement "
6354   "'operator delete'">;
6355 def err_array_size_not_integral : Error<
6356   "array size expression must have integral or %select{|unscoped }0"
6357   "enumeration type, not %1">;
6358 def err_array_size_incomplete_type : Error<
6359   "array size expression has incomplete class type %0">;
6360 def err_array_size_explicit_conversion : Error<
6361   "array size expression of type %0 requires explicit conversion to type %1">;
6362 def note_array_size_conversion : Note<
6363   "conversion to %select{integral|enumeration}0 type %1 declared here">;
6364 def err_array_size_ambiguous_conversion : Error<
6365   "ambiguous conversion of array size expression of type %0 to an integral or "
6366   "enumeration type">;
6367 def ext_array_size_conversion : Extension<
6368   "implicit conversion from array size expression of type %0 to "
6369   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6370   InGroup<CXX11>;
6371 def warn_cxx98_compat_array_size_conversion : Warning<
6372   "implicit conversion from array size expression of type %0 to "
6373   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6374   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6375 def err_address_space_qualified_new : Error<
6376   "'new' cannot allocate objects of type %0 in address space '%1'">;
6377 def err_address_space_qualified_delete : Error<
6378   "'delete' cannot delete objects of type %0 in address space '%1'">;
6379
6380 def err_default_init_const : Error<
6381   "default initialization of an object of const type %0"
6382   "%select{| without a user-provided default constructor}1">;
6383 def ext_default_init_const : ExtWarn<
6384   "default initialization of an object of const type %0"
6385   "%select{| without a user-provided default constructor}1 "
6386   "is a Microsoft extension">,
6387   InGroup<MicrosoftConstInit>;
6388 def err_delete_operand : Error<"cannot delete expression of type %0">;
6389 def ext_delete_void_ptr_operand : ExtWarn<
6390   "cannot delete expression with pointer-to-'void' type %0">,
6391   InGroup<DeleteIncomplete>;
6392 def err_ambiguous_delete_operand : Error<
6393   "ambiguous conversion of delete expression of type %0 to a pointer">;
6394 def warn_delete_incomplete : Warning<
6395   "deleting pointer to incomplete type %0 may cause undefined behavior">,
6396   InGroup<DeleteIncomplete>;
6397 def err_delete_incomplete_class_type : Error<
6398   "deleting incomplete class type %0; no conversions to pointer type">;
6399 def err_delete_explicit_conversion : Error<
6400   "converting delete expression from type %0 to type %1 invokes an explicit "
6401   "conversion function">;
6402 def note_delete_conversion : Note<"conversion to pointer type %0">;
6403 def warn_delete_array_type : Warning<
6404   "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6405 def warn_mismatched_delete_new : Warning<
6406   "'delete%select{|[]}0' applied to a pointer that was allocated with "
6407   "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6408   InGroup<DiagGroup<"mismatched-new-delete">>;
6409 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6410 def err_no_suitable_delete_member_function_found : Error<
6411   "no suitable member %0 in %1">;
6412 def err_ambiguous_suitable_delete_member_function_found : Error<
6413   "multiple suitable %0 functions in %1">;
6414 def warn_ambiguous_suitable_delete_function_found : Warning<
6415   "multiple suitable %0 functions for %1; no 'operator delete' function "
6416   "will be invoked if initialization throws an exception">,
6417   InGroup<DiagGroup<"ambiguous-delete">>;
6418 def note_member_declared_here : Note<
6419   "member %0 declared here">;
6420 def note_member_first_declared_here : Note<
6421   "member %0 first declared here">;
6422 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6423 def warn_increment_bool : Warning<
6424   "incrementing expression of type bool is deprecated and "
6425   "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
6426 def ext_increment_bool : ExtWarn<
6427   "ISO C++17 does not allow incrementing expression of type bool">,
6428   DefaultError, InGroup<IncrementBool>;
6429 def err_increment_decrement_enum : Error<
6430   "cannot %select{decrement|increment}0 expression of enum type %1">;
6431 def err_catch_incomplete_ptr : Error<
6432   "cannot catch pointer to incomplete type %0">;
6433 def err_catch_incomplete_ref : Error<
6434   "cannot catch reference to incomplete type %0">;
6435 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6436 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6437 def err_catch_variably_modified : Error<
6438   "cannot catch variably modified type %0">;
6439 def err_qualified_catch_declarator : Error<
6440   "exception declarator cannot be qualified">;
6441 def err_early_catch_all : Error<"catch-all handler must come last">;
6442 def err_bad_memptr_rhs : Error<
6443   "right hand operand to %0 has non-pointer-to-member type %1">;
6444 def err_bad_memptr_lhs : Error<
6445   "left hand operand to %0 must be a %select{|pointer to }1class "
6446   "compatible with the right hand operand, but is %2">;
6447 def warn_exception_caught_by_earlier_handler : Warning<
6448   "exception of type %0 will be caught by earlier handler">,
6449   InGroup<Exceptions>;
6450 def note_previous_exception_handler : Note<"for type %0">;
6451 def err_exceptions_disabled : Error<
6452   "cannot use '%0' with exceptions disabled">;
6453 def err_objc_exceptions_disabled : Error<
6454   "cannot use '%0' with Objective-C exceptions disabled">;
6455 def warn_throw_in_noexcept_func : Warning<
6456   "%0 has a non-throwing exception specification but can still throw">,
6457   InGroup<Exceptions>;
6458 def note_throw_in_dtor : Note<
6459   "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
6460   "non-throwing}1 exception specification">;
6461 def note_throw_in_function : Note<"function declared non-throwing here">;
6462 def err_seh_try_outside_functions : Error<
6463   "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6464 def err_mixing_cxx_try_seh_try : Error<
6465   "cannot use C++ 'try' in the same function as SEH '__try'">;
6466 def err_seh_try_unsupported : Error<
6467   "SEH '__try' is not supported on this target">;
6468 def note_conflicting_try_here : Note<
6469   "conflicting %0 here">;
6470 def warn_jump_out_of_seh_finally : Warning<
6471   "jump out of __finally block has undefined behavior">,
6472   InGroup<DiagGroup<"jump-seh-finally">>;
6473 def warn_non_virtual_dtor : Warning<
6474   "%0 has virtual functions but non-virtual destructor">,
6475   InGroup<NonVirtualDtor>, DefaultIgnore;
6476 def warn_delete_non_virtual_dtor : Warning<
6477   "%select{delete|destructor}0 called on non-final %1 that has "
6478   "virtual functions but non-virtual destructor">,
6479   InGroup<DeleteNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader;
6480 def note_delete_non_virtual : Note<
6481   "qualify call to silence this warning">;
6482 def warn_delete_abstract_non_virtual_dtor : Warning<
6483   "%select{delete|destructor}0 called on %1 that is abstract but has "
6484   "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>, ShowInSystemHeader;
6485 def warn_overloaded_virtual : Warning<
6486   "%q0 hides overloaded virtual %select{function|functions}1">,
6487   InGroup<OverloadedVirtual>, DefaultIgnore;
6488 def note_hidden_overloaded_virtual_declared_here : Note<
6489   "hidden overloaded virtual function %q0 declared here"
6490   "%select{|: different classes%diff{ ($ vs $)|}2,3"
6491   "|: different number of parameters (%2 vs %3)"
6492   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6493   "|: different return type%diff{ ($ vs $)|}2,3"
6494   "|: different qualifiers ("
6495   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6496   "volatile and restrict|const, volatile, and restrict}2 vs "
6497   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6498   "volatile and restrict|const, volatile, and restrict}3)"
6499   "|: different exception specifications}1">;
6500 def warn_using_directive_in_header : Warning<
6501   "using namespace directive in global context in header">,
6502   InGroup<HeaderHygiene>, DefaultIgnore;
6503 def warn_overaligned_type : Warning<
6504   "type %0 requires %1 bytes of alignment and the default allocator only "
6505   "guarantees %2 bytes">,
6506   InGroup<OveralignedType>, DefaultIgnore;
6507 def warn_aligned_allocation_unavailable :Warning<
6508   "aligned %select{allocation|deallocation}0 function of type '%1' is only "
6509   "available on %2 %3 or newer">, InGroup<AlignedAllocationUnavailable>, DefaultError;
6510 def note_silence_unligned_allocation_unavailable : Note<
6511   "if you supply your own aligned allocation functions, use "
6512   "-Wno-aligned-allocation-unavailable to silence this diagnostic">;
6513
6514 def err_conditional_void_nonvoid : Error<
6515   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6516   "is of type %0">;
6517 def err_conditional_ambiguous : Error<
6518   "conditional expression is ambiguous; "
6519   "%diff{$ can be converted to $ and vice versa|"
6520   "types can be convert to each other}0,1">;
6521 def err_conditional_ambiguous_ovl : Error<
6522   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6523   "can be converted to several common types">;
6524 def err_conditional_vector_size : Error<
6525   "vector condition type %0 and result type %1 do not have the same number "
6526   "of elements">;
6527 def err_conditional_vector_element_size : Error<
6528   "vector condition type %0 and result type %1 do not have elements of the "
6529   "same size">;
6530
6531 def err_throw_incomplete : Error<
6532   "cannot throw object of incomplete type %0">;
6533 def err_throw_incomplete_ptr : Error<
6534   "cannot throw pointer to object of incomplete type %0">;
6535 def err_return_in_constructor_handler : Error<
6536   "return in the catch of a function try block of a constructor is illegal">;
6537 def warn_cdtor_function_try_handler_mem_expr : Warning<
6538   "cannot refer to a non-static member from the handler of a "
6539   "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6540
6541 let CategoryName = "Lambda Issue" in {
6542   def err_capture_more_than_once : Error<
6543     "%0 can appear only once in a capture list">;
6544   def err_reference_capture_with_reference_default : Error<
6545     "'&' cannot precede a capture when the capture default is '&'">;
6546   def err_copy_capture_with_copy_default : Error<
6547     "'&' must precede a capture when the capture default is '='">;
6548   def err_capture_does_not_name_variable : Error<
6549     "%0 in capture list does not name a variable">;
6550   def err_capture_non_automatic_variable : Error<
6551     "%0 cannot be captured because it does not have automatic storage "
6552     "duration">;
6553   def err_this_capture : Error<
6554     "'this' cannot be %select{implicitly |}0captured in this context">;
6555   def err_lambda_capture_anonymous_var : Error<
6556     "unnamed variable cannot be implicitly captured in a lambda expression">;
6557   def err_lambda_capture_flexarray_type : Error<
6558     "variable %0 with flexible array member cannot be captured in "
6559     "a lambda expression">;
6560   def err_lambda_impcap : Error<
6561     "variable %0 cannot be implicitly captured in a lambda with no "
6562     "capture-default specified">;
6563   def note_lambda_decl : Note<"lambda expression begins here">;
6564   def err_lambda_unevaluated_operand : Error<
6565     "lambda expression in an unevaluated operand">;
6566   def err_lambda_in_constant_expression : Error<
6567     "a lambda expression may not appear inside of a constant expression">;
6568   def err_lambda_return_init_list : Error<
6569     "cannot deduce lambda return type from initializer list">;
6570   def err_lambda_capture_default_arg : Error<
6571     "lambda expression in default argument cannot capture any entity">;
6572   def err_lambda_incomplete_result : Error<
6573     "incomplete result type %0 in lambda expression">;
6574   def err_noreturn_lambda_has_return_expr : Error<
6575     "lambda declared 'noreturn' should not return">;
6576   def warn_maybe_falloff_nonvoid_lambda : Warning<
6577     "control may reach end of non-void lambda">,
6578     InGroup<ReturnType>;
6579   def warn_falloff_nonvoid_lambda : Warning<
6580     "control reaches end of non-void lambda">,
6581     InGroup<ReturnType>;
6582   def err_access_lambda_capture : Error<
6583     // The ERRORs represent other special members that aren't constructors, in
6584     // hopes that someone will bother noticing and reporting if they appear
6585     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6586     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6587     AccessControl;
6588   def note_lambda_to_block_conv : Note<
6589     "implicit capture of lambda object due to conversion to block pointer "
6590     "here">;
6591   def note_var_explicitly_captured_here : Note<"variable %0 is"
6592     "%select{| explicitly}1 captured here">;
6593
6594   // C++14 lambda init-captures.
6595   def warn_cxx11_compat_init_capture : Warning<
6596     "initialized lambda captures are incompatible with C++ standards "
6597     "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6598   def ext_init_capture : ExtWarn<
6599     "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6600   def err_init_capture_no_expression : Error<
6601     "initializer missing for lambda capture %0">;
6602   def err_init_capture_multiple_expressions : Error<
6603     "initializer for lambda capture %0 contains multiple expressions">;
6604   def err_init_capture_paren_braces : Error<
6605     "cannot deduce type for lambda capture %1 from "
6606     "%select{parenthesized|nested}0 initializer list">;
6607   def err_init_capture_deduction_failure : Error<
6608     "cannot deduce type for lambda capture %0 from initializer of type %2">;
6609   def err_init_capture_deduction_failure_from_init_list : Error<
6610     "cannot deduce type for lambda capture %0 from initializer list">;
6611
6612   // C++17 '*this' captures.
6613   def warn_cxx14_compat_star_this_lambda_capture : Warning<
6614     "by value capture of '*this' is incompatible with C++ standards before C++17">,
6615      InGroup<CXXPre17Compat>, DefaultIgnore;
6616   def ext_star_this_lambda_capture_cxx17 : ExtWarn<
6617     "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
6618
6619   // C++2a [=, this] captures.
6620   def warn_cxx17_compat_equals_this_lambda_capture : Warning<
6621     "explicit capture of 'this' with a capture default of '=' is incompatible "
6622     "with C++ standards before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
6623   def ext_equals_this_lambda_capture_cxx2a : ExtWarn<
6624     "explicit capture of 'this' with a capture default of '=' "
6625     "is a C++2a extension">, InGroup<CXX2a>;
6626 }
6627
6628 def err_return_in_captured_stmt : Error<
6629   "cannot return from %0">;
6630 def err_capture_block_variable : Error<
6631   "__block variable %0 cannot be captured in a "
6632   "%select{lambda expression|captured statement}1">;
6633
6634 def err_operator_arrow_circular : Error<
6635   "circular pointer delegation detected">;
6636 def err_operator_arrow_depth_exceeded : Error<
6637   "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6638   "'operator->' calls">;
6639 def note_operator_arrow_here : Note<
6640   "'operator->' declared here produces an object of type %0">;
6641 def note_operator_arrows_suppressed : Note<
6642   "(skipping %0 'operator->'%s0 in backtrace)">;
6643 def note_operator_arrow_depth : Note<
6644   "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6645
6646 def err_pseudo_dtor_base_not_scalar : Error<
6647   "object expression of non-scalar type %0 cannot be used in a "
6648   "pseudo-destructor expression">;
6649 def ext_pseudo_dtor_on_void : ExtWarn<
6650   "pseudo-destructors on type void are a Microsoft extension">,
6651   InGroup<MicrosoftVoidPseudoDtor>;
6652 def err_pseudo_dtor_type_mismatch : Error<
6653   "the type of object expression "
6654   "%diff{($) does not match the type being destroyed ($)|"
6655   "does not match the type being destroyed}0,1 "
6656   "in pseudo-destructor expression">;
6657 def err_pseudo_dtor_call_with_args : Error<
6658   "call to pseudo-destructor cannot have any arguments">;
6659 def err_dtor_expr_without_call : Error<
6660   "reference to %select{destructor|pseudo-destructor}0 must be called"
6661   "%select{|; did you mean to call it with no arguments?}1">;
6662 def err_pseudo_dtor_destructor_non_type : Error<
6663   "%0 does not refer to a type name in pseudo-destructor expression; expected "
6664   "the name of type %1">;
6665 def err_invalid_use_of_function_type : Error<
6666   "a function type is not allowed here">;
6667 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6668 def err_typecheck_bool_condition : Error<
6669   "value of type %0 is not contextually convertible to 'bool'">;
6670 def err_typecheck_ambiguous_condition : Error<
6671   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6672 def err_typecheck_nonviable_condition : Error<
6673   "no viable conversion%select{%diff{ from $ to $|}1,2|"
6674   "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6675 def err_typecheck_nonviable_condition_incomplete : Error<
6676   "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6677 def err_typecheck_deleted_function : Error<
6678   "conversion function %diff{from $ to $|between types}0,1 "
6679   "invokes a deleted function">;
6680   
6681 def err_expected_class_or_namespace : Error<"%0 is not a class"
6682   "%select{ or namespace|, namespace, or enumeration}1">;
6683 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6684   "because namespace %1 does not enclose namespace %2">;
6685 def err_invalid_declarator_global_scope : Error<
6686   "definition or redeclaration of %0 cannot name the global scope">;
6687 def err_invalid_declarator_in_function : Error<
6688   "definition or redeclaration of %0 not allowed inside a function">;
6689 def err_invalid_declarator_in_block : Error<
6690   "definition or redeclaration of %0 not allowed inside a block">;
6691 def err_not_tag_in_scope : Error<
6692   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6693
6694 def err_no_typeid_with_fno_rtti : Error<
6695   "cannot use typeid with -fno-rtti">;
6696 def err_no_dynamic_cast_with_fno_rtti : Error<
6697   "cannot use dynamic_cast with -fno-rtti">;
6698
6699 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6700   "cannot form a pointer-to-member to member %0 of reference type %1">;
6701 def err_incomplete_object_call : Error<
6702   "incomplete type in call to object of type %0">;
6703
6704 def warn_condition_is_assignment : Warning<"using the result of an "
6705   "assignment as a condition without parentheses">,
6706   InGroup<Parentheses>;
6707 // Completely identical except off by default.
6708 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6709   "of an assignment as a condition without parentheses">,
6710   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6711 def note_condition_assign_to_comparison : Note<
6712   "use '==' to turn this assignment into an equality comparison">;
6713 def note_condition_or_assign_to_comparison : Note<
6714   "use '!=' to turn this compound assignment into an inequality comparison">;
6715 def note_condition_assign_silence : Note<
6716   "place parentheses around the assignment to silence this warning">;
6717
6718 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6719   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6720 def note_equality_comparison_to_assign : Note<
6721   "use '=' to turn this equality comparison into an assignment">;
6722 def note_equality_comparison_silence : Note<
6723   "remove extraneous parentheses around the comparison to silence this warning">;
6724
6725 // assignment related diagnostics (also for argument passing, returning, etc).
6726 // In most of these diagnostics the %2 is a value from the
6727 // Sema::AssignmentAction enumeration
6728 def err_typecheck_convert_incompatible : Error<
6729   "%select{%diff{assigning to $ from incompatible type $|"
6730   "assigning to type from incompatible type}0,1"
6731   "|%diff{passing $ to parameter of incompatible type $|"
6732   "passing type to parameter of incompatible type}0,1"
6733   "|%diff{returning $ from a function with incompatible result type $|"
6734   "returning type from a function with incompatible result type}0,1"
6735   "|%diff{converting $ to incompatible type $|"
6736   "converting type to incompatible type}0,1"
6737   "|%diff{initializing $ with an expression of incompatible type $|"
6738   "initializing type with an expression of incompatible type}0,1"
6739   "|%diff{sending $ to parameter of incompatible type $|"
6740   "sending type to parameter of incompatible type}0,1"
6741   "|%diff{casting $ to incompatible type $|"
6742   "casting type to incompatible type}0,1}2"
6743   "%select{|; dereference with *|"
6744   "; take the address with &|"
6745   "; remove *|"
6746   "; remove &}3"
6747   "%select{|: different classes%diff{ ($ vs $)|}5,6"
6748   "|: different number of parameters (%5 vs %6)"
6749   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6750   "|: different return type%diff{ ($ vs $)|}5,6"
6751   "|: different qualifiers ("
6752   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6753   "volatile and restrict|const, volatile, and restrict}5 vs "
6754   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6755   "volatile and restrict|const, volatile, and restrict}6)"
6756   "|: different exception specifications}4">;
6757 def err_typecheck_missing_return_type_incompatible : Error<
6758   "%diff{return type $ must match previous return type $|"
6759   "return type must match previous return type}0,1 when %select{block "
6760   "literal|lambda expression}2 has unspecified explicit return type">;
6761
6762 def note_incomplete_class_and_qualified_id : Note<
6763   "conformance of forward class %0 to protocol %1 can not be confirmed">;
6764 def warn_incompatible_qualified_id : Warning<
6765   "%select{%diff{assigning to $ from incompatible type $|"
6766   "assigning to type from incompatible type}0,1"
6767   "|%diff{passing $ to parameter of incompatible type $|"
6768   "passing type to parameter of incompatible type}0,1"
6769   "|%diff{returning $ from a function with incompatible result type $|"
6770   "returning type from a function with incompatible result type}0,1"
6771   "|%diff{converting $ to incompatible type $|"
6772   "converting type to incompatible type}0,1"
6773   "|%diff{initializing $ with an expression of incompatible type $|"
6774   "initializing type with an expression of incompatible type}0,1"
6775   "|%diff{sending $ to parameter of incompatible type $|"
6776   "sending type to parameter of incompatible type}0,1"
6777   "|%diff{casting $ to incompatible type $|"
6778   "casting type to incompatible type}0,1}2">;
6779 def ext_typecheck_convert_pointer_int : ExtWarn<
6780   "incompatible pointer to integer conversion "
6781   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6782   "|%diff{passing $ to parameter of type $|"
6783   "passing to parameter of different type}0,1"
6784   "|%diff{returning $ from a function with result type $|"
6785   "returning from function with different return type}0,1"
6786   "|%diff{converting $ to type $|converting between types}0,1"
6787   "|%diff{initializing $ with an expression of type $|"
6788   "initializing with expression of different type}0,1"
6789   "|%diff{sending $ to parameter of type $|"
6790   "sending to parameter of different type}0,1"
6791   "|%diff{casting $ to type $|casting between types}0,1}2"
6792   "%select{|; dereference with *|"
6793   "; take the address with &|"
6794   "; remove *|"
6795   "; remove &}3">,
6796   InGroup<IntConversion>;
6797 def ext_typecheck_convert_int_pointer : ExtWarn<
6798   "incompatible integer to pointer conversion "
6799   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6800   "|%diff{passing $ to parameter of type $|"
6801   "passing to parameter of different type}0,1"
6802   "|%diff{returning $ from a function with result type $|"
6803   "returning from function with different return type}0,1"
6804   "|%diff{converting $ to type $|converting between types}0,1"
6805   "|%diff{initializing $ with an expression of type $|"
6806   "initializing with expression of different type}0,1"
6807   "|%diff{sending $ to parameter of type $|"
6808   "sending to parameter of different type}0,1"
6809   "|%diff{casting $ to type $|casting between types}0,1}2"
6810   "%select{|; dereference with *|"
6811   "; take the address with &|"
6812   "; remove *|"
6813   "; remove &}3">,
6814   InGroup<IntConversion>;
6815 def ext_typecheck_convert_pointer_void_func : Extension<
6816   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6817   "|%diff{passing $ to parameter of type $|"
6818   "passing to parameter of different type}0,1"
6819   "|%diff{returning $ from a function with result type $|"
6820   "returning from function with different return type}0,1"
6821   "|%diff{converting $ to type $|converting between types}0,1"
6822   "|%diff{initializing $ with an expression of type $|"
6823   "initializing with expression of different type}0,1"
6824   "|%diff{sending $ to parameter of type $|"
6825   "sending to parameter of different type}0,1"
6826   "|%diff{casting $ to type $|casting between types}0,1}2"
6827   " converts between void pointer and function pointer">;
6828 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6829   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6830   "|%diff{passing $ to parameter of type $|"
6831   "passing to parameter of different type}0,1"
6832   "|%diff{returning $ from a function with result type $|"
6833   "returning from function with different return type}0,1"
6834   "|%diff{converting $ to type $|converting between types}0,1"
6835   "|%diff{initializing $ with an expression of type $|"
6836   "initializing with expression of different type}0,1"
6837   "|%diff{sending $ to parameter of type $|"
6838   "sending to parameter of different type}0,1"
6839   "|%diff{casting $ to type $|casting between types}0,1}2"
6840   " converts between pointers to integer types with different sign">,
6841   InGroup<DiagGroup<"pointer-sign">>;
6842 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6843   "incompatible pointer types "
6844   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6845   "|%diff{passing $ to parameter of type $|"
6846   "passing to parameter of different type}0,1"
6847   "|%diff{returning $ from a function with result type $|"
6848   "returning from function with different return type}0,1"
6849   "|%diff{converting $ to type $|converting between types}0,1"
6850   "|%diff{initializing $ with an expression of type $|"
6851   "initializing with expression of different type}0,1"
6852   "|%diff{sending $ to parameter of type $|"
6853   "sending to parameter of different type}0,1"
6854   "|%diff{casting $ to type $|casting between types}0,1}2"
6855   "%select{|; dereference with *|"
6856   "; take the address with &|"
6857   "; remove *|"
6858   "; remove &}3">,
6859   InGroup<IncompatiblePointerTypes>;
6860 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6861   "incompatible function pointer types "
6862   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6863   "|%diff{passing $ to parameter of type $|"
6864   "passing to parameter of different type}0,1"
6865   "|%diff{returning $ from a function with result type $|"
6866   "returning from function with different return type}0,1"
6867   "|%diff{converting $ to type $|converting between types}0,1"
6868   "|%diff{initializing $ with an expression of type $|"
6869   "initializing with expression of different type}0,1"
6870   "|%diff{sending $ to parameter of type $|"
6871   "sending to parameter of different type}0,1"
6872   "|%diff{casting $ to type $|casting between types}0,1}2"
6873   "%select{|; dereference with *|"
6874   "; take the address with &|"
6875   "; remove *|"
6876   "; remove &}3">,
6877   InGroup<IncompatibleFunctionPointerTypes>;
6878 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6879   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6880   "|%diff{passing $ to parameter of type $|"
6881   "passing to parameter of different type}0,1"
6882   "|%diff{returning $ from a function with result type $|"
6883   "returning from function with different return type}0,1"
6884   "|%diff{converting $ to type $|converting between types}0,1"
6885   "|%diff{initializing $ with an expression of type $|"
6886   "initializing with expression of different type}0,1"
6887   "|%diff{sending $ to parameter of type $|"
6888   "sending to parameter of different type}0,1"
6889   "|%diff{casting $ to type $|casting between types}0,1}2"
6890   " discards qualifiers">,
6891   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6892 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6893   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6894   "|%diff{passing $ to parameter of type $|"
6895   "passing to parameter of different type}0,1"
6896   "|%diff{returning $ from a function with result type $|"
6897   "returning from function with different return type}0,1"
6898   "|%diff{converting $ to type $|converting between types}0,1"
6899   "|%diff{initializing $ with an expression of type $|"
6900   "initializing with expression of different type}0,1"
6901   "|%diff{sending $ to parameter of type $|"
6902   "sending to parameter of different type}0,1"
6903   "|%diff{casting $ to type $|casting between types}0,1}2"
6904   " discards qualifiers in nested pointer types">,
6905   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6906 def warn_incompatible_vectors : Warning<
6907   "incompatible vector types "
6908   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6909   "|%diff{passing $ to parameter of type $|"
6910   "passing to parameter of different type}0,1"
6911   "|%diff{returning $ from a function with result type $|"
6912   "returning from function with different return type}0,1"
6913   "|%diff{converting $ to type $|converting between types}0,1"
6914   "|%diff{initializing $ with an expression of type $|"
6915   "initializing with expression of different type}0,1"
6916   "|%diff{sending $ to parameter of type $|"
6917   "sending to parameter of different type}0,1"
6918   "|%diff{casting $ to type $|casting between types}0,1}2">,
6919   InGroup<VectorConversion>, DefaultIgnore;
6920 def err_int_to_block_pointer : Error<
6921   "invalid block pointer conversion "
6922   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6923   "|%diff{passing $ to parameter of type $|"
6924   "passing to parameter of different type}0,1"
6925   "|%diff{returning $ from a function with result type $|"
6926   "returning from function with different return type}0,1"
6927   "|%diff{converting $ to type $|converting between types}0,1"
6928   "|%diff{initializing $ with an expression of type $|"
6929   "initializing with expression of different type}0,1"
6930   "|%diff{sending $ to parameter of type $|"
6931   "sending to parameter of different type}0,1"
6932   "|%diff{casting $ to type $|casting between types}0,1}2">;
6933 def err_typecheck_convert_incompatible_block_pointer : Error<
6934   "incompatible block pointer types "
6935   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6936   "|%diff{passing $ to parameter of type $|"
6937   "passing to parameter of different type}0,1"
6938   "|%diff{returning $ from a function with result type $|"
6939   "returning from function with different return type}0,1"
6940   "|%diff{converting $ to type $|converting between types}0,1"
6941   "|%diff{initializing $ with an expression of type $|"
6942   "initializing with expression of different type}0,1"
6943   "|%diff{sending $ to parameter of type $|"
6944   "sending to parameter of different type}0,1"
6945   "|%diff{casting $ to type $|casting between types}0,1}2">;
6946 def err_typecheck_incompatible_address_space : Error<
6947   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6948   "|%diff{passing $ to parameter of type $|"
6949   "passing to parameter of different type}0,1"
6950   "|%diff{returning $ from a function with result type $|"
6951   "returning from function with different return type}0,1"
6952   "|%diff{converting $ to type $|converting between types}0,1"
6953   "|%diff{initializing $ with an expression of type $|"
6954   "initializing with expression of different type}0,1"
6955   "|%diff{sending $ to parameter of type $|"
6956   "sending to parameter of different type}0,1"
6957   "|%diff{casting $ to type $|casting between types}0,1}2"
6958   " changes address space of pointer">;
6959 def err_typecheck_incompatible_ownership : Error<
6960   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6961   "|%diff{passing $ to parameter of type $|"
6962   "passing to parameter of different type}0,1"
6963   "|%diff{returning $ from a function with result type $|"
6964   "returning from function with different return type}0,1"
6965   "|%diff{converting $ to type $|converting between types}0,1"
6966   "|%diff{initializing $ with an expression of type $|"
6967   "initializing with expression of different type}0,1"
6968   "|%diff{sending $ to parameter of type $|"
6969   "sending to parameter of different type}0,1"
6970   "|%diff{casting $ to type $|casting between types}0,1}2"
6971   " changes retain/release properties of pointer">;
6972 def err_typecheck_comparison_of_distinct_blocks : Error<
6973   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6974
6975 def err_typecheck_array_not_modifiable_lvalue : Error<
6976   "array type %0 is not assignable">;
6977 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6978   "non-object type %0 is not assignable">;
6979 def err_typecheck_expression_not_modifiable_lvalue : Error<
6980   "expression is not assignable">;
6981 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6982   "incomplete type %0 is not assignable">;
6983 def err_typecheck_lvalue_casts_not_supported : Error<
6984   "assignment to cast is illegal, lvalue casts are not supported">;
6985
6986 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6987   "vector is not assignable (contains duplicate components)">;
6988 def err_block_decl_ref_not_modifiable_lvalue : Error<
6989   "variable is not assignable (missing __block type specifier)">;
6990 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6991   "cannot assign to a variable captured by copy in a non-mutable lambda">;
6992 def err_typecheck_call_not_function : Error<
6993   "called object type %0 is not a function or function pointer">;
6994 def err_call_incomplete_return : Error<
6995   "calling function with incomplete return type %0">;
6996 def err_call_function_incomplete_return : Error<
6997   "calling %0 with incomplete return type %1">;
6998 def err_call_incomplete_argument : Error<
6999   "argument type %0 is incomplete">;
7000 def err_typecheck_call_too_few_args : Error<
7001   "too few %select{|||execution configuration }0arguments to "
7002   "%select{function|block|method|kernel function}0 call, "
7003   "expected %1, have %2">;
7004 def err_typecheck_call_too_few_args_one : Error<
7005   "too few %select{|||execution configuration }0arguments to "
7006   "%select{function|block|method|kernel function}0 call, "
7007   "single argument %1 was not specified">;
7008 def err_typecheck_call_too_few_args_at_least : Error<
7009   "too few %select{|||execution configuration }0arguments to "
7010   "%select{function|block|method|kernel function}0 call, "
7011   "expected at least %1, have %2">;
7012 def err_typecheck_call_too_few_args_at_least_one : Error<
7013   "too few %select{|||execution configuration }0arguments to "
7014   "%select{function|block|method|kernel function}0 call, "
7015   "at least argument %1 must be specified">;
7016 def err_typecheck_call_too_few_args_suggest : Error<
7017   "too few %select{|||execution configuration }0arguments to "
7018   "%select{function|block|method|kernel function}0 call, "
7019   "expected %1, have %2; did you mean %3?">;
7020 def err_typecheck_call_too_few_args_at_least_suggest : Error<
7021   "too few %select{|||execution configuration }0arguments to "
7022   "%select{function|block|method|kernel function}0 call, "
7023   "expected at least %1, have %2; did you mean %3?">;
7024 def err_typecheck_call_too_many_args : Error<
7025   "too many %select{|||execution configuration }0arguments to "
7026   "%select{function|block|method|kernel function}0 call, "
7027   "expected %1, have %2">;
7028 def err_typecheck_call_too_many_args_one : Error<
7029   "too many %select{|||execution configuration }0arguments to "
7030   "%select{function|block|method|kernel function}0 call, "
7031   "expected single argument %1, have %2 arguments">;
7032 def err_typecheck_call_too_many_args_at_most : Error<
7033   "too many %select{|||execution configuration }0arguments to "
7034   "%select{function|block|method|kernel function}0 call, "
7035   "expected at most %1, have %2">;
7036 def err_typecheck_call_too_many_args_at_most_one : Error<
7037   "too many %select{|||execution configuration }0arguments to "
7038   "%select{function|block|method|kernel function}0 call, "
7039   "expected at most single argument %1, have %2 arguments">;
7040 def err_typecheck_call_too_many_args_suggest : Error<
7041   "too many %select{|||execution configuration }0arguments to "
7042   "%select{function|block|method|kernel function}0 call, "
7043   "expected %1, have %2; did you mean %3?">;
7044 def err_typecheck_call_too_many_args_at_most_suggest : Error<
7045   "too many %select{|||execution configuration }0arguments to "
7046   "%select{function|block|method|kernel function}0 call, "
7047   "expected at most %1, have %2; did you mean %3?">;
7048   
7049 def err_arc_typecheck_convert_incompatible_pointer : Error<
7050   "incompatible pointer types passing retainable parameter of type %0"
7051   "to a CF function expecting %1 type">;
7052   
7053 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
7054
7055 def warn_call_wrong_number_of_arguments : Warning<
7056   "too %select{few|many}0 arguments in call to %1">;
7057 def err_atomic_builtin_must_be_pointer : Error<
7058   "address argument to atomic builtin must be a pointer (%0 invalid)">;
7059 def err_atomic_builtin_must_be_pointer_intptr : Error<
7060   "address argument to atomic builtin must be a pointer to integer or pointer"
7061   " (%0 invalid)">;
7062 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
7063   "address argument to atomic builtin must be a pointer to integer,"
7064   " floating-point or pointer (%0 invalid)">;
7065 def err_atomic_builtin_pointer_size : Error<
7066   "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
7067   "type (%0 invalid)">;
7068 def err_atomic_exclusive_builtin_pointer_size : Error<
7069   "address argument to load or store exclusive builtin must be a pointer to"
7070   " 1,2,4 or 8 byte type (%0 invalid)">;
7071 def err_atomic_op_needs_atomic : Error<
7072   "address argument to atomic operation must be a pointer to _Atomic "
7073   "type (%0 invalid)">;
7074 def err_atomic_op_needs_non_const_atomic : Error<
7075   "address argument to atomic operation must be a pointer to non-%select{const|constant}0 _Atomic "
7076   "type (%1 invalid)">;
7077 def err_atomic_op_needs_non_const_pointer : Error<
7078   "address argument to atomic operation must be a pointer to non-const "
7079   "type (%0 invalid)">;
7080 def err_atomic_op_needs_trivial_copy : Error<
7081   "address argument to atomic operation must be a pointer to a "
7082   "trivially-copyable type (%0 invalid)">;
7083 def err_atomic_op_needs_atomic_int_or_ptr : Error<
7084   "address argument to atomic operation must be a pointer to %select{|atomic }0"
7085   "integer or pointer (%1 invalid)">;
7086 def err_atomic_op_bitwise_needs_atomic_int : Error<
7087   "address argument to bitwise atomic operation must be a pointer to "
7088   "%select{|atomic }0integer (%1 invalid)">;
7089 def warn_atomic_op_has_invalid_memory_order : Warning<
7090   "memory order argument to atomic operation is invalid">,
7091   InGroup<DiagGroup<"atomic-memory-ordering">>;
7092 def err_atomic_op_has_invalid_synch_scope : Error<
7093   "synchronization scope argument to atomic operation is invalid">;
7094
7095 def err_overflow_builtin_must_be_int : Error<
7096   "operand argument to overflow builtin must be an integer (%0 invalid)">;
7097 def err_overflow_builtin_must_be_ptr_int : Error<
7098   "result argument to overflow builtin must be a pointer "
7099   "to a non-const integer (%0 invalid)">;
7100
7101 def err_atomic_load_store_uses_lib : Error<
7102   "atomic %select{load|store}0 requires runtime support that is not "
7103   "available for this target">;
7104
7105 def err_nontemporal_builtin_must_be_pointer : Error<
7106   "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
7107 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
7108   "address argument to nontemporal builtin must be a pointer to integer, float, "
7109   "pointer, or a vector of such types (%0 invalid)">;
7110
7111 def err_deleted_function_use : Error<"attempt to use a deleted function">;
7112 def err_deleted_inherited_ctor_use : Error<
7113   "constructor inherited by %0 from base class %1 is implicitly deleted">;
7114
7115 def note_called_by : Note<"called by %0">;
7116 def err_kern_type_not_void_return : Error<
7117   "kernel function type %0 must have void return type">;
7118 def err_kern_is_nonstatic_method : Error<
7119   "kernel function %0 must be a free function or static member function">;
7120 def err_config_scalar_return : Error<
7121   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
7122 def err_kern_call_not_global_function : Error<
7123   "kernel call to non-global function %0">;
7124 def err_global_call_not_config : Error<
7125   "call to global function %0 not configured">;
7126 def err_ref_bad_target : Error<
7127   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7128   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
7129 def err_ref_bad_target_global_initializer : Error<
7130   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7131   "function %1 in global initializer">;
7132 def warn_kern_is_method : Extension<
7133   "kernel function %0 is a member function; this may not be accepted by nvcc">,
7134   InGroup<CudaCompat>;
7135 def warn_kern_is_inline : Warning<
7136   "ignored 'inline' attribute on kernel function %0">,
7137   InGroup<CudaCompat>;
7138 def err_variadic_device_fn : Error<
7139   "CUDA device code does not support variadic functions">;
7140 def err_va_arg_in_device : Error<
7141   "CUDA device code does not support va_arg">;
7142 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
7143 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
7144   "constexpr function '%0' without __host__ or __device__ attributes cannot "
7145   "overload __device__ function with same signature.  Add a __host__ "
7146   "attribute, or build with -fno-cuda-host-device-constexpr.">;
7147 def note_cuda_conflicting_device_function_declared_here : Note<
7148   "conflicting __device__ function declared here">;
7149 def err_cuda_device_exceptions : Error<
7150   "cannot use '%0' in "
7151   "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
7152 def err_dynamic_var_init : Error<
7153     "dynamic initialization is not supported for "
7154     "__device__, __constant__, and __shared__ variables.">;
7155 def err_shared_var_init : Error<
7156     "initialization is not supported for __shared__ variables.">;
7157 def err_device_static_local_var : Error<
7158     "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
7159     "function, only __shared__ variables may be marked 'static'">;
7160 def err_cuda_vla : Error<
7161     "cannot use variable-length arrays in "
7162     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7163 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
7164 def err_cuda_host_shared : Error<
7165     "__shared__ local variables not allowed in "
7166     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7167 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
7168 def err_cuda_ovl_target : Error<
7169   "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
7170   "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
7171 def note_cuda_ovl_candidate_target_mismatch : Note<
7172     "candidate template ignored: target attributes do not match">;
7173
7174 def warn_non_pod_vararg_with_format_string : Warning<
7175   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
7176   "%select{function|block|method|constructor}2; expected type from format "
7177   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
7178 // The arguments to this diagnostic should match the warning above.
7179 def err_cannot_pass_objc_interface_to_vararg_format : Error<
7180   "cannot pass object with interface type %1 by value to variadic "
7181   "%select{function|block|method|constructor}2; expected type from format "
7182   "string was %3">;
7183
7184 def err_cannot_pass_objc_interface_to_vararg : Error<
7185   "cannot pass object with interface type %0 by value through variadic "
7186   "%select{function|block|method|constructor}1">;
7187 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
7188   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
7189   " %select{function|block|method|constructor}2; call will abort at runtime">,
7190   InGroup<NonPODVarargs>, DefaultError;
7191 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
7192   "passing object of trivial but non-POD type %0 through variadic"
7193   " %select{function|block|method|constructor}1 is incompatible with C++98">,
7194   InGroup<CXX98Compat>, DefaultIgnore;
7195 def warn_pass_class_arg_to_vararg : Warning<
7196   "passing object of class type %0 through variadic "
7197   "%select{function|block|method|constructor}1"
7198   "%select{|; did you mean to call '%3'?}2">,
7199   InGroup<ClassVarargs>, DefaultIgnore;
7200 def err_cannot_pass_to_vararg : Error<
7201   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7202   "%select{function|block|method|constructor}2">;
7203 def err_cannot_pass_to_vararg_format : Error<
7204   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7205   "%select{function|block|method|constructor}2; expected type from format "
7206   "string was %3">;
7207
7208 def err_typecheck_call_invalid_ordered_compare : Error<
7209   "ordered compare requires two args of floating point type"
7210   "%diff{ ($ and $)|}0,1">;
7211 def err_typecheck_call_invalid_unary_fp : Error<
7212   "floating point classification requires argument of floating point type "
7213   "(passed in %0)">;
7214 def err_typecheck_cond_expect_int_float : Error<
7215   "used type %0 where integer or floating point type is required">;
7216 def err_typecheck_cond_expect_scalar : Error<
7217   "used type %0 where arithmetic or pointer type is required">;
7218 def err_typecheck_cond_expect_nonfloat : Error<
7219   "used type %0 where floating point type is not allowed">;
7220 def ext_typecheck_cond_one_void : Extension<
7221   "C99 forbids conditional expressions with only one void side">;
7222 def err_typecheck_cast_to_incomplete : Error<
7223   "cast to incomplete type %0">;
7224 def ext_typecheck_cast_nonscalar : Extension<
7225   "C99 forbids casting nonscalar type %0 to the same type">;
7226 def ext_typecheck_cast_to_union : Extension<
7227   "cast to union type is a GNU extension">,
7228   InGroup<GNUUnionCast>;
7229 def err_typecheck_cast_to_union_no_type : Error<
7230   "cast to union type from type %0 not present in union">;
7231 def err_cast_pointer_from_non_pointer_int : Error<
7232   "operand of type %0 cannot be cast to a pointer type">;
7233 def warn_cast_pointer_from_sel : Warning<
7234   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
7235   InGroup<SelTypeCast>;
7236 def warn_function_def_in_objc_container : Warning<
7237   "function definition inside an Objective-C container is deprecated">,
7238   InGroup<FunctionDefInObjCContainer>;
7239
7240 def warn_cast_calling_conv : Warning<
7241   "cast between incompatible calling conventions '%0' and '%1'; "
7242   "calls through this pointer may abort at runtime">,
7243   InGroup<DiagGroup<"cast-calling-convention">>;
7244 def note_change_calling_conv_fixit : Note<
7245   "consider defining %0 with the '%1' calling convention">;
7246 def warn_bad_function_cast : Warning<
7247   "cast from function call of type %0 to non-matching type %1">,
7248   InGroup<BadFunctionCast>, DefaultIgnore;
7249 def err_cast_pointer_to_non_pointer_int : Error<
7250   "pointer cannot be cast to type %0">;
7251 def err_typecheck_expect_scalar_operand : Error<
7252   "operand of type %0 where arithmetic or pointer type is required">;
7253 def err_typecheck_cond_incompatible_operands : Error<
7254   "incompatible operand types%diff{ ($ and $)|}0,1">;
7255 def err_cast_selector_expr : Error<
7256   "cannot type cast @selector expression">;
7257 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
7258   "pointer type mismatch%diff{ ($ and $)|}0,1">,
7259   InGroup<DiagGroup<"pointer-type-mismatch">>;
7260 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
7261   "pointer/integer type mismatch in conditional expression"
7262   "%diff{ ($ and $)|}0,1">,
7263   InGroup<DiagGroup<"conditional-type-mismatch">>;
7264 def err_typecheck_choose_expr_requires_constant : Error<
7265   "'__builtin_choose_expr' requires a constant expression">;
7266 def warn_unused_expr : Warning<"expression result unused">,
7267   InGroup<UnusedValue>;
7268 def warn_unused_voidptr : Warning<
7269   "expression result unused; should this cast be to 'void'?">,
7270   InGroup<UnusedValue>;
7271 def warn_unused_property_expr : Warning<
7272  "property access result unused - getters should not be used for side effects">,
7273   InGroup<UnusedGetterReturnValue>;
7274 def warn_unused_container_subscript_expr : Warning<
7275  "container access result unused - container access should not be used for side effects">,
7276   InGroup<UnusedValue>;
7277 def warn_unused_call : Warning<
7278   "ignoring return value of function declared with %0 attribute">,
7279   InGroup<UnusedValue>;
7280 def warn_side_effects_unevaluated_context : Warning<
7281   "expression with side effects has no effect in an unevaluated context">,
7282   InGroup<UnevaluatedExpression>;
7283 def warn_side_effects_typeid : Warning<
7284   "expression with side effects will be evaluated despite being used as an "
7285   "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
7286 def warn_unused_result : Warning<
7287   "ignoring return value of function declared with %0 attribute">,
7288   InGroup<UnusedResult>;
7289 def warn_unused_volatile : Warning<
7290   "expression result unused; assign into a variable to force a volatile load">,
7291   InGroup<DiagGroup<"unused-volatile-lvalue">>;
7292
7293 def ext_cxx14_attr : Extension<
7294   "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
7295 def ext_cxx17_attr : Extension<
7296   "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
7297
7298 def warn_unused_comparison : Warning<
7299   "%select{equality|inequality|relational|three-way}0 comparison result unused">,
7300   InGroup<UnusedComparison>;
7301 def note_inequality_comparison_to_or_assign : Note<
7302   "use '|=' to turn this inequality comparison into an or-assignment">;
7303
7304 def err_incomplete_type_used_in_type_trait_expr : Error<
7305   "incomplete type %0 used in type trait expression">;
7306
7307 def err_require_constant_init_failed : Error<
7308   "variable does not have a constant initializer">;
7309 def note_declared_required_constant_init_here : Note<
7310   "required by 'require_constant_initialization' attribute here">;
7311
7312 def err_dimension_expr_not_constant_integer : Error<
7313   "dimension expression does not evaluate to a constant unsigned int">;
7314
7315 def err_typecheck_cond_incompatible_operands_null : Error<
7316   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7317 def ext_empty_struct_union : Extension<
7318   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7319 def ext_no_named_members_in_struct_union : Extension<
7320   "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7321 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7322   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7323   InGroup<CXXCompat>, DefaultIgnore;
7324 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7325   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7326   InGroup<ExternCCompat>;
7327 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7328   "volatile qualifiers|const qualifier|volatile qualifier}2">,
7329   InGroup<CastQual>, DefaultIgnore;
7330 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7331   "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7332 def warn_redefine_extname_not_applied : Warning<
7333   "#pragma redefine_extname is applicable to external C declarations only; "
7334   "not applied to %select{function|variable}0 %1">,
7335   InGroup<Pragmas>;
7336 } // End of general sema category.
7337
7338 // inline asm.
7339 let CategoryName = "Inline Assembly Issue" in {
7340   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7341   def err_asm_invalid_output_constraint : Error<
7342     "invalid output constraint '%0' in asm">;
7343   def err_asm_invalid_lvalue_in_input : Error<
7344     "invalid lvalue in asm input for constraint '%0'">;
7345   def err_asm_invalid_input_constraint : Error<
7346     "invalid input constraint '%0' in asm">;
7347   def err_asm_immediate_expected : Error<"constraint '%0' expects "
7348     "an integer constant expression">;
7349   def err_asm_invalid_type_in_input : Error<
7350     "invalid type %0 in asm input for constraint '%1'">;
7351   def err_asm_tying_incompatible_types : Error<
7352     "unsupported inline asm: input with type "
7353     "%diff{$ matching output with type $|}0,1">;
7354   def err_asm_unexpected_constraint_alternatives : Error<
7355     "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7356   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7357   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7358   def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7359     "global register variables on this target">;
7360   def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7361     "match variable size">;
7362   def err_asm_bad_register_type : Error<"bad type for named register variable">;
7363   def err_asm_invalid_input_size : Error<
7364     "invalid input size for constraint '%0'">;
7365   def err_asm_invalid_output_size : Error<
7366     "invalid output size for constraint '%0'">;
7367   def err_invalid_asm_cast_lvalue : Error<
7368     "invalid use of a cast in a inline asm context requiring an l-value: "
7369     "remove the cast or build with -fheinous-gnu-extensions">;
7370   def err_invalid_asm_value_for_constraint
7371       : Error <"value '%0' out of range for constraint '%1'">;
7372   def err_asm_non_addr_value_in_memory_constraint : Error <
7373     "reference to a %select{bit-field|vector element|global register variable}0"
7374     " in asm %select{input|output}1 with a memory constraint '%2'">;
7375   def err_asm_input_duplicate_match : Error<
7376     "more than one input constraint matches the same output '%0'">;
7377
7378   def warn_asm_label_on_auto_decl : Warning<
7379     "ignored asm label '%0' on automatic variable">;
7380   def warn_invalid_asm_cast_lvalue : Warning<
7381     "invalid use of a cast in an inline asm context requiring an l-value: "
7382     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7383     "for this in the future">;
7384   def warn_asm_mismatched_size_modifier : Warning<
7385     "value size does not match register size specified by the constraint "
7386     "and modifier">,
7387     InGroup<ASMOperandWidths>;
7388
7389   def note_asm_missing_constraint_modifier : Note<
7390     "use constraint modifier \"%0\"">;
7391   def note_asm_input_duplicate_first : Note<
7392     "constraint '%0' is already present here">;
7393 }
7394
7395   def error_inoutput_conflict_with_clobber : Error<
7396     "asm-specifier for input or output variable conflicts with asm"
7397     " clobber list">;
7398
7399 let CategoryName = "Semantic Issue" in {
7400
7401 def err_invalid_conversion_between_vectors : Error<
7402   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7403   "size">;
7404 def err_invalid_conversion_between_vector_and_integer : Error<
7405   "invalid conversion between vector type %0 and integer type %1 "
7406   "of different size">;
7407
7408 def err_opencl_function_pointer : Error<
7409   "pointers to functions are not allowed">;
7410
7411 def err_opencl_taking_address_capture : Error<
7412   "taking address of a capture is not allowed">;
7413
7414 def err_invalid_conversion_between_vector_and_scalar : Error<
7415   "invalid conversion between vector type %0 and scalar type %1">;
7416
7417 // C++ member initializers.
7418 def err_only_constructors_take_base_inits : Error<
7419   "only constructors take base initializers">;
7420
7421 def err_multiple_mem_initialization : Error <
7422   "multiple initializations given for non-static member %0">;
7423 def err_multiple_mem_union_initialization : Error <
7424   "initializing multiple members of union">;
7425 def err_multiple_base_initialization : Error <
7426   "multiple initializations given for base %0">;
7427
7428 def err_mem_init_not_member_or_class : Error<
7429   "member initializer %0 does not name a non-static data member or base "
7430   "class">;
7431
7432 def warn_initializer_out_of_order : Warning<
7433   "%select{field|base class}0 %1 will be initialized after "
7434   "%select{field|base}2 %3">,
7435   InGroup<Reorder>, DefaultIgnore;
7436 def warn_abstract_vbase_init_ignored : Warning<
7437   "initializer for virtual base class %0 of abstract class %1 "
7438   "will never be used">,
7439   InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7440
7441 def err_base_init_does_not_name_class : Error<
7442   "constructor initializer %0 does not name a class">;
7443 def err_base_init_direct_and_virtual : Error<
7444   "base class initializer %0 names both a direct base class and an "
7445   "inherited virtual base class">;
7446 def err_not_direct_base_or_virtual : Error<
7447   "type %0 is not a direct or virtual base of %1">;
7448
7449 def err_in_class_initializer_non_const : Error<
7450   "non-const static data member must be initialized out of line">;
7451 def err_in_class_initializer_volatile : Error<
7452   "static const volatile data member must be initialized out of line">;
7453 def err_in_class_initializer_bad_type : Error<
7454   "static data member of type %0 must be initialized out of line">;
7455 def ext_in_class_initializer_float_type : ExtWarn<
7456   "in-class initializer for static data member of type %0 is a GNU extension">,
7457   InGroup<GNUStaticFloatInit>;
7458 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7459   "in-class initializer for static data member of type %0 requires "
7460   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7461 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7462 def err_in_class_initializer_literal_type : Error<
7463   "in-class initializer for static data member of type %0 requires "
7464   "'constexpr' specifier">;
7465 def err_in_class_initializer_non_constant : Error<
7466   "in-class initializer for static data member is not a constant expression">;
7467 def err_in_class_initializer_not_yet_parsed : Error<
7468   "default member initializer for %1 needed within definition of enclosing "
7469   "class %0 outside of member functions">;
7470 def note_in_class_initializer_not_yet_parsed : Note<
7471   "default member initializer declared here">;
7472 def err_in_class_initializer_cycle
7473     : Error<"default member initializer for %0 uses itself">;
7474 def err_exception_spec_cycle
7475     : Error<"exception specification of %0 uses itself">;
7476
7477 def ext_in_class_initializer_non_constant : Extension<
7478   "in-class initializer for static data member is not a constant expression; "
7479   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7480
7481 def err_thread_dynamic_init : Error<
7482   "initializer for thread-local variable must be a constant expression">;
7483 def err_thread_nontrivial_dtor : Error<
7484   "type of thread-local variable has non-trivial destruction">;
7485 def note_use_thread_local : Note<
7486   "use 'thread_local' to allow this">;
7487
7488 // C++ anonymous unions and GNU anonymous structs/unions
7489 def ext_anonymous_union : Extension<
7490   "anonymous unions are a C11 extension">, InGroup<C11>;
7491 def ext_gnu_anonymous_struct : Extension<
7492   "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7493 def ext_c11_anonymous_struct : Extension<
7494   "anonymous structs are a C11 extension">, InGroup<C11>;
7495 def err_anonymous_union_not_static : Error<
7496   "anonymous unions at namespace or global scope must be declared 'static'">;
7497 def err_anonymous_union_with_storage_spec : Error<
7498   "anonymous union at class scope must not have a storage specifier">;
7499 def err_anonymous_struct_not_member : Error<
7500   "anonymous %select{structs|structs and classes}0 must be "
7501   "%select{struct or union|class}0 members">;
7502 def err_anonymous_record_member_redecl : Error<
7503   "member of anonymous %select{struct|union}0 redeclares %1">;
7504 def err_anonymous_record_with_type : Error<
7505   "types cannot be declared in an anonymous %select{struct|union}0">;
7506 def ext_anonymous_record_with_type : Extension<
7507   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7508   "extension">, InGroup<MicrosoftAnonTag>;
7509 def ext_anonymous_record_with_anonymous_type : Extension<
7510   "anonymous types declared in an anonymous %select{struct|union}0 "
7511   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7512 def err_anonymous_record_with_function : Error<
7513   "functions cannot be declared in an anonymous %select{struct|union}0">;
7514 def err_anonymous_record_with_static : Error<
7515   "static members cannot be declared in an anonymous %select{struct|union}0">;
7516 def err_anonymous_record_bad_member : Error<
7517   "anonymous %select{struct|union}0 can only contain non-static data members">;
7518 def err_anonymous_record_nonpublic_member : Error<
7519   "anonymous %select{struct|union}0 cannot contain a "
7520   "%select{private|protected}1 data member">;
7521 def ext_ms_anonymous_record : ExtWarn<
7522   "anonymous %select{structs|unions}0 are a Microsoft extension">,
7523   InGroup<MicrosoftAnonTag>;
7524
7525 // C++ local classes
7526 def err_reference_to_local_in_enclosing_context : Error<
7527   "reference to local %select{variable|binding}1 %0 declared in enclosing "
7528   "%select{%3|block literal|lambda expression|context}2">;
7529
7530 def err_static_data_member_not_allowed_in_local_class : Error<
7531   "static data member %0 not allowed in local class %1">; 
7532   
7533 // C++ derived classes
7534 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7535 def err_base_must_be_class : Error<"base specifier must name a class">;
7536 def err_union_as_base_class : Error<"unions cannot be base classes">;
7537 def err_circular_inheritance : Error<
7538   "circular inheritance between %0 and %1">;
7539 def err_base_class_has_flexible_array_member : Error<
7540   "base class %0 has a flexible array member">;
7541 def err_incomplete_base_class : Error<"base class has incomplete type">;
7542 def err_duplicate_base_class : Error<
7543   "base class %0 specified more than once as a direct base class">;
7544 def warn_inaccessible_base_class : Warning<
7545   "direct base %0 is inaccessible due to ambiguity:%1">,
7546   InGroup<DiagGroup<"inaccessible-base">>;
7547 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
7548 def err_ambiguous_derived_to_base_conv : Error<
7549   "ambiguous conversion from derived class %0 to base class %1:%2">;
7550 def err_ambiguous_memptr_conv : Error<
7551   "ambiguous conversion from pointer to member of %select{base|derived}0 "
7552   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7553 def ext_ms_ambiguous_direct_base : ExtWarn<
7554   "accessing inaccessible direct base %0 of %1 is a Microsoft extension">,
7555   InGroup<MicrosoftInaccessibleBase>;
7556
7557 def err_memptr_conv_via_virtual : Error<
7558   "conversion from pointer to member of class %0 to pointer to member "
7559   "of class %1 via virtual base %2 is not allowed">;
7560
7561 // C++ member name lookup
7562 def err_ambiguous_member_multiple_subobjects : Error<
7563   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7564 def err_ambiguous_member_multiple_subobject_types : Error<
7565   "member %0 found in multiple base classes of different types">;
7566 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7567 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7568 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7569 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7570   "declaration in a different namespace">;
7571 def note_hidden_tag : Note<"type declaration hidden">;
7572 def note_hiding_object : Note<"declaration hides type">;
7573
7574 // C++ operator overloading
7575 def err_operator_overload_needs_class_or_enum : Error<
7576   "overloaded %0 must have at least one parameter of class "
7577   "or enumeration type">;
7578
7579 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7580 def err_operator_overload_static : Error<
7581   "overloaded %0 cannot be a static member function">;
7582 def err_operator_overload_default_arg : Error<
7583   "parameter of overloaded %0 cannot have a default argument">;
7584 def err_operator_overload_must_be : Error<
7585   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7586   "(has %1 parameter%s1)">;
7587
7588 def err_operator_overload_must_be_member : Error<
7589   "overloaded %0 must be a non-static member function">;
7590 def err_operator_overload_post_incdec_must_be_int : Error<
7591   "parameter of overloaded post-%select{increment|decrement}1 operator must "
7592   "have type 'int' (not %0)">;
7593
7594 // C++ allocation and deallocation functions.
7595 def err_operator_new_delete_declared_in_namespace : Error<
7596   "%0 cannot be declared inside a namespace">;
7597 def err_operator_new_delete_declared_static : Error<
7598   "%0 cannot be declared static in global scope">;
7599 def ext_operator_new_delete_declared_inline : ExtWarn<
7600   "replacement function %0 cannot be declared 'inline'">,
7601   InGroup<DiagGroup<"inline-new-delete">>;
7602 def err_operator_new_delete_invalid_result_type : Error<
7603   "%0 must return type %1">;
7604 def err_operator_new_delete_dependent_result_type : Error<
7605   "%0 cannot have a dependent return type; use %1 instead">;
7606 def err_operator_new_delete_too_few_parameters : Error<
7607   "%0 must have at least one parameter">;
7608 def err_operator_new_delete_template_too_few_parameters : Error<
7609   "%0 template must have at least two parameters">;
7610 def warn_operator_new_returns_null : Warning<
7611   "%0 should not return a null pointer unless it is declared 'throw()'"
7612   "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7613
7614 def err_operator_new_dependent_param_type : Error<
7615   "%0 cannot take a dependent type as first parameter; "
7616   "use size_t (%1) instead">;
7617 def err_operator_new_param_type : Error<
7618   "%0 takes type size_t (%1) as first parameter">;
7619 def err_operator_new_default_arg: Error<
7620   "parameter of %0 cannot have a default argument">;
7621 def err_operator_delete_dependent_param_type : Error<
7622   "%0 cannot take a dependent type as first parameter; use %1 instead">;
7623 def err_operator_delete_param_type : Error<
7624   "first parameter of %0 must have type %1">;
7625 def err_destroying_operator_delete_not_usual : Error<
7626   "destroying operator delete can have only an optional size and optional "
7627   "alignment parameter">;
7628 def note_implicit_delete_this_in_destructor_here : Note<
7629   "while checking implicit 'delete this' for virtual destructor">;
7630
7631 // C++ literal operators
7632 def err_literal_operator_outside_namespace : Error<
7633   "literal operator %0 must be in a namespace or global scope">;
7634 def err_literal_operator_id_outside_namespace : Error<
7635   "non-namespace scope '%0' cannot have a literal operator member">;
7636 def err_literal_operator_default_argument : Error<
7637   "literal operator cannot have a default argument">;
7638 def err_literal_operator_bad_param_count : Error<
7639   "non-template literal operator must have one or two parameters">;
7640 def err_literal_operator_invalid_param : Error<
7641   "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7642 def err_literal_operator_param : Error<
7643   "invalid literal operator parameter type %0, did you mean %1?">;
7644 def err_literal_operator_template_with_params : Error<
7645   "literal operator template cannot have any parameters">;
7646 def err_literal_operator_template : Error<
7647   "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7648 def err_literal_operator_extern_c : Error<
7649   "literal operator must have C++ linkage">;
7650 def ext_string_literal_operator_template : ExtWarn<
7651   "string literal operator templates are a GNU extension">,
7652   InGroup<GNUStringLiteralOperatorTemplate>;
7653 def warn_user_literal_reserved : Warning<
7654   "user-defined literal suffixes not starting with '_' are reserved"
7655   "%select{; no literal will invoke this operator|}0">,
7656   InGroup<UserDefinedLiterals>;
7657
7658 // C++ conversion functions
7659 def err_conv_function_not_member : Error<
7660   "conversion function must be a non-static member function">;
7661 def err_conv_function_return_type : Error<
7662   "conversion function cannot have a return type">;
7663 def err_conv_function_with_params : Error<
7664   "conversion function cannot have any parameters">;
7665 def err_conv_function_variadic : Error<
7666   "conversion function cannot be variadic">;
7667 def err_conv_function_to_array : Error<
7668   "conversion function cannot convert to an array type">;
7669 def err_conv_function_to_function : Error<
7670   "conversion function cannot convert to a function type">;
7671 def err_conv_function_with_complex_decl : Error<
7672   "cannot specify any part of a return type in the "
7673   "declaration of a conversion function"
7674   "%select{"
7675   "; put the complete type after 'operator'|"
7676   "; use a typedef to declare a conversion to %1|"
7677   "; use an alias template to declare a conversion to %1|"
7678   "}0">;
7679 def err_conv_function_redeclared : Error<
7680   "conversion function cannot be redeclared">;
7681 def warn_conv_to_self_not_used : Warning<
7682   "conversion function converting %0 to itself will never be used">;
7683 def warn_conv_to_base_not_used : Warning<
7684   "conversion function converting %0 to its base class %1 will never be used">;
7685 def warn_conv_to_void_not_used : Warning<
7686   "conversion function converting %0 to %1 will never be used">;
7687
7688 def warn_not_compound_assign : Warning<
7689   "use of unary operator that may be intended as compound assignment (%0=)">;
7690
7691 // C++11 explicit conversion operators
7692 def ext_explicit_conversion_functions : ExtWarn<
7693   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7694 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7695   "explicit conversion functions are incompatible with C++98">,
7696   InGroup<CXX98Compat>, DefaultIgnore;
7697
7698 // C++11 defaulted functions
7699 def err_defaulted_special_member_params : Error<
7700   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7701   "have default arguments">;
7702 def err_defaulted_special_member_variadic : Error<
7703   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7704   "be variadic">;
7705 def err_defaulted_special_member_return_type : Error<
7706   "explicitly-defaulted %select{copy|move}0 assignment operator must "
7707   "return %1">;
7708 def err_defaulted_special_member_quals : Error<
7709   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7710   "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7711 def err_defaulted_special_member_volatile_param : Error<
7712   "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
7713   "copy constructor|move constructor|copy assignment operator|"
7714   "move assignment operator|<<ERROR>>}0 may not be volatile">;
7715 def err_defaulted_special_member_move_const_param : Error<
7716   "the parameter for an explicitly-defaulted move "
7717   "%select{constructor|assignment operator}0 may not be const">;
7718 def err_defaulted_special_member_copy_const_param : Error<
7719   "the parameter for this explicitly-defaulted copy "
7720   "%select{constructor|assignment operator}0 is const, but a member or base "
7721   "requires it to be non-const">;
7722 def err_defaulted_copy_assign_not_ref : Error<
7723   "the parameter for an explicitly-defaulted copy assignment operator must be an "
7724   "lvalue reference type">;
7725 def err_incorrect_defaulted_exception_spec : Error<
7726   "exception specification of explicitly defaulted %select{default constructor|"
7727   "copy constructor|move constructor|copy assignment operator|move assignment "
7728   "operator|destructor}0 does not match the "
7729   "calculated one">;
7730 def err_incorrect_defaulted_constexpr : Error<
7731   "defaulted definition of %select{default constructor|copy constructor|"
7732   "move constructor|copy assignment operator|move assignment operator}0 "
7733   "is not constexpr">;
7734 def err_out_of_line_default_deletes : Error<
7735   "defaulting this %select{default constructor|copy constructor|move "
7736   "constructor|copy assignment operator|move assignment operator|destructor}0 "
7737   "would delete it after its first declaration">;
7738 def warn_vbase_moved_multiple_times : Warning<
7739   "defaulted move assignment operator of %0 will move assign virtual base "
7740   "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7741 def note_vbase_moved_here : Note<
7742   "%select{%1 is a virtual base class of base class %2 declared here|"
7743   "virtual base class %1 declared here}0">;
7744
7745 def ext_implicit_exception_spec_mismatch : ExtWarn<
7746   "function previously declared with an %select{explicit|implicit}0 exception "
7747   "specification redeclared with an %select{implicit|explicit}0 exception "
7748   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7749
7750 def warn_ptr_arith_precedes_bounds : Warning<
7751   "the pointer decremented by %0 refers before the beginning of the array">,
7752   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7753 def warn_ptr_arith_exceeds_bounds : Warning<
7754   "the pointer incremented by %0 refers past the end of the array (that "
7755   "contains %1 element%s2)">,
7756   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7757 def warn_array_index_precedes_bounds : Warning<
7758   "array index %0 is before the beginning of the array">,
7759   InGroup<ArrayBounds>;
7760 def warn_array_index_exceeds_bounds : Warning<
7761   "array index %0 is past the end of the array (which contains %1 "
7762   "element%s2)">, InGroup<ArrayBounds>;
7763 def note_array_index_out_of_bounds : Note<
7764   "array %0 declared here">;
7765
7766 def warn_printf_insufficient_data_args : Warning<
7767   "more '%%' conversions than data arguments">, InGroup<Format>;
7768 def warn_printf_data_arg_not_used : Warning<
7769   "data argument not used by format string">, InGroup<FormatExtraArgs>;
7770 def warn_format_invalid_conversion : Warning<
7771   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7772 def warn_printf_incomplete_specifier : Warning<
7773   "incomplete format specifier">, InGroup<Format>;
7774 def warn_missing_format_string : Warning<
7775   "format string missing">, InGroup<Format>;
7776 def warn_scanf_nonzero_width : Warning<
7777   "zero field width in scanf format string is unused">,
7778   InGroup<Format>;
7779 def warn_format_conversion_argument_type_mismatch : Warning<
7780   "format specifies type %0 but the argument has "
7781   "%select{type|underlying type}2 %1">,
7782   InGroup<Format>;
7783 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7784   "format specifies type %0 but the argument has "
7785   "%select{type|underlying type}2 %1">,
7786   InGroup<FormatPedantic>;
7787 def warn_format_argument_needs_cast : Warning<
7788   "%select{values of type|enum values with underlying type}2 '%0' should not "
7789   "be used as format arguments; add an explicit cast to %1 instead">,
7790   InGroup<Format>;
7791 def warn_printf_positional_arg_exceeds_data_args : Warning <
7792   "data argument position '%0' exceeds the number of data arguments (%1)">,
7793   InGroup<Format>;
7794 def warn_format_zero_positional_specifier : Warning<
7795   "position arguments in format strings start counting at 1 (not 0)">,
7796   InGroup<Format>;
7797 def warn_format_invalid_positional_specifier : Warning<
7798   "invalid position specified for %select{field width|field precision}0">,
7799   InGroup<Format>;
7800 def warn_format_mix_positional_nonpositional_args : Warning<
7801   "cannot mix positional and non-positional arguments in format string">,
7802   InGroup<Format>;
7803 def warn_static_array_too_small : Warning<
7804   "array argument is too small; contains %0 elements, callee requires at least %1">,
7805   InGroup<ArrayBounds>;
7806 def note_callee_static_array : Note<
7807   "callee declares array parameter as static here">;
7808 def warn_empty_format_string : Warning<
7809   "format string is empty">, InGroup<FormatZeroLength>;
7810 def warn_format_string_is_wide_literal : Warning<
7811   "format string should not be a wide string">, InGroup<Format>;
7812 def warn_printf_format_string_contains_null_char : Warning<
7813   "format string contains '\\0' within the string body">, InGroup<Format>;
7814 def warn_printf_format_string_not_null_terminated : Warning<
7815   "format string is not null-terminated">, InGroup<Format>;
7816 def warn_printf_asterisk_missing_arg : Warning<
7817   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7818   InGroup<Format>;
7819 def warn_printf_asterisk_wrong_type : Warning<
7820   "field %select{width|precision}0 should have type %1, but argument has type %2">,
7821   InGroup<Format>;
7822 def warn_printf_nonsensical_optional_amount: Warning<
7823   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7824   InGroup<Format>;
7825 def warn_printf_nonsensical_flag: Warning<
7826   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7827   InGroup<Format>;
7828 def warn_format_nonsensical_length: Warning<
7829   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7830   InGroup<Format>;
7831 def warn_format_non_standard_positional_arg: Warning<
7832   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7833 def warn_format_non_standard: Warning<
7834   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7835   InGroup<FormatNonStandard>, DefaultIgnore;
7836 def warn_format_non_standard_conversion_spec: Warning<
7837   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7838   InGroup<FormatNonStandard>, DefaultIgnore;
7839 def warn_format_invalid_annotation : Warning<
7840   "using '%0' format specifier annotation outside of os_log()/os_trace()">,
7841   InGroup<Format>;
7842 def warn_format_P_no_precision : Warning<
7843   "using '%%P' format specifier without precision">,
7844   InGroup<Format>;
7845 def warn_printf_ignored_flag: Warning<
7846   "flag '%0' is ignored when flag '%1' is present">,
7847   InGroup<Format>;
7848 def warn_printf_empty_objc_flag: Warning<
7849   "missing object format flag">,
7850   InGroup<Format>;
7851 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7852   "object format flags cannot be used with '%0' conversion specifier">,
7853   InGroup<Format>;
7854 def warn_printf_invalid_objc_flag: Warning<
7855     "'%0' is not a valid object format flag">,
7856     InGroup<Format>;
7857 def warn_scanf_scanlist_incomplete : Warning<
7858   "no closing ']' for '%%[' in scanf format string">,
7859   InGroup<Format>;
7860 def note_format_string_defined : Note<"format string is defined here">;
7861 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7862 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7863 def note_format_security_fixit: Note<
7864   "treat the string as an argument to avoid this">;
7865
7866 def warn_null_arg : Warning<
7867   "null passed to a callee that requires a non-null argument">,
7868   InGroup<NonNull>;
7869 def warn_null_ret : Warning<
7870   "null returned from %select{function|method}0 that requires a non-null return value">,
7871   InGroup<NonNull>;
7872
7873 // CHECK: returning address/reference of stack memory
7874 def warn_ret_stack_addr_ref : Warning<
7875   "%select{address of|reference to}0 stack memory associated with local "
7876   "variable %1 returned">,
7877   InGroup<ReturnStackAddress>;
7878 def warn_ret_local_temp_addr_ref : Warning<
7879   "returning %select{address of|reference to}0 local temporary object">,
7880   InGroup<ReturnStackAddress>;
7881 def warn_ret_addr_label : Warning<
7882   "returning address of label, which is local">,
7883   InGroup<ReturnStackAddress>;
7884 def err_ret_local_block : Error<
7885   "returning block that lives on the local stack">;
7886 def note_ref_var_local_bind : Note<
7887   "binding reference variable %0 here">;
7888
7889 // Check for initializing a member variable with the address or a reference to
7890 // a constructor parameter.
7891 def warn_bind_ref_member_to_parameter : Warning<
7892   "binding reference member %0 to stack allocated parameter %1">,
7893   InGroup<DanglingField>;
7894 def warn_init_ptr_member_to_parameter_addr : Warning<
7895   "initializing pointer member %0 with the stack address of parameter %1">,
7896   InGroup<DanglingField>;
7897 def warn_bind_ref_member_to_temporary : Warning<
7898   "binding reference %select{|subobject of }1member %0 to a temporary value">,
7899   InGroup<DanglingField>;
7900 def note_ref_or_ptr_member_declared_here : Note<
7901   "%select{reference|pointer}0 member declared here">;
7902 def note_ref_subobject_of_member_declared_here : Note<
7903   "member with reference subobject declared here">;
7904
7905 // For non-floating point, expressions of the form x == x or x != x
7906 // should result in a warning, since these always evaluate to a constant.
7907 // Array comparisons have similar warnings
7908 def warn_comparison_always : Warning<
7909   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
7910   InGroup<TautologicalCompare>;
7911 def warn_comparison_bitwise_always : Warning<
7912   "bitwise comparison always evaluates to %select{false|true}0">,
7913   InGroup<TautologicalCompare>;
7914 def warn_tautological_overlap_comparison : Warning<
7915   "overlapping comparisons always evaluate to %select{false|true}0">,
7916   InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7917
7918 def warn_stringcompare : Warning<
7919   "result of comparison against %select{a string literal|@encode}0 is "
7920   "unspecified (use strncmp instead)">,
7921   InGroup<StringCompare>;
7922
7923 def warn_identity_field_assign : Warning<
7924   "assigning %select{field|instance variable}0 to itself">,
7925   InGroup<SelfAssignmentField>;
7926
7927 // Type safety attributes
7928 def err_type_tag_for_datatype_not_ice : Error<
7929   "'type_tag_for_datatype' attribute requires the initializer to be "
7930   "an %select{integer|integral}0 constant expression">;
7931 def err_type_tag_for_datatype_too_large : Error<
7932   "'type_tag_for_datatype' attribute requires the initializer to be "
7933   "an %select{integer|integral}0 constant expression "
7934   "that can be represented by a 64 bit integer">;
7935 def err_tag_index_out_of_range : Error<
7936   "%select{type tag|argument}0 index %1 is greater than the number of arguments specified">;
7937 def warn_type_tag_for_datatype_wrong_kind : Warning<
7938   "this type tag was not designed to be used with this function">,
7939   InGroup<TypeSafety>;
7940 def warn_type_safety_type_mismatch : Warning<
7941   "argument type %0 doesn't match specified %1 type tag "
7942   "%select{that requires %3|}2">, InGroup<TypeSafety>;
7943 def warn_type_safety_null_pointer_required : Warning<
7944   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7945
7946 // Generic selections.
7947 def err_assoc_type_incomplete : Error<
7948   "type %0 in generic association incomplete">;
7949 def err_assoc_type_nonobject : Error<
7950   "type %0 in generic association not an object type">;
7951 def err_assoc_type_variably_modified : Error<
7952   "type %0 in generic association is a variably modified type">;
7953 def err_assoc_compatible_types : Error<
7954   "type %0 in generic association compatible with previously specified type %1">;
7955 def note_compat_assoc : Note<
7956   "compatible type %0 specified here">;
7957 def err_generic_sel_no_match : Error<
7958   "controlling expression type %0 not compatible with any generic association type">;
7959 def err_generic_sel_multi_match : Error<
7960   "controlling expression type %0 compatible with %1 generic association types">;
7961
7962
7963 // Blocks
7964 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7965   " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">;
7966 def err_block_returning_array_function : Error<
7967   "block cannot return %select{array|function}0 type %1">;
7968
7969 // Builtin annotation
7970 def err_builtin_annotation_first_arg : Error<
7971   "first argument to __builtin_annotation must be an integer">;
7972 def err_builtin_annotation_second_arg : Error<
7973   "second argument to __builtin_annotation must be a non-wide string constant">;
7974 def err_msvc_annotation_wide_str : Error<
7975   "arguments to __annotation must be wide string constants">;
7976
7977 // CFString checking
7978 def err_cfstring_literal_not_string_constant : Error<
7979   "CFString literal is not a string constant">;
7980 def warn_cfstring_truncated : Warning<
7981   "input conversion stopped due to an input byte that does not "
7982   "belong to the input codeset UTF-8">,
7983   InGroup<DiagGroup<"CFString-literal">>;
7984
7985 // os_log checking
7986 // TODO: separate diagnostic for os_trace()
7987 def err_os_log_format_not_string_constant : Error<
7988   "os_log() format argument is not a string constant">;
7989 def err_os_log_argument_too_big : Error<
7990   "os_log() argument %0 is too big (%1 bytes, max %2)">;
7991 def warn_os_log_format_narg : Error<
7992  "os_log() '%%n' format specifier is not allowed">, DefaultError;
7993
7994 // Statements.
7995 def err_continue_not_in_loop : Error<
7996   "'continue' statement not in loop statement">;
7997 def err_break_not_in_loop_or_switch : Error<
7998   "'break' statement not in loop or switch statement">;
7999 def warn_loop_ctrl_binds_to_inner : Warning<
8000   "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
8001   InGroup<GccCompat>;
8002 def warn_break_binds_to_switch : Warning<
8003   "'break' is bound to loop, GCC binds it to switch">,
8004   InGroup<GccCompat>;
8005 def err_default_not_in_switch : Error<
8006   "'default' statement not in switch statement">;
8007 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
8008 def warn_bool_switch_condition : Warning<
8009   "switch condition has boolean value">, InGroup<SwitchBool>;
8010 def warn_case_value_overflow : Warning<
8011   "overflow converting case value to switch condition type (%0 to %1)">,
8012   InGroup<Switch>;
8013 def err_duplicate_case : Error<"duplicate case value '%0'">;
8014 def err_duplicate_case_differing_expr : Error<
8015   "duplicate case value: '%0' and '%1' both equal '%2'">;
8016 def warn_case_empty_range : Warning<"empty case range specified">;
8017 def warn_missing_case_for_condition :
8018   Warning<"no case matching constant switch condition '%0'">;
8019
8020 def warn_def_missing_case : Warning<"%plural{"
8021   "1:enumeration value %1 not explicitly handled in switch|"
8022   "2:enumeration values %1 and %2 not explicitly handled in switch|"
8023   "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
8024   ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
8025   InGroup<SwitchEnum>, DefaultIgnore;
8026
8027 def warn_missing_case : Warning<"%plural{"
8028   "1:enumeration value %1 not handled in switch|"
8029   "2:enumeration values %1 and %2 not handled in switch|"
8030   "3:enumeration values %1, %2, and %3 not handled in switch|"
8031   ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
8032   InGroup<Switch>;
8033
8034 def warn_unannotated_fallthrough : Warning<
8035   "unannotated fall-through between switch labels">,
8036   InGroup<ImplicitFallthrough>, DefaultIgnore;
8037 def warn_unannotated_fallthrough_per_function : Warning<
8038   "unannotated fall-through between switch labels in partly-annotated "
8039   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
8040 def note_insert_fallthrough_fixit : Note<
8041   "insert '%0;' to silence this warning">;
8042 def note_insert_break_fixit : Note<
8043   "insert 'break;' to avoid fall-through">;
8044 def err_fallthrough_attr_wrong_target : Error<
8045   "%0 attribute is only allowed on empty statements">;
8046 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
8047 def err_fallthrough_attr_outside_switch : Error<
8048   "fallthrough annotation is outside switch statement">;
8049 def err_fallthrough_attr_invalid_placement : Error<
8050   "fallthrough annotation does not directly precede switch label">;
8051 def warn_fallthrough_attr_unreachable : Warning<
8052   "fallthrough annotation in unreachable code">,
8053   InGroup<ImplicitFallthrough>, DefaultIgnore;
8054
8055 def warn_unreachable_default : Warning<
8056   "default label in switch which covers all enumeration values">,
8057   InGroup<CoveredSwitchDefault>, DefaultIgnore;
8058 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
8059   InGroup<Switch>;
8060 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
8061   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
8062 def err_typecheck_statement_requires_scalar : Error<
8063   "statement requires expression of scalar type (%0 invalid)">;
8064 def err_typecheck_statement_requires_integer : Error<
8065   "statement requires expression of integer type (%0 invalid)">;
8066 def err_multiple_default_labels_defined : Error<
8067   "multiple default labels in one switch">;
8068 def err_switch_multiple_conversions : Error<
8069   "multiple conversions from switch condition type %0 to an integral or "
8070   "enumeration type">;
8071 def note_switch_conversion : Note<
8072   "conversion to %select{integral|enumeration}0 type %1">;
8073 def err_switch_explicit_conversion : Error<
8074   "switch condition type %0 requires explicit conversion to %1">;
8075 def err_switch_incomplete_class_type : Error<
8076   "switch condition has incomplete class type %0">;
8077
8078 def warn_empty_if_body : Warning<
8079   "if statement has empty body">, InGroup<EmptyBody>;
8080 def warn_empty_for_body : Warning<
8081   "for loop has empty body">, InGroup<EmptyBody>;
8082 def warn_empty_range_based_for_body : Warning<
8083   "range-based for loop has empty body">, InGroup<EmptyBody>;
8084 def warn_empty_while_body : Warning<
8085   "while loop has empty body">, InGroup<EmptyBody>;
8086 def warn_empty_switch_body : Warning<
8087   "switch statement has empty body">, InGroup<EmptyBody>;
8088 def note_empty_body_on_separate_line : Note<
8089   "put the semicolon on a separate line to silence this warning">;
8090
8091 def err_va_start_captured_stmt : Error<
8092   "'va_start' cannot be used in a captured statement">;
8093 def err_va_start_outside_function : Error<
8094   "'va_start' cannot be used outside a function">;
8095 def err_va_start_fixed_function : Error<
8096   "'va_start' used in function with fixed args">;
8097 def err_va_start_used_in_wrong_abi_function : Error<
8098   "'va_start' used in %select{System V|Win64}0 ABI function">;
8099 def err_ms_va_start_used_in_sysv_function : Error<
8100   "'__builtin_ms_va_start' used in System V ABI function">;
8101 def warn_second_arg_of_va_start_not_last_named_param : Warning<
8102   "second argument to 'va_start' is not the last named parameter">,
8103   InGroup<Varargs>;
8104 def warn_va_start_type_is_undefined : Warning<
8105   "passing %select{an object that undergoes default argument promotion|"
8106   "an object of reference type|a parameter declared with the 'register' "
8107   "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
8108 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
8109   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
8110 def err_second_parameter_to_va_arg_incomplete: Error<
8111   "second argument to 'va_arg' is of incomplete type %0">;
8112 def err_second_parameter_to_va_arg_abstract: Error<
8113   "second argument to 'va_arg' is of abstract type %0">;
8114 def warn_second_parameter_to_va_arg_not_pod : Warning<
8115   "second argument to 'va_arg' is of non-POD type %0">,
8116   InGroup<NonPODVarargs>, DefaultError;
8117 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
8118   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
8119   InGroup<NonPODVarargs>, DefaultError;
8120 def warn_second_parameter_to_va_arg_never_compatible : Warning<
8121   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
8122   "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
8123
8124 def warn_return_missing_expr : Warning<
8125   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8126   InGroup<ReturnType>;
8127 def ext_return_missing_expr : ExtWarn<
8128   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8129   InGroup<ReturnType>;
8130 def ext_return_has_expr : ExtWarn<
8131   "%select{void function|void method|constructor|destructor}1 %0 "
8132   "should not return a value">,
8133   DefaultError, InGroup<ReturnType>;
8134 def ext_return_has_void_expr : Extension<
8135   "void %select{function|method|block}1 %0 should not return void expression">;
8136 def err_return_init_list : Error<
8137   "%select{void function|void method|constructor|destructor}1 %0 "
8138   "must not return a value">;
8139 def err_ctor_dtor_returns_void : Error<
8140   "%select{constructor|destructor}1 %0 must not return void expression">;
8141 def warn_noreturn_function_has_return_expr : Warning<
8142   "function %0 declared 'noreturn' should not return">,
8143   InGroup<InvalidNoreturn>;
8144 def warn_falloff_noreturn_function : Warning<
8145   "function declared 'noreturn' should not return">,
8146   InGroup<InvalidNoreturn>;
8147 def err_noreturn_block_has_return_expr : Error<
8148   "block declared 'noreturn' should not return">;
8149 def err_noreturn_missing_on_first_decl : Error<
8150   "function declared '[[noreturn]]' after its first declaration">;
8151 def note_noreturn_missing_first_decl : Note<
8152   "declaration missing '[[noreturn]]' attribute is here">;
8153 def err_carries_dependency_missing_on_first_decl : Error<
8154   "%select{function|parameter}0 declared '[[carries_dependency]]' "
8155   "after its first declaration">;
8156 def note_carries_dependency_missing_first_decl : Note<
8157   "declaration missing '[[carries_dependency]]' attribute is here">;
8158 def err_carries_dependency_param_not_function_decl : Error<
8159   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
8160   "declaration or lambda">;
8161 def err_block_on_nonlocal : Error<
8162   "__block attribute not allowed, only allowed on local variables">;
8163 def err_block_on_vm : Error<
8164   "__block attribute not allowed on declaration with a variably modified type">;
8165
8166 def err_vec_builtin_non_vector : Error<
8167  "first two arguments to %0 must be vectors">;
8168 def err_vec_builtin_incompatible_vector : Error<
8169   "first two arguments to %0 must have the same type">;
8170 def err_vsx_builtin_nonconstant_argument : Error<
8171   "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
8172
8173 def err_shufflevector_nonconstant_argument : Error<
8174   "index for __builtin_shufflevector must be a constant integer">;
8175 def err_shufflevector_argument_too_large : Error<
8176   "index for __builtin_shufflevector must be less than the total number "
8177   "of vector elements">;
8178
8179 def err_convertvector_non_vector : Error<
8180   "first argument to __builtin_convertvector must be a vector">;
8181 def err_convertvector_non_vector_type : Error<
8182   "second argument to __builtin_convertvector must be a vector type">;
8183 def err_convertvector_incompatible_vector : Error<
8184   "first two arguments to __builtin_convertvector must have the same number of elements">;
8185
8186 def err_first_argument_to_cwsc_not_call : Error<
8187   "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
8188 def err_first_argument_to_cwsc_block_call : Error<
8189   "first argument to __builtin_call_with_static_chain must not be a block call">;
8190 def err_first_argument_to_cwsc_builtin_call : Error<
8191   "first argument to __builtin_call_with_static_chain must not be a builtin call">;
8192 def err_first_argument_to_cwsc_pdtor_call : Error<
8193   "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
8194 def err_second_argument_to_cwsc_not_pointer : Error<
8195   "second argument to __builtin_call_with_static_chain must be of pointer type">;
8196
8197 def err_vector_incorrect_num_initializers : Error<
8198   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
8199 def err_altivec_empty_initializer : Error<"expected initializer">;
8200
8201 def err_invalid_neon_type_code : Error<
8202   "incompatible constant for this __builtin_neon function">; 
8203 def err_argument_invalid_range : Error<
8204   "argument should be a value from %0 to %1">;
8205 def err_argument_not_multiple : Error<
8206   "argument should be a multiple of %0">;
8207 def warn_neon_vector_initializer_non_portable : Warning<
8208   "vector initializers are not compatible with NEON intrinsics in big endian "
8209   "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
8210 def note_neon_vector_initializer_non_portable : Note<
8211   "consider using vld1_%0%1() to initialize a vector from memory, or "
8212   "vcreate_%0%1() to initialize from an integer constant">;
8213 def note_neon_vector_initializer_non_portable_q : Note<
8214   "consider using vld1q_%0%1() to initialize a vector from memory, or "
8215   "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
8216   "constants">;
8217 def err_systemz_invalid_tabort_code : Error<
8218   "invalid transaction abort code">;
8219 def err_64_bit_builtin_32_bit_tgt : Error<
8220   "this builtin is only available on 64-bit targets">;
8221 def err_builtin_x64_aarch64_only : Error<
8222   "this builtin is only available on x86-64 and aarch64 targets">;
8223 def err_ppc_builtin_only_on_pwr7 : Error<
8224   "this builtin is only valid on POWER7 or later CPUs">;
8225 def err_x86_builtin_invalid_rounding : Error<
8226   "invalid rounding argument">;
8227 def err_x86_builtin_invalid_scale : Error<
8228   "scale argument must be 1, 2, 4, or 8">;
8229
8230 def err_builtin_longjmp_unsupported : Error<
8231   "__builtin_longjmp is not supported for the current target">;
8232 def err_builtin_setjmp_unsupported : Error<
8233   "__builtin_setjmp is not supported for the current target">;
8234
8235 def err_builtin_longjmp_invalid_val : Error<
8236   "argument to __builtin_longjmp must be a constant 1">;
8237 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
8238
8239 def err_constant_integer_arg_type : Error<
8240   "argument to %0 must be a constant integer">;
8241
8242 def ext_mixed_decls_code : Extension<
8243   "ISO C90 forbids mixing declarations and code">,
8244   InGroup<DiagGroup<"declaration-after-statement">>;
8245   
8246 def err_non_local_variable_decl_in_for : Error<
8247   "declaration of non-local variable in 'for' loop">;
8248 def err_non_variable_decl_in_for : Error<
8249   "non-variable declaration in 'for' loop">;
8250 def err_toomany_element_decls : Error<
8251   "only one element declaration is allowed">;
8252 def err_selector_element_not_lvalue : Error<
8253   "selector element is not a valid lvalue">;
8254 def err_selector_element_type : Error<
8255   "selector element type %0 is not a valid object">;
8256 def err_selector_element_const_type : Error<
8257   "selector element of type %0 cannot be a constant l-value expression">;
8258 def err_collection_expr_type : Error<
8259   "the type %0 is not a pointer to a fast-enumerable object">;
8260 def warn_collection_expr_type : Warning<
8261   "collection expression type %0 may not respond to %1">;
8262
8263 def err_invalid_conversion_between_ext_vectors : Error<
8264   "invalid conversion between ext-vector type %0 and %1">;
8265
8266 def warn_duplicate_attribute_exact : Warning<
8267   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
8268
8269 def warn_duplicate_attribute : Warning<
8270   "attribute %0 is already applied with different parameters">,
8271   InGroup<IgnoredAttributes>;
8272
8273 def warn_sync_fetch_and_nand_semantics_change : Warning<
8274   "the semantics of this intrinsic changed with GCC "
8275   "version 4.4 - the newer semantics are provided here">,
8276   InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
8277
8278 // Type
8279 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
8280 def warn_receiver_forward_class : Warning<
8281     "receiver %0 is a forward class and corresponding @interface may not exist">,
8282     InGroup<ForwardClassReceiver>;
8283 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
8284 def ext_missing_declspec : ExtWarn<
8285   "declaration specifier missing, defaulting to 'int'">;
8286 def ext_missing_type_specifier : ExtWarn<
8287   "type specifier missing, defaults to 'int'">,
8288   InGroup<ImplicitInt>;
8289 def err_decimal_unsupported : Error<
8290   "GNU decimal type extension not supported">;
8291 def err_missing_type_specifier : Error<
8292   "C++ requires a type specifier for all declarations">;
8293 def err_objc_array_of_interfaces : Error<
8294   "array of interface %0 is invalid (probably should be an array of pointers)">;
8295 def ext_c99_array_usage : Extension<
8296   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8297   "feature">, InGroup<C99>;
8298 def err_c99_array_usage_cxx : Error<
8299   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8300   "feature, not permitted in C++">;
8301 def err_type_unsupported : Error<
8302   "%0 is not supported on this target">;
8303 def warn_nsconsumed_attribute_mismatch : Warning<
8304   "overriding method has mismatched ns_consumed attribute on its"
8305   " parameter">, InGroup<NSConsumedMismatch>;
8306 def warn_nsreturns_retained_attribute_mismatch : Warning<
8307   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
8308   " attributes">, InGroup<NSReturnsMismatch>;
8309   
8310 def note_getter_unavailable : Note<
8311   "or because setter is declared here, but no getter method %0 is found">;
8312 def err_invalid_protocol_qualifiers : Error<
8313   "invalid protocol qualifiers on non-ObjC type">;
8314 def warn_ivar_use_hidden : Warning<
8315   "local declaration of %0 hides instance variable">,
8316    InGroup<ShadowIvar>;
8317 def warn_direct_initialize_call : Warning<
8318   "explicit call to +initialize results in duplicate call to +initialize">,
8319    InGroup<ExplicitInitializeCall>;
8320 def warn_direct_super_initialize_call : Warning<
8321   "explicit call to [super initialize] should only be in implementation "
8322   "of +initialize">,
8323    InGroup<ExplicitInitializeCall>;
8324 def err_ivar_use_in_class_method : Error<
8325   "instance variable %0 accessed in class method">;
8326 def err_private_ivar_access : Error<"instance variable %0 is private">,
8327   AccessControl;
8328 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8329   AccessControl;
8330 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8331 def ext_typecheck_base_super : Warning<
8332   "method parameter type "
8333   "%diff{$ does not match super class method parameter type $|"
8334   "does not match super class method parameter type}0,1">,
8335    InGroup<SuperSubClassMismatch>, DefaultIgnore;
8336 def warn_missing_method_return_type : Warning<
8337   "method has no return type specified; defaults to 'id'">,
8338   InGroup<MissingMethodReturnType>, DefaultIgnore;
8339 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8340   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8341
8342 // Spell-checking diagnostics
8343 def err_unknown_typename : Error<
8344   "unknown type name %0">;
8345 def err_unknown_type_or_class_name_suggest : Error<
8346   "unknown %select{type|class}1 name %0; did you mean %2?">;
8347 def err_unknown_typename_suggest : Error<
8348   "unknown type name %0; did you mean %1?">;
8349 def err_unknown_nested_typename_suggest : Error<
8350   "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8351 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8352 def err_undeclared_use_suggest : Error<
8353   "use of undeclared %0; did you mean %1?">;
8354 def err_undeclared_var_use_suggest : Error<
8355   "use of undeclared identifier %0; did you mean %1?">;
8356 def err_no_template : Error<"no template named %0">;
8357 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8358 def err_no_member_template : Error<"no template named %0 in %1">;
8359 def err_no_member_template_suggest : Error<
8360   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8361 def err_non_template_in_template_id : Error<
8362   "%0 does not name a template but is followed by template arguments">;
8363 def err_non_template_in_template_id_suggest : Error<
8364   "%0 does not name a template but is followed by template arguments; "
8365   "did you mean %1?">;
8366 def err_non_template_in_member_template_id_suggest : Error<
8367   "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
8368 def note_non_template_in_template_id_found : Note<
8369   "non-template declaration found by name lookup">;
8370 def err_mem_init_not_member_or_class_suggest : Error<
8371   "initializer %0 does not name a non-static data member or base "
8372   "class; did you mean the %select{base class|member}1 %2?">;
8373 def err_field_designator_unknown_suggest : Error<
8374   "field designator %0 does not refer to any field in type %1; did you mean "
8375   "%2?">;
8376 def err_typecheck_member_reference_ivar_suggest : Error<
8377   "%0 does not have a member named %1; did you mean %2?">;
8378 def err_property_not_found_suggest : Error<
8379   "property %0 not found on object of type %1; did you mean %2?">;
8380 def err_class_property_found : Error<
8381   "property %0 is a class property; did you mean to access it with class '%1'?">;
8382 def err_ivar_access_using_property_syntax_suggest : Error<
8383   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8384 def warn_property_access_suggest : Warning<
8385 "property %0 not found on object of type %1; did you mean to access property %2?">,
8386 InGroup<PropertyAccessDotSyntax>;
8387 def err_property_found_suggest : Error<
8388   "property %0 found on object of type %1; did you mean to access "
8389   "it with the \".\" operator?">;
8390 def err_undef_interface_suggest : Error<
8391   "cannot find interface declaration for %0; did you mean %1?">;
8392 def warn_undef_interface_suggest : Warning<
8393   "cannot find interface declaration for %0; did you mean %1?">;
8394 def err_undef_superclass_suggest : Error<
8395   "cannot find interface declaration for %0, superclass of %1; did you mean "
8396   "%2?">;
8397 def err_undeclared_protocol_suggest : Error<
8398   "cannot find protocol declaration for %0; did you mean %1?">;
8399 def note_base_class_specified_here : Note<
8400   "base class %0 specified here">;
8401 def err_using_directive_suggest : Error<
8402   "no namespace named %0; did you mean %1?">;
8403 def err_using_directive_member_suggest : Error<
8404   "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8405 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8406 def err_sizeof_pack_no_pack_name_suggest : Error<
8407   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8408 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8409
8410 def err_uncasted_use_of_unknown_any : Error<
8411   "%0 has unknown type; cast it to its declared type to use it">;
8412 def err_uncasted_call_of_unknown_any : Error<
8413   "%0 has unknown return type; cast the call to its declared return type">;
8414 def err_uncasted_send_to_unknown_any_method : Error<
8415   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8416   "message send to the method's return type">;
8417 def err_unsupported_unknown_any_decl : Error<
8418   "%0 has unknown type, which is not supported for this kind of declaration">;
8419 def err_unsupported_unknown_any_expr : Error<
8420   "unsupported expression with unknown type">;
8421 def err_unsupported_unknown_any_call : Error<
8422   "call to unsupported expression with unknown type">;
8423 def err_unknown_any_addrof : Error<
8424   "the address of a declaration with unknown type "
8425   "can only be cast to a pointer type">;
8426 def err_unknown_any_addrof_call : Error<
8427   "address-of operator cannot be applied to a call to a function with "
8428   "unknown return type">;
8429 def err_unknown_any_var_function_type : Error<
8430   "variable %0 with unknown type cannot be given a function type">;
8431 def err_unknown_any_function : Error<
8432   "function %0 with unknown type must be given a function type">;
8433
8434 def err_filter_expression_integral : Error<
8435   "filter expression type should be an integral value not %0">;
8436
8437 def err_non_asm_stmt_in_naked_function : Error<
8438   "non-ASM statement in naked function is not supported">;
8439 def err_asm_naked_this_ref : Error<
8440   "'this' pointer references not allowed in naked functions">;
8441 def err_asm_naked_parm_ref : Error<
8442   "parameter references not allowed in naked functions">;
8443
8444 // OpenCL warnings and errors.
8445 def err_invalid_astype_of_different_size : Error<
8446   "invalid reinterpretation: sizes of %0 and %1 must match">;
8447 def err_static_kernel : Error<
8448   "kernel functions cannot be declared static">;
8449 def err_opencl_ptrptr_kernel_param : Error<
8450   "kernel parameter cannot be declared as a pointer to a pointer">;
8451 def err_kernel_arg_address_space : Error<
8452   "pointer arguments to kernel functions must reside in '__global', "
8453   "'__constant' or '__local' address space">;
8454 def err_opencl_ext_vector_component_invalid_length : Error<
8455   "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
8456 def err_opencl_function_variable : Error<
8457   "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8458 def err_opencl_addrspace_scope : Error<
8459   "variables in the %0 address space can only be declared in the outermost "
8460   "scope of a kernel function">;
8461 def err_static_function_scope : Error<
8462   "variables in function scope cannot be declared static">;
8463 def err_opencl_bitfields : Error<
8464   "bit-fields are not supported in OpenCL">;
8465 def err_opencl_vla : Error<
8466   "variable length arrays are not supported in OpenCL">;
8467 def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
8468     "scalar operand type has greater rank than the type of the vector "
8469     "element. (%0 and %1)">;
8470 def err_bad_kernel_param_type : Error<
8471   "%0 cannot be used as the type of a kernel parameter">;
8472 def err_record_with_pointers_kernel_param : Error<
8473   "%select{struct|union}0 kernel parameters may not contain pointers">;
8474 def note_within_field_of_type : Note<
8475   "within field of type %0 declared here">;
8476 def note_illegal_field_declared_here : Note<
8477   "field of illegal %select{type|pointer type}0 %1 declared here">;
8478 def err_opencl_type_struct_or_union_field : Error<
8479   "the %0 type cannot be used to declare a structure or union field">;
8480 def err_event_t_addr_space_qual : Error<
8481   "the event_t type can only be used with __private address space qualifier">;
8482 def err_expected_kernel_void_return_type : Error<
8483   "kernel must have void return type">;
8484 def err_sampler_initializer_not_integer : Error<
8485   "sampler_t initialization requires 32-bit integer, not %0">;
8486 def warn_sampler_initializer_invalid_bits : Warning<
8487   "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8488 def err_sampler_argument_required : Error<
8489   "sampler_t variable required - got %0">;
8490 def err_wrong_sampler_addressspace: Error<
8491   "sampler type cannot be used with the __local and __global address space qualifiers">;
8492 def err_opencl_nonconst_global_sampler : Error<
8493   "global sampler requires a const or constant address space qualifier">;
8494 def err_opencl_cast_non_zero_to_event_t : Error<
8495   "cannot cast non-zero value '%0' to 'event_t'">;
8496 def err_opencl_global_invalid_addr_space : Error<
8497   "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8498 def err_missing_actual_pipe_type : Error<
8499   "missing actual type specifier for pipe">;
8500 def err_reference_pipe_type : Error <
8501   "pipes packet types cannot be of reference type">;
8502 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8503 def err_opencl_kernel_attr :
8504   Error<"attribute %0 can only be applied to a kernel function">;
8505 def err_opencl_return_value_with_address_space : Error<
8506   "return value cannot be qualified with address space">;
8507 def err_opencl_constant_no_init : Error<
8508   "variable in constant address space must be initialized">;
8509 def err_opencl_atomic_init: Error<
8510   "atomic variable can be %select{assigned|initialized}0 to a variable only "
8511   "in global address space">;
8512 def err_opencl_implicit_vector_conversion : Error<
8513   "implicit conversions between vector types (%0 and %1) are not permitted">;
8514 def err_opencl_invalid_type_array : Error<
8515   "array of %0 type is invalid in OpenCL">;
8516 def err_opencl_ternary_with_block : Error<
8517   "block type cannot be used as expression in ternary expression in OpenCL">;
8518 def err_opencl_pointer_to_type : Error<
8519   "pointer to type %0 is invalid in OpenCL">;
8520 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8521   "type %0 can only be used as a function parameter in OpenCL">;
8522 def warn_opencl_attr_deprecated_ignored : Warning <
8523   "%0 attribute is deprecated and ignored in OpenCL version %1">,
8524   InGroup<IgnoredAttributes>;
8525 def err_opencl_variadic_function : Error<
8526   "invalid prototype, variadic arguments are not allowed in OpenCL">;
8527 def err_opencl_requires_extension : Error<
8528   "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">;
8529
8530 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8531 def err_opencl_builtin_pipe_first_arg : Error<
8532   "first argument to %0 must be a pipe type">;
8533 def err_opencl_builtin_pipe_arg_num : Error<
8534   "invalid number of arguments to function: %0">;
8535 def err_opencl_builtin_pipe_invalid_arg : Error<
8536   "invalid argument type to function %0 (expecting %1 having %2)">;
8537 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8538   "invalid pipe access modifier (expecting %0)">;
8539
8540 // OpenCL access qualifier
8541 def err_opencl_invalid_access_qualifier : Error<
8542   "access qualifier can only be used for pipe and image type">;
8543 def err_opencl_invalid_read_write : Error<
8544   "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8545 def err_opencl_multiple_access_qualifiers : Error<
8546   "multiple access qualifiers">;
8547 def note_opencl_typedef_access_qualifier : Note<
8548   "previously declared '%0' here">;
8549
8550 // OpenCL Section 6.8.g
8551 def err_opencl_unknown_type_specifier : Error<
8552   "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">;
8553
8554 // OpenCL v2.0 s6.12.5 Blocks restrictions
8555 def err_opencl_block_storage_type : Error<
8556   "the __block storage type is not permitted">;
8557 def err_opencl_invalid_block_declaration : Error<
8558   "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8559 def err_opencl_extern_block_declaration : Error<
8560   "invalid block variable declaration - using 'extern' storage class is disallowed">;
8561 def err_opencl_block_ref_block : Error<
8562   "cannot refer to a block inside block">;
8563
8564 // OpenCL v2.0 s6.13.9 - Address space qualifier functions. 
8565 def err_opencl_builtin_to_addr_arg_num : Error<
8566   "invalid number of arguments to function: %0">;
8567 def err_opencl_builtin_to_addr_invalid_arg : Error<
8568   "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8569
8570 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8571 def err_opencl_enqueue_kernel_incorrect_args : Error<
8572   "illegal call to enqueue_kernel, incorrect argument types">;
8573 def err_opencl_enqueue_kernel_local_size_args : Error<
8574   "mismatch in number of block parameters and local size arguments passed">;
8575 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8576   "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8577 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8578   "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
8579 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8580   "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
8581
8582 def err_opencl_builtin_expected_type : Error<
8583   "illegal call to %0, expected %1 argument type">;
8584
8585 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8586 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8587   "vector component name '%0' is an OpenCL version 2.2 feature">,
8588   InGroup<OpenCLUnsupportedRGBA>;
8589 } // end of sema category
8590
8591 let CategoryName = "OpenMP Issue" in {
8592 // OpenMP support.
8593 def err_omp_expected_var_arg : Error<
8594   "%0 is not a global variable, static local variable or static data member">;
8595 def err_omp_expected_var_arg_suggest : Error<
8596   "%0 is not a global variable, static local variable or static data member; "
8597   "did you mean %1">;
8598 def err_omp_global_var_arg : Error<
8599   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8600 def err_omp_ref_type_arg : Error<
8601   "arguments of '#pragma omp %0' cannot be of reference type %1">;
8602 def err_omp_region_not_file_context : Error<
8603   "directive must be at file or namespace scope">;
8604 def err_omp_var_scope : Error<
8605   "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8606 def err_omp_var_used : Error<
8607   "'#pragma omp %0' must precede all references to variable %q1">;
8608 def err_omp_var_thread_local : Error<
8609   "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8610 def err_omp_private_incomplete_type : Error<
8611   "a private variable with incomplete type %0">;
8612 def err_omp_firstprivate_incomplete_type : Error<
8613   "a firstprivate variable with incomplete type %0">;
8614 def err_omp_lastprivate_incomplete_type : Error<
8615   "a lastprivate variable with incomplete type %0">;
8616 def err_omp_reduction_incomplete_type : Error<
8617   "a reduction list item with incomplete type %0">;
8618 def err_omp_unexpected_clause_value : Error<
8619   "expected %0 in OpenMP clause '%1'">;
8620 def err_omp_expected_var_name_member_expr : Error<
8621   "expected variable name%select{| or data member of current class}0">;
8622 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8623   "expected variable name%select{|, data member of current class}0, array element or array section">;
8624 def err_omp_expected_addressable_lvalue_or_array_item : Error<
8625   "expected addressable lvalue expression, array element or array section">;
8626 def err_omp_expected_named_var_member_or_array_expression: Error<
8627   "expected expression containing only member accesses and/or array sections based on named variables">;
8628 def err_omp_bit_fields_forbidden_in_clause : Error<
8629   "bit fields cannot be used to specify storage in a '%0' clause">;
8630 def err_array_section_does_not_specify_contiguous_storage : Error<
8631   "array section does not specify contiguous storage">;
8632 def err_omp_union_type_not_allowed : Error<
8633   "mapping of union members is not allowed">;
8634 def err_omp_expected_access_to_data_field : Error<
8635   "expected access to data field">;
8636 def err_omp_multiple_array_items_in_map_clause : Error<
8637   "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8638 def err_omp_pointer_mapped_along_with_derived_section : Error<
8639   "pointer cannot be mapped along with a section derived from itself">;
8640 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8641   "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8642 def err_omp_same_pointer_derreferenced : Error<
8643   "same pointer derreferenced in multiple different ways in map clause expressions">;
8644 def note_omp_task_predetermined_firstprivate_here : Note<
8645   "predetermined as a firstprivate in a task construct here">;
8646 def err_omp_threadprivate_incomplete_type : Error<
8647   "threadprivate variable with incomplete type %0">;
8648 def err_omp_no_dsa_for_variable : Error<
8649   "variable %0 must have explicitly specified data sharing attributes">;
8650 def err_omp_wrong_dsa : Error<
8651   "%0 variable cannot be %1">;
8652 def err_omp_variably_modified_type_not_supported : Error<
8653   "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8654 def note_omp_explicit_dsa : Note<
8655   "defined as %0">;
8656 def note_omp_predetermined_dsa : Note<
8657   "%select{static data member is predetermined as shared|"
8658   "variable with static storage duration is predetermined as shared|"
8659   "loop iteration variable is predetermined as private|"
8660   "loop iteration variable is predetermined as linear|"
8661   "loop iteration variable is predetermined as lastprivate|"
8662   "constant variable is predetermined as shared|"
8663   "global variable is predetermined as shared|"
8664   "non-shared variable in a task construct is predetermined as firstprivate|"
8665   "variable with automatic storage duration is predetermined as private}0"
8666   "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8667 def note_omp_implicit_dsa : Note<
8668   "implicitly determined as %0">;
8669 def err_omp_loop_var_dsa : Error<
8670   "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8671 def err_omp_not_for : Error<
8672   "%select{statement after '#pragma omp %1' must be a for loop|"
8673   "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8674 def note_omp_collapse_ordered_expr : Note<
8675   "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8676 def err_omp_negative_expression_in_clause : Error<
8677   "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8678 def err_omp_not_integral : Error<
8679   "expression must have integral or unscoped enumeration "
8680   "type, not %0">;
8681 def err_omp_threadprivate_in_target : Error<
8682   "threadprivate variables cannot be used in target constructs">;
8683 def err_omp_incomplete_type : Error<
8684   "expression has incomplete class type %0">;
8685 def err_omp_explicit_conversion : Error<
8686   "expression requires explicit conversion from %0 to %1">;
8687 def note_omp_conversion_here : Note<
8688   "conversion to %select{integral|enumeration}0 type %1 declared here">;
8689 def err_omp_ambiguous_conversion : Error<
8690   "ambiguous conversion from type %0 to an integral or unscoped "
8691   "enumeration type">;
8692 def err_omp_required_access : Error<
8693   "%0 variable must be %1">;
8694 def err_omp_const_variable : Error<
8695   "const-qualified variable cannot be %0">;
8696 def err_omp_const_reduction_list_item : Error<
8697   "const-qualified list item cannot be reduction">;
8698 def err_omp_linear_incomplete_type : Error<
8699   "a linear variable with incomplete type %0">;
8700 def err_omp_linear_expected_int_or_ptr : Error<
8701   "argument of a linear clause should be of integral or pointer "
8702   "type, not %0">;
8703 def warn_omp_linear_step_zero : Warning<
8704   "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8705   InGroup<OpenMPClauses>;
8706 def warn_omp_alignment_not_power_of_two : Warning<
8707   "aligned clause will be ignored because the requested alignment is not a power of 2">,
8708   InGroup<OpenMPClauses>;
8709 def err_omp_enclosed_declare_target : Error<
8710   "declare target region may not be enclosed within another declare target region">;
8711 def err_omp_invalid_target_decl : Error<
8712   "%0 used in declare target directive is not a variable or a function name">;
8713 def err_omp_declare_target_multiple : Error<
8714   "%0 appears multiple times in clauses on the same declare target directive">;
8715 def err_omp_declare_target_to_and_link : Error<
8716   "%0 must not appear in both clauses 'to' and 'link'">;
8717 def warn_omp_not_in_target_context : Warning<
8718   "declaration is not declared in any declare target region">,
8719   InGroup<OpenMPTarget>;
8720 def err_omp_function_in_link_clause : Error<
8721   "function name is not allowed in 'link' clause">;
8722 def err_omp_aligned_expected_array_or_ptr : Error<
8723   "argument of aligned clause should be array"
8724   "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8725   ", not %0">;
8726 def err_omp_aligned_twice : Error<
8727   "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8728 def err_omp_local_var_in_threadprivate_init : Error<
8729   "variable with local storage in initial value of threadprivate variable">;
8730 def err_omp_loop_not_canonical_init : Error<
8731   "initialization clause of OpenMP for loop is not in canonical form "
8732   "('var = init' or 'T var = init')">;
8733 def ext_omp_loop_not_canonical_init : ExtWarn<
8734   "initialization clause of OpenMP for loop is not in canonical form "
8735   "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8736 def err_omp_loop_not_canonical_cond : Error<
8737   "condition of OpenMP for loop must be a relational comparison "
8738   "('<', '<=', '>', or '>=') of loop variable %0">;
8739 def err_omp_loop_not_canonical_incr : Error<
8740   "increment clause of OpenMP for loop must perform simple addition "
8741   "or subtraction on loop variable %0">;
8742 def err_omp_loop_variable_type : Error<
8743   "variable must be of integer or %select{pointer|random access iterator}0 type">;
8744 def err_omp_loop_incr_not_compatible : Error<
8745   "increment expression must cause %0 to %select{decrease|increase}1 "
8746   "on each iteration of OpenMP for loop">;
8747 def note_omp_loop_cond_requres_compatible_incr : Note<
8748   "loop step is expected to be %select{negative|positive}0 due to this condition">;
8749 def err_omp_loop_diff_cxx : Error<
8750   "could not calculate number of iterations calling 'operator-' with "
8751   "upper and lower loop bounds">;
8752 def err_omp_loop_cannot_use_stmt : Error<
8753   "'%0' statement cannot be used in OpenMP for loop">;
8754 def err_omp_simd_region_cannot_use_stmt : Error<
8755   "'%0' statement cannot be used in OpenMP simd region">;
8756 def warn_omp_loop_64_bit_var : Warning<
8757   "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
8758   InGroup<OpenMPLoopForm>;
8759 def err_omp_unknown_reduction_identifier : Error<
8760   "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
8761   "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
8762 def err_omp_not_resolved_reduction_identifier : Error<
8763   "unable to resolve declare reduction construct for type %0">;
8764 def err_omp_reduction_ref_type_arg : Error<
8765   "argument of OpenMP clause '%0' must reference the same object in all threads">;
8766 def err_omp_clause_not_arithmetic_type_arg : Error<
8767   "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
8768 def err_omp_clause_floating_type_arg : Error<
8769   "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
8770 def err_omp_once_referenced : Error<
8771   "variable can appear only once in OpenMP '%0' clause">;
8772 def err_omp_once_referenced_in_target_update : Error<
8773   "variable can appear only once in OpenMP 'target update' construct">;
8774 def note_omp_referenced : Note<
8775   "previously referenced here">;
8776 def err_omp_reduction_in_task : Error<
8777   "reduction variables may not be accessed in an explicit task">;
8778 def err_omp_reduction_id_not_compatible : Error<
8779   "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
8780 def err_omp_in_reduction_not_task_reduction : Error<
8781   "in_reduction variable must appear in a task_reduction clause">;
8782 def err_omp_reduction_identifier_mismatch : Error<
8783   "in_reduction variable must have the same reduction operation as in a task_reduction clause">;
8784 def note_omp_previous_reduction_identifier : Note<
8785   "previously marked as task_reduction with different reduction operation">;
8786 def err_omp_prohibited_region : Error<
8787   "region cannot be%select{| closely}0 nested inside '%1' region"
8788   "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
8789   "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
8790   "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
8791   "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
8792 def err_omp_prohibited_region_simd : Error<
8793   "OpenMP constructs may not be nested inside a simd region">;
8794 def err_omp_prohibited_region_atomic : Error<
8795   "OpenMP constructs may not be nested inside an atomic region">;
8796 def err_omp_prohibited_region_critical_same_name : Error<
8797   "cannot nest 'critical' regions having the same name %0">;
8798 def note_omp_previous_critical_region : Note<
8799   "previous 'critical' region starts here">;
8800 def err_omp_sections_not_compound_stmt : Error<
8801   "the statement for '#pragma omp sections' must be a compound statement">;
8802 def err_omp_parallel_sections_not_compound_stmt : Error<
8803   "the statement for '#pragma omp parallel sections' must be a compound statement">;
8804 def err_omp_orphaned_section_directive : Error<
8805   "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
8806   " must be closely nested to a sections region%select{|, not a %1 region}0">;
8807 def err_omp_sections_substmt_not_section : Error<
8808   "statement in 'omp sections' directive must be enclosed into a section region">;
8809 def err_omp_parallel_sections_substmt_not_section : Error<
8810   "statement in 'omp parallel sections' directive must be enclosed into a section region">;
8811 def err_omp_parallel_reduction_in_task_firstprivate : Error<
8812   "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
8813 def err_omp_atomic_read_not_expression_statement : Error<
8814   "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
8815   " where v and x are both lvalue expressions with scalar type">;
8816 def note_omp_atomic_read_write: Note<
8817   "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
8818 def err_omp_atomic_write_not_expression_statement : Error<
8819   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
8820   " where x is a lvalue expression with scalar type">;
8821 def err_omp_atomic_update_not_expression_statement : Error<
8822   "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',"
8823   " where x is an l-value expression with scalar type">;
8824 def err_omp_atomic_not_expression_statement : Error<
8825   "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',"
8826   " where x is an l-value expression with scalar type">;
8827 def note_omp_atomic_update: Note<
8828   "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
8829   "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
8830   "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
8831 def err_omp_atomic_capture_not_expression_statement : Error<
8832   "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',"
8833   " where x and v are both l-value expressions with scalar type">;
8834 def err_omp_atomic_capture_not_compound_statement : Error<
8835   "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
8836   " '{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;}',"
8837   " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
8838   " where x is an l-value expression with scalar type">;
8839 def note_omp_atomic_capture: Note<
8840   "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
8841 def err_omp_atomic_several_clauses : Error<
8842   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
8843 def note_omp_atomic_previous_clause : Note<
8844   "'%0' clause used here">;
8845 def err_omp_target_contains_not_only_teams : Error<
8846   "target construct with nested teams region contains statements outside of the teams construct">;
8847 def note_omp_nested_teams_construct_here : Note<
8848   "nested teams construct here">;
8849 def note_omp_nested_statement_here : Note<
8850   "%select{statement|directive}0 outside teams construct here">;
8851 def err_omp_single_copyprivate_with_nowait : Error<
8852   "the 'copyprivate' clause must not be used with the 'nowait' clause">;
8853 def note_omp_nowait_clause_here : Note<
8854   "'nowait' clause is here">;
8855 def err_omp_single_decl_in_declare_simd : Error<
8856   "single declaration is expected after 'declare simd' directive">;
8857 def err_omp_function_expected : Error<
8858   "'#pragma omp declare simd' can only be applied to functions">;
8859 def err_omp_wrong_cancel_region : Error<
8860   "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
8861 def err_omp_parent_cancel_region_nowait : Error<
8862   "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be nowait">;
8863 def err_omp_parent_cancel_region_ordered : Error<
8864   "parent region for 'omp %select{cancellation point|cancel}0' construct cannot be ordered">;
8865 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">;
8866 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">;
8867 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
8868 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
8869 def err_omp_typecheck_section_value : Error<
8870   "subscripted value is not an array or pointer">;
8871 def err_omp_typecheck_section_not_integer : Error<
8872   "array section %select{lower bound|length}0 is not an integer">;
8873 def err_omp_section_function_type : Error<
8874   "section of pointer to function type %0">;
8875 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
8876   InGroup<CharSubscript>, DefaultIgnore;
8877 def err_omp_section_incomplete_type : Error<
8878   "section of pointer to incomplete type %0">;
8879 def err_omp_section_not_subset_of_array : Error<
8880   "array section must be a subset of the original array">;
8881 def err_omp_section_length_negative : Error<
8882   "section length is evaluated to a negative value %0">;
8883 def err_omp_section_length_undefined : Error<
8884   "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
8885 def err_omp_wrong_linear_modifier : Error<
8886   "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
8887 def err_omp_wrong_linear_modifier_non_reference : Error<
8888   "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
8889 def err_omp_wrong_simdlen_safelen_values : Error<
8890   "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
8891 def err_omp_wrong_if_directive_name_modifier : Error<
8892   "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
8893 def err_omp_no_more_if_clause : Error<
8894   "no more 'if' clause is allowed">;
8895 def err_omp_unnamed_if_clause : Error<
8896   "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
8897 def note_omp_previous_named_if_clause : Note<
8898   "previous clause with directive name modifier specified here">;
8899 def err_omp_ordered_directive_with_param : Error<
8900   "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
8901 def err_omp_ordered_directive_without_param : Error<
8902   "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
8903 def note_omp_ordered_param : Note<
8904   "'ordered' clause with specified parameter">;
8905 def err_omp_expected_base_var_name : Error<
8906   "expected variable name as a base of the array %select{subscript|section}0">;
8907 def err_omp_map_shared_storage : Error<
8908   "variable already marked as mapped in current construct">;
8909 def err_omp_invalid_map_type_for_directive : Error<
8910   "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
8911 def err_omp_no_clause_for_directive : Error<
8912   "expected at least one %0 clause for '#pragma omp %1'">;
8913 def err_omp_threadprivate_in_clause : Error<
8914   "threadprivate variables are not allowed in '%0' clause">;
8915 def err_omp_wrong_ordered_loop_count : Error<
8916   "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
8917 def note_collapse_loop_count : Note<
8918   "parameter of the 'collapse' clause">;
8919 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
8920   "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
8921 def note_omp_previous_grainsize_num_tasks : Note<
8922   "'%0' clause is specified here">;
8923 def err_omp_hint_clause_no_name : Error<
8924   "the name of the construct must be specified in presence of 'hint' clause">;
8925 def err_omp_critical_with_hint : Error<
8926   "constructs with the same name must have a 'hint' clause with the same value">;
8927 def note_omp_critical_hint_here : Note<
8928   "%select{|previous }0'hint' clause with value '%1'">;
8929 def note_omp_critical_no_hint : Note<
8930   "%select{|previous }0directive with no 'hint' clause specified">;
8931 def err_omp_depend_clause_thread_simd : Error<
8932   "'depend' clauses cannot be mixed with '%0' clause">;
8933 def err_omp_depend_sink_expected_loop_iteration : Error<
8934   "expected%select{| %1}0 loop iteration variable">;
8935 def err_omp_depend_sink_unexpected_expr : Error<
8936   "unexpected expression: number of expressions is larger than the number of associated loops">;
8937 def err_omp_depend_sink_expected_plus_minus : Error<
8938   "expected '+' or '-' operation">;
8939 def err_omp_depend_sink_source_not_allowed : Error<
8940   "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
8941 def err_omp_linear_ordered : Error<
8942   "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
8943 def err_omp_unexpected_schedule_modifier : Error<
8944   "modifier '%0' cannot be used along with modifier '%1'">;
8945 def err_omp_schedule_nonmonotonic_static : Error<
8946   "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
8947 def err_omp_schedule_nonmonotonic_ordered : Error<
8948   "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
8949 def err_omp_ordered_simd : Error<
8950   "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
8951 def err_omp_variable_in_given_clause_and_dsa : Error<
8952   "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
8953 def err_omp_param_or_this_in_clause : Error<
8954   "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
8955 def err_omp_expected_uniform_param : Error<
8956   "expected a reference to a parameter specified in a 'uniform' clause">;
8957 def err_omp_expected_int_param : Error<
8958   "expected a reference to an integer-typed parameter">;
8959 def err_omp_at_least_one_motion_clause_required : Error<
8960   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
8961 def err_omp_usedeviceptr_not_a_pointer : Error<
8962   "expected pointer or reference to pointer in 'use_device_ptr' clause">;
8963 def err_omp_argument_type_isdeviceptr : Error <
8964   "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
8965 def warn_omp_nesting_simd : Warning<
8966   "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
8967   InGroup<SourceUsesOpenMP>;
8968 def err_omp_orphaned_device_directive : Error<
8969   "orphaned 'omp %0' directives are prohibited"
8970   "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
8971 def err_omp_reduction_non_addressable_expression : Error<
8972   "expected addressable reduction item for the task-based directives">;
8973 def err_omp_reduction_with_nogroup : Error<
8974   "'reduction' clause cannot be used with 'nogroup' clause">;
8975 def err_omp_reduction_vla_unsupported : Error<
8976   "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">;
8977 def err_omp_linear_distribute_var_non_loop_iteration : Error<
8978   "only loop iteration variables are allowed in 'linear' clause in distribute directives">;
8979 } // end of OpenMP category
8980
8981 let CategoryName = "Related Result Type Issue" in {
8982 // Objective-C related result type compatibility
8983 def warn_related_result_type_compatibility_class : Warning<
8984   "method is expected to return an instance of its class type "
8985   "%diff{$, but is declared to return $|"
8986   ", but is declared to return different type}0,1">;
8987 def warn_related_result_type_compatibility_protocol : Warning<
8988   "protocol method is expected to return an instance of the implementing "
8989   "class, but is declared to return %0">;
8990 def note_related_result_type_family : Note<
8991   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
8992   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
8993   "self}1' method family%select{| and is expected to return an instance of its "
8994   "class type}0">;
8995 def note_related_result_type_overridden : Note<
8996   "overridden method returns an instance of its class type">;
8997 def note_related_result_type_inferred : Note<
8998   "%select{class|instance}0 method %1 is assumed to return an instance of "
8999   "its receiver type (%2)">;
9000 def note_related_result_type_explicit : Note<
9001   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
9002   "%select{| and is expected to return an instance of its class type}0">;
9003 def err_invalid_type_for_program_scope_var : Error<
9004   "the %0 type cannot be used to declare a program scope variable">;
9005
9006 }
9007
9008 let CategoryName = "Modules Issue" in {
9009 def err_module_decl_in_module_map_module : Error<
9010   "'module' declaration found while building module from module map">;
9011 def err_module_interface_implementation_mismatch : Error<
9012   "missing 'export' specifier in module declaration while "
9013   "building module interface">;
9014 def err_current_module_name_mismatch : Error<
9015   "module name '%0' specified on command line does not match name of module">;
9016 def err_module_redefinition : Error<
9017   "redefinition of module '%0'">;
9018 def note_prev_module_definition : Note<"previously defined here">;
9019 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
9020 def err_module_not_defined : Error<
9021   "definition of module '%0' is not available; use -fmodule-file= to specify "
9022   "path to precompiled module interface">;
9023 def err_module_redeclaration : Error<
9024   "translation unit contains multiple module declarations">;
9025 def note_prev_module_declaration : Note<"previous module declaration is here">;
9026 def err_module_declaration_missing : Error<
9027   "missing 'export module' declaration in module interface unit">;
9028 def err_module_private_specialization : Error<
9029   "%select{template|partial|member}0 specialization cannot be "
9030   "declared __module_private__">;
9031 def err_module_private_local : Error<
9032   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
9033   "__module_private__">;
9034 def err_module_private_local_class : Error<
9035   "local %select{struct|interface|union|class|enum}0 cannot be declared "
9036   "__module_private__">;
9037 def err_module_unimported_use : Error<
9038   "%select{declaration|definition|default argument|"
9039   "explicit specialization|partial specialization}0 of %1 must be imported "
9040   "from module '%2' before it is required">;
9041 def err_module_unimported_use_header : Error<
9042   "missing '#include %3'; "
9043   "%select{declaration|definition|default argument|"
9044   "explicit specialization|partial specialization}0 of %1 must be imported "
9045   "from module '%2' before it is required">;
9046 def err_module_unimported_use_multiple : Error<
9047   "%select{declaration|definition|default argument|"
9048   "explicit specialization|partial specialization}0 of %1 must be imported "
9049   "from one of the following modules before it is required:%2">;
9050 def ext_module_import_in_extern_c : ExtWarn<
9051   "import of C++ module '%0' appears within extern \"C\" language linkage "
9052   "specification">, DefaultError,
9053   InGroup<DiagGroup<"module-import-in-extern-c">>;
9054 def err_module_import_not_at_top_level_fatal : Error<
9055   "import of module '%0' appears within %1">, DefaultFatal;
9056 def ext_module_import_not_at_top_level_noop : ExtWarn<
9057   "redundant #include of module '%0' appears within %1">, DefaultError,
9058   InGroup<DiagGroup<"modules-import-nested-redundant">>;
9059 def note_module_import_not_at_top_level : Note<"%0 begins here">;
9060 def err_module_self_import : Error<
9061   "import of module '%0' appears within same top-level module '%1'">;
9062 def err_module_import_in_implementation : Error<
9063   "@import of module '%0' in implementation of '%1'; use #import">;
9064
9065 // C++ Modules TS
9066 def err_export_within_export : Error<
9067   "export declaration appears within another export declaration">;
9068 def err_export_not_in_module_interface : Error<
9069   "export declaration can only be used within a module interface unit after "
9070   "the module declaration">;
9071
9072 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
9073   "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
9074   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
9075 def note_equivalent_internal_linkage_decl : Note<
9076   "declared here%select{ in module '%1'|}0">;
9077
9078 def note_redefinition_modules_same_file : Note<
9079         "'%0' included multiple times, additional include site in header from module '%1'">;
9080 def note_redefinition_include_same_file : Note<
9081         "'%0' included multiple times, additional include site here">;
9082 }
9083
9084 let CategoryName = "Coroutines Issue" in {
9085 def err_return_in_coroutine : Error<
9086   "return statement not allowed in coroutine; did you mean 'co_return'?">;
9087 def note_declared_coroutine_here : Note<
9088   "function is a coroutine due to use of '%0' here">;
9089 def err_coroutine_objc_method : Error<
9090   "Objective-C methods as coroutines are not yet supported">;
9091 def err_coroutine_unevaluated_context : Error<
9092   "'%0' cannot be used in an unevaluated context">;
9093 def err_coroutine_outside_function : Error<
9094   "'%0' cannot be used outside a function">;
9095 def err_coroutine_invalid_func_context : Error<
9096   "'%1' cannot be used in %select{a constructor|a destructor"
9097   "|a copy assignment operator|a move assignment operator|the 'main' function"
9098   "|a constexpr function|a function with a deduced return type"
9099   "|a varargs function}0">;
9100 def err_implied_coroutine_type_not_found : Error<
9101   "%0 type was not found; include <experimental/coroutine> before defining "
9102   "a coroutine">;
9103 def err_implicit_coroutine_std_nothrow_type_not_found : Error<
9104   "std::nothrow was not found; include <new> before defining a coroutine which "
9105   "uses get_return_object_on_allocation_failure()">;
9106 def err_malformed_std_nothrow : Error<
9107   "std::nothrow must be a valid variable declaration">;
9108 def err_malformed_std_coroutine_handle : Error<
9109   "std::experimental::coroutine_handle must be a class template">;
9110 def err_coroutine_handle_missing_member : Error<
9111   "std::experimental::coroutine_handle missing a member named '%0'">;
9112 def err_malformed_std_coroutine_traits : Error<
9113   "'std::experimental::coroutine_traits' must be a class template">;
9114 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
9115   "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
9116 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
9117   "this function cannot be a coroutine: %0 is not a class">;
9118 def err_coroutine_promise_type_incomplete : Error<
9119   "this function cannot be a coroutine: %0 is an incomplete type">;
9120 def err_coroutine_type_missing_specialization : Error<
9121   "this function cannot be a coroutine: missing definition of "
9122   "specialization %q0">;
9123 def err_coroutine_promise_incompatible_return_functions : Error<
9124   "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
9125 def err_coroutine_promise_requires_return_function : Error<
9126   "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
9127 def note_coroutine_promise_implicit_await_transform_required_here : Note<
9128   "call to 'await_transform' implicitly required by 'co_await' here">;
9129 def note_coroutine_promise_suspend_implicitly_required : Note<
9130   "call to '%select{initial_suspend|final_suspend}0' implicitly "
9131   "required by the %select{initial suspend point|final suspend point}0">;
9132 def err_coroutine_promise_unhandled_exception_required : Error<
9133   "%0 is required to declare the member 'unhandled_exception()'">;
9134 def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
9135   "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
9136   InGroup<CoroutineMissingUnhandledException>;
9137 def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
9138   "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
9139 def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
9140   "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
9141 def err_coroutine_promise_new_requires_nothrow : Error<
9142   "%0 is required to have a non-throwing noexcept specification when the promise "
9143    "type declares 'get_return_object_on_allocation_failure()'">;
9144 def note_coroutine_promise_call_implicitly_required : Note<
9145   "call to %0 implicitly required by coroutine function here">;
9146 def err_await_suspend_invalid_return_type : Error<
9147   "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
9148 >;
9149 def note_await_ready_no_bool_conversion : Note<
9150   "return type of 'await_ready' is required to be contextually convertible to 'bool'"
9151 >;
9152 }
9153
9154 let CategoryName = "Documentation Issue" in {
9155 def warn_not_a_doxygen_trailing_member_comment : Warning<
9156   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
9157 } // end of documentation issue category
9158
9159 let CategoryName = "Instrumentation Issue" in {
9160 def warn_profile_data_out_of_date : Warning<
9161   "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
9162   " mismatched data that will be ignored">,
9163   InGroup<ProfileInstrOutOfDate>;
9164 def warn_profile_data_missing : Warning<
9165   "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1"
9166   " no data">,
9167   InGroup<ProfileInstrMissing>,
9168   DefaultIgnore;
9169 def warn_profile_data_unprofiled : Warning<
9170   "no profile data available for file \"%0\"">,
9171   InGroup<ProfileInstrUnprofiled>;
9172
9173 } // end of instrumentation issue category
9174
9175 let CategoryName = "Nullability Issue" in {
9176
9177 def warn_mismatched_nullability_attr : Warning<
9178   "nullability specifier %0 conflicts with existing specifier %1">,
9179   InGroup<Nullability>;
9180
9181 def warn_nullability_declspec : Warning<
9182   "nullability specifier %0 cannot be applied "
9183   "to non-pointer type %1; did you mean to apply the specifier to the "
9184   "%select{pointer|block pointer|member pointer|function pointer|"
9185   "member function pointer}2?">,
9186   InGroup<NullabilityDeclSpec>,
9187   DefaultError;
9188
9189 def note_nullability_here : Note<"%0 specified here">;
9190
9191 def err_nullability_nonpointer : Error<
9192   "nullability specifier %0 cannot be applied to non-pointer type %1">;
9193
9194 def warn_nullability_lost : Warning<
9195   "implicit conversion from nullable pointer %0 to non-nullable pointer "
9196   "type %1">,
9197   InGroup<NullableToNonNullConversion>, DefaultIgnore;
9198 def warn_zero_as_null_pointer_constant : Warning<
9199   "zero as null pointer constant">,
9200   InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
9201
9202 def err_nullability_cs_multilevel : Error<
9203   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
9204 def note_nullability_type_specifier : Note<
9205   "use nullability type specifier %0 to affect the innermost "
9206   "pointer type of %1">;
9207
9208 def warn_null_resettable_setter : Warning<
9209   "synthesized setter %0 for null_resettable property %1 does not handle nil">,
9210   InGroup<Nullability>;
9211
9212 def warn_nullability_missing : Warning<
9213   "%select{pointer|block pointer|member pointer}0 is missing a nullability "
9214   "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
9215   InGroup<NullabilityCompleteness>;
9216 def warn_nullability_missing_array : Warning<
9217   "array parameter is missing a nullability type specifier (_Nonnull, "
9218   "_Nullable, or _Null_unspecified)">,
9219   InGroup<NullabilityCompletenessOnArrays>;
9220 def note_nullability_fix_it : Note<
9221   "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
9222   "%select{pointer|block pointer|member pointer|array parameter}1 "
9223   "%select{should never be null|may be null|should not declare nullability}0">;
9224
9225 def warn_nullability_inferred_on_nested_type : Warning<
9226   "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
9227   "deprecated">,
9228   InGroup<NullabilityInferredOnNestedType>;
9229
9230 def err_objc_type_arg_explicit_nullability : Error<
9231   "type argument %0 cannot explicitly specify nullability">;
9232
9233 def err_objc_type_param_bound_explicit_nullability : Error<
9234   "type parameter %0 bound %1 cannot explicitly specify nullability">;
9235
9236 }
9237
9238 let CategoryName = "Generics Issue" in {
9239
9240 def err_objc_type_param_bound_nonobject : Error<
9241   "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
9242
9243 def err_objc_type_param_bound_missing_pointer : Error<
9244   "missing '*' in type bound %0 for type parameter %1">;
9245 def err_objc_type_param_bound_qualified : Error<
9246   "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
9247
9248 def err_objc_type_param_redecl : Error<
9249   "redeclaration of type parameter %0">;
9250
9251 def err_objc_type_param_arity_mismatch : Error<
9252   "%select{forward class declaration|class definition|category|extension}0 has "
9253   "too %select{few|many}1 type parameters (expected %2, have %3)">;
9254
9255 def err_objc_type_param_bound_conflict : Error<
9256   "type bound %0 for type parameter %1 conflicts with "
9257   "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
9258
9259 def err_objc_type_param_variance_conflict : Error<
9260   "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
9261   "%select{in|co|contra}2variant type parameter %3">;
9262
9263 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
9264
9265 def err_objc_type_param_bound_missing : Error<
9266   "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
9267
9268 def err_objc_parameterized_category_nonclass : Error<
9269   "%select{extension|category}0 of non-parameterized class %1 cannot have type "
9270   "parameters">;
9271
9272 def err_objc_parameterized_forward_class : Error<
9273   "forward declaration of non-parameterized class %0 cannot have type "
9274   "parameters">;
9275
9276 def err_objc_parameterized_forward_class_first : Error<
9277   "class %0 previously declared with type parameters">;
9278
9279 def err_objc_type_arg_missing_star : Error<
9280   "type argument %0 must be a pointer (requires a '*')">;
9281 def err_objc_type_arg_qualified : Error<
9282   "type argument %0 cannot be qualified with '%1'">;
9283
9284 def err_objc_type_arg_missing : Error<
9285   "no type or protocol named %0">;
9286
9287 def err_objc_type_args_and_protocols : Error<
9288   "angle brackets contain both a %select{type|protocol}0 (%1) and a "
9289   "%select{protocol|type}0 (%2)">;
9290
9291 def err_objc_type_args_non_class : Error<
9292   "type arguments cannot be applied to non-class type %0">;
9293
9294 def err_objc_type_args_non_parameterized_class : Error<
9295   "type arguments cannot be applied to non-parameterized class %0">;
9296
9297 def err_objc_type_args_specialized_class : Error<
9298   "type arguments cannot be applied to already-specialized class type %0">;
9299
9300 def err_objc_type_args_wrong_arity : Error<
9301   "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
9302 }
9303
9304 def err_objc_type_arg_not_id_compatible : Error<
9305   "type argument %0 is neither an Objective-C object nor a block type">;
9306
9307 def err_objc_type_arg_does_not_match_bound : Error<
9308   "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
9309
9310 def warn_objc_redundant_qualified_class_type : Warning<
9311   "parameterized class %0 already conforms to the protocols listed; did you "
9312   "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
9313
9314 def warn_block_literal_attributes_on_omitted_return_type : Warning<
9315   "attribute %0 ignored, because it cannot be applied to omitted return type">,
9316   InGroup<IgnoredAttributes>;
9317
9318 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
9319   "'%0' qualifier on omitted return type %1 has no effect">,
9320   InGroup<IgnoredQualifiers>;
9321
9322 def ext_warn_gnu_final : ExtWarn<
9323   "__final is a GNU extension, consider using C++11 final">,
9324   InGroup<GccCompat>;
9325
9326 def warn_shadow_field :
9327   Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">,
9328   InGroup<ShadowField>, DefaultIgnore;
9329 def note_shadow_field : Note<"declared here">;
9330
9331 } // end of sema component.