]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
Upgrade our copies of clang, llvm, lld and libc++ to r311219 from the
[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
145 // C99 variably modified types
146 def err_variably_modified_template_arg : Error<
147   "variably modified type %0 cannot be used as a template argument">;
148 def err_variably_modified_nontype_template_param : Error<
149   "non-type template parameter of variably modified type %0">;
150 def err_variably_modified_new_type : Error<
151   "'new' cannot allocate object of variably modified type %0">;
152
153 // C99 Designated Initializers
154 def ext_designated_init : Extension<
155   "designated initializers are a C99 feature">, InGroup<C99>;
156 def err_array_designator_negative : Error<
157   "array designator value '%0' is negative">;
158 def err_array_designator_empty_range : Error<
159   "array designator range [%0, %1] is empty">;
160 def err_array_designator_non_array : Error<
161   "array designator cannot initialize non-array type %0">;
162 def err_array_designator_too_large : Error<
163   "array designator index (%0) exceeds array bounds (%1)">;
164 def err_field_designator_non_aggr : Error<
165   "field designator cannot initialize a "
166   "%select{non-struct, non-union|non-class}0 type %1">;
167 def err_field_designator_unknown : Error<
168   "field designator %0 does not refer to any field in type %1">;
169 def err_field_designator_nonfield : Error<
170   "field designator %0 does not refer to a non-static data member">;
171 def note_field_designator_found : Note<"field designator refers here">;
172 def err_designator_for_scalar_init : Error<
173   "designator in initializer for scalar type %0">;
174 def warn_subobject_initializer_overrides : Warning<
175   "subobject initialization overrides initialization of other fields "
176   "within its enclosing subobject">, InGroup<InitializerOverrides>;
177 def warn_initializer_overrides : Warning<
178   "initializer overrides prior initialization of this subobject">,
179   InGroup<InitializerOverrides>;
180 def note_previous_initializer : Note<
181   "previous initialization %select{|with side effects }0is here"
182   "%select{| (side effects may not occur at run time)}0">;
183 def err_designator_into_flexible_array_member : Error<
184   "designator into flexible array member subobject">;
185 def note_flexible_array_member : Note<
186   "initialized flexible array member %0 is here">;
187 def ext_flexible_array_init : Extension<
188   "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>;
189
190 // Declarations.
191 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
192   InGroup<DuplicateDeclSpecifier>;
193 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
194   InGroup<DuplicateDeclSpecifier>;
195 def ext_plain_complex : ExtWarn<
196   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
197 def ext_integer_complex : Extension<
198   "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
199
200 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
201 def err_invalid_width_spec : Error<
202   "'%select{|short|long|long long}0 %1' is invalid">;
203 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
204 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
205
206 def ext_auto_type_specifier : ExtWarn<
207   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
208 def warn_auto_storage_class : Warning<
209   "'auto' storage class specifier is redundant and incompatible with C++11">,
210   InGroup<CXX11Compat>, DefaultIgnore;
211
212 def warn_deprecated_register : Warning<
213   "'register' storage class specifier is deprecated "
214   "and incompatible with C++17">, InGroup<DeprecatedRegister>;
215 def ext_register_storage_class : ExtWarn<
216   "ISO C++17 does not allow 'register' storage class specifier">,
217   DefaultError, InGroup<Register>;
218
219 def err_invalid_decl_spec_combination : Error<
220   "cannot combine with previous '%0' declaration specifier">;
221 def err_invalid_vector_decl_spec_combination : Error<
222   "cannot combine with previous '%0' declaration specifier. "
223   "'__vector' must be first">;
224 def err_invalid_pixel_decl_spec_combination : Error<
225   "'__pixel' must be preceded by '__vector'.  "
226   "'%0' declaration specifier not allowed here">;
227 def err_invalid_vector_bool_decl_spec : Error<
228   "cannot use '%0' with '__vector bool'">;
229 def err_invalid_vector_long_decl_spec : Error<
230   "cannot use 'long' with '__vector'">;
231 def err_invalid_vector_float_decl_spec : Error<
232   "cannot use 'float' with '__vector'">;
233 def err_invalid_vector_double_decl_spec : Error <
234   "use of 'double' with '__vector' requires VSX support to be enabled "
235   "(available on POWER7 or later)">;
236 def err_invalid_vector_long_long_decl_spec : Error <
237   "use of 'long long' with '__vector bool' requires VSX support (available on "
238   "POWER7 or later) or extended Altivec support (available on POWER8 or later) " 
239   "to be enabled">;
240 def err_invalid_vector_long_double_decl_spec : Error<
241   "cannot use 'long double' with '__vector'">;
242 def warn_vector_long_decl_spec_combination : Warning<
243   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
244
245 def err_use_of_tag_name_without_tag : Error<
246   "must use '%1' tag to refer to type %0%select{| in this scope}2">;
247
248 def err_redeclaration_different_type : Error<
249   "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
250 def err_bad_variable_name : Error<
251   "%0 cannot be the name of a variable or data member">;
252 def err_bad_parameter_name : Error<
253   "%0 cannot be the name of a parameter">;
254 def err_parameter_name_omitted : Error<"parameter name omitted">;
255 def err_anyx86_interrupt_attribute : Error<
256   "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
257   "have %select{a 'void' return type|"
258   "only a pointer parameter optionally followed by an integer parameter|"
259   "a pointer as the first parameter|a %2 type as the second parameter}1">;
260 def err_anyx86_interrupt_called : Error<
261   "interrupt service routine cannot be called directly">;
262 def warn_arm_interrupt_calling_convention : Warning<
263    "call to function without interrupt attribute could clobber interruptee's VFP registers">,
264    InGroup<Extra>;
265 def warn_mips_interrupt_attribute : Warning<
266    "MIPS 'interrupt' attribute only applies to functions that have "
267    "%select{no parameters|a 'void' return type}0">,
268    InGroup<IgnoredAttributes>;
269 def warn_unused_parameter : Warning<"unused parameter %0">,
270   InGroup<UnusedParameter>, DefaultIgnore;
271 def warn_unused_variable : Warning<"unused variable %0">,
272   InGroup<UnusedVariable>, DefaultIgnore;
273 def warn_unused_local_typedef : Warning<
274   "unused %select{typedef|type alias}0 %1">,
275   InGroup<UnusedLocalTypedef>, DefaultIgnore;
276 def warn_unused_property_backing_ivar : 
277   Warning<"ivar %0 which backs the property is not "
278   "referenced in this property's accessor">,
279   InGroup<UnusedPropertyIvar>, DefaultIgnore;
280 def warn_unused_const_variable : Warning<"unused variable %0">,
281   InGroup<UnusedConstVariable>, DefaultIgnore;
282 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
283   InGroup<UnusedExceptionParameter>, DefaultIgnore;
284 def warn_decl_in_param_list : Warning<
285   "declaration of %0 will not be visible outside of this function">,
286   InGroup<Visibility>;
287 def warn_redefinition_in_param_list : Warning<
288   "redefinition of %0 will not be visible outside of this function">,
289   InGroup<Visibility>;
290 def warn_empty_parens_are_function_decl : Warning<
291   "empty parentheses interpreted as a function declaration">,
292   InGroup<VexingParse>;
293 def warn_parens_disambiguated_as_function_declaration : Warning<
294   "parentheses were disambiguated as a function declaration">,
295   InGroup<VexingParse>;
296 def note_additional_parens_for_variable_declaration : Note<
297   "add a pair of parentheses to declare a variable">;
298 def note_empty_parens_function_call : Note<
299   "change this ',' to a ';' to call %0">;
300 def note_empty_parens_default_ctor : Note<
301   "remove parentheses to declare a variable">;
302 def note_empty_parens_zero_initialize : Note<
303   "replace parentheses with an initializer to declare a variable">;
304 def warn_unused_function : Warning<"unused function %0">,
305   InGroup<UnusedFunction>, DefaultIgnore;
306 def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
307   InGroup<UnusedTemplate>, DefaultIgnore;
308 def warn_unused_member_function : Warning<"unused member function %0">,
309   InGroup<UnusedMemberFunction>, DefaultIgnore;
310 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
311   InGroup<UsedButMarkedUnused>, DefaultIgnore;
312 def warn_unneeded_internal_decl : Warning<
313   "%select{function|variable}0 %1 is not needed and will not be emitted">,
314   InGroup<UnneededInternalDecl>, DefaultIgnore;
315 def warn_unneeded_static_internal_decl : Warning<
316   "'static' function %0 declared in header file "
317   "should be declared 'static inline'">,
318   InGroup<UnneededInternalDecl>, DefaultIgnore;
319 def warn_unneeded_member_function : Warning<
320   "member function %0 is not needed and will not be emitted">,
321   InGroup<UnneededMemberFunction>, DefaultIgnore;
322 def warn_unused_private_field: Warning<"private field %0 is not used">,
323   InGroup<UnusedPrivateField>, DefaultIgnore;
324 def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
325   "%select{used|required to be captured for this use}1">,
326   InGroup<UnusedLambdaCapture>, DefaultIgnore;
327
328 def warn_parameter_size: Warning<
329   "%0 is a large (%1 bytes) pass-by-value argument; "
330   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
331 def warn_return_value_size: Warning<
332   "return value of %0 is a large (%1 bytes) pass-by-value object; "
333   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
334 def warn_return_value_udt: Warning<
335   "%0 has C-linkage specified, but returns user-defined type %1 which is "
336   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
337 def warn_return_value_udt_incomplete: Warning<
338   "%0 has C-linkage specified, but returns incomplete type %1 which could be "
339   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
340 def warn_implicit_function_decl : Warning<
341   "implicit declaration of function %0">,
342   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
343 def ext_implicit_function_decl : ExtWarn<
344   "implicit declaration of function %0 is invalid in C99">,
345   InGroup<ImplicitFunctionDeclare>;
346 def note_function_suggestion : Note<"did you mean %0?">;
347
348 def err_ellipsis_first_param : Error<
349   "ISO C requires a named parameter before '...'">;
350 def err_declarator_need_ident : Error<"declarator requires an identifier">;
351 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
352 def err_language_linkage_spec_not_ascii : Error<
353   "string literal in language linkage specifier cannot have an "
354   "encoding-prefix">;
355 def warn_use_out_of_scope_declaration : Warning<
356   "use of out-of-scope declaration of %0">;
357 def err_inline_non_function : Error<
358   "'inline' can only appear on functions%select{| and non-local variables}0">;
359 def err_noreturn_non_function : Error<
360   "'_Noreturn' can only appear on functions">;
361 def warn_qual_return_type : Warning< 
362   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
363   InGroup<IgnoredQualifiers>, DefaultIgnore;
364 def warn_deprecated_redundant_constexpr_static_def : Warning<
365   "out-of-line definition of constexpr static data member is redundant "
366   "in C++17 and is deprecated">,
367   InGroup<Deprecated>, DefaultIgnore;
368
369 def warn_decl_shadow :
370   Warning<"declaration shadows a %select{"
371           "local variable|"
372           "variable in %2|"
373           "static data member of %2|"
374           "field of %2|"
375           "typedef in %2|"
376           "type alias in %2}1">,
377   InGroup<Shadow>, DefaultIgnore;
378 def warn_decl_shadow_uncaptured_local :
379   Warning<warn_decl_shadow.Text>,
380   InGroup<ShadowUncapturedLocal>, DefaultIgnore;
381 def warn_ctor_parm_shadows_field:
382   Warning<"constructor parameter %0 shadows the field %1 of %2">,
383   InGroup<ShadowFieldInConstructor>, DefaultIgnore;
384 def warn_modifying_shadowing_decl :
385   Warning<"modifying constructor parameter %0 that shadows a "
386           "field of %1">,
387   InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
388
389 // C++ decomposition declarations
390 def err_decomp_decl_context : Error<
391   "decomposition declaration not permitted in this context">;
392 def warn_cxx14_compat_decomp_decl : Warning<
393   "decomposition declarations are incompatible with "
394   "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre1zCompat>;
395 def ext_decomp_decl : ExtWarn<
396   "decomposition declarations are a C++17 extension">, InGroup<CXX17>;
397 def err_decomp_decl_spec : Error<
398   "decomposition declaration cannot be declared "
399   "%plural{1:'%1'|:with '%1' specifiers}0">;
400 def err_decomp_decl_type : Error<
401   "decomposition declaration cannot be declared with type %0; "
402   "declared type must be 'auto' or reference to 'auto'">;
403 def err_decomp_decl_parens : Error<
404   "decomposition declaration cannot be declared with parentheses">;
405 def err_decomp_decl_template : Error<
406   "decomposition declaration template not supported">;
407 def err_decomp_decl_not_alone : Error<
408   "decomposition declaration must be the only declaration in its group">;
409 def err_decomp_decl_requires_init : Error<
410   "decomposition declaration %0 requires an initializer">;
411 def err_decomp_decl_wrong_number_bindings : Error<
412   "type %0 decomposes into %2 elements, but %select{only |}3%1 "
413   "names were provided">;
414 def err_decomp_decl_unbindable_type : Error<
415   "cannot decompose %select{union|non-class, non-array}1 type %2">;
416 def err_decomp_decl_multiple_bases_with_members : Error<
417   "cannot decompose class type %1: "
418   "%select{its base classes %2 and|both it and its base class}0 %3 "
419   "have non-static data members">;
420 def err_decomp_decl_ambiguous_base : Error<
421   "cannot decompose members of ambiguous base class %1 of %0:%2">;
422 def err_decomp_decl_non_public_base : Error<
423   "cannot decompose members of non-public base class %1 of %0">;
424 def err_decomp_decl_non_public_member : Error<
425   "cannot decompose non-public member %0 of %1">;
426 def err_decomp_decl_anon_union_member : Error<
427   "cannot decompose class type %0 because it has an anonymous "
428   "%select{struct|union}1 member">;
429 def err_decomp_decl_std_tuple_element_not_specialized : Error<
430   "cannot decompose this type; 'std::tuple_element<%0>::type' "
431   "does not name a type">;
432 def err_decomp_decl_std_tuple_size_not_constant : Error<
433   "cannot decompose this type; 'std::tuple_size<%0>::value' "
434   "is not a valid integral constant expression">;
435 def note_in_binding_decl_init : Note<
436   "in implicit initialization of binding declaration %0">;
437
438 def err_std_type_trait_not_class_template : Error<
439   "unsupported standard library implementation: "
440   "'std::%0' is not a class template">;
441
442 // C++ using declarations
443 def err_using_requires_qualname : Error<
444   "using declaration requires a qualified name">;
445 def err_using_typename_non_type : Error<
446   "'typename' keyword used on a non-type">;
447 def err_using_dependent_value_is_type : Error<
448   "dependent using declaration resolved to type without 'typename'">;
449 def err_using_decl_nested_name_specifier_is_not_class : Error<
450   "using declaration in class refers into '%0', which is not a class">;
451 def err_using_decl_nested_name_specifier_is_current_class : Error<
452   "using declaration refers to its own class">;
453 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
454   "using declaration refers into '%0', which is not a base class of %1">;
455 def err_using_decl_constructor_not_in_direct_base : Error<
456   "%0 is not a direct base of %1, cannot inherit constructors">;
457 def err_using_decl_can_not_refer_to_class_member : Error<
458   "using declaration cannot refer to class member">;
459 def err_ambiguous_inherited_constructor : Error<
460   "constructor of %0 inherited from multiple base class subobjects">;
461 def note_ambiguous_inherited_constructor_using : Note<
462   "inherited from base class %0 here">;
463 def note_using_decl_class_member_workaround : Note<
464   "use %select{an alias declaration|a typedef declaration|a reference|"
465   "a const variable|a constexpr variable}0 instead">;
466 def err_using_decl_can_not_refer_to_namespace : Error<
467   "using declaration cannot refer to a namespace">;
468 def err_using_decl_can_not_refer_to_scoped_enum : Error<
469   "using declaration cannot refer to a scoped enumerator">;
470 def err_using_decl_constructor : Error<
471   "using declaration cannot refer to a constructor">;
472 def warn_cxx98_compat_using_decl_constructor : Warning<
473   "inheriting constructors are incompatible with C++98">,
474   InGroup<CXX98Compat>, DefaultIgnore;
475 def err_using_decl_destructor : Error<
476   "using declaration cannot refer to a destructor">;
477 def err_using_decl_template_id : Error<
478   "using declaration cannot refer to a template specialization">;
479 def note_using_decl_target : Note<"target of using declaration">;
480 def note_using_decl_conflict : Note<"conflicting declaration">;
481 def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
482 def err_using_decl_conflict : Error<
483   "target of using declaration conflicts with declaration already in scope">;
484 def err_using_decl_conflict_reverse : Error<
485   "declaration conflicts with target of using declaration already in scope">;
486 def note_using_decl : Note<"%select{|previous }0using declaration">;
487 def err_using_decl_redeclaration_expansion : Error<
488   "using declaration pack expansion at block scope produces multiple values">;
489
490 def warn_access_decl_deprecated : Warning<
491   "access declarations are deprecated; use using declarations instead">,
492   InGroup<Deprecated>;
493 def err_access_decl : Error<
494   "ISO C++11 does not allow access declarations; "
495   "use using declarations instead">;
496 def ext_dynamic_exception_spec : ExtWarn<
497   "ISO C++17 does not allow dynamic exception specifications">,
498   InGroup<DynamicExceptionSpec>, DefaultError;
499 def warn_exception_spec_deprecated : Warning<
500   "dynamic exception specifications are deprecated">,
501   InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
502 def note_exception_spec_deprecated : Note<"use '%0' instead">;
503 def warn_deprecated_copy_operation : Warning<
504   "definition of implicit copy %select{constructor|assignment operator}1 "
505   "for %0 is deprecated because it has a user-declared "
506   "%select{copy %select{assignment operator|constructor}1|destructor}2">,
507   InGroup<Deprecated>, DefaultIgnore;
508 def warn_cxx1z_compat_exception_spec_in_signature : Warning<
509   "mangled name of %0 will change in C++17 due to non-throwing exception "
510   "specification in function signature">, InGroup<CXX17CompatMangling>;
511
512 def warn_global_constructor : Warning<
513   "declaration requires a global constructor">,
514   InGroup<GlobalConstructors>, DefaultIgnore;
515 def warn_global_destructor : Warning<
516   "declaration requires a global destructor">,
517    InGroup<GlobalConstructors>, DefaultIgnore;
518 def warn_exit_time_destructor : Warning<
519   "declaration requires an exit-time destructor">,
520   InGroup<ExitTimeDestructors>, DefaultIgnore;
521
522 def err_invalid_thread : Error<
523   "'%0' is only allowed on variable declarations">;
524 def err_thread_non_global : Error<
525   "'%0' variables must have global storage">;
526 def err_thread_unsupported : Error<
527   "thread-local storage is not supported for the current target">;
528
529 def warn_maybe_falloff_nonvoid_function : Warning<
530   "control may reach end of non-void function">,
531   InGroup<ReturnType>;
532 def warn_falloff_nonvoid_function : Warning<
533   "control reaches end of non-void function">,
534   InGroup<ReturnType>;
535 def err_maybe_falloff_nonvoid_block : Error<
536   "control may reach end of non-void block">;
537 def err_falloff_nonvoid_block : Error<
538   "control reaches end of non-void block">;
539 def warn_maybe_falloff_nonvoid_coroutine : Warning<
540   "control may reach end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
541   InGroup<ReturnType>;
542 def warn_falloff_nonvoid_coroutine : Warning<
543   "control reaches end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">,
544   InGroup<ReturnType>;
545 def warn_suggest_noreturn_function : Warning<
546   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
547   InGroup<MissingNoreturn>, DefaultIgnore;
548 def warn_suggest_noreturn_block : Warning<
549   "block could be declared with attribute 'noreturn'">,
550   InGroup<MissingNoreturn>, DefaultIgnore;
551
552 // Unreachable code.
553 def warn_unreachable : Warning<
554   "code will never be executed">,
555   InGroup<UnreachableCode>, DefaultIgnore;
556 def warn_unreachable_break : Warning<
557   "'break' will never be executed">,
558   InGroup<UnreachableCodeBreak>, DefaultIgnore;
559 def warn_unreachable_return : Warning<
560   "'return' will never be executed">,
561   InGroup<UnreachableCodeReturn>, DefaultIgnore;
562 def warn_unreachable_loop_increment : Warning<
563   "loop will run at most once (loop increment never executed)">,
564   InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
565 def note_unreachable_silence : Note<
566   "silence by adding parentheses to mark code as explicitly dead">;
567
568 /// Built-in functions.
569 def ext_implicit_lib_function_decl : ExtWarn<
570   "implicitly declaring library function '%0' with type %1">,
571   InGroup<ImplicitFunctionDeclare>;
572 def note_include_header_or_declare : Note<
573   "include the header <%0> or explicitly provide a declaration for '%1'">;
574 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
575 def warn_implicit_decl_requires_sysheader : Warning<
576   "declaration of built-in function '%1' requires inclusion of the header <%0>">,
577   InGroup<BuiltinRequiresHeader>;
578 def warn_redecl_library_builtin : Warning<
579   "incompatible redeclaration of library function %0">,
580   InGroup<DiagGroup<"incompatible-library-redeclaration">>;
581 def err_builtin_definition : Error<"definition of builtin function %0">;
582 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
583 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
584 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
585 def err_function_needs_feature
586     : Error<"always_inline function %1 requires target feature '%2', but would "
587             "be inlined into function %0 that is compiled without support for "
588             "'%2'">;
589 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
590   InGroup<ImplicitFunctionDeclare>, DefaultError;
591 def warn_dyn_class_memaccess : Warning<
592   "%select{destination for|source of|first operand of|second operand of}0 this "
593   "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
594   "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
595   InGroup<DiagGroup<"dynamic-class-memaccess">>;
596 def note_bad_memaccess_silence : Note<
597   "explicitly cast the pointer to silence this warning">;
598 def warn_sizeof_pointer_expr_memaccess : Warning<
599   "'%0' call operates on objects of type %1 while the size is based on a " 
600   "different type %2">, 
601   InGroup<SizeofPointerMemaccess>;
602 def warn_sizeof_pointer_expr_memaccess_note : Note<
603   "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
604   "it by the number of elements)|remove the addressof in the argument to "
605   "'sizeof' (and multiply it by the number of elements)|provide an explicit "
606   "length}0?">;
607 def warn_sizeof_pointer_type_memaccess : Warning<
608   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
609   "%select{destination|source}2; expected %3 or an explicit length">,
610   InGroup<SizeofPointerMemaccess>;
611 def warn_strlcpycat_wrong_size : Warning<
612   "size argument in %0 call appears to be size of the source; "
613   "expected the size of the destination">,
614   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
615 def note_strlcpycat_wrong_size : Note<
616   "change size argument to be the size of the destination">;
617 def warn_memsize_comparison : Warning<
618   "size argument in %0 call is a comparison">,
619   InGroup<DiagGroup<"memsize-comparison">>;
620 def note_memsize_comparison_paren : Note<
621   "did you mean to compare the result of %0 instead?">;
622 def note_memsize_comparison_cast_silence : Note<
623   "explicitly cast the argument to size_t to silence this warning">;
624   
625 def warn_strncat_large_size : Warning<
626   "the value of the size argument in 'strncat' is too large, might lead to a " 
627   "buffer overflow">, InGroup<StrncatSize>;
628 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " 
629   "to be size of the source">, InGroup<StrncatSize>;
630 def warn_strncat_wrong_size : Warning<
631   "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
632 def note_strncat_wrong_size : Note<
633   "change the argument to be the free space in the destination buffer minus " 
634   "the terminating null byte">;
635
636 def warn_assume_side_effects : Warning<
637   "the argument to %0 has side effects that will be discarded">,
638   InGroup<DiagGroup<"assume">>;
639
640 def warn_memcpy_chk_overflow : Warning<
641   "%0 will always overflow destination buffer">,
642   InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
643
644 /// main()
645 // static main() is not an error in C, just in C++.
646 def warn_static_main : Warning<"'main' should not be declared static">,
647     InGroup<Main>;
648 def err_static_main : Error<"'main' is not allowed to be declared static">;
649 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
650 def ext_variadic_main : ExtWarn<
651   "'main' is not allowed to be declared variadic">, InGroup<Main>;
652 def ext_noreturn_main : ExtWarn<
653   "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
654 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
655 def err_constexpr_main : Error<
656   "'main' is not allowed to be declared constexpr">;
657 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
658 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
659 def err_main_returns_nonint : Error<"'main' must return 'int'">;
660 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
661     InGroup<MainReturnType>;
662 def note_main_change_return_type : Note<"change return type to 'int'">;
663 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
664     "must be 0, 2, or 3">;
665 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
666     InGroup<Main>;
667 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
668     "parameter of 'main' (%select{argument count|argument array|environment|"
669     "platform-specific data}0) must be of type %1">;
670 def warn_main_returns_bool_literal : Warning<"bool literal returned from "
671     "'main'">, InGroup<Main>;
672 def err_main_global_variable :
673     Error<"main cannot be declared as global variable">;
674 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
675     "has undefined behavior">, InGroup<Main>;
676 def ext_main_used : Extension<
677   "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
678
679 /// parser diagnostics
680 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
681   InGroup<MissingDeclarations>;
682 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
683   InGroup<MissingDeclarations>;
684 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
685 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
686   " of anonymous type, but linkage was already computed">;
687 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
688   "linkage prior to definition">;
689 def err_statically_allocated_object : Error<
690   "interface type cannot be statically allocated">;
691 def err_object_cannot_be_passed_returned_by_value : Error<
692   "interface type %1 cannot be %select{returned|passed}0 by value"
693   "; did you forget * in %1?">;
694 def err_parameters_retval_cannot_have_fp16_type : Error<
695   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
696 def err_opencl_half_load_store : Error<
697   "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
698   "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
699 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
700 def err_opencl_half_declaration : Error<
701   "declaring variable of type %0 is not allowed">;
702 def err_opencl_half_param : Error<
703   "declaring function parameter of type %0 is not allowed; did you forget * ?">;
704 def err_opencl_invalid_return : Error<
705   "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
706 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
707 def warn_pragma_options_align_reset_failed : Warning<
708   "#pragma options align=reset failed: %0">,
709   InGroup<IgnoredPragmas>;
710 def err_pragma_options_align_mac68k_target_unsupported : Error<
711   "mac68k alignment pragma is not supported on this target">;
712 def warn_pragma_pack_invalid_alignment : Warning<
713   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
714   InGroup<IgnoredPragmas>;
715 // Follow the Microsoft implementation.
716 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
717 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
718   "specifying both a name and alignment to 'pop' is undefined">;
719 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
720   InGroup<IgnoredPragmas>;
721 def warn_cxx_ms_struct :
722   Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
723           "with base classes or virtual functions">,
724   DefaultError, InGroup<IncompatibleMSStruct>;
725 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
726 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
727 def err_invalid_super_scope : Error<"invalid use of '__super', "
728   "this keyword can only be used inside class or member function scope">;
729 def err_super_in_lambda_unsupported : Error<
730   "use of '__super' inside a lambda is unsupported">;
731
732 def warn_pragma_unused_undeclared_var : Warning<
733   "undeclared variable %0 used as an argument for '#pragma unused'">,
734   InGroup<IgnoredPragmas>;
735 def warn_atl_uuid_deprecated : Warning<
736   "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
737   InGroup<DeprecatedDeclarations>;
738 def warn_pragma_unused_expected_var_arg : Warning<
739   "only variables can be arguments to '#pragma unused'">,
740   InGroup<IgnoredPragmas>;
741 def err_pragma_push_visibility_mismatch : Error<
742   "#pragma visibility push with no matching #pragma visibility pop">;
743 def note_surrounding_namespace_ends_here : Note<
744   "surrounding namespace with visibility attribute ends here">;
745 def err_pragma_pop_visibility_mismatch : Error<
746   "#pragma visibility pop with no matching #pragma visibility push">;
747 def note_surrounding_namespace_starts_here : Note<
748   "surrounding namespace with visibility attribute starts here">;
749 def err_pragma_loop_invalid_argument_type : Error<
750   "invalid argument of type %0; expected an integer type">;
751 def err_pragma_loop_invalid_argument_value : Error<
752   "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
753 def err_pragma_loop_compatibility : Error<
754   "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
755 def err_pragma_loop_precedes_nonloop : Error<
756   "expected a for, while, or do-while loop to follow '%0'">;
757
758 def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
759   "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
760   "those declarations">;
761 def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
762   "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
763 def err_pragma_attribute_invalid_matchers : Error<
764   "attribute %0 can't be applied to %1">;
765 def err_pragma_attribute_stack_mismatch : Error<
766   "'#pragma clang attribute pop' with no matching '#pragma clang attribute push'">;
767 def warn_pragma_attribute_unused : Warning<
768   "unused attribute %0 in '#pragma clang attribute push' region">,
769   InGroup<PragmaClangAttribute>;
770 def note_pragma_attribute_region_ends_here : Note<
771   "'#pragma clang attribute push' regions ends here">;
772 def err_pragma_attribute_no_pop_eof : Error<"unterminated "
773   "'#pragma clang attribute push' at end of file">;
774 def note_pragma_attribute_applied_decl_here : Note<
775   "when applied to this declaration">;
776
777 /// Objective-C parser diagnostics
778 def err_duplicate_class_def : Error<
779   "duplicate interface definition for class %0">;
780 def err_undef_superclass : Error<
781   "cannot find interface declaration for %0, superclass of %1">;
782 def err_forward_superclass : Error<
783   "attempting to use the forward class %0 as superclass of %1">;
784 def err_no_nsconstant_string_class : Error<
785   "cannot find interface declaration for %0">;
786 def err_recursive_superclass : Error<
787   "trying to recursively use %0 as superclass of %1">;
788 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
789 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
790 def warn_duplicate_protocol_def : Warning<
791   "duplicate protocol definition of %0 is ignored">,
792   InGroup<DiagGroup<"duplicate-protocol">>;
793 def err_protocol_has_circular_dependency : Error<
794   "protocol has circular dependency">;
795 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
796 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
797 def warn_atprotocol_protocol : Warning<
798   "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
799 def warn_readonly_property : Warning<
800   "attribute 'readonly' of property %0 restricts attribute "
801   "'readwrite' of property inherited from %1">,
802   InGroup<PropertyAttr>;
803
804 def warn_property_attribute : Warning<
805   "'%1' attribute on property %0 does not match the property inherited from %2">,
806   InGroup<PropertyAttr>;
807 def warn_property_types_are_incompatible : Warning<
808   "property type %0 is incompatible with type %1 inherited from %2">,
809   InGroup<DiagGroup<"incompatible-property-type">>;
810 def warn_protocol_property_mismatch : Warning<
811   "property %select{of type %1|with attribute '%1'|without attribute '%1'|with "
812   "getter %1|with setter %1}0 was selected for synthesis">,
813   InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
814 def err_protocol_property_mismatch: Error<warn_protocol_property_mismatch.Text>;
815 def err_undef_interface : Error<"cannot find interface declaration for %0">;
816 def err_category_forward_interface : Error<
817   "cannot define %select{category|class extension}0 for undefined class %1">;
818 def err_class_extension_after_impl : Error<
819   "cannot declare class extension for %0 after class implementation">;
820 def note_implementation_declared : Note<
821   "class implementation is declared here">;
822 def note_while_in_implementation : Note<
823   "detected while default synthesizing properties in class implementation">;
824 def note_class_declared : Note<
825   "class is declared here">;
826 def note_receiver_class_declared : Note<
827   "receiver is instance of class declared here">;
828 def note_receiver_expr_here : Note<
829   "receiver expression is here">;
830 def note_receiver_is_id : Note<
831   "receiver is treated with 'id' type for purpose of method lookup">;
832 def note_suppressed_class_declare : Note<
833   "class with specified objc_requires_property_definitions attribute is declared here">;
834 def err_objc_root_class_subclass : Error<
835   "objc_root_class attribute may only be specified on a root class declaration">;
836 def err_restricted_superclass_mismatch : Error<
837   "cannot subclass a class that was declared with the "
838   "'objc_subclassing_restricted' attribute">;
839 def warn_objc_root_class_missing : Warning<
840   "class %0 defined without specifying a base class">,
841   InGroup<ObjCRootClass>;
842 def err_objc_runtime_visible_category : Error<
843   "cannot implement a category for class %0 that is only visible via the "
844   "Objective-C runtime">;
845 def err_objc_runtime_visible_subclass : Error<
846   "cannot implement subclass %0 of a superclass %1 that is only visible via the "
847   "Objective-C runtime">;
848 def note_objc_needs_superclass : Note<
849   "add a super class to fix this problem">;
850 def warn_dup_category_def : Warning<
851   "duplicate definition of category %1 on interface %0">;
852 def err_conflicting_super_class : Error<"conflicting super class name %0">;
853 def err_dup_implementation_class : Error<"reimplementation of class %0">;
854 def err_dup_implementation_category : Error<
855   "reimplementation of category %1 for class %0">;
856 def err_conflicting_ivar_type : Error<
857   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
858 def err_duplicate_ivar_declaration : Error<
859   "instance variable is already declared">;
860 def warn_on_superclass_use : Warning<
861   "class implementation may not have super class">;
862 def err_conflicting_ivar_bitwidth : Error<
863   "instance variable %0 has conflicting bit-field width">;
864 def err_conflicting_ivar_name : Error<
865   "conflicting instance variable names: %0 vs %1">;
866 def err_inconsistent_ivar_count : Error<
867   "inconsistent number of instance variables specified">;
868 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
869   InGroup<DiagGroup<"incomplete-implementation">>;
870
871 def warn_conflicting_overriding_ret_types : Warning<
872   "conflicting return type in "
873   "declaration of %0%diff{: $ vs $|}1,2">,
874   InGroup<OverridingMethodMismatch>, DefaultIgnore;
875
876 def warn_conflicting_ret_types : Warning<
877   "conflicting return type in "
878   "implementation of %0%diff{: $ vs $|}1,2">,
879   InGroup<MismatchedReturnTypes>;
880
881 def warn_conflicting_overriding_ret_type_modifiers : Warning<
882   "conflicting distributed object modifiers on return type "
883   "in declaration of %0">,
884   InGroup<OverridingMethodMismatch>, DefaultIgnore;
885
886 def warn_conflicting_ret_type_modifiers : Warning<
887   "conflicting distributed object modifiers on return type "
888   "in implementation of %0">,
889   InGroup<DistributedObjectModifiers>;
890
891 def warn_non_covariant_overriding_ret_types : Warning<
892   "conflicting return type in "
893   "declaration of %0: %1 vs %2">,
894   InGroup<OverridingMethodMismatch>, DefaultIgnore;
895
896 def warn_non_covariant_ret_types : Warning<
897   "conflicting return type in "
898   "implementation of %0: %1 vs %2">,
899   InGroup<MethodSignatures>, DefaultIgnore;
900
901 def warn_conflicting_overriding_param_types : Warning<
902   "conflicting parameter types in "
903   "declaration of %0%diff{: $ vs $|}1,2">,
904   InGroup<OverridingMethodMismatch>, DefaultIgnore;
905
906 def warn_conflicting_param_types : Warning<
907   "conflicting parameter types in "
908   "implementation of %0%diff{: $ vs $|}1,2">,
909   InGroup<MismatchedParameterTypes>;
910
911 def warn_conflicting_param_modifiers : Warning<
912   "conflicting distributed object modifiers on parameter type "
913   "in implementation of %0">,
914   InGroup<DistributedObjectModifiers>;
915
916 def warn_conflicting_overriding_param_modifiers : Warning<
917   "conflicting distributed object modifiers on parameter type "
918   "in declaration of %0">,
919   InGroup<OverridingMethodMismatch>, DefaultIgnore;
920
921 def warn_non_contravariant_overriding_param_types : Warning<
922   "conflicting parameter types in "
923   "declaration of %0: %1 vs %2">,
924   InGroup<OverridingMethodMismatch>, DefaultIgnore;
925
926 def warn_non_contravariant_param_types : Warning<
927   "conflicting parameter types in "
928   "implementation of %0: %1 vs %2">,
929   InGroup<MethodSignatures>, DefaultIgnore;
930
931 def warn_conflicting_overriding_variadic :Warning<
932   "conflicting variadic declaration of method and its "
933   "implementation">,
934   InGroup<OverridingMethodMismatch>, DefaultIgnore;
935
936 def warn_conflicting_variadic :Warning<
937   "conflicting variadic declaration of method and its "
938   "implementation">;
939
940 def warn_category_method_impl_match:Warning<
941   "category is implementing a method which will also be implemented"
942   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
943
944 def warn_implements_nscopying : Warning<
945 "default assign attribute on property %0 which implements "
946 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
947
948 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
949   InGroup<ObjCMultipleMethodNames>;
950 def warn_strict_multiple_method_decl : Warning<
951   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
952 def warn_accessor_property_type_mismatch : Warning<
953   "type of property %0 does not match type of accessor %1">;
954 def note_conv_function_declared_at : Note<"type conversion function declared here">;
955 def note_method_declared_at : Note<"method %0 declared here">;
956 def note_property_attribute : Note<"property %0 is declared "
957   "%select{deprecated|unavailable|partial}1 here">;
958 def err_setter_type_void : Error<"type of setter must be void">;
959 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
960 def warn_duplicate_method_decl : 
961   Warning<"multiple declarations of method %0 found and ignored">, 
962   InGroup<MethodDuplicate>, DefaultIgnore;
963 def warn_objc_cdirective_format_string :
964   Warning<"using %0 directive in %select{NSString|CFString}1 "
965           "which is being passed as a formatting argument to the formatting "
966           "%select{method|CFfunction}2">,
967   InGroup<ObjCCStringFormat>, DefaultIgnore;
968 def err_objc_var_decl_inclass : 
969     Error<"cannot declare variable inside @interface or @protocol">;
970 def err_missing_method_context : Error<
971   "missing context for method declaration">;
972 def err_objc_property_attr_mutually_exclusive : Error<
973   "property attributes '%0' and '%1' are mutually exclusive">;
974 def err_objc_property_requires_object : Error<
975   "property with '%0' attribute must be of object type">;
976 def warn_objc_property_no_assignment_attribute : Warning<
977   "no 'assign', 'retain', or 'copy' attribute is specified - "
978   "'assign' is assumed">,
979   InGroup<ObjCPropertyNoAttribute>;
980 def warn_objc_isa_use : Warning<
981   "direct access to Objective-C's isa is deprecated in favor of "
982   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
983 def warn_objc_isa_assign : Warning<
984   "assignment to Objective-C's isa is deprecated in favor of "
985   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
986 def warn_objc_pointer_masking : Warning<
987   "bitmasking for introspection of Objective-C object pointers is strongly "
988   "discouraged">,
989   InGroup<ObjCPointerIntrospect>;
990 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
991   InGroup<ObjCPointerIntrospectPerformSelector>;
992 def warn_objc_property_default_assign_on_object : Warning<
993   "default property attribute 'assign' not appropriate for non-GC object">,
994   InGroup<ObjCPropertyNoAttribute>;
995 def warn_property_attr_mismatch : Warning<
996   "property attribute in class extension does not match the primary class">,
997   InGroup<PropertyAttr>;
998 def warn_property_implicitly_mismatched : Warning <
999   "primary property declaration is implicitly strong while redeclaration "
1000   "in class extension is weak">,
1001   InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
1002 def warn_objc_property_copy_missing_on_block : Warning<
1003     "'copy' attribute must be specified for the block property "
1004     "when -fobjc-gc-only is specified">;
1005 def warn_objc_property_retain_of_block : Warning<
1006     "retain'ed block property does not copy the block "
1007     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1008 def warn_objc_readonly_property_has_setter : Warning<
1009     "setter cannot be specified for a readonly property">,
1010     InGroup<ObjCReadonlyPropertyHasSetter>;
1011 def warn_atomic_property_rule : Warning<
1012   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1013   "with a user defined %select{getter|setter}2">,
1014   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1015 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1016   "synthesized, or both be user defined,or the property must be nonatomic">;
1017 def err_atomic_property_nontrivial_assign_op : Error<
1018   "atomic property of reference type %0 cannot have non-trivial assignment"
1019   " operator">;
1020 def warn_cocoa_naming_owned_rule : Warning<
1021   "property follows Cocoa naming"
1022   " convention for returning 'owned' objects">,
1023   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1024 def err_cocoa_naming_owned_rule : Error<
1025   "property follows Cocoa naming"
1026   " convention for returning 'owned' objects">;
1027 def note_cocoa_naming_declare_family : Note<
1028   "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1029   "object">;
1030 def warn_auto_synthesizing_protocol_property :Warning<
1031   "auto property synthesis will not synthesize property %0"
1032   " declared in protocol %1">,
1033   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1034 def note_add_synthesize_directive : Note<
1035   "add a '@synthesize' directive">;
1036 def warn_no_autosynthesis_shared_ivar_property : Warning <
1037   "auto property synthesis will not synthesize property "
1038   "%0 because it cannot share an ivar with another synthesized property">,
1039   InGroup<ObjCNoPropertyAutoSynthesis>;
1040 def warn_no_autosynthesis_property : Warning<
1041   "auto property synthesis will not synthesize property "
1042   "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1043   "via another property">,
1044   InGroup<ObjCNoPropertyAutoSynthesis>;
1045 def warn_autosynthesis_property_in_superclass : Warning<
1046   "auto property synthesis will not synthesize property "
1047   "%0; it will be implemented by its superclass, use @dynamic to "
1048   "acknowledge intention">,
1049   InGroup<ObjCNoPropertyAutoSynthesis>;
1050 def warn_autosynthesis_property_ivar_match :Warning<
1051   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1052   "%2, not existing instance variable %3">,
1053   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1054 def warn_missing_explicit_synthesis : Warning <
1055   "auto property synthesis is synthesizing property not explicitly synthesized">,
1056   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1057 def warn_property_getter_owning_mismatch : Warning<
1058   "property declared as returning non-retained objects"
1059   "; getter returning retained objects">;
1060 def warn_property_redecl_getter_mismatch : Warning<
1061   "getter name mismatch between property redeclaration (%1) and its original "
1062   "declaration (%0)">, InGroup<PropertyAttr>;
1063 def err_property_setter_ambiguous_use : Error<
1064   "synthesized properties %0 and %1 both claim setter %2 -"
1065   " use of this setter will cause unexpected behavior">;
1066 def warn_default_atomic_custom_getter_setter : Warning<
1067   "atomic by default property %0 has a user defined %select{getter|setter}1 "
1068   "(property should be marked 'atomic' if this is intended)">,
1069   InGroup<CustomAtomic>, DefaultIgnore;
1070 def err_use_continuation_class : Error<
1071   "illegal redeclaration of property in class extension %0"
1072   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1073 def err_type_mismatch_continuation_class : Error<
1074   "type of property %0 in class extension does not match "
1075   "property type in primary class">;
1076 def err_use_continuation_class_redeclaration_readwrite : Error<
1077   "illegal redeclaration of 'readwrite' property in class extension %0"
1078   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1079   "'readonly' public property?)">;
1080 def err_continuation_class : Error<"class extension has no primary class">;
1081 def err_property_type : Error<"property cannot have array or function type %0">;
1082 def err_missing_property_context : Error<
1083   "missing context for property implementation declaration">;
1084 def err_bad_property_decl : Error<
1085   "property implementation must have its declaration in interface %0 or one of "
1086   "its extensions">;
1087 def err_category_property : Error<
1088   "property declared in category %0 cannot be implemented in "
1089   "class implementation">;
1090 def note_property_declare : Note<
1091   "property declared here">;
1092 def note_protocol_property_declare : Note<
1093   "it could also be property "
1094   "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter "
1095   "%1|with setter %1}0 declared here">;
1096 def note_property_synthesize : Note<
1097   "property synthesized here">;
1098 def err_synthesize_category_decl : Error<
1099   "@synthesize not allowed in a category's implementation">;
1100 def err_synthesize_on_class_property : Error<
1101   "@synthesize not allowed on a class property %0">;
1102 def err_missing_property_interface : Error<
1103   "property implementation in a category with no category declaration">;
1104 def err_bad_category_property_decl : Error<
1105   "property implementation must have its declaration in the category %0">;
1106 def err_bad_property_context : Error<
1107   "property implementation must be in a class or category implementation">;
1108 def err_missing_property_ivar_decl : Error<
1109   "synthesized property %0 must either be named the same as a compatible"
1110   " instance variable or must explicitly name an instance variable">;
1111 def err_arc_perform_selector_retains : Error<
1112   "performSelector names a selector which retains the object">;
1113 def warn_arc_perform_selector_leaks : Warning<
1114   "performSelector may cause a leak because its selector is unknown">,
1115   InGroup<DiagGroup<"arc-performSelector-leaks">>;
1116 def warn_dealloc_in_category : Warning<
1117 "-dealloc is being overridden in a category">,
1118 InGroup<DeallocInCategory>;
1119 def err_gc_weak_property_strong_type : Error<
1120   "weak attribute declared on a __strong type property in GC mode">;
1121 def warn_arc_repeated_use_of_weak : Warning <
1122   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1123   "accessed multiple times in this %select{function|method|block|lambda}2 "
1124   "but may be unpredictably set to nil; assign to a strong variable to keep "
1125   "the object alive">,
1126   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1127 def warn_implicitly_retains_self : Warning <
1128   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1129   "this is intended behavior">,
1130   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1131 def warn_arc_possible_repeated_use_of_weak : Warning <
1132   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1133   "be accessed multiple times in this %select{function|method|block|lambda}2 "
1134   "and may be unpredictably set to nil; assign to a strong variable to keep "
1135   "the object alive">,
1136   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1137 def note_arc_weak_also_accessed_here : Note<
1138   "also accessed here">;
1139 def err_incomplete_synthesized_property : Error<
1140   "cannot synthesize property %0 with incomplete type %1">;
1141
1142 def err_property_ivar_type : Error<
1143   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1144 def err_property_accessor_type : Error<
1145   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1146 def err_ivar_in_superclass_use : Error<
1147   "property %0 attempting to use instance variable %1 declared in super class %2">;
1148 def err_weak_property : Error<
1149   "existing instance variable %1 for __weak property %0 must be __weak">;
1150 def err_strong_property : Error<
1151   "existing instance variable %1 for strong property %0 may not be __weak">;
1152 def err_dynamic_property_ivar_decl : Error<
1153   "dynamic property cannot have instance variable specification">;
1154 def err_duplicate_ivar_use : Error<
1155   "synthesized properties %0 and %1 both claim instance variable %2">;
1156 def err_property_implemented : Error<"property %0 is already implemented">;
1157 def warn_objc_missing_super_call : Warning<
1158   "method possibly missing a [super %0] call">,
1159   InGroup<ObjCMissingSuperCalls>;
1160 def err_dealloc_bad_result_type : Error<
1161   "dealloc return type must be correctly specified as 'void' under ARC, "
1162   "instead of %0">;
1163 def warn_undeclared_selector : Warning<
1164   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1165 def warn_undeclared_selector_with_typo : Warning<
1166   "undeclared selector %0; did you mean %1?">,
1167   InGroup<UndeclaredSelector>, DefaultIgnore;
1168 def warn_implicit_atomic_property : Warning<
1169   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1170 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1171   "property should be changed to be readwrite">;
1172 def warn_auto_readonly_iboutlet_property : Warning<
1173   "readonly IBOutlet property %0 when auto-synthesized may "
1174   "not work correctly with 'nib' loader">,
1175   InGroup<DiagGroup<"readonly-iboutlet-property">>;
1176 def warn_auto_implicit_atomic_property : Warning<
1177   "property is assumed atomic when auto-synthesizing the property">,
1178   InGroup<ImplicitAtomic>, DefaultIgnore;
1179 def warn_unimplemented_selector:  Warning<
1180   "no method with selector %0 is implemented in this translation unit">, 
1181   InGroup<Selector>, DefaultIgnore;
1182 def warn_unimplemented_protocol_method : Warning<
1183   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1184 def warn_multiple_selectors: Warning<
1185   "several methods with selector %0 of mismatched types are found "
1186   "for the @selector expression">,
1187   InGroup<SelectorTypeMismatch>, DefaultIgnore;
1188
1189 def err_objc_kindof_nonobject : Error<
1190   "'__kindof' specifier cannot be applied to non-object type %0">;
1191 def err_objc_kindof_wrong_position : Error<
1192   "'__kindof' type specifier must precede the declarator">;
1193
1194 def err_objc_method_unsupported_param_ret_type : Error<
1195   "%0 %select{parameter|return}1 type is unsupported; "
1196   "support for vector types for this target is introduced in %2">;
1197
1198 // C++ declarations
1199 def err_static_assert_expression_is_not_constant : Error<
1200   "static_assert expression is not an integral constant expression">;
1201 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1202 def ext_static_assert_no_message : ExtWarn<
1203   "static_assert with no message is a C++17 extension">, InGroup<CXX17>;
1204 def warn_cxx14_compat_static_assert_no_message : Warning<
1205   "static_assert with no message is incompatible with C++ standards before C++17">,
1206   DefaultIgnore, InGroup<CXXPre1zCompat>;
1207
1208 def ext_inline_variable : ExtWarn<
1209   "inline variables are a C++17 extension">, InGroup<CXX17>;
1210 def warn_cxx14_compat_inline_variable : Warning<
1211   "inline variables are incompatible with C++ standards before C++17">,
1212   DefaultIgnore, InGroup<CXXPre1zCompat>;
1213
1214 def warn_inline_namespace_reopened_noninline : Warning<
1215   "inline namespace reopened as a non-inline namespace">;
1216 def err_inline_namespace_mismatch : Error<
1217   "non-inline namespace cannot be reopened as inline">;
1218
1219 def err_unexpected_friend : Error<
1220   "friends can only be classes or functions">;
1221 def ext_enum_friend : ExtWarn<
1222   "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1223 def warn_cxx98_compat_enum_friend : Warning<
1224   "befriending enumeration type %0 is incompatible with C++98">,
1225   InGroup<CXX98Compat>, DefaultIgnore;
1226 def ext_nonclass_type_friend : ExtWarn<
1227   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1228 def warn_cxx98_compat_nonclass_type_friend : Warning<
1229   "non-class friend type %0 is incompatible with C++98">,
1230   InGroup<CXX98Compat>, DefaultIgnore;
1231 def err_friend_is_member : Error<
1232   "friends cannot be members of the declaring class">;
1233 def warn_cxx98_compat_friend_is_member : Warning<
1234   "friend declaration naming a member of the declaring class is incompatible "
1235   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1236 def ext_unelaborated_friend_type : ExtWarn<
1237   "unelaborated friend declaration is a C++11 extension; specify "
1238   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1239   InGroup<CXX11>;
1240 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1241   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1242   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1243 def err_qualified_friend_not_found : Error<
1244   "no function named %0 with type %1 was found in the specified scope">;
1245 def err_introducing_special_friend : Error<
1246   "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1247   " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1248   "as a friend">;
1249 def err_tagless_friend_type_template : Error<
1250   "friend type templates must use an elaborated type">;
1251 def err_no_matching_local_friend : Error<
1252   "no matching function found in local scope">;
1253 def err_no_matching_local_friend_suggest : Error<
1254   "no matching function %0 found in local scope; did you mean %3?">;
1255 def err_partial_specialization_friend : Error<
1256   "partial specialization cannot be declared as a friend">;
1257 def err_qualified_friend_def : Error<
1258   "friend function definition cannot be qualified with '%0'">;
1259 def err_friend_def_in_local_class : Error<
1260   "friend function cannot be defined in a local class">;
1261 def err_friend_not_first_in_declaration : Error<
1262   "'friend' must appear first in a non-function declaration">;
1263 def err_using_decl_friend : Error<
1264   "cannot befriend target of using declaration">;
1265 def warn_template_qualified_friend_unsupported : Warning<
1266   "dependent nested name specifier '%0' for friend class declaration is "
1267   "not supported; turning off access control for %1">,
1268   InGroup<UnsupportedFriend>;
1269 def warn_template_qualified_friend_ignored : Warning<
1270   "dependent nested name specifier '%0' for friend template declaration is "
1271   "not supported; ignoring this friend declaration">,
1272   InGroup<UnsupportedFriend>;
1273 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1274   "unqualified friend declaration referring to type outside of the nearest "
1275   "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1276   InGroup<MicrosoftUnqualifiedFriend>;
1277 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1278
1279 def err_invalid_member_in_interface : Error<
1280   "%select{data member |non-public member function |static member function |"
1281           "user-declared constructor|user-declared destructor|operator |"
1282           "nested class }0%1 is not permitted within an interface type">;
1283 def err_invalid_base_in_interface : Error<
1284   "interface type cannot inherit from "
1285   "%select{'struct|non-public 'interface|'class}0 %1'">;
1286
1287 def err_abstract_type_in_decl : Error<
1288   "%select{return|parameter|variable|field|instance variable|"
1289   "synthesized instance variable}0 type %1 is an abstract class">;
1290 def err_allocation_of_abstract_type : Error<
1291   "allocating an object of abstract class type %0">;
1292 def err_throw_abstract_type : Error<
1293   "cannot throw an object of abstract type %0">;
1294 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1295 def err_capture_of_abstract_type : Error<
1296   "by-copy capture of value of abstract type %0">;
1297 def err_capture_of_incomplete_type : Error<
1298   "by-copy capture of variable %0 with incomplete type %1">;
1299 def err_capture_default_non_local : Error<
1300   "non-local lambda expression cannot have a capture-default">;
1301
1302 def err_multiple_final_overriders : Error<
1303   "virtual function %q0 has more than one final overrider in %1">; 
1304 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1305
1306 def err_type_defined_in_type_specifier : Error<
1307   "%0 cannot be defined in a type specifier">;
1308 def err_type_defined_in_result_type : Error<
1309   "%0 cannot be defined in the result type of a function">;
1310 def err_type_defined_in_param_type : Error<
1311   "%0 cannot be defined in a parameter type">;
1312 def err_type_defined_in_alias_template : Error<
1313   "%0 cannot be defined in a type alias template">;
1314 def err_type_defined_in_condition : Error<
1315   "%0 cannot be defined in a condition">;
1316
1317 def note_pure_virtual_function : Note<
1318   "unimplemented pure virtual method %0 in %1">;
1319
1320 def note_pure_qualified_call_kext : Note<
1321   "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1322
1323 def err_deleted_decl_not_first : Error<
1324   "deleted definition must be first declaration">;
1325
1326 def err_deleted_override : Error<
1327   "deleted function %0 cannot override a non-deleted function">;
1328
1329 def err_non_deleted_override : Error<
1330   "non-deleted function %0 cannot override a deleted function">;
1331
1332 def warn_weak_vtable : Warning<
1333   "%0 has no out-of-line virtual method definitions; its vtable will be "
1334   "emitted in every translation unit">,
1335   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1336 def warn_weak_template_vtable : Warning<
1337   "explicit template instantiation %0 will emit a vtable in every "
1338   "translation unit">,
1339   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1340
1341 def ext_using_undefined_std : ExtWarn<
1342   "using directive refers to implicitly-defined namespace 'std'">;
1343   
1344 // C++ exception specifications
1345 def err_exception_spec_in_typedef : Error<
1346   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1347 def err_distant_exception_spec : Error<
1348   "exception specifications are not allowed beyond a single level "
1349   "of indirection">;
1350 def err_incomplete_in_exception_spec : Error<
1351   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1352   "in exception specification">;
1353 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1354   InGroup<MicrosoftExceptionSpec>;
1355 def err_rref_in_exception_spec : Error<
1356   "rvalue reference type %0 is not allowed in exception specification">;
1357 def err_mismatched_exception_spec : Error<
1358   "exception specification in declaration does not match previous declaration">;
1359 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1360   InGroup<MicrosoftExceptionSpec>;
1361 def err_override_exception_spec : Error<
1362   "exception specification of overriding function is more lax than "
1363   "base version">;
1364 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1365   InGroup<MicrosoftExceptionSpec>;
1366 def err_incompatible_exception_specs : Error<
1367   "target exception specification is not superset of source">;
1368 def warn_incompatible_exception_specs : Warning<
1369   err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1370 def err_deep_exception_specs_differ : Error<
1371   "exception specifications of %select{return|argument}0 types differ">;
1372 def warn_deep_exception_specs_differ : Warning<
1373   err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1374 def err_missing_exception_specification : Error<
1375   "%0 is missing exception specification '%1'">;
1376 def ext_missing_exception_specification : ExtWarn<
1377   err_missing_exception_specification.Text>,
1378   InGroup<DiagGroup<"missing-exception-spec">>;
1379 def ext_ms_missing_exception_specification : ExtWarn<
1380   err_missing_exception_specification.Text>,
1381   InGroup<MicrosoftExceptionSpec>;
1382 def err_noexcept_needs_constant_expression : Error<
1383   "argument to noexcept specifier must be a constant expression">;
1384 def err_exception_spec_not_parsed : Error<
1385   "exception specification is not available until end of class definition">;
1386
1387 // C++ access checking
1388 def err_class_redeclared_with_different_access : Error<
1389   "%0 redeclared with '%1' access">;
1390 def err_access : Error<
1391   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1392 def ext_ms_using_declaration_inaccessible : ExtWarn<
1393   "using declaration referring to inaccessible member '%0' (which refers "
1394   "to accessible member '%1') is a Microsoft compatibility extension">,
1395     AccessControl, InGroup<MicrosoftUsingDecl>;
1396 def err_access_ctor : Error<
1397   "calling a %select{private|protected}0 constructor of class %2">, 
1398   AccessControl;
1399 def ext_rvalue_to_reference_access_ctor : Extension<
1400   "C++98 requires an accessible copy constructor for class %2 when binding "
1401   "a reference to a temporary; was %select{private|protected}0">,
1402   AccessControl, InGroup<BindToTemporaryCopy>;
1403 def err_access_base_ctor : Error<
1404   // The ERRORs represent other special members that aren't constructors, in
1405   // hopes that someone will bother noticing and reporting if they appear
1406   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1407   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1408   "|*ERROR*|}2constructor">, AccessControl;
1409 def err_access_field_ctor : Error<
1410   // The ERRORs represent other special members that aren't constructors, in
1411   // hopes that someone will bother noticing and reporting if they appear
1412   "field of type %0 has %select{private|protected}2 "
1413   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1414   AccessControl;
1415 def err_access_friend_function : Error<
1416   "friend function %1 is a %select{private|protected}0 member of %3">,
1417   AccessControl;
1418
1419 def err_access_dtor : Error<
1420   "calling a %select{private|protected}1 destructor of class %0">, 
1421   AccessControl;
1422 def err_access_dtor_base :
1423     Error<"base class %0 has %select{private|protected}1 destructor">,
1424     AccessControl;
1425 def err_access_dtor_vbase :
1426     Error<"inherited virtual base class %1 has "
1427     "%select{private|protected}2 destructor">,
1428     AccessControl;
1429 def err_access_dtor_temp :
1430     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1431     AccessControl;
1432 def err_access_dtor_exception :
1433     Error<"exception object of type %0 has %select{private|protected}1 "
1434           "destructor">, AccessControl;
1435 def err_access_dtor_field :
1436     Error<"field of type %1 has %select{private|protected}2 destructor">,
1437     AccessControl;
1438 def err_access_dtor_var :
1439     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1440     AccessControl;
1441 def err_access_dtor_ivar :
1442     Error<"instance variable of type %0 has %select{private|protected}1 "
1443           "destructor">,
1444     AccessControl;
1445 def note_previous_access_declaration : Note<
1446   "previously declared '%1' here">;
1447 def note_access_natural : Note<
1448   "%select{|implicitly }1declared %select{private|protected}0 here">;
1449 def note_access_constrained_by_path : Note<
1450   "constrained by %select{|implicitly }1%select{private|protected}0"
1451   " inheritance here">;
1452 def note_access_protected_restricted_noobject : Note<
1453   "must name member using the type of the current context %0">;
1454 def note_access_protected_restricted_ctordtor : Note<
1455   "protected %select{constructor|destructor}0 can only be used to "
1456   "%select{construct|destroy}0 a base class subobject">;
1457 def note_access_protected_restricted_object : Note<
1458   "can only access this member on an object of type %0">;
1459 def warn_cxx98_compat_sfinae_access_control : Warning<
1460   "substitution failure due to access control is incompatible with C++98">,
1461   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1462   
1463 // C++ name lookup
1464 def err_incomplete_nested_name_spec : Error<
1465   "incomplete type %0 named in nested name specifier">;
1466 def err_dependent_nested_name_spec : Error<
1467   "nested name specifier for a declaration cannot depend on a template "
1468   "parameter">;
1469 def err_nested_name_member_ref_lookup_ambiguous : Error<
1470   "lookup of %0 in member access expression is ambiguous">;
1471 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1472   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1473   InGroup<AmbigMemberTemplate>;
1474 def note_ambig_member_ref_object_type : Note<
1475   "lookup in the object type %0 refers here">;
1476 def note_ambig_member_ref_scope : Note<
1477   "lookup from the current scope refers here">;
1478 def err_qualified_member_nonclass : Error<
1479   "qualified member access refers to a member in %0">;
1480 def err_incomplete_member_access : Error<
1481   "member access into incomplete type %0">;
1482 def err_incomplete_type : Error<
1483   "incomplete type %0 where a complete type is required">;
1484 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1485   "enumeration type in nested name specifier is incompatible with C++98">,
1486   InGroup<CXX98Compat>, DefaultIgnore;
1487 def err_nested_name_spec_is_not_class : Error<
1488   "%0 cannot appear before '::' because it is not a class"
1489   "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1490 def ext_nested_name_spec_is_enum : ExtWarn<
1491   "use of enumeration in a nested name specifier is a C++11 extension">,
1492   InGroup<CXX11>;
1493 def err_out_of_line_qualified_id_type_names_constructor : Error<
1494   "qualified reference to %0 is a constructor name rather than a "
1495   "%select{template name|type}1 in this context">;
1496 def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1497   "ISO C++ specifies that "
1498   "qualified reference to %0 is a constructor name rather than a "
1499   "%select{template name|type}1 in this context, despite preceding "
1500   "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1501   InGroup<DiagGroup<"injected-class-name">>;
1502
1503 // C++ class members
1504 def err_storageclass_invalid_for_member : Error<
1505   "storage class specified for a member declaration">;
1506 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1507 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1508 def ext_mutable_reference : ExtWarn<
1509   "'mutable' on a reference type is a Microsoft extension">,
1510   InGroup<MicrosoftMutableReference>;
1511 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1512 def err_mutable_nonmember : Error<
1513   "'mutable' can only be applied to member variables">;
1514 def err_virtual_in_union : Error<
1515   "unions cannot have virtual functions">;
1516 def err_virtual_non_function : Error<
1517   "'virtual' can only appear on non-static member functions">;
1518 def err_virtual_out_of_class : Error<
1519   "'virtual' can only be specified inside the class definition">;
1520 def err_virtual_member_function_template : Error<
1521   "'virtual' cannot be specified on member function templates">;
1522 def err_static_overrides_virtual : Error<
1523   "'static' member function %0 overrides a virtual function in a base class">;
1524 def err_explicit_non_function : Error<
1525   "'explicit' can only appear on non-static member functions">;
1526 def err_explicit_out_of_class : Error<
1527   "'explicit' can only be specified inside the class definition">;
1528 def err_explicit_non_ctor_or_conv_function : Error<
1529   "'explicit' can only be applied to a constructor or conversion function">;
1530 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1531 def err_static_out_of_line : Error<
1532   "'static' can only be specified inside the class definition">;
1533 def err_storage_class_for_static_member : Error<
1534   "static data member definition cannot specify a storage class">;
1535 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1536 def err_not_integral_type_bitfield : Error<
1537   "bit-field %0 has non-integral type %1">;
1538 def err_not_integral_type_anon_bitfield : Error<
1539   "anonymous bit-field has non-integral type %0">;
1540 def err_member_function_initialization : Error<
1541   "initializer on function does not look like a pure-specifier">;
1542 def err_non_virtual_pure : Error<
1543   "%0 is not virtual and cannot be declared pure">;
1544 def ext_pure_function_definition : ExtWarn<
1545   "function definition with pure-specifier is a Microsoft extension">,
1546   InGroup<MicrosoftPureDefinition>;
1547 def err_implicit_object_parameter_init : Error<
1548   "cannot initialize object parameter of type %0 with an expression "
1549   "of type %1">;
1550 def err_qualified_member_of_unrelated : Error<
1551   "%q0 is not a member of class %1">;
1552
1553 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1554   "call to pure virtual member function %0 has undefined behavior; "
1555   "overrides of %0 in subclasses are not available in the "
1556   "%select{constructor|destructor}1 of %2">;
1557
1558 def note_member_declared_at : Note<"member is declared here">;
1559 def note_ivar_decl : Note<"instance variable is declared here">;
1560 def note_bitfield_decl : Note<"bit-field is declared here">;
1561 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1562 def note_member_synthesized_at : Note<
1563   "in implicit %select{default constructor|copy constructor|move constructor|"
1564   "copy assignment operator|move assignment operator|destructor}0 for %1 "
1565   "first required here">;
1566 def err_missing_default_ctor : Error<
1567   "%select{constructor for %1 must explicitly initialize the|"
1568   "implicit default constructor for %1 must explicitly initialize the|"
1569   "cannot use constructor inherited from base class %4;}0 "
1570   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1571   "does not have a default constructor">;
1572 def note_due_to_dllexported_class : Note<
1573   "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
1574
1575 def err_illegal_union_or_anon_struct_member : Error<
1576   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1577   "%select{constructor|copy constructor|move constructor|copy assignment "
1578   "operator|move assignment operator|destructor}2">;
1579 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1580   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1581   "%select{constructor|copy constructor|move constructor|copy assignment "
1582   "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1583   InGroup<CXX98Compat>, DefaultIgnore;
1584
1585 def note_nontrivial_virtual_dtor : Note<
1586   "destructor for %0 is not trivial because it is virtual">;
1587 def note_nontrivial_has_virtual : Note<
1588   "because type %0 has a virtual %select{member function|base class}1">;
1589 def note_nontrivial_no_def_ctor : Note<
1590   "because %select{base class of |field of |}0type %1 has no "
1591   "default constructor">;
1592 def note_user_declared_ctor : Note<
1593   "implicit default constructor suppressed by user-declared constructor">;
1594 def note_nontrivial_no_copy : Note<
1595   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1596   "assignment operator|<<ERROR>>}2 can be used to "
1597   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1598   "%select{base class|field|an object}0 of type %3">;
1599 def note_nontrivial_user_provided : Note<
1600   "because %select{base class of |field of |}0type %1 has a user-provided "
1601   "%select{default constructor|copy constructor|move constructor|"
1602   "copy assignment operator|move assignment operator|destructor}2">;
1603 def note_nontrivial_in_class_init : Note<
1604   "because field %0 has an initializer">;
1605 def note_nontrivial_param_type : Note<
1606   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1607 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1608 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1609 def note_nontrivial_subobject : Note<
1610   "because the function selected to %select{construct|copy|move|copy|move|"
1611   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1612 def note_nontrivial_objc_ownership : Note<
1613   "because type %0 has a member with %select{no|no|__strong|__weak|"
1614   "__autoreleasing}1 ownership">;
1615
1616 def err_static_data_member_not_allowed_in_anon_struct : Error<
1617   "static data member %0 not allowed in anonymous struct">;
1618 def ext_static_data_member_in_union : ExtWarn<
1619   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1620 def warn_cxx98_compat_static_data_member_in_union : Warning<
1621   "static data member %0 in union is incompatible with C++98">,
1622   InGroup<CXX98Compat>, DefaultIgnore;
1623 def ext_union_member_of_reference_type : ExtWarn<
1624   "union member %0 has reference type %1, which is a Microsoft extension">,
1625   InGroup<MicrosoftUnionMemberReference>;
1626 def err_union_member_of_reference_type : Error<
1627   "union member %0 has reference type %1">;
1628 def ext_anonymous_struct_union_qualified : Extension<
1629   "anonymous %select{struct|union}0 cannot be '%1'">;
1630 def err_different_return_type_for_overriding_virtual_function : Error<
1631   "virtual function %0 has a different return type "
1632   "%diff{($) than the function it overrides (which has return type $)|"
1633   "than the function it overrides}1,2">;
1634 def note_overridden_virtual_function : Note<
1635   "overridden virtual function is here">;
1636 def err_conflicting_overriding_cc_attributes : Error<
1637   "virtual function %0 has different calling convention attributes "
1638   "%diff{($) than the function it overrides (which has calling convention $)|"
1639   "than the function it overrides}1,2">;
1640
1641 def err_covariant_return_inaccessible_base : Error<
1642   "invalid covariant return for virtual function: %1 is a "
1643   "%select{private|protected}2 base class of %0">, AccessControl;
1644 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1645   "return type of virtual function %3 is not covariant with the return type of "
1646   "the function it overrides (ambiguous conversion from derived class "
1647   "%0 to base class %1:%2)">;
1648 def err_covariant_return_not_derived : Error<
1649   "return type of virtual function %0 is not covariant with the return type of "
1650   "the function it overrides (%1 is not derived from %2)">;
1651 def err_covariant_return_incomplete : Error<
1652   "return type of virtual function %0 is not covariant with the return type of "
1653   "the function it overrides (%1 is incomplete)">;
1654 def err_covariant_return_type_different_qualifications : Error<
1655   "return type of virtual function %0 is not covariant with the return type of "
1656   "the function it overrides (%1 has different qualifiers than %2)">;
1657 def err_covariant_return_type_class_type_more_qualified : Error<
1658   "return type of virtual function %0 is not covariant with the return type of "
1659   "the function it overrides (class type %1 is more qualified than class "
1660   "type %2">;
1661
1662 // C++ implicit special member functions
1663 def note_in_declaration_of_implicit_special_member : Note<
1664   "while declaring the implicit "
1665   "%select{default constructor|copy constructor|move constructor|"
1666   "copy assignment operator|move assignment operator|destructor}1"
1667   " for %0">;
1668
1669 // C++ constructors
1670 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1671 def err_invalid_qualified_constructor : Error<
1672   "'%0' qualifier is not allowed on a constructor">;
1673 def err_ref_qualifier_constructor : Error<
1674   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1675
1676 def err_constructor_return_type : Error<
1677   "constructor cannot have a return type">;
1678 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1679 def err_constructor_byvalue_arg : Error<
1680   "copy constructor must pass its first argument by reference">;
1681 def warn_no_constructor_for_refconst : Warning<
1682   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1683   "constructor to initialize its non-modifiable members">;
1684 def note_refconst_member_not_initialized : Note<
1685   "%select{const|reference}0 member %1 will never be initialized">;
1686 def ext_ms_explicit_constructor_call : ExtWarn<
1687   "explicit constructor calls are a Microsoft extension">,
1688   InGroup<MicrosoftExplicitConstructorCall>;
1689
1690 // C++ destructors
1691 def err_destructor_not_member : Error<
1692   "destructor must be a non-static member function">;
1693 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1694 def err_invalid_qualified_destructor : Error<
1695   "'%0' qualifier is not allowed on a destructor">;
1696 def err_ref_qualifier_destructor : Error<
1697   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1698 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1699 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1700 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1701 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1702 def err_destructor_typedef_name : Error<
1703   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1704 def err_destructor_name : Error<
1705   "expected the class name after '~' to name the enclosing class">;
1706 def err_destructor_class_name : Error<
1707   "expected the class name after '~' to name a destructor">;
1708 def err_ident_in_dtor_not_a_type : Error<
1709   "identifier %0 in object destruction expression does not name a type">;
1710 def err_destructor_expr_type_mismatch : Error<
1711   "destructor type %0 in object destruction expression does not match the "
1712   "type %1 of the object being destroyed">;
1713 def note_destructor_type_here : Note<
1714   "type %0 is declared here">;
1715
1716 def err_destructor_template : Error<
1717   "destructor cannot be declared as a template">;
1718
1719 // C++ initialization
1720 def err_init_conversion_failed : Error<
1721   "cannot initialize %select{a variable|a parameter|return object|an "
1722   "exception object|a member subobject|an array element|a new value|a value|a "
1723   "base class|a constructor delegation|a vector element|a block element|a "
1724   "block element|a complex element|a lambda capture|a compound literal "
1725   "initializer|a related result|a parameter of CF audited function}0 "
1726   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1727   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1728   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1729   "|: different number of parameters (%5 vs %6)"
1730   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1731   "|: different return type%diff{ ($ vs $)|}5,6"
1732   "|: different qualifiers ("
1733   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1734   "volatile and restrict|const, volatile, and restrict}5 vs "
1735   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1736   "volatile and restrict|const, volatile, and restrict}6)"
1737   "|: different exception specifications}4">;
1738
1739 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1740   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1741 def err_lvalue_reference_bind_to_initlist : Error<
1742   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1743   "initializer list temporary">;
1744 def err_lvalue_reference_bind_to_temporary : Error<
1745   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1746   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1747 def err_lvalue_reference_bind_to_unrelated : Error<
1748   "%select{non-const|volatile}0 lvalue reference "
1749   "%diff{to type $ cannot bind to a value of unrelated type $|"
1750   "cannot bind to a value of unrelated type}1,2">;
1751 def err_reference_bind_drops_quals : Error<
1752   "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1753   "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1754   "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1755   "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1756 def err_reference_bind_failed : Error<
1757   "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1758   "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1759 def err_reference_bind_init_list : Error<
1760   "reference to type %0 cannot bind to an initializer list">;
1761 def warn_temporary_array_to_pointer_decay : Warning<
1762   "pointer is initialized by a temporary array, which will be destroyed at the "
1763   "end of the full-expression">,
1764   InGroup<DiagGroup<"address-of-array-temporary">>;
1765 def err_init_list_bad_dest_type : Error<
1766   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1767   "list">;
1768 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1769     "'this' argument has type %1, but function is not marked "
1770     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1771     "volatile or restrict|const, volatile, or restrict}2">;
1772
1773 def err_reference_bind_to_bitfield : Error<
1774   "%select{non-const|volatile}0 reference cannot bind to "
1775   "bit-field%select{| %1}2">;
1776 def err_reference_bind_to_vector_element : Error<
1777   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1778 def err_reference_var_requires_init : Error<
1779   "declaration of reference variable %0 requires an initializer">;
1780 def err_reference_without_init : Error<
1781   "reference to type %0 requires an initializer">;
1782 def note_value_initialization_here : Note<
1783   "in value-initialization of type %0 here">;
1784 def err_reference_has_multiple_inits : Error<
1785   "reference cannot be initialized with multiple values">;
1786 def err_init_non_aggr_init_list : Error<
1787   "initialization of non-aggregate type %0 with an initializer list">;
1788 def err_init_reference_member_uninitialized : Error<
1789   "reference member of type %0 uninitialized">;
1790 def note_uninit_reference_member : Note<
1791   "uninitialized reference member is here">;
1792 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1793   InGroup<Uninitialized>;
1794 def warn_base_class_is_uninit : Warning<
1795   "base class %0 is uninitialized when used here to access %q1">,
1796   InGroup<Uninitialized>;
1797 def warn_reference_field_is_uninit : Warning<
1798   "reference %0 is not yet bound to a value when used here">,
1799   InGroup<Uninitialized>;
1800 def note_uninit_in_this_constructor : Note<
1801   "during field initialization in %select{this|the implicit default}0 "
1802   "constructor">;
1803 def warn_static_self_reference_in_init : Warning<
1804   "static variable %0 is suspiciously used within its own initialization">,
1805   InGroup<UninitializedStaticSelfInit>;
1806 def warn_uninit_self_reference_in_init : Warning<
1807   "variable %0 is uninitialized when used within its own initialization">,
1808   InGroup<Uninitialized>;
1809 def warn_uninit_self_reference_in_reference_init : Warning<
1810   "reference %0 is not yet bound to a value when used within its own"
1811   " initialization">,
1812   InGroup<Uninitialized>;
1813 def warn_uninit_var : Warning<
1814   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1815   InGroup<Uninitialized>, DefaultIgnore;
1816 def warn_sometimes_uninit_var : Warning<
1817   "variable %0 is %select{used|captured}1 uninitialized whenever "
1818   "%select{'%3' condition is %select{true|false}4|"
1819   "'%3' loop %select{is entered|exits because its condition is false}4|"
1820   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1821   "switch %3 is taken|"
1822   "its declaration is reached|"
1823   "%3 is called}2">,
1824   InGroup<UninitializedSometimes>, DefaultIgnore;
1825 def warn_maybe_uninit_var : Warning<
1826   "variable %0 may be uninitialized when "
1827   "%select{used here|captured by block}1">,
1828   InGroup<UninitializedMaybe>, DefaultIgnore;
1829 def note_var_declared_here : Note<"variable %0 is declared here">;
1830 def note_uninit_var_use : Note<
1831   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1832 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1833   "block pointer variable %0 is uninitialized when captured by block">,
1834   InGroup<Uninitialized>, DefaultIgnore;
1835 def note_block_var_fixit_add_initialization : Note<
1836   "did you mean to use __block %0?">;
1837 def note_in_omitted_aggregate_initializer : Note<
1838   "in implicit initialization of %select{"
1839   "array element %1 with omitted initializer|"
1840   "field %1 with omitted initializer|"
1841   "trailing array elements in runtime-sized array new}0">;
1842 def note_in_reference_temporary_list_initializer : Note<
1843   "in initialization of temporary of type %0 created to "
1844   "list-initialize this reference">;
1845 def note_var_fixit_add_initialization : Note<
1846   "initialize the variable %0 to silence this warning">;
1847 def note_uninit_fixit_remove_cond : Note<
1848   "remove the %select{'%1' if its condition|condition if it}0 "
1849   "is always %select{false|true}2">;
1850 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1851 def err_list_init_in_parens : Error<
1852   "cannot initialize %select{non-class|reference}0 type %1 with a "
1853   "parenthesized initializer list">;
1854
1855 def warn_unsequenced_mod_mod : Warning<
1856   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1857 def warn_unsequenced_mod_use : Warning<
1858   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1859
1860 def err_temp_copy_no_viable : Error<
1861   "no viable constructor %select{copying variable|copying parameter|"
1862   "returning object|throwing object|copying member subobject|copying array "
1863   "element|allocating object|copying temporary|initializing base subobject|"
1864   "initializing vector element|capturing value}0 of type %1">;
1865 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1866   "no viable constructor %select{copying variable|copying parameter|"
1867   "returning object|throwing object|copying member subobject|copying array "
1868   "element|allocating object|copying temporary|initializing base subobject|"
1869   "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1870   "constructor when binding a reference to a temporary">,
1871   InGroup<BindToTemporaryCopy>;
1872 def err_temp_copy_ambiguous : Error<
1873   "ambiguous constructor call when %select{copying variable|copying "
1874   "parameter|returning object|throwing object|copying member subobject|copying "
1875   "array element|allocating object|copying temporary|initializing base subobject|"
1876   "initializing vector element|capturing value}0 of type %1">;
1877 def err_temp_copy_deleted : Error<
1878   "%select{copying variable|copying parameter|returning object|throwing "
1879   "object|copying member subobject|copying array element|allocating object|"
1880   "copying temporary|initializing base subobject|initializing vector element|"
1881   "capturing value}0 of type %1 invokes deleted constructor">;
1882 def err_temp_copy_incomplete : Error<
1883   "copying a temporary object of incomplete type %0">;
1884 def warn_cxx98_compat_temp_copy : Warning<
1885   "%select{copying variable|copying parameter|returning object|throwing "
1886   "object|copying member subobject|copying array element|allocating object|"
1887   "copying temporary|initializing base subobject|initializing vector element}1 "
1888   "of type %2 when binding a reference to a temporary would %select{invoke "
1889   "an inaccessible constructor|find no viable constructor|find ambiguous "
1890   "constructors|invoke a deleted constructor}0 in C++98">,
1891   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1892 def err_selected_explicit_constructor : Error<
1893   "chosen constructor is explicit in copy-initialization">;
1894 def note_explicit_ctor_deduction_guide_here : Note<
1895   "explicit %select{constructor|deduction guide}0 declared here">;
1896
1897 // C++11 decltype
1898 def err_decltype_in_declarator : Error<
1899     "'decltype' cannot be used to name a declaration">;
1900     
1901 // C++11 auto
1902 def warn_cxx98_compat_auto_type_specifier : Warning<
1903   "'auto' type specifier is incompatible with C++98">,
1904   InGroup<CXX98Compat>, DefaultIgnore;
1905 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1906   "variable %0 declared with deduced type %1 "
1907   "cannot appear in its own initializer">;
1908 def err_binding_cannot_appear_in_own_initializer : Error<
1909   "binding %0 cannot appear in the initializer of its own "
1910   "decomposition declaration">;
1911 def err_illegal_decl_array_of_auto : Error<
1912   "'%0' declared as array of %1">;
1913 def err_new_array_of_auto : Error<
1914   "cannot allocate array of 'auto'">;
1915 def err_auto_not_allowed : Error<
1916   "%select{'auto'|'decltype(auto)'|'__auto_type'|"
1917   "use of "
1918   "%select{class template|function template|variable template|alias template|"
1919   "template template parameter|template}2 %3 requires template arguments; "
1920   "argument deduction}0 not allowed "
1921   "%select{in function prototype"
1922   "|in non-static struct member|in struct member"
1923   "|in non-static union member|in union member"
1924   "|in non-static class member|in interface member"
1925   "|in exception declaration|in template parameter until C++17|in block literal"
1926   "|in template argument|in typedef|in type alias|in function return type"
1927   "|in conversion function type|here|in lambda parameter"
1928   "|in type allocated by 'new'|in K&R-style function parameter"
1929   "|in template parameter|in friend declaration}1">;
1930 def err_dependent_deduced_tst : Error<
1931   "typename specifier refers to "
1932   "%select{class template|function template|variable template|alias template|"
1933   "template template parameter|template}0 member in %1; "
1934   "argument deduction not allowed here">;
1935 def err_auto_not_allowed_var_inst : Error<
1936   "'auto' variable template instantiation is not allowed">;
1937 def err_auto_var_requires_init : Error<
1938   "declaration of variable %0 with deduced type %1 requires an initializer">;
1939 def err_auto_new_requires_ctor_arg : Error<
1940   "new expression for type %0 requires a constructor argument">;
1941 def err_auto_new_list_init : Error<
1942   "new expression for type %0 cannot use list-initialization">;
1943 def err_auto_var_init_no_expression : Error<
1944   "initializer for variable %0 with type %1 is empty">;
1945 def err_auto_var_init_multiple_expressions : Error<
1946   "initializer for variable %0 with type %1 contains multiple expressions">;
1947 def err_auto_var_init_paren_braces : Error<
1948   "cannot deduce type for variable %1 with type %2 from "
1949   "%select{parenthesized|nested}0 initializer list">;
1950 def err_auto_new_ctor_multiple_expressions : Error<
1951   "new expression for type %0 contains multiple constructor arguments">;
1952 def err_auto_missing_trailing_return : Error<
1953   "'auto' return without trailing return type; deduced return types are a "
1954   "C++14 extension">;
1955 def err_deduced_return_type : Error<
1956   "deduced return types are a C++14 extension">;
1957 def err_trailing_return_without_auto : Error<
1958   "function with trailing return type must specify return type 'auto', not %0">;
1959 def err_trailing_return_in_parens : Error<
1960   "trailing return type may not be nested within parentheses">;
1961 def err_auto_var_deduction_failure : Error<
1962   "variable %0 with type %1 has incompatible initializer of type %2">;
1963 def err_auto_var_deduction_failure_from_init_list : Error<
1964   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
1965 def err_auto_new_deduction_failure : Error<
1966   "new expression for type %0 has incompatible constructor argument of type %1">;
1967 def err_auto_different_deductions : Error<
1968   "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
1969   "deduced as %1 in declaration of %2 and "
1970   "deduced as %3 in declaration of %4">;
1971 def err_auto_non_deduced_not_alone : Error<
1972   "%select{function with deduced return type|"
1973   "declaration with trailing return type}0 "
1974   "must be the only declaration in its group">;
1975 def err_implied_std_initializer_list_not_found : Error<
1976   "cannot deduce type of initializer list because std::initializer_list was "
1977   "not found; include <initializer_list>">;
1978 def err_malformed_std_initializer_list : Error<
1979   "std::initializer_list must be a class template with a single type parameter">;
1980 def warn_dangling_std_initializer_list : Warning<
1981   "array backing the initializer list will be destroyed at the end of "
1982   "%select{the full-expression|the constructor}0">,
1983   InGroup<DiagGroup<"dangling-initializer-list">>;
1984 def err_auto_init_list_from_c : Error<
1985   "cannot use __auto_type with initializer list in C">;
1986 def err_auto_bitfield : Error<
1987   "cannot pass bit-field as __auto_type initializer in C">;
1988
1989 // C++1y decltype(auto) type
1990 def err_decltype_auto_invalid : Error<
1991   "'decltype(auto)' not allowed here">;
1992 def err_decltype_auto_cannot_be_combined : Error<
1993   "'decltype(auto)' cannot be combined with other type specifiers">;
1994 def err_decltype_auto_function_declarator_not_declaration : Error<
1995   "'decltype(auto)' can only be used as a return type "
1996   "in a function declaration">;
1997 def err_decltype_auto_compound_type : Error<
1998   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
1999 def err_decltype_auto_initializer_list : Error<
2000   "cannot deduce 'decltype(auto)' from initializer list">;
2001
2002 // C++1z deduced class template specialization types
2003 def err_deduced_class_template_compound_type : Error<
2004   "cannot %select{form pointer to|form reference to|form array of|"
2005   "form function returning|use parentheses when declaring variable with}0 "
2006   "deduced class template specialization type">;
2007 def err_deduced_non_class_template_specialization_type : Error<
2008   "%select{<error>|function template|variable template|alias template|"
2009   "template template parameter|template}0 %1 requires template arguments; "
2010   "argument deduction only allowed for class templates">;
2011 def err_deduced_class_template_ctor_ambiguous : Error<
2012   "ambiguous deduction for template arguments of %0">;
2013 def err_deduced_class_template_ctor_no_viable : Error<
2014   "no viable constructor or deduction guide for deduction of "
2015   "template arguments of %0">;
2016 def err_deduced_class_template_incomplete : Error<
2017   "template %0 has no definition and no %select{|viable }1deduction guides "
2018   "for deduction of template arguments">;
2019 def err_deduced_class_template_deleted : Error<
2020   "class template argument deduction for %0 selected a deleted constructor">;
2021 def err_deduced_class_template_explicit : Error<
2022   "class template argument deduction for %0 selected an explicit "
2023   "%select{constructor|deduction guide}1 for copy-list-initialization">;
2024 def err_deduction_guide_no_trailing_return_type : Error<
2025   "deduction guide declaration without trailing return type">;
2026 def err_deduction_guide_bad_trailing_return_type : Error<
2027   "deduced type %1 of deduction guide is not %select{|written as }2"
2028   "a specialization of template %0">;
2029 def err_deduction_guide_with_complex_decl : Error<
2030   "cannot specify any part of a return type in the "
2031   "declaration of a deduction guide">;
2032 def err_deduction_guide_invalid_specifier : Error<
2033   "deduction guide cannot be declared '%0'">;
2034 def err_deduction_guide_name_not_class_template : Error<
2035   "cannot specify deduction guide for "
2036   "%select{<error>|function template|variable template|alias template|"
2037   "template template parameter|dependent template name}0 %1">;
2038 def err_deduction_guide_wrong_scope : Error<
2039   "deduction guide must be declared in the same scope as template %q0">;
2040 def err_deduction_guide_defines_function : Error<
2041   "deduction guide cannot have a function definition">;
2042 def err_deduction_guide_explicit_mismatch : Error<
2043   "deduction guide is %select{not |}0declared 'explicit' but "
2044   "previous declaration was%select{ not|}0">;
2045 def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2046   "%select{explicitly instantiated|explicitly specialized}0">;
2047 def err_deduction_guide_template_not_deducible : Error<
2048     "deduction guide template contains "
2049     "%select{a template parameter|template parameters}0 that cannot be "
2050     "deduced">;
2051
2052 // C++1y deduced return types
2053 def err_auto_fn_deduction_failure : Error<
2054   "cannot deduce return type %0 from returned value of type %1">;
2055 def err_auto_fn_different_deductions : Error<
2056   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2057   "deduced as %2 in earlier return statement">;
2058 def err_auto_fn_used_before_defined : Error<
2059   "function %0 with deduced return type cannot be used before it is defined">;
2060 def err_auto_fn_no_return_but_not_auto : Error<
2061   "cannot deduce return type %0 for function with no return statements">;
2062 def err_auto_fn_return_void_but_not_auto : Error<
2063   "cannot deduce return type %0 from omitted return expression">;
2064 def err_auto_fn_return_init_list : Error<
2065   "cannot deduce return type from initializer list">;
2066 def err_auto_fn_virtual : Error<
2067   "function with deduced return type cannot be virtual">;
2068
2069 // C++11 override control
2070 def override_keyword_only_allowed_on_virtual_member_functions : Error<
2071   "only virtual member functions can be marked '%0'">;
2072 def override_keyword_hides_virtual_member_function : Error<
2073   "non-virtual member function marked '%0' hides virtual member "
2074   "%select{function|functions}1">;
2075 def err_function_marked_override_not_overriding : Error<
2076   "%0 marked 'override' but does not override any member functions">;
2077 def warn_destructor_marked_not_override_overriding : Warning <
2078   "%0 overrides a destructor but is not marked 'override'">,
2079   InGroup<CXX11WarnOverrideDestructor>, DefaultIgnore;
2080 def warn_function_marked_not_override_overriding : Warning <
2081   "%0 overrides a member function but is not marked 'override'">,
2082   InGroup<CXX11WarnOverrideMethod>;
2083 def err_class_marked_final_used_as_base : Error<
2084   "base %0 is marked '%select{final|sealed}1'">;
2085 def warn_abstract_final_class : Warning<
2086   "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2087
2088 // C++11 attributes
2089 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2090
2091 // C++11 final
2092 def err_final_function_overridden : Error<
2093   "declaration of %0 overrides a '%select{final|sealed}1' function">;
2094
2095 // C++11 scoped enumerations
2096 def err_enum_invalid_underlying : Error<
2097   "non-integral type %0 is an invalid underlying type">;
2098 def err_enumerator_too_large : Error<
2099   "enumerator value is not representable in the underlying type %0">;
2100 def ext_enumerator_too_large : Extension<
2101   "enumerator value is not representable in the underlying type %0">,
2102   InGroup<MicrosoftEnumValue>;
2103 def err_enumerator_wrapped : Error<
2104   "enumerator value %0 is not representable in the underlying type %1">;
2105 def err_enum_redeclare_type_mismatch : Error<
2106   "enumeration redeclared with different underlying type %0 (was %1)">;
2107 def err_enum_redeclare_fixed_mismatch : Error<
2108   "enumeration previously declared with %select{non|}0fixed underlying type">;
2109 def err_enum_redeclare_scoped_mismatch : Error<
2110   "enumeration previously declared as %select{un|}0scoped">;
2111 def err_enum_class_reference : Error<
2112   "reference to %select{|scoped }0enumeration must use 'enum' "
2113   "not 'enum class'">;
2114 def err_only_enums_have_underlying_types : Error<
2115   "only enumeration types have underlying types">;
2116 def err_underlying_type_of_incomplete_enum : Error<
2117   "cannot determine underlying type of incomplete enumeration type %0">;
2118
2119 // C++11 delegating constructors
2120 def err_delegating_ctor : Error<
2121   "delegating constructors are permitted only in C++11">;
2122 def warn_cxx98_compat_delegating_ctor : Warning<
2123   "delegating constructors are incompatible with C++98">,
2124   InGroup<CXX98Compat>, DefaultIgnore;
2125 def err_delegating_initializer_alone : Error<
2126   "an initializer for a delegating constructor must appear alone">;
2127 def warn_delegating_ctor_cycle : Warning<
2128   "constructor for %0 creates a delegation cycle">, DefaultError,
2129   InGroup<DelegatingCtorCycles>;
2130 def note_it_delegates_to : Note<"it delegates to">;
2131 def note_which_delegates_to : Note<"which delegates to">;
2132
2133 // C++11 range-based for loop
2134 def err_for_range_decl_must_be_var : Error<
2135   "for range declaration must declare a variable">;
2136 def err_for_range_storage_class : Error<
2137   "loop variable %0 may not be declared %select{'extern'|'static'|"
2138   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2139 def err_type_defined_in_for_range : Error<
2140   "types may not be defined in a for range declaration">;
2141 def err_for_range_deduction_failure : Error<
2142   "cannot use type %0 as a range">;
2143 def err_for_range_incomplete_type : Error<
2144   "cannot use incomplete type %0 as a range">;
2145 def err_for_range_iter_deduction_failure : Error<
2146   "cannot use type %0 as an iterator">;
2147 def err_for_range_member_begin_end_mismatch : Error<
2148   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
2149 def ext_for_range_begin_end_types_differ : ExtWarn<
2150   "'begin' and 'end' returning different types (%0 and %1) is a C++17 extension">,
2151   InGroup<CXX17>;
2152 def warn_for_range_begin_end_types_differ : Warning<
2153   "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2154   "with C++ standards before C++17">, InGroup<CXXPre1zCompat>, DefaultIgnore;
2155 def note_in_for_range: Note<
2156   "when looking up '%select{begin|end}0' function for range expression "
2157   "of type %1">;
2158 def err_for_range_invalid: Error<
2159   "invalid range expression of type %0; no viable '%select{begin|end}1' "
2160   "function available">;
2161 def err_range_on_array_parameter : Error<
2162   "cannot build range expression with array function parameter %0 since "
2163   "parameter with array type %1 is treated as pointer type %2">;
2164 def err_for_range_dereference : Error<
2165   "invalid range expression of type %0; did you mean to dereference it "
2166   "with '*'?">;
2167 def note_for_range_invalid_iterator : Note <
2168   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2169 def note_for_range_begin_end : Note<
2170   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2171 def warn_for_range_const_reference_copy : Warning<
2172   "loop variable %0 "
2173   "%diff{has type $ but is initialized with type $"
2174   "| is initialized with a value of a different type}1,2 resulting in a copy">,
2175   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2176 def note_use_type_or_non_reference : Note<
2177   "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2178 def warn_for_range_variable_always_copy : Warning<
2179   "loop variable %0 is always a copy because the range of type %1 does not "
2180   "return a reference">,
2181   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2182 def note_use_non_reference_type : Note<"use non-reference type %0">;
2183 def warn_for_range_copy : Warning<
2184   "loop variable %0 of type %1 creates a copy from type %2">,
2185   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2186 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2187
2188 // C++11 constexpr
2189 def warn_cxx98_compat_constexpr : Warning<
2190   "'constexpr' specifier is incompatible with C++98">,
2191   InGroup<CXX98Compat>, DefaultIgnore;
2192 // FIXME: Maybe this should also go in -Wc++14-compat?
2193 def warn_cxx14_compat_constexpr_not_const : Warning<
2194   "'constexpr' non-static member function will not be implicitly 'const' "
2195   "in C++14; add 'const' to avoid a change in behavior">,
2196   InGroup<DiagGroup<"constexpr-not-const">>;
2197 def err_invalid_constexpr : Error<
2198   "%select{function parameter|typedef|non-static data member}0 "
2199   "cannot be constexpr">;
2200 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2201   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2202 def err_constexpr_tag : Error<
2203   "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
2204 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
2205 def err_constexpr_no_declarators : Error<
2206   "constexpr can only be used in variable and function declarations">;
2207 def err_invalid_constexpr_var_decl : Error<
2208   "constexpr variable declaration must be a definition">;
2209 def err_constexpr_static_mem_var_requires_init : Error<
2210   "declaration of constexpr static data member %0 requires an initializer">;
2211 def err_constexpr_var_non_literal : Error<
2212   "constexpr variable cannot have non-literal type %0">;
2213 def err_constexpr_var_requires_const_init : Error<
2214   "constexpr variable %0 must be initialized by a constant expression">;
2215 def err_constexpr_redecl_mismatch : Error<
2216   "%select{non-constexpr declaration of %0 follows constexpr declaration"
2217   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
2218 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2219 def err_constexpr_virtual_base : Error<
2220   "constexpr %select{member function|constructor}0 not allowed in "
2221   "%select{struct|interface|class}1 with virtual base "
2222   "%plural{1:class|:classes}2">;
2223 def note_non_literal_incomplete : Note<
2224   "incomplete type %0 is not a literal type">;
2225 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2226   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2227 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2228 def err_constexpr_non_literal_return : Error<
2229   "constexpr function's return type %0 is not a literal type">;
2230 def err_constexpr_non_literal_param : Error<
2231   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
2232   "not a literal type">;
2233 def err_constexpr_body_invalid_stmt : Error<
2234   "statement not allowed in constexpr %select{function|constructor}0">;
2235 def ext_constexpr_body_invalid_stmt : ExtWarn<
2236   "use of this statement in a constexpr %select{function|constructor}0 "
2237   "is a C++14 extension">, InGroup<CXX14>;
2238 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2239   "use of this statement in a constexpr %select{function|constructor}0 "
2240   "is incompatible with C++ standards before C++14">,
2241   InGroup<CXXPre14Compat>, DefaultIgnore;
2242 def ext_constexpr_type_definition : ExtWarn<
2243   "type definition in a constexpr %select{function|constructor}0 "
2244   "is a C++14 extension">, InGroup<CXX14>;
2245 def warn_cxx11_compat_constexpr_type_definition : Warning<
2246   "type definition in a constexpr %select{function|constructor}0 "
2247   "is incompatible with C++ standards before C++14">,
2248   InGroup<CXXPre14Compat>, DefaultIgnore;
2249 def err_constexpr_vla : Error<
2250   "variably-modified type %0 cannot be used in a constexpr "
2251   "%select{function|constructor}1">;
2252 def ext_constexpr_local_var : ExtWarn<
2253   "variable declaration in a constexpr %select{function|constructor}0 "
2254   "is a C++14 extension">, InGroup<CXX14>;
2255 def warn_cxx11_compat_constexpr_local_var : Warning<
2256   "variable declaration in a constexpr %select{function|constructor}0 "
2257   "is incompatible with C++ standards before C++14">,
2258   InGroup<CXXPre14Compat>, DefaultIgnore;
2259 def err_constexpr_local_var_static : Error<
2260   "%select{static|thread_local}1 variable not permitted in a constexpr "
2261   "%select{function|constructor}0">;
2262 def err_constexpr_local_var_non_literal_type : Error<
2263   "variable of non-literal type %1 cannot be defined in a constexpr "
2264   "%select{function|constructor}0">;
2265 def err_constexpr_local_var_no_init : Error<
2266   "variables defined in a constexpr %select{function|constructor}0 must be "
2267   "initialized">;
2268 def ext_constexpr_function_never_constant_expr : ExtWarn<
2269   "constexpr %select{function|constructor}0 never produces a "
2270   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2271 def err_attr_cond_never_constant_expr : Error<
2272   "%0 attribute expression never produces a constant expression">;
2273 def err_diagnose_if_invalid_diagnostic_type : Error<
2274   "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2275   "instead">;
2276 def err_constexpr_body_no_return : Error<
2277   "no return statement in constexpr function">;
2278 def err_constexpr_return_missing_expr : Error<
2279   "non-void constexpr function %0 should return a value">;
2280 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2281   "constexpr function with no return statements is incompatible with C++ "
2282   "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2283 def ext_constexpr_body_multiple_return : ExtWarn<
2284   "multiple return statements in constexpr function is a C++14 extension">,
2285   InGroup<CXX14>;
2286 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2287   "multiple return statements in constexpr function "
2288   "is incompatible with C++ standards before C++14">,
2289   InGroup<CXXPre14Compat>, DefaultIgnore;
2290 def note_constexpr_body_previous_return : Note<
2291   "previous return statement is here">;
2292 def err_constexpr_function_try_block : Error<
2293   "function try block not allowed in constexpr %select{function|constructor}0">;
2294 def err_constexpr_union_ctor_no_init : Error<
2295   "constexpr union constructor does not initialize any member">;
2296 def err_constexpr_ctor_missing_init : Error<
2297   "constexpr constructor must initialize all members">;
2298 def note_constexpr_ctor_missing_init : Note<
2299   "member not initialized by constructor">;
2300 def note_non_literal_no_constexpr_ctors : Note<
2301   "%0 is not literal because it is not an aggregate and has no constexpr "
2302   "constructors other than copy or move constructors">;
2303 def note_non_literal_base_class : Note<
2304   "%0 is not literal because it has base class %1 of non-literal type">;
2305 def note_non_literal_field : Note<
2306   "%0 is not literal because it has data member %1 of "
2307   "%select{non-literal|volatile}3 type %2">;
2308 def note_non_literal_user_provided_dtor : Note<
2309   "%0 is not literal because it has a user-provided destructor">;
2310 def note_non_literal_nontrivial_dtor : Note<
2311   "%0 is not literal because it has a non-trivial destructor">;
2312 def warn_private_extern : Warning<
2313   "use of __private_extern__ on a declaration may not produce external symbol "
2314   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2315 def note_private_extern : Note<
2316   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2317
2318 // C++ Concepts TS
2319 def err_concept_wrong_decl_kind : Error<
2320   "'concept' can only appear on the definition of a function template or variable template">;
2321 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2322   "concept declarations may only appear in namespace scope">;
2323 def err_function_concept_not_defined : Error<
2324   "function concept declaration must be a definition">;
2325 def err_var_concept_not_initialized : Error<
2326   "variable concept declaration must be initialized">;
2327 def err_function_concept_exception_spec : Error<
2328   "function concept cannot have exception specification">;
2329 def err_concept_decl_invalid_specifiers : Error<
2330   "%select{variable|function}0 concept cannot be declared "
2331   "'%select{thread_local|inline|friend|constexpr}1'">;
2332 def err_function_concept_with_params : Error<
2333   "function concept cannot have any parameters">;
2334 def err_function_concept_bool_ret : Error<
2335   "declared return type of function concept must be 'bool'">;
2336 def err_variable_concept_bool_decl : Error<
2337   "declared type of variable concept must be 'bool'">;
2338 def err_concept_specified_specialization : Error<
2339   "'concept' cannot be applied on an "
2340   "%select{explicit instantiation|explicit specialization|partial specialization}0">;
2341 def err_concept_specialized : Error<
2342   "%select{function|variable}0 concept cannot be "
2343   "%select{explicitly instantiated|explicitly specialized|partially specialized}1">;
2344
2345 def err_template_different_associated_constraints : Error<
2346   "associated constraints differ in template redeclaration">;
2347
2348 // C++11 char16_t/char32_t
2349 def warn_cxx98_compat_unicode_type : Warning<
2350   "'%0' type specifier is incompatible with C++98">,
2351   InGroup<CXX98Compat>, DefaultIgnore;
2352
2353 // __make_integer_seq
2354 def err_integer_sequence_negative_length : Error<
2355   "integer sequences must have non-negative sequence length">;
2356 def err_integer_sequence_integral_element_type : Error<
2357   "integer sequences must have integral element type">;
2358
2359 // __type_pack_element
2360 def err_type_pack_element_out_of_bounds : Error<
2361   "a parameter pack may not be accessed at an out of bounds index">;
2362
2363 // Objective-C++
2364 def err_objc_decls_may_only_appear_in_global_scope : Error<
2365   "Objective-C declarations may only appear in global scope">;
2366 def warn_auto_var_is_id : Warning<
2367   "'auto' deduced as 'id' in declaration of %0">,
2368   InGroup<DiagGroup<"auto-var-id">>;
2369
2370 // Attributes
2371 def err_nsobject_attribute : Error<
2372   "'NSObject' attribute is for pointer types only">;
2373 def err_attributes_are_not_compatible : Error<
2374   "%0 and %1 attributes are not compatible">;
2375 def err_attribute_wrong_number_arguments : Error<
2376   "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2377   ":requires exactly %1 arguments}1">;
2378 def err_attribute_too_many_arguments : Error<
2379   "%0 attribute takes no more than %1 argument%s1">;
2380 def err_attribute_too_few_arguments : Error<
2381   "%0 attribute takes at least %1 argument%s1">;
2382 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2383 def err_attribute_bad_neon_vector_size : Error<
2384   "Neon vector size must be 64 or 128 bits">;
2385 def err_attribute_requires_positive_integer : Error<
2386   "%0 attribute requires a positive integral compile time constant expression">;
2387 def err_attribute_requires_opencl_version : Error<
2388   "%0 attribute requires OpenCL version %1%select{| or above}2">;
2389 def warn_unsupported_target_attribute
2390     : Warning<"Ignoring unsupported '%0' in the target attribute string">,
2391     InGroup<IgnoredAttributes>;
2392 def err_attribute_unsupported
2393     : Error<"%0 attribute is not supported for this target">;
2394 // The err_*_attribute_argument_not_int are separate because they're used by
2395 // VerifyIntegerConstantExpression.
2396 def err_aligned_attribute_argument_not_int : Error<
2397   "'aligned' attribute requires integer constant">;
2398 def err_align_value_attribute_argument_not_int : Error<
2399   "'align_value' attribute requires integer constant">;
2400 def err_alignas_attribute_wrong_decl_type : Error<
2401   "%0 attribute cannot be applied to a %select{function parameter|"
2402   "variable with 'register' storage class|'catch' variable|bit-field}1">;
2403 def err_alignas_missing_on_definition : Error<
2404   "%0 must be specified on definition if it is specified on any declaration">;
2405 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2406 def err_alignas_mismatch : Error<
2407   "redeclaration has different alignment requirement (%1 vs %0)">;
2408 def err_alignas_underaligned : Error<
2409   "requested alignment is less than minimum alignment of %1 for type %0">;
2410 def err_attribute_argument_n_type : Error<
2411   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2412   "constant|a string|an identifier}2">;
2413 def err_attribute_argument_type : Error<
2414   "%0 attribute requires %select{int or bool|an integer "
2415   "constant|a string|an identifier}1">;
2416 def err_attribute_argument_outof_range : Error<
2417   "%0 attribute requires integer constant between %1 and %2 inclusive">;
2418 def err_init_priority_object_attr : Error<
2419   "can only use 'init_priority' attribute on file-scope definitions "
2420   "of objects of class type">;
2421 def err_attribute_argument_vec_type_hint : Error<
2422   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2423 def err_attribute_argument_out_of_bounds : Error<
2424   "%0 attribute parameter %1 is out of bounds">;
2425 def err_attribute_only_once_per_parameter : Error<
2426   "%0 attribute can only be applied once per parameter">;
2427 def err_attribute_uuid_malformed_guid : Error<
2428   "uuid attribute contains a malformed GUID">;
2429 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2430 def note_previous_uuid : Note<"previous uuid specified here">;
2431 def warn_attribute_pointers_only : Warning<
2432   "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2433   InGroup<IgnoredAttributes>;
2434 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2435 def err_attribute_integers_only : Error<
2436   "%0 attribute argument may only refer to a function parameter of integer "
2437   "type">;
2438 def warn_attribute_return_pointers_only : Warning<
2439   "%0 attribute only applies to return values that are pointers">,
2440   InGroup<IgnoredAttributes>;
2441 def warn_attribute_return_pointers_refs_only : Warning<
2442   "%0 attribute only applies to return values that are pointers or references">,
2443   InGroup<IgnoredAttributes>;
2444 def warn_attribute_pointer_or_reference_only : Warning<
2445   "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2446   InGroup<IgnoredAttributes>;
2447 def err_attribute_no_member_pointers : Error<
2448   "%0 attribute cannot be used with pointers to members">;
2449 def err_attribute_invalid_implicit_this_argument : Error<
2450   "%0 attribute is invalid for the implicit this argument">;
2451 def err_ownership_type : Error<
2452   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2453 def err_ownership_returns_index_mismatch : Error<
2454   "'ownership_returns' attribute index does not match; here it is %0">;
2455 def note_ownership_returns_index_mismatch : Note<
2456   "declared with index %0 here">;
2457 def err_format_strftime_third_parameter : Error<
2458   "strftime format attribute requires 3rd parameter to be 0">;
2459 def err_format_attribute_requires_variadic : Error<
2460   "format attribute requires variadic function">;
2461 def err_format_attribute_not : Error<"format argument not %0">;
2462 def err_format_attribute_result_not : Error<"function does not return %0">;
2463 def err_format_attribute_implicit_this_format_string : Error<
2464   "format attribute cannot specify the implicit this argument as the format "
2465   "string">;
2466 def err_init_method_bad_return_type : Error<
2467   "init methods must return an object pointer type, not %0">;
2468 def err_attribute_invalid_size : Error<
2469   "vector size not an integral multiple of component size">;
2470 def err_attribute_zero_size : Error<"zero vector size">;
2471 def err_attribute_size_too_large : Error<"vector size too large">;
2472 def err_typecheck_vector_not_convertable_implict_truncation : Error<
2473    "cannot convert between %select{scalar|vector}0 type %1 and vector type"
2474    " %2 as implicit conversion would cause truncation">;
2475 def err_typecheck_vector_not_convertable : Error<
2476   "cannot convert between vector values of different size (%0 and %1)">;
2477 def err_typecheck_vector_not_convertable_non_scalar : Error<
2478   "cannot convert between vector and non-scalar values (%0 and %1)">;
2479 def err_typecheck_vector_lengths_not_equal : Error<
2480   "vector operands do not have the same number of elements (%0 and %1)">;
2481 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2482   "vector operands do not have the same elements sizes (%0 and %1)">,
2483   InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2484 def err_ext_vector_component_exceeds_length : Error<
2485   "vector component access exceeds type %0">;
2486 def err_ext_vector_component_name_illegal : Error<
2487   "illegal vector component name '%0'">;
2488 def err_attribute_address_space_negative : Error<
2489   "address space is negative">;
2490 def err_attribute_address_space_too_high : Error<
2491   "address space is larger than the maximum supported (%0)">;
2492 def err_attribute_address_multiple_qualifiers : Error<
2493   "multiple address spaces specified for type">;
2494 def err_attribute_address_function_type : Error<
2495   "function type may not be qualified with an address space">;
2496 def err_as_qualified_auto_decl : Error<
2497   "automatic variable qualified with an%select{| invalid}0 address space">;
2498 def err_arg_with_address_space : Error<
2499   "parameter may not be qualified with an address space">;
2500 def err_field_with_address_space : Error<
2501   "field may not be qualified with an address space">;
2502 def err_attr_objc_ownership_redundant : Error<
2503   "the type %0 is already explicitly ownership-qualified">;
2504 def err_invalid_nsnumber_type : Error<
2505   "%0 is not a valid literal type for NSNumber">;
2506 def err_objc_illegal_boxed_expression_type : Error<
2507   "illegal type %0 used in a boxed expression">;
2508 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2509   "non-trivially copyable type %0 cannot be used in a boxed expression">;
2510 def err_objc_incomplete_boxed_expression_type : Error<
2511   "incomplete type %0 used in a boxed expression">;
2512 def err_undeclared_objc_literal_class : Error<
2513   "definition of class %0 must be available to use Objective-C "
2514   "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2515   "string literals}1">;
2516 def err_undeclared_boxing_method : Error<
2517   "declaration of %0 is missing in %1 class">;
2518 def err_objc_literal_method_sig : Error<
2519   "literal construction method %0 has incompatible signature">;
2520 def note_objc_literal_method_param : Note<
2521   "%select{first|second|third}0 parameter has unexpected type %1 "
2522   "(should be %2)">;
2523 def note_objc_literal_method_return : Note<
2524   "method returns unexpected type %0 (should be an object type)">;
2525 def err_invalid_collection_element : Error<
2526   "collection element of type %0 is not an Objective-C object">;
2527 def err_box_literal_collection : Error<
2528   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2529   "in a collection">;
2530 def warn_objc_literal_comparison : Warning<
2531   "direct comparison of %select{an array literal|a dictionary literal|"
2532   "a numeric literal|a boxed expression|}0 has undefined behavior">,
2533   InGroup<ObjCLiteralComparison>;
2534 def err_missing_atsign_prefix : Error<
2535   "string literal must be prefixed by '@' ">;
2536 def warn_objc_string_literal_comparison : Warning<
2537   "direct comparison of a string literal has undefined behavior">, 
2538   InGroup<ObjCStringComparison>;
2539 def warn_concatenated_nsarray_literal : Warning<
2540   "concatenated NSString literal for an NSArray expression - "
2541   "possibly missing a comma">,
2542   InGroup<ObjCStringConcatenation>;
2543 def note_objc_literal_comparison_isequal : Note<
2544   "use 'isEqual:' instead">;
2545 def warn_objc_collection_literal_element : Warning<
2546   "object of type %0 is not compatible with "
2547   "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2548   InGroup<ObjCLiteralConversion>;
2549 def err_swift_param_attr_not_swiftcall : Error<
2550   "'%0' parameter can only be used with swiftcall calling convention">;
2551 def err_swift_indirect_result_not_first : Error<
2552   "'swift_indirect_result' parameters must be first parameters of function">;
2553 def err_swift_error_result_not_after_swift_context : Error<
2554   "'swift_error_result' parameter must follow 'swift_context' parameter">;
2555 def err_swift_abi_parameter_wrong_type : Error<
2556   "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2557   "type here is %2">;
2558
2559 def err_attribute_argument_invalid : Error<
2560   "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2561   "min must not be greater than max}1">;
2562 def err_attribute_argument_is_zero : Error<
2563   "%0 attribute must be greater than 0">;
2564 def warn_attribute_argument_n_negative : Warning<
2565   "%0 attribute parameter %1 is negative and will be ignored">,
2566   InGroup<CudaCompat>;
2567 def err_property_function_in_objc_container : Error<
2568   "use of Objective-C property in function nested in Objective-C "
2569   "container not supported, move function outside its container">;
2570
2571 let CategoryName = "Cocoa API Issue" in {
2572 def warn_objc_redundant_literal_use : Warning<
2573   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2574 }
2575
2576 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2577   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2578
2579 def err_tls_var_aligned_over_maximum : Error<
2580   "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2581   "alignment (%2) for a thread-local variable on this target">;
2582
2583 def err_only_annotate_after_access_spec : Error<
2584   "access specifier can only have annotation attributes">;
2585
2586 def err_attribute_section_invalid_for_target : Error<
2587   "argument to 'section' attribute is not valid for this target: %0">;
2588 def warn_mismatched_section : Warning<
2589   "section does not match previous declaration">, InGroup<Section>;
2590
2591 def err_anonymous_property: Error<
2592   "anonymous property is not supported">;
2593 def err_property_is_variably_modified : Error<
2594   "property %0 has a variably modified type">;
2595 def err_no_accessor_for_property : Error<
2596   "no %select{getter|setter}0 defined for property %1">;
2597 def err_cannot_find_suitable_accessor : Error<
2598   "cannot find suitable %select{getter|setter}0 for property %1">;
2599
2600 def warn_alloca_align_alignof : Warning<
2601   "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2602   InGroup<DiagGroup<"alloca-with-align-alignof">>;
2603
2604 def err_alignment_too_small : Error<
2605   "requested alignment must be %0 or greater">;
2606 def err_alignment_too_big : Error<
2607   "requested alignment must be %0 or smaller">;
2608 def err_alignment_not_power_of_two : Error<
2609   "requested alignment is not a power of 2">;
2610 def err_alignment_dependent_typedef_name : Error<
2611   "requested alignment is dependent but declaration is not dependent">;
2612
2613 def err_attribute_aligned_too_great : Error<
2614   "requested alignment must be %0 bytes or smaller">;
2615 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2616   "%q0 redeclared without %1 attribute: previous %1 ignored">,
2617   InGroup<MicrosoftInconsistentDllImport>;
2618 def warn_redeclaration_without_import_attribute : Warning<
2619   "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2620   InGroup<MicrosoftInconsistentDllImport>;
2621 def warn_dllimport_dropped_from_inline_function : Warning<
2622   "%q0 redeclared inline; %1 attribute ignored">,
2623   InGroup<IgnoredAttributes>;
2624 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2625   InGroup<IgnoredAttributes>;
2626 def warn_attribute_ignored_on_inline :
2627   Warning<"%0 attribute ignored on inline function">,
2628   InGroup<IgnoredAttributes>;
2629 def warn_attribute_after_definition_ignored : Warning<
2630   "attribute %0 after definition is ignored">,
2631    InGroup<IgnoredAttributes>;
2632 def warn_unknown_attribute_ignored : Warning<
2633   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2634 def warn_cxx11_gnu_attribute_on_type : Warning<
2635   "attribute %0 ignored, because it cannot be applied to a type">,
2636   InGroup<IgnoredAttributes>;
2637 def warn_unhandled_ms_attribute_ignored : Warning<
2638   "__declspec attribute %0 is not supported">, 
2639   InGroup<IgnoredAttributes>;
2640 def err_decl_attribute_invalid_on_stmt : Error<
2641   "%0 attribute cannot be applied to a statement">;
2642 def err_stmt_attribute_invalid_on_decl : Error<
2643   "%0 attribute cannot be applied to a declaration">;
2644 def warn_declspec_attribute_ignored : Warning<
2645   "attribute %0 is ignored, place it after "
2646   "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2647   "type declaration">, InGroup<IgnoredAttributes>;
2648 def warn_attribute_precede_definition : Warning<
2649   "attribute declaration must precede definition">,
2650   InGroup<IgnoredAttributes>;
2651 def warn_attribute_void_function_method : Warning<
2652   "attribute %0 cannot be applied to "
2653   "%select{functions|Objective-C method}1 without return value">,
2654   InGroup<IgnoredAttributes>;
2655 def warn_attribute_weak_on_field : Warning<
2656   "__weak attribute cannot be specified on a field declaration">,
2657   InGroup<IgnoredAttributes>;
2658 def warn_gc_attribute_weak_on_local : Warning<
2659   "Objective-C GC does not allow weak variables on the stack">,
2660   InGroup<IgnoredAttributes>;
2661 def warn_nsobject_attribute : Warning<
2662   "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2663   InGroup<NSobjectAttribute>;
2664 def warn_independentclass_attribute : Warning<
2665   "'objc_independent_class' attribute may be put on a typedef only; "
2666   "attribute is ignored">,
2667   InGroup<IndependentClassAttribute>;
2668 def warn_ptr_independentclass_attribute : Warning<
2669   "'objc_independent_class' attribute may be put on Objective-C object "
2670   "pointer type only; attribute is ignored">,
2671   InGroup<IndependentClassAttribute>;
2672 def warn_attribute_weak_on_local : Warning<
2673   "__weak attribute cannot be specified on an automatic variable when ARC "
2674   "is not enabled">,
2675   InGroup<IgnoredAttributes>;
2676 def warn_weak_identifier_undeclared : Warning<
2677   "weak identifier %0 never declared">;
2678 def err_attribute_weak_static : Error<
2679   "weak declaration cannot have internal linkage">;
2680 def err_attribute_selectany_non_extern_data : Error<
2681   "'selectany' can only be applied to data items with external linkage">;
2682 def err_declspec_thread_on_thread_variable : Error<
2683   "'__declspec(thread)' applied to variable that already has a "
2684   "thread-local storage specifier">;
2685 def err_attribute_dll_not_extern : Error<
2686   "%q0 must have external linkage when declared %q1">;
2687 def err_attribute_dll_thread_local : Error<
2688   "%q0 cannot be thread local when declared %q1">;
2689 def err_attribute_dll_lambda : Error<
2690   "lambda cannot be declared %0">;
2691 def warn_attribute_invalid_on_definition : Warning<
2692   "'%0' attribute cannot be specified on a definition">,
2693   InGroup<IgnoredAttributes>;
2694 def err_attribute_dll_redeclaration : Error<
2695   "redeclaration of %q0 cannot add %q1 attribute">;
2696 def warn_attribute_dll_redeclaration : Warning<
2697   "redeclaration of %q0 should not add %q1 attribute">,
2698   InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2699 def err_attribute_dllimport_function_definition : Error<
2700   "dllimport cannot be applied to non-inline function definition">;
2701 def err_attribute_dll_deleted : Error<
2702   "attribute %q0 cannot be applied to a deleted function">;
2703 def err_attribute_dllimport_data_definition : Error<
2704   "definition of dllimport data">;
2705 def err_attribute_dllimport_static_field_definition : Error<
2706   "definition of dllimport static field not allowed">;
2707 def warn_attribute_dllimport_static_field_definition : Warning<
2708   "definition of dllimport static field">,
2709   InGroup<DiagGroup<"dllimport-static-field-def">>;
2710 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2711   "explicit instantiation declaration should not be 'dllexport'">,
2712   InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2713 def warn_invalid_initializer_from_system_header : Warning<
2714   "invalid constructor form class in system header, should not be explicit">,
2715   InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2716 def note_used_in_initialization_here : Note<"used in initialization here">;
2717 def err_attribute_dll_member_of_dll_class : Error<
2718   "attribute %q0 cannot be applied to member of %q1 class">;
2719 def warn_attribute_dll_instantiated_base_class : Warning<
2720   "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2721   "base class template without dll attribute is not supported">,
2722   InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2723 def err_attribute_dll_ambiguous_default_ctor : Error<
2724   "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2725 def err_attribute_weakref_not_static : Error<
2726   "weakref declaration must have internal linkage">;
2727 def err_attribute_weakref_not_global_context : Error<
2728   "weakref declaration of %0 must be in a global context">;
2729 def err_attribute_weakref_without_alias : Error<
2730   "weakref declaration of %0 must also have an alias attribute">;
2731 def err_alias_not_supported_on_darwin : Error <
2732   "only weak aliases are supported on darwin">;
2733 def err_alias_to_undefined : Error<
2734   "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">;
2735 def warn_alias_to_weak_alias : Warning<
2736   "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">,
2737   InGroup<IgnoredAttributes>;
2738 def warn_alias_with_section : Warning<
2739   "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">,
2740   InGroup<IgnoredAttributes>;
2741 def err_duplicate_mangled_name : Error<
2742   "definition with same mangled name as another definition">;
2743 def err_cyclic_alias : Error<
2744   "%select{alias|ifunc}0 definition is part of a cycle">;
2745 def err_ifunc_resolver_return : Error<
2746   "ifunc resolver function must return a pointer">;
2747 def err_ifunc_resolver_params : Error<
2748   "ifunc resolver function must have no parameters">;
2749 def warn_attribute_wrong_decl_type : Warning<
2750   "%0 attribute only applies to %select{"
2751   "functions"
2752   "|unions"
2753   "|variables and functions"
2754   "|functions and global variables"
2755   "|functions, variables, and Objective-C interfaces"
2756   "|functions and methods"
2757   "|parameters"
2758   "|functions, methods and blocks"
2759   "|functions, methods, and classes"
2760   "|functions, methods, and parameters"
2761   "|functions, methods, and global variables"
2762   "|classes"
2763   "|enums"
2764   "|variables"
2765   "|methods"
2766   "|fields and global variables"
2767   "|structs"
2768   "|parameters and typedefs"
2769   "|variables and typedefs"
2770   "|thread-local variables"
2771   "|variables and fields"
2772   "|variables, data members and tag types"
2773   "|types and namespaces"
2774   "|Objective-C interfaces"
2775   "|methods and properties"
2776   "|functions, methods, and properties"
2777   "|struct or union"
2778   "|struct, union or class"
2779   "|types"
2780   "|Objective-C instance methods"
2781   "|init methods of interface or class extension declarations"
2782   "|variables, functions and classes"
2783   "|functions, variables, classes, and Objective-C interfaces"
2784   "|Objective-C protocols"
2785   "|variables with static or thread storage duration"
2786   "|functions, methods, properties, and global variables"
2787   "|structs, unions, and typedefs"
2788   "|structs and typedefs"
2789   "|interface or protocol declarations"
2790   "|kernel functions"
2791   "|non-K&R-style functions"
2792   "|variables, enums, fields and typedefs"
2793   "|functions, methods, enums, and classes"
2794   "|structs, classes, variables, functions, and inline namespaces"
2795   "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members"
2796   "|classes and enumerations"
2797   "|named declarations}1">,
2798   InGroup<IgnoredAttributes>;
2799 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2800 def warn_type_attribute_wrong_type : Warning<
2801   "'%0' only applies to %select{function|pointer|"
2802   "Objective-C object or block pointer}1 types; type here is %2">,
2803   InGroup<IgnoredAttributes>;
2804 def warn_incomplete_encoded_type : Warning<
2805   "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2806   InGroup<DiagGroup<"encode-type">>;
2807 def warn_gnu_inline_attribute_requires_inline : Warning<
2808   "'gnu_inline' attribute requires function to be marked 'inline',"
2809   " attribute ignored">,
2810   InGroup<IgnoredAttributes>;
2811 def err_attribute_vecreturn_only_vector_member : Error<
2812   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2813 def err_attribute_vecreturn_only_pod_record : Error<
2814   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2815 def err_cconv_change : Error<
2816   "function declared '%0' here was previously declared "
2817   "%select{'%2'|without calling convention}1">;
2818 def warn_cconv_ignored : Warning<
2819   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2820 def err_cconv_knr : Error<
2821   "function with no prototype cannot use the %0 calling convention">;
2822 def warn_cconv_knr : Warning<
2823   err_cconv_knr.Text>,
2824   InGroup<DiagGroup<"missing-prototype-for-cc">>;
2825 def err_cconv_varargs : Error<
2826   "variadic function cannot use %0 calling convention">;
2827 def warn_cconv_varargs : Warning<
2828   "%0 calling convention ignored on variadic function">,
2829   InGroup<IgnoredAttributes>;
2830 def warn_cconv_structors : Warning<
2831   "%0 calling convention ignored on constructor/destructor">,
2832   InGroup<IgnoredAttributes>;
2833 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2834   "attribute was previously declared "
2835   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2836 def err_function_attribute_mismatch : Error<
2837   "function declared with %0 attribute "
2838   "was previously declared without the %0 attribute">;
2839 def err_objc_precise_lifetime_bad_type : Error<
2840   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2841 def warn_objc_precise_lifetime_meaningless : Error<
2842   "objc_precise_lifetime is not meaningful for "
2843   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2844 def err_invalid_pcs : Error<"invalid PCS type">;
2845 def warn_attribute_not_on_decl : Warning<
2846   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2847 def err_base_specifier_attribute : Error<
2848   "%0 attribute cannot be applied to a base specifier">;
2849 def err_invalid_attribute_on_virtual_function : Error<
2850   "%0 attribute cannot be applied to virtual functions">;
2851
2852 // Availability attribute
2853 def warn_availability_unknown_platform : Warning<
2854   "unknown platform %0 in availability macro">, InGroup<Availability>;
2855 def warn_availability_version_ordering : Warning<
2856   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2857   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2858   "attribute ignored">, InGroup<Availability>;
2859 def warn_mismatched_availability: Warning<
2860   "availability does not match previous declaration">, InGroup<Availability>;
2861 def warn_mismatched_availability_override : Warning<
2862   "%select{|overriding }4method %select{introduced after|"
2863   "deprecated before|obsoleted before}0 "
2864   "%select{the protocol method it implements|overridden method}4 "
2865   "on %1 (%2 vs. %3)">, InGroup<Availability>;
2866 def warn_mismatched_availability_override_unavail : Warning<
2867   "%select{|overriding }1method cannot be unavailable on %0 when "
2868   "%select{the protocol method it implements|its overridden method}1 is "
2869   "available">,
2870   InGroup<Availability>;
2871 def note_overridden_method : Note<
2872   "overridden method is here">;
2873 def note_protocol_method : Note<
2874   "protocol method is here">;
2875
2876 def warn_unguarded_availability :
2877   Warning<"%0 is only available on %1 %2 or newer">,
2878   InGroup<UnguardedAvailability>, DefaultIgnore;
2879 def warn_unguarded_availability_new :
2880   Warning<warn_unguarded_availability.Text>,
2881   InGroup<UnguardedAvailabilityNew>;
2882 def warn_partial_availability : Warning<"%0 is only available conditionally">,
2883     InGroup<UnguardedAvailability>, DefaultIgnore;
2884 def warn_partial_availability_new : Warning<warn_partial_availability.Text>,
2885   InGroup<UnguardedAvailabilityNew>;
2886 def note_partial_availability_silence : Note<
2887   "annotate %select{%1|anonymous %1}0 with an availability attribute to silence">;
2888 def note_unguarded_available_silence : Note<
2889   "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
2890   " this warning">;
2891 def warn_partial_message : Warning<"%0 is partial: %1">,
2892     InGroup<UnguardedAvailability>, DefaultIgnore;
2893 def warn_partial_message_new : Warning<warn_partial_message.Text>,
2894   InGroup<UnguardedAvailabilityNew>;
2895 def warn_partial_fwdclass_message : Warning<
2896     "%0 may be partial because the receiver type is unknown">,
2897     InGroup<UnguardedAvailability>, DefaultIgnore;
2898 def warn_partial_fwdclass_message_new :
2899   Warning<warn_partial_fwdclass_message.Text>,
2900   InGroup<UnguardedAvailabilityNew>;
2901 def warn_at_available_unchecked_use : Warning<
2902   "%select{@available|__builtin_available}0 does not guard availability here; "
2903   "use if (%select{@available|__builtin_available}0) instead">,
2904   InGroup<DiagGroup<"unsupported-availability-guard">>;
2905
2906 // Thread Safety Attributes
2907 def warn_invalid_capability_name : Warning<
2908   "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2909   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2910 def warn_thread_attribute_ignored : Warning<
2911   "ignoring %0 attribute because its argument is invalid">,
2912   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2913 def warn_thread_attribute_argument_not_lockable : Warning<
2914   "%0 attribute requires arguments whose type is annotated "
2915   "with 'capability' attribute; type here is %1">,
2916   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2917 def warn_thread_attribute_decl_not_lockable : Warning<
2918   "%0 attribute can only be applied in a context annotated "
2919   "with 'capability(\"mutex\")' attribute">,
2920   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2921 def warn_thread_attribute_decl_not_pointer : Warning<
2922   "%0 only applies to pointer types; type here is %1">,
2923   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2924 def err_attribute_argument_out_of_range : Error<
2925   "%0 attribute parameter %1 is out of bounds: "
2926   "%plural{0:no parameters to index into|"
2927   "1:can only be 1, since there is one parameter|"
2928   ":must be between 1 and %2}2">;
2929
2930 // Thread Safety Analysis   
2931 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
2932   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2933 def warn_unlock_kind_mismatch : Warning<
2934   "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
2935   "%select{shared|exclusive}3 access">,
2936   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2937 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
2938   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2939 def warn_no_unlock : Warning<
2940   "%0 '%1' is still held at the end of function">,
2941   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2942 def warn_expecting_locked : Warning<
2943   "expecting %0 '%1' to be held at the end of function">,
2944   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;  
2945 // FIXME: improve the error message about locks not in scope
2946 def warn_lock_some_predecessors : Warning<
2947   "%0 '%1' is not held on every path through here">,
2948   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2949 def warn_expecting_lock_held_on_loop : Warning<
2950   "expecting %0 '%1' to be held at start of each loop">,
2951   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2952 def note_locked_here : Note<"%0 acquired here">;
2953 def warn_lock_exclusive_and_shared : Warning<
2954   "%0 '%1' is acquired exclusively and shared in the same scope">,
2955   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2956 def note_lock_exclusive_and_shared : Note<
2957   "the other acquisition of %0 '%1' is here">;
2958 def warn_variable_requires_any_lock : Warning<
2959   "%select{reading|writing}1 variable '%0' requires holding "
2960   "%select{any mutex|any mutex exclusively}1">,
2961   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2962 def warn_var_deref_requires_any_lock : Warning<
2963   "%select{reading|writing}1 the value pointed to by '%0' requires holding "
2964   "%select{any mutex|any mutex exclusively}1">,
2965   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2966 def warn_fun_excludes_mutex : Warning<
2967   "cannot call function '%1' while %0 '%2' is held">,
2968   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2969 def warn_cannot_resolve_lock : Warning<
2970   "cannot resolve lock expression">,
2971   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2972 def warn_acquired_before : Warning<
2973   "%0 '%1' must be acquired before '%2'">,
2974   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2975 def warn_acquired_before_after_cycle : Warning<
2976   "Cycle in acquired_before/after dependencies, starting with '%0'">,
2977   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2978
2979
2980 // Thread safety warnings negative capabilities
2981 def warn_acquire_requires_negative_cap : Warning<
2982   "acquiring %0 '%1' requires negative capability '%2'">,
2983   InGroup<ThreadSafetyNegative>, DefaultIgnore;
2984
2985 // Thread safety warnings on pass by reference
2986 def warn_guarded_pass_by_reference : Warning<
2987   "passing variable '%1' by reference requires holding %0 "
2988   "%select{'%2'|'%2' exclusively}3">,
2989   InGroup<ThreadSafetyReference>, DefaultIgnore;
2990 def warn_pt_guarded_pass_by_reference : Warning<
2991   "passing the value that '%1' points to by reference requires holding %0 "
2992   "%select{'%2'|'%2' exclusively}3">,
2993   InGroup<ThreadSafetyReference>, DefaultIgnore;
2994
2995 // Imprecise thread safety warnings
2996 def warn_variable_requires_lock : Warning<
2997   "%select{reading|writing}3 variable '%1' requires holding %0 "
2998   "%select{'%2'|'%2' exclusively}3">,
2999   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3000 def warn_var_deref_requires_lock : Warning<
3001   "%select{reading|writing}3 the value pointed to by '%1' requires "
3002   "holding %0 %select{'%2'|'%2' exclusively}3">,
3003   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3004 def warn_fun_requires_lock : Warning<
3005   "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
3006   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
3007
3008 // Precise thread safety warnings
3009 def warn_variable_requires_lock_precise :
3010   Warning<warn_variable_requires_lock.Text>,
3011   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3012 def warn_var_deref_requires_lock_precise :
3013   Warning<warn_var_deref_requires_lock.Text>,
3014   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3015 def warn_fun_requires_lock_precise :
3016   Warning<warn_fun_requires_lock.Text>,
3017   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
3018 def note_found_mutex_near_match : Note<"found near match '%0'">;
3019
3020 // Verbose thread safety warnings
3021 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, 
3022   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
3023 def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
3024 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
3025
3026 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
3027 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, 
3028   InGroup<ThreadSafetyBeta>, DefaultIgnore;
3029
3030 // Consumed warnings
3031 def warn_use_in_invalid_state : Warning<
3032   "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3033   "state">, InGroup<Consumed>, DefaultIgnore;
3034 def warn_use_of_temp_in_invalid_state : Warning<
3035   "invalid invocation of method '%0' on a temporary object while it is in the "
3036   "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3037 def warn_attr_on_unconsumable_class : Warning<
3038   "consumed analysis attribute is attached to member of class '%0' which isn't "
3039   "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3040 def warn_return_typestate_for_unconsumable_type : Warning<
3041   "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3042   DefaultIgnore;
3043 def warn_return_typestate_mismatch : Warning<
3044   "return value not in expected state; expected '%0', observed '%1'">,
3045   InGroup<Consumed>, DefaultIgnore;
3046 def warn_loop_state_mismatch : Warning<
3047   "state of variable '%0' must match at the entry and exit of loop">,
3048   InGroup<Consumed>, DefaultIgnore;
3049 def warn_param_return_typestate_mismatch : Warning<
3050   "parameter '%0' not in expected state when the function returns: expected "
3051   "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3052 def warn_param_typestate_mismatch : Warning<
3053   "argument not in expected state; expected '%0', observed '%1'">,
3054   InGroup<Consumed>, DefaultIgnore;
3055
3056 // no_sanitize attribute
3057 def warn_unknown_sanitizer_ignored : Warning<
3058   "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3059
3060 def warn_impcast_vector_scalar : Warning<
3061   "implicit conversion turns vector to scalar: %0 to %1">,
3062   InGroup<Conversion>, DefaultIgnore;
3063 def warn_impcast_complex_scalar : Warning<
3064   "implicit conversion discards imaginary component: %0 to %1">,
3065   InGroup<Conversion>, DefaultIgnore;
3066 def warn_impcast_float_precision : Warning<
3067   "implicit conversion loses floating-point precision: %0 to %1">,
3068   InGroup<Conversion>, DefaultIgnore;
3069 def warn_impcast_double_promotion : Warning<
3070   "implicit conversion increases floating-point precision: %0 to %1">,
3071   InGroup<DoublePromotion>, DefaultIgnore;
3072 def warn_impcast_integer_sign : Warning<
3073   "implicit conversion changes signedness: %0 to %1">,
3074   InGroup<SignConversion>, DefaultIgnore;
3075 def warn_impcast_integer_sign_conditional : Warning<
3076   "operand of ? changes signedness: %0 to %1">,
3077   InGroup<SignConversion>, DefaultIgnore;
3078 def warn_impcast_integer_precision : Warning<
3079   "implicit conversion loses integer precision: %0 to %1">,
3080   InGroup<Conversion>, DefaultIgnore;
3081 def warn_impcast_integer_64_32 : Warning<
3082   "implicit conversion loses integer precision: %0 to %1">,
3083   InGroup<Shorten64To32>, DefaultIgnore;
3084 def warn_impcast_integer_precision_constant : Warning<
3085   "implicit conversion from %2 to %3 changes value from %0 to %1">,
3086   InGroup<ConstantConversion>;
3087 def warn_impcast_bitfield_precision_constant : Warning<
3088   "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3089   InGroup<BitFieldConstantConversion>;
3090
3091 def warn_impcast_literal_float_to_integer : Warning<
3092   "implicit conversion from %0 to %1 changes value from %2 to %3">,
3093   InGroup<LiteralConversion>;
3094 def warn_impcast_float_integer : Warning<
3095   "implicit conversion turns floating-point number into integer: %0 to %1">,
3096   InGroup<FloatConversion>, DefaultIgnore;
3097
3098 def warn_impcast_float_to_integer : Warning<
3099   "implicit conversion of out of range value from %0 to %1 changes value "
3100   "from %2 to %3">,
3101   InGroup<FloatOverflowConversion>, DefaultIgnore;
3102 def warn_impcast_float_to_integer_zero : Warning<
3103   "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3104   InGroup<FloatZeroConversion>, DefaultIgnore;
3105
3106 def warn_impcast_string_literal_to_bool : Warning<
3107   "implicit conversion turns string literal into bool: %0 to %1">,
3108   InGroup<StringConversion>, DefaultIgnore;
3109 def warn_impcast_different_enum_types : Warning<
3110   "implicit conversion from enumeration type %0 to different enumeration type "
3111   "%1">, InGroup<EnumConversion>;
3112 def warn_impcast_bool_to_null_pointer : Warning<
3113     "initialization of pointer of type %0 to null from a constant boolean "
3114     "expression">, InGroup<BoolConversion>;
3115 def warn_non_literal_null_pointer : Warning<
3116     "expression which evaluates to zero treated as a null pointer constant of "
3117     "type %0">, InGroup<NonLiteralNullConversion>;
3118 def warn_impcast_null_pointer_to_integer : Warning<
3119     "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3120     InGroup<NullConversion>;
3121 def warn_impcast_floating_point_to_bool : Warning<
3122     "implicit conversion turns floating-point number into bool: %0 to %1">,
3123     InGroup<ImplicitConversionFloatingPointToBool>;
3124 def ext_ms_impcast_fn_obj : ExtWarn<
3125   "implicit conversion between pointer-to-function and pointer-to-object is a "
3126   "Microsoft extension">, InGroup<MicrosoftCast>;
3127
3128 def warn_impcast_pointer_to_bool : Warning<
3129     "address of%select{| function| array}0 '%1' will always evaluate to "
3130     "'true'">,
3131     InGroup<PointerBoolConversion>;
3132 def warn_cast_nonnull_to_bool : Warning<
3133     "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3134     "'true' on first encounter">,
3135     InGroup<PointerBoolConversion>;
3136 def warn_this_bool_conversion : Warning<
3137   "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3138   "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3139 def warn_address_of_reference_bool_conversion : Warning<
3140   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3141   "code; pointer may be assumed to always convert to true">,
3142   InGroup<UndefinedBoolConversion>;
3143
3144 def warn_null_pointer_compare : Warning<
3145     "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3146     "equal to a null pointer is always %select{true|false}2">,
3147     InGroup<TautologicalPointerCompare>;
3148 def warn_nonnull_expr_compare : Warning<
3149     "comparison of nonnull %select{function call|parameter}0 '%1' "
3150     "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3151     "encounter">,
3152     InGroup<TautologicalPointerCompare>;
3153 def warn_this_null_compare : Warning<
3154   "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3155   "assumed to always evaluate to %select{true|false}0">,
3156   InGroup<TautologicalUndefinedCompare>;
3157 def warn_address_of_reference_null_compare : Warning<
3158   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3159   "code; comparison may be assumed to always evaluate to "
3160   "%select{true|false}0">,
3161   InGroup<TautologicalUndefinedCompare>;
3162 def note_reference_is_return_value : Note<"%0 returns a reference">;
3163
3164 def note_function_warning_silence : Note<
3165     "prefix with the address-of operator to silence this warning">;
3166 def note_function_to_function_call : Note<
3167     "suffix with parentheses to turn this into a function call">;
3168 def warn_impcast_objective_c_literal_to_bool : Warning<
3169     "implicit boolean conversion of Objective-C object literal always "
3170     "evaluates to true">,
3171     InGroup<ObjCLiteralConversion>;
3172
3173 def warn_cast_align : Warning<
3174   "cast from %0 to %1 increases required alignment from %2 to %3">,
3175   InGroup<CastAlign>, DefaultIgnore;
3176 def warn_old_style_cast : Warning<
3177   "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3178
3179 // Separate between casts to void* and non-void* pointers.
3180 // Some APIs use (abuse) void* for something like a user context,
3181 // and often that value is an integer even if it isn't a pointer itself.
3182 // Having a separate warning flag allows users to control the warning
3183 // for their workflow.
3184 def warn_int_to_pointer_cast : Warning<
3185   "cast to %1 from smaller integer type %0">,
3186   InGroup<IntToPointerCast>;
3187 def warn_int_to_void_pointer_cast : Warning<
3188   "cast to %1 from smaller integer type %0">,
3189   InGroup<IntToVoidPointerCast>;
3190
3191 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3192   "enums in the Microsoft ABI are signed integers by default; consider giving "
3193   "the enum %0 an unsigned underlying type to make this code portable">,
3194   InGroup<SignedEnumBitfield>, DefaultIgnore;
3195 def warn_attribute_packed_for_bitfield : Warning<
3196   "'packed' attribute was ignored on bit-fields with single-byte alignment "
3197   "in older versions of GCC and Clang">,
3198   InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3199 def warn_transparent_union_attribute_field_size_align : Warning<
3200   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3201   "%select{alignment|size}0 of the first field in transparent union; "
3202   "transparent_union attribute ignored">,
3203   InGroup<IgnoredAttributes>;
3204 def note_transparent_union_first_field_size_align : Note<
3205   "%select{alignment|size}0 of first field is %1 bits">;
3206 def warn_transparent_union_attribute_not_definition : Warning<
3207   "transparent_union attribute can only be applied to a union definition; "
3208   "attribute ignored">,
3209   InGroup<IgnoredAttributes>;
3210 def warn_transparent_union_attribute_floating : Warning<
3211   "first field of a transparent union cannot have %select{floating point|"
3212   "vector}0 type %1; transparent_union attribute ignored">,
3213   InGroup<IgnoredAttributes>;
3214 def warn_transparent_union_attribute_zero_fields : Warning<
3215   "transparent union definition must contain at least one field; "
3216   "transparent_union attribute ignored">,
3217   InGroup<IgnoredAttributes>;
3218 def warn_attribute_type_not_supported : Warning<
3219   "%0 attribute argument not supported: %1">,
3220   InGroup<IgnoredAttributes>;
3221 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3222   InGroup<IgnoredAttributes>;
3223 def warn_attribute_protected_visibility :
3224   Warning<"target does not support 'protected' visibility; using 'default'">,
3225   InGroup<DiagGroup<"unsupported-visibility">>;
3226 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3227 def note_previous_attribute : Note<"previous attribute is here">;
3228 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3229 def note_attribute : Note<"attribute is here">;
3230 def err_mismatched_ms_inheritance : Error<
3231   "inheritance model does not match %select{definition|previous declaration}0">;
3232 def warn_ignored_ms_inheritance : Warning<
3233   "inheritance model ignored on %select{primary template|partial specialization}0">,
3234   InGroup<IgnoredAttributes>;
3235 def note_previous_ms_inheritance : Note<
3236   "previous inheritance model specified here">;
3237 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3238 def err_mode_not_primitive : Error<
3239   "mode attribute only supported for integer and floating-point types">;
3240 def err_mode_wrong_type : Error<
3241   "type of machine mode does not match type of base type">;
3242 def warn_vector_mode_deprecated : Warning<
3243   "specifying vector types with the 'mode' attribute is deprecated; "
3244   "use the 'vector_size' attribute instead">,
3245   InGroup<DeprecatedAttributes>;
3246 def err_complex_mode_vector_type : Error<
3247   "type of machine mode does not support base vector types">;
3248 def err_enum_mode_vector_type : Error<
3249   "mode %0 is not supported for enumeration types">;
3250 def warn_attribute_nonnull_no_pointers : Warning<
3251   "'nonnull' attribute applied to function with no pointer arguments">,
3252   InGroup<IgnoredAttributes>;
3253 def warn_attribute_nonnull_parm_no_args : Warning<
3254   "'nonnull' attribute when used on parameters takes no arguments">,
3255   InGroup<IgnoredAttributes>;
3256 def note_declared_nonnull : Note<
3257   "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3258 def warn_attribute_sentinel_named_arguments : Warning<
3259   "'sentinel' attribute requires named arguments">,
3260   InGroup<IgnoredAttributes>;
3261 def warn_attribute_sentinel_not_variadic : Warning<
3262   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3263   InGroup<IgnoredAttributes>;
3264 def err_attribute_sentinel_less_than_zero : Error<
3265   "'sentinel' parameter 1 less than zero">;
3266 def err_attribute_sentinel_not_zero_or_one : Error<
3267   "'sentinel' parameter 2 not 0 or 1">;
3268 def warn_cleanup_ext : Warning<
3269   "GCC does not allow the 'cleanup' attribute argument to be anything other "
3270   "than a simple identifier">, 
3271   InGroup<GccCompat>;
3272 def err_attribute_cleanup_arg_not_function : Error<
3273   "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3274 def err_attribute_cleanup_func_must_take_one_arg : Error<
3275   "'cleanup' function %0 must take 1 parameter">;
3276 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3277   "'cleanup' function %0 parameter has "
3278   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3279 def err_attribute_regparm_wrong_platform : Error<
3280   "'regparm' is not valid on this platform">;
3281 def err_attribute_regparm_invalid_number : Error<
3282   "'regparm' parameter must be between 0 and %0 inclusive">;
3283 def err_attribute_not_supported_in_lang : Error<
3284   "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3285 def err_attribute_not_supported_on_arch
3286     : Error<"%0 attribute is not supported on '%1'">;
3287
3288 // Clang-Specific Attributes
3289 def warn_attribute_iboutlet : Warning<
3290   "%0 attribute can only be applied to instance variables or properties">,
3291   InGroup<IgnoredAttributes>;
3292 def err_iboutletcollection_type : Error<
3293   "invalid type %0 as argument of iboutletcollection attribute">;
3294 def err_iboutletcollection_builtintype : Error<
3295   "type argument of iboutletcollection attribute cannot be a builtin type">;
3296 def warn_iboutlet_object_type : Warning<
3297   "%select{instance variable|property}2 with %0 attribute must "
3298   "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3299 def warn_iboutletcollection_property_assign : Warning<
3300   "IBOutletCollection properties should be copy/strong and not assign">,
3301   InGroup<ObjCInvalidIBOutletProperty>;
3302   
3303 def err_attribute_overloadable_mismatch : Error<
3304   "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
3305 def note_attribute_overloadable_prev_overload : Note<
3306   "previous %select{unmarked |}0overload of function is here">;
3307 def err_attribute_overloadable_no_prototype : Error<
3308   "'overloadable' function %0 must have a prototype">;
3309 def err_attribute_overloadable_multiple_unmarked_overloads : Error<
3310   "at most one overload for a given name may lack the 'overloadable' "
3311   "attribute">;
3312 def warn_ns_attribute_wrong_return_type : Warning<
3313   "%0 attribute only applies to %select{functions|methods|properties}1 that "
3314   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3315   InGroup<IgnoredAttributes>;
3316 def err_ns_attribute_wrong_parameter_type : Error<
3317   "%0 attribute only applies to "
3318   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3319 def warn_ns_attribute_wrong_parameter_type : Warning<
3320   "%0 attribute only applies to "
3321   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
3322   InGroup<IgnoredAttributes>;
3323 def warn_objc_requires_super_protocol : Warning<
3324   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3325   InGroup<DiagGroup<"requires-super-attribute">>;
3326 def note_protocol_decl : Note<
3327   "protocol is declared here">;
3328 def note_protocol_decl_undefined : Note<
3329   "protocol %0 has no definition">;
3330
3331 // objc_designated_initializer attribute diagnostics.
3332 def warn_objc_designated_init_missing_super_call : Warning<
3333   "designated initializer missing a 'super' call to a designated initializer of the super class">,
3334   InGroup<ObjCDesignatedInit>;
3335 def note_objc_designated_init_marked_here : Note<
3336   "method marked as designated initializer of the class here">;
3337 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3338   "designated initializer should only invoke a designated initializer on 'super'">,
3339   InGroup<ObjCDesignatedInit>;
3340 def warn_objc_designated_init_non_designated_init_call : Warning<
3341   "designated initializer invoked a non-designated initializer">,
3342   InGroup<ObjCDesignatedInit>;
3343 def warn_objc_secondary_init_super_init_call : Warning<
3344   "convenience initializer should not invoke an initializer on 'super'">,
3345   InGroup<ObjCDesignatedInit>;
3346 def warn_objc_secondary_init_missing_init_call : Warning<
3347   "convenience initializer missing a 'self' call to another initializer">,
3348   InGroup<ObjCDesignatedInit>;
3349 def warn_objc_implementation_missing_designated_init_override : Warning<
3350   "method override for the designated initializer of the superclass %objcinstance0 not found">,
3351   InGroup<ObjCDesignatedInit>;
3352
3353 // objc_bridge attribute diagnostics.
3354 def err_objc_attr_not_id : Error<
3355   "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3356 def err_objc_attr_typedef_not_id : Error<
3357   "parameter of %0 attribute must be 'id' when used on a typedef">;
3358 def err_objc_attr_typedef_not_void_pointer : Error<
3359   "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3360 def err_objc_cf_bridged_not_interface : Error<
3361   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3362 def err_objc_ns_bridged_invalid_cfobject : Error<
3363   "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3364 def warn_objc_invalid_bridge : Warning<
3365   "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3366 def warn_objc_invalid_bridge_to_cf : Warning<
3367   "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3368
3369 // objc_bridge_related attribute diagnostics.
3370 def err_objc_bridged_related_invalid_class : Error<
3371   "could not find Objective-C class %0 to convert %1 to %2">;
3372 def err_objc_bridged_related_invalid_class_name : Error<
3373   "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3374 def err_objc_bridged_related_known_method : Error<
3375  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3376  "method for this conversion">;
3377
3378 def err_objc_attr_protocol_requires_definition : Error<
3379   "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3380
3381 // Function Parameter Semantic Analysis.
3382 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3383 def err_void_only_param : Error<
3384   "'void' must be the first and only parameter if specified">;
3385 def err_void_param_qualified : Error<
3386   "'void' as parameter must not have type qualifiers">;
3387 def err_ident_list_in_fn_declaration : Error<
3388   "a parameter list without types is only allowed in a function definition">;
3389 def ext_param_not_declared : Extension<
3390   "parameter %0 was not declared, defaulting to type 'int'">;
3391 def err_param_default_argument : Error<
3392   "C does not support default arguments">;
3393 def err_param_default_argument_redefinition : Error<
3394   "redefinition of default argument">;
3395 def ext_param_default_argument_redefinition : ExtWarn<
3396   err_param_default_argument_redefinition.Text>,
3397   InGroup<MicrosoftDefaultArgRedefinition>;
3398 def err_param_default_argument_missing : Error<
3399   "missing default argument on parameter">;
3400 def err_param_default_argument_missing_name : Error<
3401   "missing default argument on parameter %0">;
3402 def err_param_default_argument_references_param : Error<
3403   "default argument references parameter %0">;
3404 def err_param_default_argument_references_local : Error<
3405   "default argument references local variable %0 of enclosing function">;
3406 def err_param_default_argument_references_this : Error<
3407   "default argument references 'this'">;
3408 def err_param_default_argument_nonfunc : Error<
3409   "default arguments can only be specified for parameters in a function "
3410   "declaration">;
3411 def err_param_default_argument_template_redecl : Error<
3412   "default arguments cannot be added to a function template that has already "
3413   "been declared">;
3414 def err_param_default_argument_member_template_redecl : Error<
3415   "default arguments cannot be added to an out-of-line definition of a member "
3416   "of a %select{class template|class template partial specialization|nested "
3417   "class in a template}0">;
3418 def err_param_default_argument_on_parameter_pack : Error<
3419   "parameter pack cannot have a default argument">;
3420 def err_uninitialized_member_for_assign : Error<
3421   "cannot define the implicit copy assignment operator for %0, because "
3422   "non-static %select{reference|const}1 member %2 cannot use copy "
3423   "assignment operator">;
3424 def err_uninitialized_member_in_ctor : Error<
3425   "%select{constructor for %1|"
3426   "implicit default constructor for %1|"
3427   "cannot use constructor inherited from %1:}0 must explicitly "
3428   "initialize the %select{reference|const}2 member %3">;
3429 def err_default_arg_makes_ctor_special : Error<
3430   "addition of default argument on redeclaration makes this constructor a "
3431   "%select{default|copy|move}0 constructor">;
3432
3433 def err_use_of_default_argument_to_function_declared_later : Error<
3434   "use of default argument to function %0 that is declared later in class %1">;
3435 def note_default_argument_declared_here : Note<
3436   "default argument declared here">;
3437 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3438
3439 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3440   "%diff{promoted type $ of K&R function parameter is not compatible with the "
3441   "parameter type $|promoted type of K&R function parameter is not compatible "
3442   "with parameter type}0,1 declared in a previous prototype">,
3443   InGroup<KNRPromotedParameter>;
3444
3445
3446 // C++ Overloading Semantic Analysis.
3447 def err_ovl_diff_return_type : Error<
3448   "functions that differ only in their return type cannot be overloaded">;
3449 def err_ovl_static_nonstatic_member : Error<
3450   "static and non-static member functions with the same parameter types "
3451   "cannot be overloaded">;
3452
3453 def err_ovl_no_viable_function_in_call : Error<
3454   "no matching function for call to %0">;
3455 def err_ovl_no_viable_member_function_in_call : Error<
3456   "no matching member function for call to %0">;
3457 def err_ovl_ambiguous_call : Error<
3458   "call to %0 is ambiguous">;
3459 def err_ovl_deleted_call : Error<
3460   "call to %select{unavailable|deleted}0 function %1%2">;
3461 def err_ovl_ambiguous_member_call : Error<
3462   "call to member function %0 is ambiguous">;
3463 def err_ovl_deleted_member_call : Error<
3464   "call to %select{unavailable|deleted}0 member function %1%2">;
3465 def note_ovl_too_many_candidates : Note<
3466     "remaining %0 candidate%s0 omitted; "
3467     "pass -fshow-overloads=all to show them">;
3468 def note_ovl_candidate : Note<"candidate "
3469     "%select{function|function|constructor|"
3470     "function |function |constructor |"
3471     "is the implicit default constructor|"
3472     "is the implicit copy constructor|"
3473     "is the implicit move constructor|"
3474     "is the implicit copy assignment operator|"
3475     "is the implicit move assignment operator|"
3476     "inherited constructor|"
3477     "inherited constructor }0%2"
3478     "%select{| has different class%diff{ (expected $ but has $)|}4,5"
3479     "| has different number of parameters (expected %4 but has %5)"
3480     "| has type mismatch at %ordinal4 parameter"
3481     "%diff{ (expected $ but has $)|}5,6"
3482     "| has different return type%diff{ ($ expected but has $)|}4,5"
3483     "| has different qualifiers (expected "
3484     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3485     "|volatile and restrict|const, volatile, and restrict}4 but found "
3486     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3487     "|volatile and restrict|const, volatile, and restrict}5)"
3488     "| has different exception specification}3">;
3489
3490 def note_ovl_candidate_inherited_constructor : Note<
3491     "constructor from base class %0 inherited here">;
3492 def note_ovl_candidate_inherited_constructor_slice : Note<
3493     "candidate %select{constructor|template}0 ignored: "
3494     "inherited constructor cannot be used to %select{copy|move}1 object">;
3495 def note_ovl_candidate_illegal_constructor : Note<
3496     "candidate %select{constructor|template}0 ignored: "
3497     "instantiation %select{takes|would take}0 its own class type by value">;
3498 def note_ovl_candidate_bad_deduction : Note<
3499     "candidate template ignored: failed template argument deduction">;
3500 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3501     "couldn't infer template argument %0">;
3502 def note_ovl_candidate_inconsistent_deduction : Note<
3503     "candidate template ignored: deduced conflicting %select{types|values|"
3504     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3505 def note_ovl_candidate_inconsistent_deduction_types : Note<
3506     "candidate template ignored: deduced values %diff{"
3507     "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3508     "%1 and %3 of conflicting types for parameter %0}2,4">;
3509 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3510     "candidate template ignored: invalid explicitly-specified argument "
3511     "for template parameter %0">;
3512 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3513     "candidate template ignored: invalid explicitly-specified argument "
3514     "for %ordinal0 template parameter">;
3515 def note_ovl_candidate_instantiation_depth : Note<
3516     "candidate template ignored: substitution exceeded maximum template "
3517     "instantiation depth">;
3518 def note_ovl_candidate_underqualified : Note<
3519     "candidate template ignored: cannot deduce a type for %0 that would "
3520     "make %2 equal %1">;
3521 def note_ovl_candidate_substitution_failure : Note<
3522     "candidate template ignored: substitution failure%0%1">;
3523 def note_ovl_candidate_disabled_by_enable_if : Note<
3524     "candidate template ignored: disabled by %0%1">;
3525 def note_ovl_candidate_disabled_by_requirement : Note<
3526     "candidate template ignored: requirement '%0' was not satisfied%1">;
3527 def note_ovl_candidate_has_pass_object_size_params: Note<
3528     "candidate address cannot be taken because parameter %0 has "
3529     "pass_object_size attribute">;
3530 def err_diagnose_if_succeeded : Error<"%0">;
3531 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3532     ShowInSystemHeader;
3533 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3534     "candidate disabled: %0">;
3535 def note_ovl_candidate_disabled_by_extension : Note<
3536     "candidate disabled due to OpenCL extension">;
3537 def err_addrof_function_disabled_by_enable_if_attr : Error<
3538     "cannot take address of function %0 because it has one or more "
3539     "non-tautological enable_if conditions">;
3540 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3541     "candidate function made ineligible by enable_if">;
3542 def note_ovl_candidate_deduced_mismatch : Note<
3543     "candidate template ignored: deduced type "
3544     "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3545     "adjusted type $ of %select{|element of }4argument"
3546     "|of %select{|element of }4%ordinal0 parameter does not match "
3547     "adjusted type of %select{|element of }4argument}1,2%3">;
3548 def note_ovl_candidate_non_deduced_mismatch : Note<
3549     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3550 // This note is needed because the above note would sometimes print two
3551 // different types with the same name.  Remove this note when the above note
3552 // can handle that case properly.
3553 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3554     "candidate template ignored: could not match %q0 against %q1">;
3555
3556 // Note that we don't treat templates differently for this diagnostic.
3557 def note_ovl_candidate_arity : Note<"candidate "
3558     "%select{function|function|constructor|function|function|constructor|"
3559     "constructor (the implicit default constructor)|"
3560     "constructor (the implicit copy constructor)|"
3561     "constructor (the implicit move constructor)|"
3562     "function (the implicit copy assignment operator)|"
3563     "function (the implicit move assignment operator)|"
3564     "inherited constructor|"
3565     "inherited constructor}0 %select{|template }1"
3566     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
3567     "%plural{1:was|:were}4 provided">;
3568
3569 def note_ovl_candidate_arity_one : Note<"candidate "
3570     "%select{function|function|constructor|function|function|constructor|"
3571     "constructor (the implicit default constructor)|"
3572     "constructor (the implicit copy constructor)|"
3573     "constructor (the implicit move constructor)|"
3574     "function (the implicit copy assignment operator)|"
3575     "function (the implicit move assignment operator)|"
3576     "inherited constructor|"
3577     "inherited constructor}0 %select{|template }1not viable: "
3578     "%select{requires at least|allows at most single|requires single}2 "
3579     "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
3580
3581 def note_ovl_candidate_deleted : Note<
3582     "candidate %select{function|function|constructor|"
3583     "function |function |constructor |"
3584     "constructor (the implicit default constructor)|"
3585     "constructor (the implicit copy constructor)|"
3586     "constructor (the implicit move constructor)|"
3587     "function (the implicit copy assignment operator)|"
3588     "function (the implicit move assignment operator)|"
3589     "inherited constructor|"
3590     "inherited constructor }0%1 has been "
3591     "%select{explicitly made unavailable|explicitly deleted|"
3592     "implicitly deleted}2">;
3593
3594 // Giving the index of the bad argument really clutters this message, and
3595 // it's relatively unimportant because 1) it's generally obvious which
3596 // argument(s) are of the given object type and 2) the fix is usually
3597 // to complete the type, which doesn't involve changes to the call line
3598 // anyway.  If people complain, we can change it.
3599 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
3600     "%select{function|function|constructor|"
3601     "function |function |constructor |"
3602     "constructor (the implicit default constructor)|"
3603     "constructor (the implicit copy constructor)|"
3604     "constructor (the implicit move constructor)|"
3605     "function (the implicit copy assignment operator)|"
3606     "function (the implicit move assignment operator)|"
3607     "inherited constructor|"
3608     "inherited constructor }0%1 "
3609     "not viable: cannot convert argument of incomplete type "
3610     "%diff{$ to $|to parameter type}2,3 for "
3611     "%select{%ordinal5 argument|object argument}4"
3612     "%select{|; dereference the argument with *|"
3613     "; take the address of the argument with &|"
3614     "; remove *|"
3615     "; remove &}6">;
3616 def note_ovl_candidate_bad_list_argument : Note<"candidate "
3617     "%select{function|function|constructor|"
3618     "function |function |constructor |"
3619     "constructor (the implicit default constructor)|"
3620     "constructor (the implicit copy constructor)|"
3621     "constructor (the implicit move constructor)|"
3622     "function (the implicit copy assignment operator)|"
3623     "function (the implicit move assignment operator)|"
3624     "inherited constructor|"
3625     "inherited constructor }0%1 "
3626     "not viable: cannot convert initializer list argument to %3">;
3627 def note_ovl_candidate_bad_overload : Note<"candidate "
3628     "%select{function|function|constructor|"
3629     "function |function |constructor |"
3630     "constructor (the implicit default constructor)|"
3631     "constructor (the implicit copy constructor)|"
3632     "constructor (the implicit move constructor)|"
3633     "function (the implicit copy assignment operator)|"
3634     "function (the implicit move assignment operator)|"
3635     "inherited constructor|"
3636     "inherited constructor }0%1"
3637     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
3638 def note_ovl_candidate_bad_conv : Note<"candidate "
3639     "%select{function|function|constructor|"
3640     "function |function |constructor |"
3641     "constructor (the implicit default constructor)|"
3642     "constructor (the implicit copy constructor)|"
3643     "constructor (the implicit move constructor)|"
3644     "function (the implicit copy assignment operator)|"
3645     "function (the implicit move assignment operator)|"
3646     "inherited constructor|"
3647     "inherited constructor }0%1"
3648     " not viable: no known conversion "
3649     "%diff{from $ to $|from argument type to parameter type}2,3 for "
3650     "%select{%ordinal5 argument|object argument}4"
3651     "%select{|; dereference the argument with *|"
3652     "; take the address of the argument with &|"
3653     "; remove *|"
3654     "; remove &}6">;
3655 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
3656     "%select{function|function|constructor|"
3657     "function |function |constructor |"
3658     "constructor (the implicit default constructor)|"
3659     "constructor (the implicit copy constructor)|"
3660     "constructor (the implicit move constructor)|"
3661     "function (the implicit copy assignment operator)|"
3662     "function (the implicit move assignment operator)|"
3663     "inherited constructor|"
3664     "inherited constructor }0%1"
3665     " not viable: cannot implicitly convert argument "
3666     "%diff{of type $ to $|type to parameter type}2,3 for "
3667     "%select{%ordinal5 argument|object argument}4 under ARC">;
3668 def note_ovl_candidate_bad_lvalue : Note<"candidate "
3669     "%select{function|function|constructor|"
3670     "function |function |constructor |"
3671     "constructor (the implicit default constructor)|"
3672     "constructor (the implicit copy constructor)|"
3673     "constructor (the implicit move constructor)|"
3674     "function (the implicit copy assignment operator)|"
3675     "function (the implicit move assignment operator)|"
3676     "inherited constructor|"
3677     "inherited constructor }0%1"
3678     " not viable: expects an l-value for "
3679     "%select{%ordinal3 argument|object argument}2">;
3680 def note_ovl_candidate_bad_addrspace : Note<"candidate "
3681     "%select{function|function|constructor|"
3682     "function |function |constructor |"
3683     "constructor (the implicit default constructor)|"
3684     "constructor (the implicit copy constructor)|"
3685     "constructor (the implicit move constructor)|"
3686     "function (the implicit copy assignment operator)|"
3687     "function (the implicit move assignment operator)|"
3688     "inherited constructor|"
3689     "inherited constructor }0%1 not viable: "
3690     "%select{%ordinal6|'this'}5 argument (%2) is in "
3691     "address space %3, but parameter must be in address space %4">;
3692 def note_ovl_candidate_bad_gc : Note<"candidate "
3693     "%select{function|function|constructor|"
3694     "function |function |constructor |"
3695     "constructor (the implicit default constructor)|"
3696     "constructor (the implicit copy constructor)|"
3697     "constructor (the implicit move constructor)|"
3698     "function (the implicit copy assignment operator)|"
3699     "function (the implicit move assignment operator)|"
3700     "inherited constructor|"
3701     "inherited constructor }0%1 not viable: "
3702     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
3703     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
3704 def note_ovl_candidate_bad_ownership : Note<"candidate "
3705     "%select{function|function|constructor|"
3706     "function |function |constructor |"
3707     "constructor (the implicit default constructor)|"
3708     "constructor (the implicit copy constructor)|"
3709     "constructor (the implicit move constructor)|"
3710     "function (the implicit copy assignment operator)|"
3711     "function (the implicit move assignment operator)|"
3712     "inherited constructor|"
3713     "inherited constructor }0%1 not viable: "
3714     "%select{%ordinal6|'this'}5 argument (%2) has "
3715     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
3716     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3717     "__autoreleasing}4 ownership">;
3718 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
3719     "%select{|function|||function|||||"
3720     "function (the implicit copy assignment operator)|"
3721     "function (the implicit move assignment operator)||}0 not viable: "
3722     "'this' argument has type %2, but method is not marked "
3723     "%select{const|restrict|const or restrict|volatile|const or volatile|"
3724     "volatile or restrict|const, volatile, or restrict}3">;
3725 def note_ovl_candidate_bad_cvr : Note<"candidate "
3726     "%select{function|function|constructor|"
3727     "function |function |constructor |"
3728     "constructor (the implicit default constructor)|"
3729     "constructor (the implicit copy constructor)|"
3730     "constructor (the implicit move constructor)|"
3731     "function (the implicit copy assignment operator)|"
3732     "function (the implicit move assignment operator)|"
3733     "inherited constructor|"
3734     "inherited constructor }0%1 not viable: "
3735     "%ordinal4 argument (%2) would lose "
3736     "%select{const|restrict|const and restrict|volatile|const and volatile|"
3737     "volatile and restrict|const, volatile, and restrict}3 qualifier"
3738     "%select{||s||s|s|s}3">;
3739 def note_ovl_candidate_bad_unaligned : Note<"candidate "
3740     "%select{function|function|constructor|"
3741     "function |function |constructor |"
3742     "constructor (the implicit default constructor)|"
3743     "constructor (the implicit copy constructor)|"
3744     "constructor (the implicit move constructor)|"
3745     "function (the implicit copy assignment operator)|"
3746     "function (the implicit move assignment operator)|"
3747     "inherited constructor|"
3748     "inherited constructor }0%1 not viable: "
3749     "%ordinal4 argument (%2) would lose __unaligned qualifier">;
3750 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
3751     "%select{function|function|constructor|"
3752     "function |function |constructor |"
3753     "constructor (the implicit default constructor)|"
3754     "constructor (the implicit copy constructor)|"
3755     "constructor (the implicit move constructor)|"
3756     "function (the implicit copy assignment operator)|"
3757     "function (the implicit move assignment operator)|"
3758     "inherited constructor|"
3759     "inherited constructor }0%1 not viable: "
3760     "cannot %select{convert from|convert from|bind}2 "
3761     "%select{base class pointer|superclass|base class object of type}2 %3 to "
3762     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
3763     "%ordinal5 argument">;
3764 def note_ovl_candidate_bad_target : Note<
3765     "candidate %select{function|function|constructor|"
3766     "function|function|constructor|"
3767     "constructor (the implicit default constructor)|"
3768     "constructor (the implicit copy constructor)|"
3769     "constructor (the implicit move constructor)|"
3770     "function (the implicit copy assignment operator)|"
3771     "function (the implicit move assignment operator)|"
3772     "inherited constructor|"
3773     "inherited constructor}0 not viable: "
3774     "call to "
3775     "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from"
3776     " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">;
3777 def note_implicit_member_target_infer_collision : Note<
3778     "implicit %select{"
3779     "default constructor|"
3780     "copy constructor|"
3781     "move constructor|"
3782     "copy assignment operator|"
3783     "move assignment operator|"
3784     "destructor}0 inferred target collision: call to both "
3785     "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3786     "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3787
3788 def note_ambiguous_type_conversion: Note<
3789     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3790 def note_ovl_builtin_binary_candidate : Note<
3791     "built-in candidate %0">;
3792 def note_ovl_builtin_unary_candidate : Note<
3793     "built-in candidate %0">;
3794 def err_ovl_no_viable_function_in_init : Error<
3795   "no matching constructor for initialization of %0">;
3796 def err_ovl_no_conversion_in_cast : Error<
3797   "cannot convert %1 to %2 without a conversion operator">;
3798 def err_ovl_no_viable_conversion_in_cast : Error<
3799   "no matching conversion for %select{|static_cast|reinterpret_cast|"
3800   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3801 def err_ovl_ambiguous_conversion_in_cast : Error<
3802   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3803   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3804 def err_ovl_deleted_conversion_in_cast : Error<
3805   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3806   "functional-style cast}0 from %1 to %2 uses deleted function">;
3807 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3808 def err_ref_init_ambiguous : Error<
3809   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3810 def err_ovl_deleted_init : Error<
3811   "call to %select{unavailable|deleted}0 constructor of %1">;
3812 def err_ovl_deleted_special_init : Error<
3813   "call to implicitly-deleted %select{default constructor|copy constructor|"
3814   "move constructor|copy assignment operator|move assignment operator|"
3815   "destructor|function}0 of %1">;
3816 def err_ovl_ambiguous_oper_unary : Error<
3817   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3818 def err_ovl_ambiguous_oper_binary : Error<
3819   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3820 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3821 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3822 def err_ovl_deleted_oper : Error<
3823   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3824 def err_ovl_deleted_special_oper : Error<
3825   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3826   "assigned|destroyed}1 because its %select{default constructor|"
3827   "copy constructor|move constructor|copy assignment operator|"
3828   "move assignment operator|destructor}1 is implicitly deleted">;
3829 def err_ovl_no_viable_subscript :
3830     Error<"no viable overloaded operator[] for type %0">;
3831 def err_ovl_no_oper :
3832     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3833 def err_ovl_unresolvable : Error<
3834   "reference to overloaded function could not be resolved; "
3835   "did you mean to call it%select{| with no arguments}0?">;
3836 def err_bound_member_function : Error<
3837   "reference to non-static member function must be called"
3838   "%select{|; did you mean to call it with no arguments?}0">;
3839 def note_possible_target_of_call : Note<"possible target for call">;
3840
3841 def err_ovl_no_viable_object_call : Error<
3842   "no matching function for call to object of type %0">;
3843 def err_ovl_ambiguous_object_call : Error<
3844   "call to object of type %0 is ambiguous">;
3845 def err_ovl_deleted_object_call : Error<
3846   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3847 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3848 def err_member_call_without_object : Error<
3849   "call to non-static member function without an object argument">;
3850
3851 // C++ Address of Overloaded Function
3852 def err_addr_ovl_no_viable : Error<
3853   "address of overloaded function %0 does not match required type %1">;
3854 def err_addr_ovl_ambiguous : Error<
3855   "address of overloaded function %0 is ambiguous">;
3856 def err_addr_ovl_not_func_ptrref : Error<
3857   "address of overloaded function %0 cannot be converted to type %1">;
3858 def err_addr_ovl_no_qualifier : Error<
3859   "cannot form member pointer of type %0 without '&' and class name">;
3860
3861 // C++11 Literal Operators
3862 def err_ovl_no_viable_literal_operator : Error<
3863   "no matching literal operator for call to %0"
3864   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3865   "%select{| or 'const char *'}4"
3866   "%select{|, and no matching literal operator template}5">;
3867
3868 // C++ Template Declarations
3869 def err_template_param_shadow : Error<
3870   "declaration of %0 shadows template parameter">;
3871 def note_template_param_here : Note<"template parameter is declared here">;
3872 def warn_template_export_unsupported : Warning<
3873   "exported templates are unsupported">;
3874 def err_template_outside_namespace_or_class_scope : Error<
3875   "templates can only be declared in namespace or class scope">;
3876 def err_template_inside_local_class : Error<
3877   "templates cannot be declared inside of a local class">;
3878 def err_template_linkage : Error<"templates must have C++ linkage">;
3879 def err_template_typedef : Error<"a typedef cannot be a template">;
3880 def err_template_unnamed_class : Error<
3881   "cannot declare a class template with no name">;
3882 def err_template_param_list_different_arity : Error<
3883   "%select{too few|too many}0 template parameters in template "
3884   "%select{|template parameter }1redeclaration">;
3885 def note_template_param_list_different_arity : Note<
3886   "%select{too few|too many}0 template parameters in template template "
3887   "argument">;
3888 def note_template_prev_declaration : Note<
3889   "previous template %select{declaration|template parameter}0 is here">;
3890 def err_template_param_different_kind : Error<
3891   "template parameter has a different kind in template "
3892   "%select{|template parameter }0redeclaration">;
3893 def note_template_param_different_kind : Note<
3894   "template parameter has a different kind in template argument">;
3895   
3896 def err_template_nontype_parm_different_type : Error<
3897   "template non-type parameter has a different type %0 in template "
3898   "%select{|template parameter }1redeclaration">;
3899
3900 def note_template_nontype_parm_different_type : Note<
3901   "template non-type parameter has a different type %0 in template argument">;
3902 def note_template_nontype_parm_prev_declaration : Note<
3903   "previous non-type template parameter with type %0 is here">;
3904 def err_template_nontype_parm_bad_type : Error<
3905   "a non-type template parameter cannot have type %0">;
3906 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3907   "non-type template parameters declared with %0 are incompatible with C++ "
3908   "standards before C++17">,
3909   DefaultIgnore, InGroup<CXXPre1zCompat>;
3910 def err_template_param_default_arg_redefinition : Error<
3911   "template parameter redefines default argument">;
3912 def note_template_param_prev_default_arg : Note<
3913   "previous default template argument defined here">;
3914 def err_template_param_default_arg_missing : Error<
3915   "template parameter missing a default argument">;
3916 def ext_template_parameter_default_in_function_template : ExtWarn<
3917   "default template arguments for a function template are a C++11 extension">,
3918   InGroup<CXX11>;
3919 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3920   "default template arguments for a function template are incompatible with C++98">,
3921   InGroup<CXX98Compat>, DefaultIgnore;
3922 def err_template_parameter_default_template_member : Error<
3923   "cannot add a default template argument to the definition of a member of a "
3924   "class template">;
3925 def err_template_parameter_default_friend_template : Error<
3926   "default template argument not permitted on a friend template">;
3927 def err_template_template_parm_no_parms : Error<
3928   "template template parameter must have its own template parameters">;
3929
3930 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3931   InGroup<CXX14>;
3932 def warn_cxx11_compat_variable_template : Warning<
3933   "variable templates are incompatible with C++ standards before C++14">,
3934   InGroup<CXXPre14Compat>, DefaultIgnore;
3935 def err_template_variable_noparams : Error<
3936   "extraneous 'template<>' in declaration of variable %0">;
3937 def err_template_member : Error<"member %0 declared as a template">;
3938 def err_template_member_noparams : Error<
3939   "extraneous 'template<>' in declaration of member %0">;
3940 def err_template_tag_noparams : Error<
3941   "extraneous 'template<>' in declaration of %0 %1">;
3942 def err_template_decl_ref : Error<
3943   "cannot refer to %select{class|variable}0 template %1 without a template argument list">;
3944
3945 // C++ Template Argument Lists
3946 def err_template_missing_args : Error<
3947   "use of "
3948   "%select{class template|function template|variable template|alias template|"
3949   "template template parameter|template}0 %1 requires template arguments">;
3950 def err_template_arg_list_different_arity : Error<
3951   "%select{too few|too many}0 template arguments for "
3952   "%select{class template|function template|variable template|alias template|"
3953   "template template parameter|template}1 %2">;
3954 def note_template_decl_here : Note<"template is declared here">;
3955 def err_template_arg_must_be_type : Error<
3956   "template argument for template type parameter must be a type">;
3957 def err_template_arg_must_be_type_suggest : Error<
3958   "template argument for template type parameter must be a type; "
3959   "did you forget 'typename'?">;
3960 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3961   "template argument for template type parameter must be a type; "
3962   "omitted 'typename' is a Microsoft extension">,
3963   InGroup<MicrosoftTemplate>;
3964 def err_template_arg_must_be_expr : Error<
3965   "template argument for non-type template parameter must be an expression">;
3966 def err_template_arg_nontype_ambig : Error<
3967   "template argument for non-type template parameter is treated as function type %0">;
3968 def err_template_arg_must_be_template : Error<
3969   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3970 def ext_template_arg_local_type : ExtWarn<
3971   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3972 def ext_template_arg_unnamed_type : ExtWarn<
3973   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
3974 def warn_cxx98_compat_template_arg_local_type : Warning<
3975   "local type %0 as template argument is incompatible with C++98">,
3976   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
3977 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
3978   "unnamed type as template argument is incompatible with C++98">,
3979   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
3980 def note_template_unnamed_type_here : Note<
3981   "unnamed type used in template argument was declared here">;
3982 def err_template_arg_overload_type : Error<
3983   "template argument is the type of an unresolved overloaded function">;
3984 def err_template_arg_not_valid_template : Error<
3985   "template argument does not refer to a class or alias template, or template "
3986   "template parameter">;
3987 def note_template_arg_refers_here_func : Note<
3988   "template argument refers to function template %0, here">;
3989 def err_template_arg_template_params_mismatch : Error<
3990   "template template argument has different template parameters than its "
3991   "corresponding template template parameter">;
3992 def err_template_arg_not_integral_or_enumeral : Error<
3993   "non-type template argument of type %0 must have an integral or enumeration"
3994   " type">;
3995 def err_template_arg_not_ice : Error<
3996   "non-type template argument of type %0 is not an integral constant "
3997   "expression">;
3998 def err_template_arg_not_address_constant : Error<
3999   "non-type template argument of type %0 is not a constant expression">;
4000 def warn_cxx98_compat_template_arg_null : Warning<
4001   "use of null pointer as non-type template argument is incompatible with "
4002   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4003 def err_template_arg_untyped_null_constant : Error<
4004   "null non-type template argument must be cast to template parameter type %0">;
4005 def err_template_arg_wrongtype_null_constant : Error<
4006   "null non-type template argument of type %0 does not match template parameter "
4007   "of type %1">;
4008 def err_non_type_template_parm_type_deduction_failure : Error<
4009   "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
4010 def err_deduced_non_type_template_arg_type_mismatch : Error<
4011   "deduced non-type template argument does not have the same type as the "
4012   "corresponding template parameter%diff{ ($ vs $)|}0,1">;
4013 def err_non_type_template_arg_subobject : Error<
4014   "non-type template argument refers to subobject '%0'">;
4015 def err_non_type_template_arg_addr_label_diff : Error<
4016   "template argument / label address difference / what did you expect?">;
4017 def err_template_arg_not_convertible : Error<
4018   "non-type template argument of type %0 cannot be converted to a value "
4019   "of type %1">;
4020 def warn_template_arg_negative : Warning<
4021   "non-type template argument with value '%0' converted to '%1' for unsigned "
4022   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4023 def warn_template_arg_too_large : Warning<
4024   "non-type template argument value '%0' truncated to '%1' for "
4025   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
4026 def err_template_arg_no_ref_bind : Error<
4027   "non-type template parameter of reference type "
4028   "%diff{$ cannot bind to template argument of type $"
4029   "|cannot bind to template of incompatible argument type}0,1">;
4030 def err_template_arg_ref_bind_ignores_quals : Error<
4031   "reference binding of non-type template parameter "
4032   "%diff{of type $ to template argument of type $|to template argument}0,1 "
4033   "ignores qualifiers">;
4034 def err_template_arg_not_decl_ref : Error<
4035   "non-type template argument does not refer to any declaration">;
4036 def err_template_arg_not_address_of : Error<
4037   "non-type template argument for template parameter of pointer type %0 must "
4038   "have its address taken">;
4039 def err_template_arg_address_of_non_pointer : Error<
4040   "address taken in non-type template argument for template parameter of "
4041   "reference type %0">;
4042 def err_template_arg_reference_var : Error<
4043   "non-type template argument of reference type %0 is not an object">;
4044 def err_template_arg_field : Error<
4045   "non-type template argument refers to non-static data member %0">;
4046 def err_template_arg_method : Error<
4047   "non-type template argument refers to non-static member function %0">;
4048 def err_template_arg_object_no_linkage : Error<
4049   "non-type template argument refers to %select{function|object}0 %1 that "
4050   "does not have linkage">;
4051 def warn_cxx98_compat_template_arg_object_internal : Warning<
4052   "non-type template argument referring to %select{function|object}0 %1 with "
4053   "internal linkage is incompatible with C++98">,
4054   InGroup<CXX98Compat>, DefaultIgnore;
4055 def ext_template_arg_object_internal : ExtWarn<
4056   "non-type template argument referring to %select{function|object}0 %1 with "
4057   "internal linkage is a C++11 extension">, InGroup<CXX11>;
4058 def err_template_arg_thread_local : Error<
4059   "non-type template argument refers to thread-local object">;
4060 def note_template_arg_internal_object : Note<
4061   "non-type template argument refers to %select{function|object}0 here">;
4062 def note_template_arg_refers_here : Note<
4063   "non-type template argument refers here">;
4064 def err_template_arg_not_object_or_func : Error<
4065   "non-type template argument does not refer to an object or function">;
4066 def err_template_arg_not_pointer_to_member_form : Error<
4067   "non-type template argument is not a pointer to member constant">;
4068 def err_template_arg_member_ptr_base_derived_not_supported : Error<
4069   "sorry, non-type template argument of pointer-to-member type %1 that refers "
4070   "to member %q0 of a different class is not supported yet">;
4071 def ext_template_arg_extra_parens : ExtWarn<
4072   "address non-type template argument cannot be surrounded by parentheses">;
4073 def warn_cxx98_compat_template_arg_extra_parens : Warning<
4074   "redundant parentheses surrounding address non-type template argument are "
4075   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4076 def err_pointer_to_member_type : Error<
4077   "invalid use of pointer to member type after %select{.*|->*}0">;
4078 def err_pointer_to_member_call_drops_quals : Error<
4079   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4080 def err_pointer_to_member_oper_value_classify: Error<
4081   "pointer-to-member function type %0 can only be called on an "
4082   "%select{rvalue|lvalue}1">;
4083 def ext_ms_deref_template_argument: ExtWarn<
4084   "non-type template argument containing a dereference operation is a "
4085   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4086 def ext_ms_delayed_template_argument: ExtWarn<
4087   "using the undeclared type %0 as a default template argument is a "
4088   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4089 def err_template_arg_deduced_incomplete_pack : Error<
4090   "deduced incomplete pack %0 for template parameter %1">;
4091
4092 // C++ template specialization
4093 def err_template_spec_unknown_kind : Error<
4094   "can only provide an explicit specialization for a class template, function "
4095   "template, variable template, or a member function, static data member, "
4096   "%select{or member class|member class, or member enumeration}0 of a "
4097   "class template">;
4098 def note_specialized_entity : Note<
4099   "explicitly specialized declaration is here">;
4100 def note_explicit_specialization_declared_here : Note<
4101   "explicit specialization declared here">;
4102 def err_template_spec_decl_function_scope : Error<
4103   "explicit specialization of %0 in function scope">;
4104 def err_template_spec_decl_class_scope : Error<
4105   "explicit specialization of %0 in class scope">;
4106 def err_template_spec_decl_friend : Error<
4107   "cannot declare an explicit specialization in a friend">;
4108 def err_template_spec_decl_out_of_scope_global : Error<
4109   "%select{class template|class template partial|variable template|"
4110   "variable template partial|function template|member function|"
4111   "static data member|member class|member enumeration}0 "
4112   "specialization of %1 must originally be declared in the global scope">;
4113 def err_template_spec_decl_out_of_scope : Error<
4114   "%select{class template|class template partial|variable template|"
4115   "variable template partial|function template|member "
4116   "function|static data member|member class|member enumeration}0 "
4117   "specialization of %1 must originally be declared in namespace %2">;
4118 def ext_template_spec_decl_out_of_scope : ExtWarn<
4119   "first declaration of %select{class template|class template partial|"
4120   "variable template|variable template partial|"
4121   "function template|member function|static data member|member class|"
4122   "member enumeration}0 specialization of %1 outside namespace %2 is a "
4123   "C++11 extension">, InGroup<CXX11>;
4124 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
4125   "%select{class template|class template partial|variable template|"
4126   "variable template partial|function template|member "
4127   "function|static data member|member class|member enumeration}0 "
4128   "specialization of %1 outside namespace %2 is incompatible with C++98">,
4129   InGroup<CXX98Compat>, DefaultIgnore;
4130 def err_template_spec_redecl_out_of_scope : Error<
4131   "%select{class template|class template partial|variable template|"
4132   "variable template partial|function template|member "
4133   "function|static data member|member class|member enumeration}0 "
4134   "specialization of %1 not in a namespace enclosing %2">;
4135 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4136   "%select{class template|class template partial|variable template|"
4137   "variable template partial|function template|member "
4138   "function|static data member|member class|member enumeration}0 "
4139   "specialization of %1 outside namespace enclosing %2 "
4140   "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4141 def err_template_spec_redecl_global_scope : Error<
4142   "%select{class template|class template partial|variable template|"
4143   "variable template partial|function template|member "
4144   "function|static data member|member class|member enumeration}0 "
4145   "specialization of %1 must occur at global scope">;
4146 def err_spec_member_not_instantiated : Error<
4147   "specialization of member %q0 does not specialize an instantiated member">;
4148 def note_specialized_decl : Note<"attempt to specialize declaration here">;
4149 def err_specialization_after_instantiation : Error<
4150   "explicit specialization of %0 after instantiation">;
4151 def note_instantiation_required_here : Note<
4152   "%select{implicit|explicit}0 instantiation first required here">;
4153 def err_template_spec_friend : Error<
4154   "template specialization declaration cannot be a friend">;
4155 def err_template_spec_default_arg : Error<
4156   "default argument not permitted on an explicit "
4157   "%select{instantiation|specialization}0 of function %1">;
4158 def err_not_class_template_specialization : Error<
4159   "cannot specialize a %select{dependent template|template template "
4160   "parameter}0">;
4161 def err_function_specialization_in_class : Error<
4162   "cannot specialize a function %0 within class scope">;
4163 def ext_function_specialization_in_class : ExtWarn<
4164   "explicit specialization of %0 within class scope is a Microsoft extension">,
4165   InGroup<MicrosoftTemplate>;
4166 def ext_explicit_specialization_storage_class : ExtWarn<
4167   "explicit specialization cannot have a storage class">;
4168 def err_explicit_specialization_inconsistent_storage_class : Error<
4169   "explicit specialization has extraneous, inconsistent storage class "
4170   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4171
4172 // C++ class template specializations and out-of-line definitions
4173 def err_template_spec_needs_header : Error<
4174   "template specialization requires 'template<>'">;
4175 def err_template_spec_needs_template_parameters : Error<
4176   "template specialization or definition requires a template parameter list "
4177   "corresponding to the nested type %0">;
4178 def err_template_param_list_matches_nontemplate : Error<
4179   "template parameter list matching the non-templated nested type %0 should "
4180   "be empty ('template<>')">;
4181 def err_alias_template_extra_headers : Error<
4182   "extraneous template parameter list in alias template declaration">;
4183 def err_template_spec_extra_headers : Error<
4184   "extraneous template parameter list in template specialization or "
4185   "out-of-line template definition">;
4186 def warn_template_spec_extra_headers : Warning<
4187   "extraneous template parameter list in template specialization">;
4188 def note_explicit_template_spec_does_not_need_header : Note<
4189   "'template<>' header not required for explicitly-specialized class %0 "
4190   "declared here">;
4191 def err_template_qualified_declarator_no_match : Error<
4192   "nested name specifier '%0' for declaration does not refer into a class, "
4193   "class template or class template partial specialization">;
4194 def err_specialize_member_of_template : Error<
4195   "cannot specialize %select{|(with 'template<>') }0a member of an "
4196   "unspecialized template">;
4197
4198 // C++ Class Template Partial Specialization
4199 def err_default_arg_in_partial_spec : Error<
4200     "default template argument in a class template partial specialization">;
4201 def err_dependent_non_type_arg_in_partial_spec : Error<
4202     "type of specialized non-type template argument depends on a template "
4203     "parameter of the partial specialization">;
4204 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4205     "template parameter is used in default argument declared here">;
4206 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4207     "non-type template argument specializes a template parameter with "
4208     "dependent type %0">;
4209 def err_partial_spec_args_match_primary_template : Error<
4210     "%select{class|variable}0 template partial specialization does not "
4211     "specialize any template argument; to %select{declare|define}1 the "
4212     "primary template, remove the template argument list">; 
4213 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4214     "%select{class|variable}0 template partial specialization is not "
4215     "more specialized than the primary template">, DefaultError,
4216     InGroup<DiagGroup<"invalid-partial-specialization">>;
4217 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4218 def ext_partial_specs_not_deducible : ExtWarn<
4219     "%select{class|variable}0 template partial specialization contains "
4220     "%select{a template parameter|template parameters}1 that cannot be "
4221     "deduced; this partial specialization will never be used">,
4222     DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4223 def note_non_deducible_parameter : Note<
4224     "non-deducible template parameter %0">;
4225 def err_partial_spec_ordering_ambiguous : Error<
4226     "ambiguous partial specializations of %0">;
4227 def note_partial_spec_match : Note<"partial specialization matches %0">;
4228 def err_partial_spec_redeclared : Error<
4229   "class template partial specialization %0 cannot be redeclared">;
4230 def note_partial_specialization_declared_here : Note<
4231   "explicit specialization declared here">;
4232 def note_prev_partial_spec_here : Note<
4233   "previous declaration of class template partial specialization %0 is here">;
4234 def err_partial_spec_fully_specialized : Error<
4235   "partial specialization of %0 does not use any of its template parameters">;
4236
4237 // C++ Variable Template Partial Specialization
4238 def err_var_partial_spec_redeclared : Error<
4239   "variable template partial specialization %0 cannot be redefined">;
4240 def note_var_prev_partial_spec_here : Note<
4241   "previous declaration of variable template partial specialization is here">;
4242 def err_var_spec_no_template : Error<
4243   "no variable template matches%select{| partial}0 specialization">;
4244 def err_var_spec_no_template_but_method : Error<
4245   "no variable template matches specialization; "
4246   "did you mean to use %0 as function template instead?">;
4247   
4248 // C++ Function template specializations
4249 def err_function_template_spec_no_match : Error<
4250     "no function template matches function template specialization %0">;
4251 def err_function_template_spec_ambiguous : Error<
4252     "function template specialization %0 ambiguously refers to more than one "
4253     "function template; explicitly specify%select{| additional}1 template "
4254     "arguments to identify a particular function template">;
4255 def note_function_template_spec_matched : Note<
4256     "function template %q0 matches specialization %1">;
4257 def err_function_template_partial_spec : Error<
4258     "function template partial specialization is not allowed">;
4259
4260 // C++ Template Instantiation
4261 def err_template_recursion_depth_exceeded : Error<
4262   "recursive template instantiation exceeded maximum depth of %0">,
4263   DefaultFatal, NoSFINAE;
4264 def note_template_recursion_depth : Note<
4265   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4266
4267 def err_template_instantiate_within_definition : Error<
4268   "%select{implicit|explicit}0 instantiation of template %1 within its"
4269   " own definition">;
4270 def err_template_instantiate_undefined : Error<
4271   "%select{implicit|explicit}0 instantiation of undefined template %1">;
4272 def err_implicit_instantiate_member_undefined : Error<
4273   "implicit instantiation of undefined member %0">;
4274 def note_template_class_instantiation_was_here : Note<
4275   "class template %0 was instantiated here">;
4276 def note_template_class_explicit_specialization_was_here : Note<
4277   "class template %0 was explicitly specialized here">;
4278 def note_template_class_instantiation_here : Note<
4279   "in instantiation of template class %q0 requested here">;
4280 def note_template_member_class_here : Note<
4281   "in instantiation of member class %q0 requested here">;
4282 def note_template_member_function_here : Note<
4283   "in instantiation of member function %q0 requested here">;
4284 def note_function_template_spec_here : Note<
4285   "in instantiation of function template specialization %q0 requested here">;
4286 def note_template_static_data_member_def_here : Note<
4287   "in instantiation of static data member %q0 requested here">;
4288 def note_template_variable_def_here : Note<
4289   "in instantiation of variable template specialization %q0 requested here">;
4290 def note_template_enum_def_here : Note<
4291   "in instantiation of enumeration %q0 requested here">;
4292 def note_template_nsdmi_here : Note<
4293   "in instantiation of default member initializer %q0 requested here">;
4294 def note_template_type_alias_instantiation_here : Note<
4295   "in instantiation of template type alias %0 requested here">;
4296 def note_template_exception_spec_instantiation_here : Note<
4297   "in instantiation of exception specification for %0 requested here">;
4298 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4299   "required here, but no definition is available">,
4300   InGroup<UndefinedVarTemplate>;
4301 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4302   "required here, but no definition is available">,
4303   InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4304 def note_forward_template_decl : Note<
4305   "forward declaration of template entity is here">;
4306 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4307   "declaration to suppress this warning if %q0 is explicitly instantiated in "
4308   "another translation unit">;
4309
4310 def note_default_arg_instantiation_here : Note<
4311   "in instantiation of default argument for '%0' required here">;
4312 def note_default_function_arg_instantiation_here : Note<
4313   "in instantiation of default function argument expression "
4314   "for '%0' required here">;
4315 def note_explicit_template_arg_substitution_here : Note<
4316   "while substituting explicitly-specified template arguments into function "
4317   "template %0 %1">;
4318 def note_function_template_deduction_instantiation_here : Note<
4319   "while substituting deduced template arguments into function template %0 "
4320   "%1">;
4321 def note_deduced_template_arg_substitution_here : Note<
4322   "during template argument deduction for %select{class|variable}0 template "
4323   "%select{partial specialization |}1%2 %3">;
4324 def note_prior_template_arg_substitution : Note<
4325   "while substituting prior template arguments into %select{non-type|template}0"
4326   " template parameter%1 %2">;
4327 def note_template_default_arg_checking : Note<
4328   "while checking a default template argument used here">;
4329 def note_instantiation_contexts_suppressed : Note<
4330   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4331   "see all)">;
4332
4333 def err_field_instantiates_to_function : Error<
4334   "data member instantiated with function type %0">;
4335 def err_variable_instantiates_to_function : Error<
4336   "%select{variable|static data member}0 instantiated with function type %1">;
4337 def err_nested_name_spec_non_tag : Error<
4338   "type %0 cannot be used prior to '::' because it has no members">;
4339
4340 def err_using_pack_expansion_empty : Error<
4341   "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4342
4343 // C++ Explicit Instantiation
4344 def err_explicit_instantiation_duplicate : Error<
4345     "duplicate explicit instantiation of %0">;
4346 def ext_explicit_instantiation_duplicate : ExtWarn<
4347     "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4348     InGroup<MicrosoftTemplate>;
4349 def note_previous_explicit_instantiation : Note<
4350     "previous explicit instantiation is here">;
4351 def warn_explicit_instantiation_after_specialization : Warning<
4352   "explicit instantiation of %0 that occurs after an explicit "
4353   "specialization has no effect">,
4354   InGroup<DiagGroup<"instantiation-after-specialization">>;
4355 def note_previous_template_specialization : Note<
4356     "previous template specialization is here">;
4357 def err_explicit_instantiation_nontemplate_type : Error<
4358     "explicit instantiation of non-templated type %0">;
4359 def note_nontemplate_decl_here : Note<
4360     "non-templated declaration is here">;
4361 def err_explicit_instantiation_in_class : Error<
4362   "explicit instantiation of %0 in class scope">;
4363 def err_explicit_instantiation_out_of_scope : Error<
4364   "explicit instantiation of %0 not in a namespace enclosing %1">;
4365 def err_explicit_instantiation_must_be_global : Error<
4366   "explicit instantiation of %0 must occur at global scope">;
4367 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4368   "explicit instantiation of %0 not in a namespace enclosing %1">, 
4369   InGroup<CXX11Compat>, DefaultIgnore;
4370 def warn_explicit_instantiation_must_be_global_0x : Warning<
4371   "explicit instantiation of %0 must occur at global scope">, 
4372   InGroup<CXX11Compat>, DefaultIgnore;
4373   
4374 def err_explicit_instantiation_requires_name : Error<
4375   "explicit instantiation declaration requires a name">;
4376 def err_explicit_instantiation_of_typedef : Error<
4377   "explicit instantiation of typedef %0">;
4378 def err_explicit_instantiation_storage_class : Error<
4379   "explicit instantiation cannot have a storage class">;
4380 def err_explicit_instantiation_not_known : Error<
4381   "explicit instantiation of %0 does not refer to a function template, "
4382   "variable template, member function, member class, or static data member">;
4383 def note_explicit_instantiation_here : Note<
4384   "explicit instantiation refers here">;
4385 def err_explicit_instantiation_data_member_not_instantiated : Error<
4386   "explicit instantiation refers to static data member %q0 that is not an "
4387   "instantiation">;
4388 def err_explicit_instantiation_member_function_not_instantiated : Error<
4389   "explicit instantiation refers to member function %q0 that is not an "
4390   "instantiation">;
4391 def err_explicit_instantiation_ambiguous : Error<
4392   "partial ordering for explicit instantiation of %0 is ambiguous">;
4393 def note_explicit_instantiation_candidate : Note<
4394   "explicit instantiation candidate function %q0 template here %1">;
4395 def err_explicit_instantiation_inline : Error<
4396   "explicit instantiation cannot be 'inline'">;
4397 def warn_explicit_instantiation_inline_0x : Warning<
4398   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4399   DefaultIgnore;
4400 def err_explicit_instantiation_constexpr : Error<
4401   "explicit instantiation cannot be 'constexpr'">;
4402 def ext_explicit_instantiation_without_qualified_id : Extension<
4403   "qualifier in explicit instantiation of %q0 requires a template-id "
4404   "(a typedef is not permitted)">;
4405 def err_explicit_instantiation_without_template_id : Error<
4406   "explicit instantiation of %q0 must specify a template argument list">;
4407 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4408   "explicit instantiation of %q0 must occur in namespace %1">;
4409 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4410   "explicit instantiation of %q0 must occur in namespace %1">,
4411   InGroup<CXX11Compat>, DefaultIgnore;
4412 def err_explicit_instantiation_undefined_member : Error<
4413   "explicit instantiation of undefined %select{member class|member function|"
4414   "static data member}0 %1 of class template %2">;
4415 def err_explicit_instantiation_undefined_func_template : Error<
4416   "explicit instantiation of undefined function template %0">;
4417 def err_explicit_instantiation_undefined_var_template : Error<
4418   "explicit instantiation of undefined variable template %q0">;
4419 def err_explicit_instantiation_declaration_after_definition : Error<
4420   "explicit instantiation declaration (with 'extern') follows explicit "
4421   "instantiation definition (without 'extern')">;
4422 def note_explicit_instantiation_definition_here : Note<
4423   "explicit instantiation definition is here">;
4424 def err_invalid_var_template_spec_type : Error<"type %2 "
4425   "of %select{explicit instantiation|explicit specialization|"
4426   "partial specialization|redeclaration}0 of %1 does not match"
4427   " expected type %3">;
4428 def err_mismatched_exception_spec_explicit_instantiation : Error<
4429   "exception specification in explicit instantiation does not match "
4430   "instantiated one">;
4431 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4432   err_mismatched_exception_spec_explicit_instantiation.Text>,
4433   InGroup<MicrosoftExceptionSpec>;
4434   
4435 // C++ typename-specifiers
4436 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4437 def err_typename_nested_not_found_enable_if : Error<
4438   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4439   "this declaration">;
4440 def err_typename_nested_not_found_requirement : Error<
4441   "failed requirement '%0'; 'enable_if' cannot be used to disable this "
4442   "declaration">;
4443 def err_typename_nested_not_type : Error<
4444     "typename specifier refers to non-type member %0 in %1">;
4445 def note_typename_refers_here : Note<
4446     "referenced member %0 is declared here">;
4447 def err_typename_missing : Error<
4448   "missing 'typename' prior to dependent type name '%0%1'">;
4449 def err_typename_missing_template : Error<
4450   "missing 'typename' prior to dependent type template name '%0%1'">;
4451 def ext_typename_missing : ExtWarn<
4452   "missing 'typename' prior to dependent type name '%0%1'">,
4453   InGroup<DiagGroup<"typename-missing">>;
4454 def ext_typename_outside_of_template : ExtWarn<
4455   "'typename' occurs outside of a template">, InGroup<CXX11>;
4456 def warn_cxx98_compat_typename_outside_of_template : Warning<
4457   "use of 'typename' outside of a template is incompatible with C++98">,
4458   InGroup<CXX98Compat>, DefaultIgnore;
4459 def err_typename_refers_to_using_value_decl : Error<
4460   "typename specifier refers to a dependent using declaration for a value "
4461   "%0 in %1">;
4462 def note_using_value_decl_missing_typename : Note<
4463   "add 'typename' to treat this using declaration as a type">;
4464
4465 def err_template_kw_refers_to_non_template : Error<
4466   "%0 following the 'template' keyword does not refer to a template">;
4467 def err_template_kw_refers_to_class_template : Error<
4468   "'%0%1' instantiated to a class template, not a function template">;
4469 def note_referenced_class_template : Note<
4470   "class template declared here">;
4471 def err_template_kw_missing : Error<
4472   "missing 'template' keyword prior to dependent template name '%0%1'">;
4473 def ext_template_outside_of_template : ExtWarn<
4474   "'template' keyword outside of a template">, InGroup<CXX11>;
4475 def warn_cxx98_compat_template_outside_of_template : Warning<
4476   "use of 'template' keyword outside of a template is incompatible with C++98">,
4477   InGroup<CXX98Compat>, DefaultIgnore;
4478
4479 def err_non_type_template_in_nested_name_specifier : Error<
4480   "qualified name refers into a specialization of %select{function|variable}0 "
4481   "template %1">;
4482 def err_template_id_not_a_type : Error<
4483   "template name refers to non-type template %0">;
4484 def note_template_declared_here : Note<
4485   "%select{function template|class template|variable template"
4486   "|type alias template|template template parameter}0 "
4487   "%1 declared here">;
4488 def err_alias_template_expansion_into_fixed_list : Error<
4489   "pack expansion used as argument for non-pack parameter of alias template">;
4490 def note_parameter_type : Note<
4491   "parameter of type %0 is declared here">;
4492
4493 // C++11 Variadic Templates
4494 def err_template_param_pack_default_arg : Error<
4495   "template parameter pack cannot have a default argument">;
4496 def err_template_param_pack_must_be_last_template_parameter : Error<
4497   "template parameter pack must be the last template parameter">;
4498
4499 def err_template_parameter_pack_non_pack : Error<
4500   "%select{template type|non-type template|template template}0 parameter"
4501   "%select{| pack}1 conflicts with previous %select{template type|"
4502   "non-type template|template template}0 parameter%select{ pack|}1">;
4503 def note_template_parameter_pack_non_pack : Note<
4504   "%select{template type|non-type template|template template}0 parameter"
4505   "%select{| pack}1 does not match %select{template type|non-type template"
4506   "|template template}0 parameter%select{ pack|}1 in template argument">;
4507 def note_template_parameter_pack_here : Note<
4508   "previous %select{template type|non-type template|template template}0 "
4509   "parameter%select{| pack}1 declared here">;
4510   
4511 def err_unexpanded_parameter_pack : Error<
4512   "%select{expression|base type|declaration type|data member type|bit-field "
4513   "size|static assertion|fixed underlying type|enumerator value|"
4514   "using declaration|friend declaration|qualifier|initializer|default argument|"
4515   "non-type template parameter type|exception type|partial specialization|"
4516   "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4517   "%plural{0: an|:}1 unexpanded parameter pack"
4518   "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4519
4520 def err_pack_expansion_without_parameter_packs : Error<
4521   "pack expansion does not contain any unexpanded parameter packs">;
4522 def err_pack_expansion_length_conflict : Error<
4523   "pack expansion contains parameter packs %0 and %1 that have different "
4524   "lengths (%2 vs. %3)">;
4525 def err_pack_expansion_length_conflict_multilevel : Error<
4526   "pack expansion contains parameter pack %0 that has a different "
4527   "length (%1 vs. %2) from outer parameter packs">;
4528 def err_pack_expansion_member_init : Error<
4529   "pack expansion for initialization of member %0">;
4530
4531 def err_function_parameter_pack_without_parameter_packs : Error<
4532   "type %0 of function parameter pack does not contain any unexpanded "
4533   "parameter packs">;
4534 def err_ellipsis_in_declarator_not_parameter : Error<
4535   "only function and template parameters can be parameter packs">;
4536
4537 def err_sizeof_pack_no_pack_name : Error<
4538   "%0 does not refer to the name of a parameter pack">;
4539
4540 def err_fold_expression_packs_both_sides : Error<
4541   "binary fold expression has unexpanded parameter packs in both operands">;
4542 def err_fold_expression_empty : Error<
4543   "unary fold expression has empty expansion for operator '%0' "
4544   "with no fallback value">;
4545 def err_fold_expression_bad_operand : Error<
4546   "expression not permitted as operand of fold expression">;
4547
4548 def err_unexpected_typedef : Error<
4549   "unexpected type name %0: expected expression">;
4550 def err_unexpected_namespace : Error<
4551   "unexpected namespace name %0: expected expression">;
4552 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4553 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4554   "use of undeclared identifier %0; "
4555   "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4556   InGroup<MicrosoftTemplate>;
4557 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4558   "found via unqualified lookup into dependent bases of class templates is a "
4559   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4560 def note_dependent_var_use : Note<"must qualify identifier to find this "
4561     "declaration in dependent base class">;
4562 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4563     "visible in the template definition nor found by argument-dependent lookup">;
4564 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4565     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4566 def err_undeclared_use : Error<"use of undeclared %0">;
4567 def warn_deprecated : Warning<"%0 is deprecated">,
4568     InGroup<DeprecatedDeclarations>;
4569 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4570 def warn_property_method_deprecated :
4571     Warning<"property access is using %0 method which is deprecated">,
4572     InGroup<DeprecatedDeclarations>;
4573 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4574     InGroup<DeprecatedDeclarations>;
4575 def warn_deprecated_anonymous_namespace : Warning<
4576   "'deprecated' attribute on anonymous namespace ignored">,
4577   InGroup<IgnoredAttributes>;
4578 def warn_deprecated_fwdclass_message : Warning<
4579     "%0 may be deprecated because the receiver type is unknown">,
4580     InGroup<DeprecatedDeclarations>;
4581 def warn_deprecated_def : Warning<
4582   "implementing deprecated %select{method|class|category}0">,
4583   InGroup<DeprecatedImplementations>, DefaultIgnore;
4584 def warn_unavailable_def : Warning<
4585   "implementing unavailable method">,
4586   InGroup<DeprecatedImplementations>, DefaultIgnore;
4587 def err_unavailable : Error<"%0 is unavailable">;
4588 def err_property_method_unavailable :
4589     Error<"property access is using %0 method which is unavailable">;
4590 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4591 def warn_unavailable_fwdclass_message : Warning<
4592     "%0 may be unavailable because the receiver type is unknown">,
4593     InGroup<UnavailableDeclarations>;
4594 def note_availability_specified_here : Note<
4595   "%0 has been explicitly marked "
4596   "%select{unavailable|deleted|deprecated|partial}1 here">;
4597 def note_implicitly_deleted : Note<
4598   "explicitly defaulted function was implicitly deleted here">;
4599 def warn_not_enough_argument : Warning<
4600   "not enough variable arguments in %0 declaration to fit a sentinel">,
4601   InGroup<Sentinel>;
4602 def warn_missing_sentinel : Warning <
4603   "missing sentinel in %select{function call|method dispatch|block call}0">,
4604   InGroup<Sentinel>;
4605 def note_sentinel_here : Note<
4606   "%select{function|method|block}0 has been explicitly marked sentinel here">;
4607 def warn_missing_prototype : Warning<
4608   "no previous prototype for function %0">,
4609   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4610 def note_declaration_not_a_prototype : Note<
4611   "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; 
4612 def warn_strict_prototypes : Warning<
4613   "this %select{function declaration is not|block declaration is not|"
4614   "old-style function definition is not preceded by}0 a prototype">,
4615   InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4616 def warn_missing_variable_declarations : Warning<
4617   "no previous extern declaration for non-static variable %0">,
4618   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4619 def err_static_data_member_reinitialization :
4620   Error<"static data member %0 already has an initializer">;
4621 def err_redefinition : Error<"redefinition of %0">;
4622 def err_alias_after_tentative :
4623   Error<"alias definition of %0 after tentative definition">;
4624 def err_alias_is_definition :
4625   Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4626 def err_definition_of_implicitly_declared_member : Error<
4627   "definition of implicitly declared %select{default constructor|copy "
4628   "constructor|move constructor|copy assignment operator|move assignment "
4629   "operator|destructor|function}1">;
4630 def err_definition_of_explicitly_defaulted_member : Error<
4631   "definition of explicitly defaulted %select{default constructor|copy "
4632   "constructor|move constructor|copy assignment operator|move assignment "
4633   "operator|destructor|function}0">;
4634 def err_redefinition_extern_inline : Error<
4635   "redefinition of a 'extern inline' function %0 is not supported in "
4636   "%select{C99 mode|C++}1">;
4637 def warn_attr_abi_tag_namespace : Warning<
4638   "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4639   InGroup<IgnoredAttributes>;
4640 def err_abi_tag_on_redeclaration : Error<
4641   "cannot add 'abi_tag' attribute in a redeclaration">;
4642 def err_new_abi_tag_on_redeclaration : Error<
4643   "'abi_tag' %0 missing in original declaration">;
4644 def note_use_ifdef_guards : Note<
4645   "unguarded header; consider using #ifdef guards or #pragma once">;
4646
4647 def note_deleted_dtor_no_operator_delete : Note<
4648   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4649 def note_deleted_special_member_class_subobject : Note<
4650   "%select{default constructor of|copy constructor of|move constructor of|"
4651   "copy assignment operator of|move assignment operator of|destructor of|"
4652   "constructor inherited by}0 "
4653   "%1 is implicitly deleted because "
4654   "%select{base class %3|%select{||||variant }4field %3}2 has "
4655   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4656   "%select{%select{default constructor|copy constructor|move constructor|copy "
4657   "assignment operator|move assignment operator|destructor|"
4658   "%select{default|corresponding|default|default|default}4 constructor}0|"
4659   "destructor}5"
4660   "%select{||s||}4">;
4661 def note_deleted_default_ctor_uninit_field : Note<
4662   "%select{default constructor of|constructor inherited by}0 "
4663   "%1 is implicitly deleted because field %2 of "
4664   "%select{reference|const-qualified}4 type %3 would not be initialized">;
4665 def note_deleted_default_ctor_all_const : Note<
4666   "%select{default constructor of|constructor inherited by}0 "
4667   "%1 is implicitly deleted because all "
4668   "%select{data members|data members of an anonymous union member}2"
4669   " are const-qualified">;
4670 def note_deleted_copy_ctor_rvalue_reference : Note<
4671   "copy constructor of %0 is implicitly deleted because field %1 is of "
4672   "rvalue reference type %2">;
4673 def note_deleted_copy_user_declared_move : Note<
4674   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4675   " %1 has a user-declared move %select{constructor|assignment operator}2">;
4676 def note_deleted_assign_field : Note<
4677   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4678   "because field %2 is of %select{reference|const-qualified}4 type %3">;
4679
4680 // These should be errors.
4681 def warn_undefined_internal : Warning<
4682   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4683   InGroup<DiagGroup<"undefined-internal">>;
4684 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4685   InGroup<DiagGroup<"undefined-inline">>;
4686 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4687 def note_used_here : Note<"used here">;
4688
4689 def err_internal_linkage_redeclaration : Error<
4690   "'internal_linkage' attribute does not appear on the first declaration of %0">;
4691 def warn_internal_linkage_local_storage : Warning<
4692   "'internal_linkage' attribute on a non-static local variable is ignored">,
4693   InGroup<IgnoredAttributes>;
4694
4695 def ext_internal_in_extern_inline : ExtWarn<
4696   "static %select{function|variable}0 %1 is used in an inline function with "
4697   "external linkage">, InGroup<StaticInInline>;
4698 def ext_internal_in_extern_inline_quiet : Extension<
4699   "static %select{function|variable}0 %1 is used in an inline function with "
4700   "external linkage">, InGroup<StaticInInline>;
4701 def warn_static_local_in_extern_inline : Warning<
4702   "non-constant static local variable in inline function may be different "
4703   "in different files">, InGroup<StaticLocalInInline>;
4704 def note_convert_inline_to_static : Note<
4705   "use 'static' to give inline function %0 internal linkage">;
4706
4707 def ext_redefinition_of_typedef : ExtWarn<
4708   "redefinition of typedef %0 is a C11 feature">,
4709   InGroup<DiagGroup<"typedef-redefinition"> >;
4710 def err_redefinition_variably_modified_typedef : Error<
4711   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4712
4713 def err_inline_decl_follows_def : Error<
4714   "inline declaration of %0 follows non-inline definition">;
4715 def err_inline_declaration_block_scope : Error<
4716   "inline declaration of %0 not allowed in block scope">;
4717 def err_static_non_static : Error<
4718   "static declaration of %0 follows non-static declaration">;
4719 def err_different_language_linkage : Error<
4720   "declaration of %0 has a different language linkage">;
4721 def ext_retained_language_linkage : Extension<
4722   "friend function %0 retaining previous language linkage is an extension">,
4723   InGroup<DiagGroup<"retained-language-linkage">>;
4724 def err_extern_c_global_conflict : Error<
4725   "declaration of %1 %select{with C language linkage|in global scope}0 "
4726   "conflicts with declaration %select{in global scope|with C language linkage}0">;
4727 def note_extern_c_global_conflict : Note<
4728   "declared %select{in global scope|with C language linkage}0 here">;
4729 def note_extern_c_begins_here : Note<
4730   "extern \"C\" language linkage specification begins here">;
4731 def warn_weak_import : Warning <
4732   "an already-declared variable is made a weak_import declaration %0">;
4733 def ext_static_non_static : Extension<
4734   "redeclaring non-static %0 as static is a Microsoft extension">,
4735   InGroup<MicrosoftRedeclareStatic>;
4736 def err_non_static_static : Error<
4737   "non-static declaration of %0 follows static declaration">;
4738 def err_extern_non_extern : Error<
4739   "extern declaration of %0 follows non-extern declaration">;
4740 def err_non_extern_extern : Error<
4741   "non-extern declaration of %0 follows extern declaration">;
4742 def err_non_thread_thread : Error<
4743   "non-thread-local declaration of %0 follows thread-local declaration">;
4744 def err_thread_non_thread : Error<
4745   "thread-local declaration of %0 follows non-thread-local declaration">;
4746 def err_thread_thread_different_kind : Error<
4747   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4748   "follows declaration with %select{dynamic|static}1 initialization">;
4749 def err_redefinition_different_type : Error<
4750   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4751 def err_redefinition_different_kind : Error<
4752   "redefinition of %0 as different kind of symbol">;
4753 def err_redefinition_different_namespace_alias : Error<
4754   "redefinition of %0 as an alias for a different namespace">;
4755 def note_previous_namespace_alias : Note<
4756   "previously defined as an alias for %0">;
4757 def warn_forward_class_redefinition : Warning<
4758   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4759   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4760 def err_redefinition_different_typedef : Error<
4761   "%select{typedef|type alias|type alias template}0 "
4762   "redefinition with different types%diff{ ($ vs $)|}1,2">;
4763 def err_tag_reference_non_tag : Error<
4764   "%select{non-struct type|non-class type|non-union type|non-enum "
4765   "type|typedef|type alias|template|type alias template|template "
4766   "template argument}1 %0 cannot be referenced with a "
4767   "%select{struct|interface|union|class|enum}2 specifier">;
4768 def err_tag_reference_conflict : Error<
4769   "implicit declaration introduced by elaborated type conflicts with a "
4770   "%select{non-struct type|non-class type|non-union type|non-enum "
4771   "type|typedef|type alias|template|type alias template|template "
4772   "template argument}0 of the same name">;
4773 def err_dependent_tag_decl : Error<
4774   "%select{declaration|definition}0 of "
4775   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4776 def err_tag_definition_of_typedef : Error<
4777   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4778 def err_conflicting_types : Error<"conflicting types for %0">;
4779 def err_different_pass_object_size_params : Error<
4780   "conflicting pass_object_size attributes on parameters">;
4781 def err_late_asm_label_name : Error<
4782   "cannot apply asm label to %select{variable|function}0 after its first use">;
4783 def err_different_asm_label : Error<"conflicting asm label">;
4784 def err_nested_redefinition : Error<"nested redefinition of %0">;
4785 def err_use_with_wrong_tag : Error<
4786   "use of %0 with tag type that does not match previous declaration">;
4787 def warn_struct_class_tag_mismatch : Warning<
4788     "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4789     "declared as a %select{struct|interface|class}3%select{| template}1">,
4790     InGroup<MismatchedTags>, DefaultIgnore;
4791 def warn_struct_class_previous_tag_mismatch : Warning<
4792     "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4793     "here but previously declared as "
4794     "%select{a struct|an interface|a class}3%select{| template}1">,
4795      InGroup<MismatchedTags>, DefaultIgnore;
4796 def note_struct_class_suggestion : Note<
4797     "did you mean %select{struct|interface|class}0 here?">;
4798 def ext_forward_ref_enum : Extension<
4799   "ISO C forbids forward references to 'enum' types">;
4800 def err_forward_ref_enum : Error<
4801   "ISO C++ forbids forward references to 'enum' types">;
4802 def ext_ms_forward_ref_enum : ExtWarn<
4803   "forward references to 'enum' types are a Microsoft extension">,
4804   InGroup<MicrosoftEnumForwardReference>;
4805 def ext_forward_ref_enum_def : Extension<
4806   "redeclaration of already-defined enum %0 is a GNU extension">,
4807   InGroup<GNURedeclaredEnum>;
4808   
4809 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4810 def err_duplicate_member : Error<"duplicate member %0">;
4811 def err_misplaced_ivar : Error<
4812   "instance variables may not be placed in %select{categories|class extension}0">;
4813 def warn_ivars_in_interface : Warning<
4814   "declaration of instance variables in the interface is deprecated">,
4815   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4816 def ext_enum_value_not_int : Extension<
4817   "ISO C restricts enumerator values to range of 'int' (%0 is too "
4818   "%select{small|large}1)">;
4819 def ext_enum_too_large : ExtWarn<
4820   "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4821 def ext_enumerator_increment_too_large : ExtWarn<
4822   "incremented enumerator value %0 is not representable in the "
4823   "largest integer type">, InGroup<EnumTooLarge>;
4824 def warn_flag_enum_constant_out_of_range : Warning<
4825   "enumeration value %0 is out of range of flags in enumeration type %1">,
4826   InGroup<FlagEnum>;
4827   
4828 def warn_illegal_constant_array_size : Extension<
4829   "size of static array must be an integer constant expression">;
4830 def err_vm_decl_in_file_scope : Error<
4831   "variably modified type declaration not allowed at file scope">;
4832 def err_vm_decl_has_extern_linkage : Error<
4833   "variably modified type declaration cannot have 'extern' linkage">;
4834 def err_typecheck_field_variable_size : Error<
4835   "fields must have a constant size: 'variable length array in structure' "
4836   "extension will never be supported">;
4837 def err_vm_func_decl : Error<
4838   "function declaration cannot have variably modified type">;
4839 def err_array_too_large : Error<
4840   "array is too large (%0 elements)">;
4841
4842 // -Wpadded, -Wpacked
4843 def warn_padded_struct_field : Warning<
4844   "padding %select{struct|interface|class}0 %1 with %2 "
4845   "%select{byte|bit}3%s2 to align %4">,
4846   InGroup<Padded>, DefaultIgnore;
4847 def warn_padded_struct_anon_field : Warning<
4848   "padding %select{struct|interface|class}0 %1 with %2 "
4849   "%select{byte|bit}3%s2 to align anonymous bit-field">,
4850   InGroup<Padded>, DefaultIgnore;
4851 def warn_padded_struct_size : Warning<
4852   "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4853   InGroup<Padded>, DefaultIgnore;
4854 def warn_unnecessary_packed : Warning<
4855   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4856
4857 def err_typecheck_negative_array_size : Error<"array size is negative">;
4858 def warn_typecheck_function_qualifiers_ignored : Warning<
4859   "'%0' qualifier on function type %1 has no effect">,
4860   InGroup<IgnoredQualifiers>;
4861 def warn_typecheck_function_qualifiers_unspecified : Warning<
4862   "'%0' qualifier on function type %1 has unspecified behavior">;
4863 def warn_typecheck_reference_qualifiers : Warning<
4864   "'%0' qualifier on reference type %1 has no effect">,
4865   InGroup<IgnoredQualifiers>;
4866 def err_typecheck_invalid_restrict_not_pointer : Error<
4867   "restrict requires a pointer or reference (%0 is invalid)">;
4868 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4869   "restrict requires a pointer or reference">;
4870 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4871   "pointer to function type %0 may not be 'restrict' qualified">;
4872 def ext_typecheck_zero_array_size : Extension<
4873   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4874 def err_typecheck_zero_array_size : Error<
4875   "zero-length arrays are not permitted in C++">;
4876 def warn_typecheck_zero_static_array_size : Warning<
4877   "'static' has no effect on zero-length arrays">,
4878   InGroup<ArrayBounds>;
4879 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4880 def err_init_element_not_constant : Error<
4881   "initializer element is not a compile-time constant">;
4882 def ext_aggregate_init_not_constant : Extension<
4883   "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4884 def err_local_cant_init : Error<
4885   "'__local' variable cannot have an initializer">;
4886 def err_block_extern_cant_init : Error<
4887   "'extern' variable cannot have an initializer">;
4888 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4889   InGroup<DiagGroup<"extern-initializer">>;
4890 def err_variable_object_no_init : Error<
4891   "variable-sized object may not be initialized">;
4892 def err_excess_initializers : Error<
4893   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4894 def ext_excess_initializers : ExtWarn<
4895   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4896 def err_excess_initializers_in_char_array_initializer : Error<
4897   "excess elements in char array initializer">;
4898 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4899   "excess elements in char array initializer">;
4900 def err_initializer_string_for_char_array_too_long : Error<
4901   "initializer-string for char array is too long">;
4902 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4903   "initializer-string for char array is too long">;
4904 def warn_missing_field_initializers : Warning<
4905   "missing field %0 initializer">,
4906   InGroup<MissingFieldInitializers>, DefaultIgnore;
4907 def warn_braces_around_scalar_init : Warning<
4908   "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4909 def ext_many_braces_around_scalar_init : ExtWarn<
4910   "too many braces around scalar initializer">,
4911   InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4912 def ext_complex_component_init : Extension<
4913   "complex initialization specifying real and imaginary components "
4914   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4915 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4916 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4917   "scalar initialized from empty initializer list is incompatible with C++98">,
4918   InGroup<CXX98Compat>, DefaultIgnore;
4919 def warn_cxx98_compat_reference_list_init : Warning<
4920   "reference initialized from initializer list is incompatible with C++98">,
4921   InGroup<CXX98Compat>, DefaultIgnore;
4922 def warn_cxx98_compat_initializer_list_init : Warning<
4923   "initialization of initializer_list object is incompatible with C++98">,
4924   InGroup<CXX98Compat>, DefaultIgnore;
4925 def warn_cxx98_compat_ctor_list_init : Warning<
4926   "constructor call from initializer list is incompatible with C++98">,
4927   InGroup<CXX98Compat>, DefaultIgnore;
4928 def err_illegal_initializer : Error<
4929   "illegal initializer (only variables can be initialized)">;
4930 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4931 def ext_init_list_type_narrowing : ExtWarn<
4932   "type %0 cannot be narrowed to %1 in initializer list">, 
4933   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4934 def ext_init_list_variable_narrowing : ExtWarn<
4935   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4936   "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4937 def ext_init_list_constant_narrowing : ExtWarn<
4938   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4939   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4940 def warn_init_list_type_narrowing : Warning<
4941   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4942   InGroup<CXX11Narrowing>, DefaultIgnore;
4943 def warn_init_list_variable_narrowing : Warning<
4944   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4945   "initializer list in C++11">,
4946   InGroup<CXX11Narrowing>, DefaultIgnore;
4947 def warn_init_list_constant_narrowing : Warning<
4948   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4949   "C++11">,
4950   InGroup<CXX11Narrowing>, DefaultIgnore;
4951 def note_init_list_narrowing_silence : Note<
4952   "insert an explicit cast to silence this issue">;
4953 def err_init_objc_class : Error<
4954   "cannot initialize Objective-C class type %0">;
4955 def err_implicit_empty_initializer : Error<
4956   "initializer for aggregate with no elements requires explicit braces">;
4957 def err_bitfield_has_negative_width : Error<
4958   "bit-field %0 has negative width (%1)">;
4959 def err_anon_bitfield_has_negative_width : Error<
4960   "anonymous bit-field has negative width (%0)">;
4961 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
4962 def err_bitfield_width_exceeds_type_width : Error<
4963   "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
4964   "of its type (%3 bit%s3)">;
4965 def err_anon_bitfield_width_exceeds_type_width : Error<
4966   "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
4967   "of its type (%2 bit%s2)">;
4968 def err_incorrect_number_of_vector_initializers : Error<
4969   "number of elements must be either one or match the size of the vector">;
4970
4971 // Used by C++ which allows bit-fields that are wider than the type.
4972 def warn_bitfield_width_exceeds_type_width: Warning<
4973   "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
4974   "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
4975 def warn_anon_bitfield_width_exceeds_type_width : Warning<
4976   "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
4977   "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
4978 def warn_bitfield_too_small_for_enum : Warning<
4979   "bit-field %0 is not wide enough to store all enumerators of %1">,
4980   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4981 def note_widen_bitfield : Note<
4982   "widen this field to %0 bits to store all values of %1">;
4983 def warn_unsigned_bitfield_assigned_signed_enum : Warning<
4984   "assigning value of signed enum type %1 to unsigned bit-field %0; "
4985   "negative enumerators of enum %1 will be converted to positive values">,
4986   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4987 def warn_signed_bitfield_enum_conversion : Warning<
4988   "signed bit-field %0 needs an extra bit to represent the largest positive "
4989   "enumerators of %1">,
4990   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4991 def note_change_bitfield_sign : Note<
4992   "consider making the bitfield type %select{unsigned|signed}0">;
4993
4994 def warn_missing_braces : Warning<
4995   "suggest braces around initialization of subobject">,
4996   InGroup<MissingBraces>, DefaultIgnore;
4997
4998 def err_redefinition_of_label : Error<"redefinition of label %0">;
4999 def err_undeclared_label_use : Error<"use of undeclared label %0">;
5000 def err_goto_ms_asm_label : Error<
5001   "cannot jump from this goto statement to label %0 inside an inline assembly block">;
5002 def note_goto_ms_asm_label : Note<
5003   "inline assembly label %0 declared here">;
5004 def warn_unused_label : Warning<"unused label %0">,
5005   InGroup<UnusedLabel>, DefaultIgnore;
5006
5007 def err_goto_into_protected_scope : Error<
5008   "cannot jump from this goto statement to its label">;
5009 def ext_goto_into_protected_scope : ExtWarn<
5010   "jump from this goto statement to its label is a Microsoft extension">,
5011   InGroup<MicrosoftGoto>;
5012 def warn_cxx98_compat_goto_into_protected_scope : Warning<
5013   "jump from this goto statement to its label is incompatible with C++98">,
5014   InGroup<CXX98Compat>, DefaultIgnore;
5015 def err_switch_into_protected_scope : Error<
5016   "cannot jump from switch statement to this case label">;
5017 def warn_cxx98_compat_switch_into_protected_scope : Warning<
5018   "jump from switch statement to this case label is incompatible with C++98">,
5019   InGroup<CXX98Compat>, DefaultIgnore;
5020 def err_indirect_goto_without_addrlabel : Error<
5021   "indirect goto in function with no address-of-label expressions">;
5022 def err_indirect_goto_in_protected_scope : Error<
5023   "cannot jump from this indirect goto statement to one of its possible targets">;
5024 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
5025   "jump from this indirect goto statement to one of its possible targets "
5026   "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5027 def note_indirect_goto_target : Note<
5028   "possible target of indirect goto statement">;
5029 def note_protected_by_variable_init : Note<
5030   "jump bypasses variable initialization">;
5031 def note_protected_by_variable_nontriv_destructor : Note<
5032   "jump bypasses variable with a non-trivial destructor">;
5033 def note_protected_by_variable_non_pod : Note<
5034   "jump bypasses initialization of non-POD variable">;
5035 def note_protected_by_cleanup : Note<
5036   "jump bypasses initialization of variable with __attribute__((cleanup))">;
5037 def note_protected_by_vla_typedef : Note<
5038   "jump bypasses initialization of VLA typedef">;
5039 def note_protected_by_vla_type_alias : Note<
5040   "jump bypasses initialization of VLA type alias">;
5041 def note_protected_by_constexpr_if : Note<
5042   "jump enters controlled statement of constexpr if">;
5043 def note_protected_by_if_available : Note<
5044   "jump enters controlled statement of if available">;
5045 def note_protected_by_vla : Note<
5046   "jump bypasses initialization of variable length array">;
5047 def note_protected_by_objc_fast_enumeration : Note<
5048   "jump enters Objective-C fast enumeration loop">;
5049 def note_protected_by_objc_try : Note<
5050   "jump bypasses initialization of @try block">;
5051 def note_protected_by_objc_catch : Note<
5052   "jump bypasses initialization of @catch block">;
5053 def note_protected_by_objc_finally : Note<
5054   "jump bypasses initialization of @finally block">;
5055 def note_protected_by_objc_synchronized : Note<
5056   "jump bypasses initialization of @synchronized block">;
5057 def note_protected_by_objc_autoreleasepool : Note<
5058   "jump bypasses auto release push of @autoreleasepool block">;
5059 def note_protected_by_cxx_try : Note<
5060   "jump bypasses initialization of try block">;
5061 def note_protected_by_cxx_catch : Note<
5062   "jump bypasses initialization of catch block">;
5063 def note_protected_by_seh_try : Note<
5064   "jump bypasses initialization of __try block">;
5065 def note_protected_by_seh_except : Note<
5066   "jump bypasses initialization of __except block">;
5067 def note_protected_by_seh_finally : Note<
5068   "jump bypasses initialization of __finally block">;
5069 def note_protected_by___block : Note<
5070   "jump bypasses setup of __block variable">;
5071 def note_protected_by_objc_strong_init : Note<
5072   "jump bypasses initialization of __strong variable">;
5073 def note_protected_by_objc_weak_init : Note<
5074   "jump bypasses initialization of __weak variable">;
5075 def note_enters_block_captures_cxx_obj : Note<
5076   "jump enters lifetime of block which captures a destructible C++ object">;
5077 def note_enters_block_captures_strong : Note<
5078   "jump enters lifetime of block which strongly captures a variable">;
5079 def note_enters_block_captures_weak : Note<
5080   "jump enters lifetime of block which weakly captures a variable">;
5081
5082 def note_exits_cleanup : Note<
5083   "jump exits scope of variable with __attribute__((cleanup))">;
5084 def note_exits_dtor : Note<
5085   "jump exits scope of variable with non-trivial destructor">;
5086 def note_exits_temporary_dtor : Note<
5087   "jump exits scope of lifetime-extended temporary with non-trivial "
5088   "destructor">;
5089 def note_exits___block : Note<
5090   "jump exits scope of __block variable">;
5091 def note_exits_objc_try : Note<
5092   "jump exits @try block">;
5093 def note_exits_objc_catch : Note<
5094   "jump exits @catch block">;
5095 def note_exits_objc_finally : Note<
5096   "jump exits @finally block">;
5097 def note_exits_objc_synchronized : Note<
5098   "jump exits @synchronized block">;
5099 def note_exits_cxx_try : Note<
5100   "jump exits try block">;
5101 def note_exits_cxx_catch : Note<
5102   "jump exits catch block">;
5103 def note_exits_seh_try : Note<
5104   "jump exits __try block">;
5105 def note_exits_seh_except : Note<
5106   "jump exits __except block">;
5107 def note_exits_seh_finally : Note<
5108   "jump exits __finally block">;
5109 def note_exits_objc_autoreleasepool : Note<
5110   "jump exits autoreleasepool block">;
5111 def note_exits_objc_strong : Note<
5112   "jump exits scope of __strong variable">;
5113 def note_exits_objc_weak : Note<
5114   "jump exits scope of __weak variable">;
5115 def note_exits_block_captures_cxx_obj : Note<
5116   "jump exits lifetime of block which captures a destructible C++ object">;
5117 def note_exits_block_captures_strong : Note<
5118   "jump exits lifetime of block which strongly captures a variable">;
5119 def note_exits_block_captures_weak : Note<
5120   "jump exits lifetime of block which weakly captures a variable">;
5121
5122 def err_func_returning_qualified_void : ExtWarn<
5123   "function cannot return qualified void type %0">,
5124   InGroup<DiagGroup<"qualified-void-return-type">>;
5125 def err_func_returning_array_function : Error<
5126   "function cannot return %select{array|function}0 type %1">;
5127 def err_field_declared_as_function : Error<"field %0 declared as a function">;
5128 def err_field_incomplete : Error<"field has incomplete type %0">;
5129 def ext_variable_sized_type_in_struct : ExtWarn<
5130   "field %0 with variable sized type %1 not at the end of a struct or class is"
5131   " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5132
5133 def ext_c99_flexible_array_member : Extension<
5134   "flexible array members are a C99 feature">, InGroup<C99>;
5135 def err_flexible_array_virtual_base : Error<
5136   "flexible array member %0 not allowed in "
5137   "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5138 def err_flexible_array_empty_aggregate : Error<
5139   "flexible array member %0 not allowed in otherwise empty "
5140   "%select{struct|interface|union|class|enum}1">;
5141 def err_flexible_array_has_nontrivial_dtor : Error<
5142   "flexible array member %0 of type %1 with non-trivial destruction">;
5143 def ext_flexible_array_in_struct : Extension<
5144   "%0 may not be nested in a struct due to flexible array member">,
5145   InGroup<FlexibleArrayExtensions>;
5146 def ext_flexible_array_in_array : Extension<
5147   "%0 may not be used as an array element due to flexible array member">,
5148   InGroup<FlexibleArrayExtensions>;
5149 def err_flexible_array_init : Error<
5150   "initialization of flexible array member is not allowed">;
5151 def ext_flexible_array_empty_aggregate_ms : Extension<
5152   "flexible array member %0 in otherwise empty "
5153   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5154   InGroup<MicrosoftFlexibleArray>;
5155 def err_flexible_array_union : Error<
5156   "flexible array member %0 in a union is not allowed">;
5157 def ext_flexible_array_union_ms : Extension<
5158   "flexible array member %0 in a union is a Microsoft extension">,
5159   InGroup<MicrosoftFlexibleArray>;
5160 def ext_flexible_array_empty_aggregate_gnu : Extension<
5161   "flexible array member %0 in otherwise empty "
5162   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5163   InGroup<GNUEmptyStruct>;
5164 def ext_flexible_array_union_gnu : Extension<
5165   "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5166
5167 let CategoryName = "ARC Semantic Issue" in {
5168
5169 // ARC-mode diagnostics.
5170
5171 let CategoryName = "ARC Weak References" in {
5172
5173 def err_arc_weak_no_runtime : Error<
5174   "cannot create __weak reference because the current deployment target "
5175   "does not support weak references">;
5176 def err_arc_weak_disabled : Error<
5177   "cannot create __weak reference in file using manual reference counting">;
5178 def err_synthesizing_arc_weak_property_disabled : Error<
5179   "cannot synthesize weak property in file using manual reference counting">;
5180 def err_synthesizing_arc_weak_property_no_runtime : Error<
5181   "cannot synthesize weak property because the current deployment target "
5182   "does not support weak references">;
5183 def err_arc_unsupported_weak_class : Error<
5184   "class is incompatible with __weak references">;
5185 def err_arc_weak_unavailable_assign : Error<
5186   "assignment of a weak-unavailable object to a __weak object">;
5187 def err_arc_weak_unavailable_property : Error<
5188   "synthesizing __weak instance variable of type %0, which does not "
5189   "support weak references">;
5190 def note_implemented_by_class : Note<
5191   "when implemented by class %0">;
5192 def err_arc_convesion_of_weak_unavailable : Error<
5193   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5194   " a __weak object of type %2">;
5195
5196 } // end "ARC Weak References" category
5197
5198 let CategoryName = "ARC Restrictions" in {
5199
5200 def err_unavailable_in_arc : Error<
5201   "%0 is unavailable in ARC">;
5202 def note_arc_forbidden_type : Note<
5203   "declaration uses type that is ill-formed in ARC">;
5204 def note_performs_forbidden_arc_conversion : Note<
5205   "inline function performs a conversion which is forbidden in ARC">;
5206 def note_arc_init_returns_unrelated : Note<
5207   "init method must return a type related to its receiver type">;
5208 def note_arc_weak_disabled : Note<
5209   "declaration uses __weak, but ARC is disabled">;
5210 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5211   "the current deployment target does not support">;
5212 def note_arc_field_with_ownership : Note<
5213   "field has non-trivial ownership qualification">;
5214
5215 def err_arc_illegal_explicit_message : Error<
5216   "ARC forbids explicit message send of %0">;
5217 def err_arc_unused_init_message : Error<
5218   "the result of a delegate init call must be immediately returned "
5219   "or assigned to 'self'">;
5220 def err_arc_mismatched_cast : Error<
5221   "%select{implicit conversion|cast}0 of "
5222   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5223   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5224   " to %3 is disallowed with ARC">;
5225 def err_arc_nolifetime_behavior : Error<
5226   "explicit ownership qualifier on cast result has no effect">;
5227 def err_arc_objc_object_in_tag : Error<
5228   "ARC forbids %select{Objective-C objects|blocks}0 in "
5229   "%select{struct|interface|union|<<ERROR>>|enum}1">;
5230 def err_arc_objc_property_default_assign_on_object : Error<
5231   "ARC forbids synthesizing a property of an Objective-C object "
5232   "with unspecified ownership or storage attribute">;
5233 def err_arc_illegal_selector : Error<
5234   "ARC forbids use of %0 in a @selector">;
5235 def err_arc_illegal_method_def : Error<
5236   "ARC forbids %select{implementation|synthesis}0 of %1">;
5237 def warn_arc_strong_pointer_objc_pointer : Warning<
5238   "method parameter of type %0 with no explicit ownership">,
5239   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5240   
5241 } // end "ARC Restrictions" category
5242   
5243 def err_arc_lost_method_convention : Error<
5244   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5245   "method, but its implementation doesn't match because %select{"
5246   "its result type is not an object pointer|"
5247   "its result type is unrelated to its receiver type}1">;
5248 def note_arc_lost_method_convention : Note<"declaration in interface">;
5249 def err_arc_gained_method_convention : Error<
5250   "method implementation does not match its declaration">;
5251 def note_arc_gained_method_convention : Note<
5252   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5253   "family because %select{its result type is not an object pointer|"
5254   "its result type is unrelated to its receiver type}1">;
5255 def err_typecheck_arc_assign_self : Error<
5256   "cannot assign to 'self' outside of a method in the init family">;
5257 def err_typecheck_arc_assign_self_class_method : Error<
5258   "cannot assign to 'self' in a class method">;
5259 def err_typecheck_arr_assign_enumeration : Error<
5260   "fast enumeration variables cannot be modified in ARC by default; "
5261   "declare the variable __strong to allow this">;
5262 def warn_arc_retained_assign : Warning<
5263   "assigning retained object to %select{weak|unsafe_unretained}0 "
5264   "%select{property|variable}1"
5265   "; object will be released after assignment">,
5266   InGroup<ARCUnsafeRetainedAssign>;
5267 def warn_arc_retained_property_assign : Warning<
5268   "assigning retained object to unsafe property"
5269   "; object will be released after assignment">,
5270   InGroup<ARCUnsafeRetainedAssign>;
5271 def warn_arc_literal_assign : Warning<
5272   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5273   " to a weak %select{property|variable}1"
5274   "; object will be released after assignment">,
5275   InGroup<ARCUnsafeRetainedAssign>;
5276 def err_arc_new_array_without_ownership : Error<
5277   "'new' cannot allocate an array of %0 with no explicit ownership">;
5278 def err_arc_autoreleasing_var : Error<
5279   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5280   "__autoreleasing ownership">;
5281 def err_arc_autoreleasing_capture : Error<
5282   "cannot capture __autoreleasing variable in a "
5283   "%select{block|lambda by copy}0">;
5284 def err_arc_thread_ownership : Error<
5285   "thread-local variable has non-trivial ownership: type is %0">;
5286 def err_arc_indirect_no_ownership : Error<
5287   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5288 def err_arc_array_param_no_ownership : Error<
5289   "must explicitly describe intended ownership of an object array parameter">;
5290 def err_arc_pseudo_dtor_inconstant_quals : Error<
5291   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5292   "type %1">;
5293 def err_arc_init_method_unrelated_result_type : Error<
5294   "init methods must return a type related to the receiver type">;
5295 def err_arc_nonlocal_writeback : Error<
5296   "passing address of %select{non-local|non-scalar}0 object to "
5297   "__autoreleasing parameter for write-back">;
5298 def err_arc_method_not_found : Error<
5299   "no known %select{instance|class}1 method for selector %0">;
5300 def err_arc_receiver_forward_class : Error<
5301   "receiver %0 for class message is a forward declaration">;
5302 def err_arc_may_not_respond : Error<
5303   "no visible @interface for %0 declares the selector %1">;
5304 def err_arc_receiver_forward_instance : Error<
5305   "receiver type %0 for instance message is a forward declaration">;
5306 def warn_receiver_forward_instance : Warning<
5307   "receiver type %0 for instance message is a forward declaration">,
5308   InGroup<ForwardClassReceiver>, DefaultIgnore;
5309 def err_arc_collection_forward : Error<
5310   "collection expression type %0 is a forward declaration">;
5311 def err_arc_multiple_method_decl : Error< 
5312   "multiple methods named %0 found with mismatched result, "
5313   "parameter type or attributes">;
5314 def warn_arc_lifetime_result_type : Warning<
5315   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5316   "lifetime qualifier on return type is ignored">,
5317   InGroup<IgnoredQualifiers>;
5318
5319 let CategoryName = "ARC Retain Cycle" in {
5320
5321 def warn_arc_retain_cycle : Warning<
5322   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5323   InGroup<ARCRetainCycles>;
5324 def note_arc_retain_cycle_owner : Note<
5325   "block will be retained by %select{the captured object|an object strongly "
5326   "retained by the captured object}0">;
5327
5328 } // end "ARC Retain Cycle" category
5329
5330 def warn_arc_object_memaccess : Warning<
5331   "%select{destination for|source of}0 this %1 call is a pointer to "
5332   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5333
5334 let CategoryName = "ARC and @properties" in {
5335
5336 def err_arc_strong_property_ownership : Error<
5337   "existing instance variable %1 for strong property %0 may not be "
5338   "%select{|__unsafe_unretained||__weak}2">;
5339 def err_arc_assign_property_ownership : Error<
5340   "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5341   "attribute must be __unsafe_unretained">;
5342 def err_arc_inconsistent_property_ownership : Error<
5343   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5344   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5345
5346 } // end "ARC and @properties" category
5347
5348 def warn_block_capture_autoreleasing : Warning<
5349   "block captures an autoreleasing out-parameter, which may result in "
5350   "use-after-free bugs">,
5351   InGroup<BlockCaptureAutoReleasing>;
5352 def note_declare_parameter_autoreleasing : Note<
5353   "declare the parameter __autoreleasing explicitly to suppress this warning">;
5354 def note_declare_parameter_strong : Note<
5355   "declare the parameter __strong or capture a __block __strong variable to "
5356   "keep values alive across autorelease pools">;
5357
5358 def err_arc_atomic_ownership : Error<
5359   "cannot perform atomic operation on a pointer to type %0: type has "
5360   "non-trivial ownership">;
5361
5362 let CategoryName = "ARC Casting Rules" in {
5363
5364 def err_arc_bridge_cast_incompatible : Error<
5365   "incompatible types casting %0 to %1 with a %select{__bridge|"
5366   "__bridge_transfer|__bridge_retained}2 cast">;
5367 def err_arc_bridge_cast_wrong_kind : Error<
5368   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5369   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5370   "__bridge_transfer|__bridge_retained}4">;
5371 def err_arc_cast_requires_bridge : Error<
5372   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5373   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5374   "requires a bridged cast">;
5375 def note_arc_bridge : Note<
5376   "use __bridge to convert directly (no change in ownership)">;
5377 def note_arc_cstyle_bridge : Note<
5378   "use __bridge with C-style cast to convert directly (no change in ownership)">;
5379 def note_arc_bridge_transfer : Note<
5380   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5381   "ownership of a +1 %0 into ARC">;
5382 def note_arc_cstyle_bridge_transfer : Note<
5383   "use __bridge_transfer with C-style cast to transfer "
5384   "ownership of a +1 %0 into ARC">;
5385 def note_arc_bridge_retained : Note<
5386   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5387   "ARC object available as a +1 %0">;
5388 def note_arc_cstyle_bridge_retained : Note<
5389   "use __bridge_retained with C-style cast to make an "
5390   "ARC object available as a +1 %0">;
5391
5392 } // ARC Casting category
5393
5394 } // ARC category name
5395
5396 def err_flexible_array_init_needs_braces : Error<
5397   "flexible array requires brace-enclosed initializer">;
5398 def err_illegal_decl_array_of_functions : Error<
5399   "'%0' declared as array of functions of type %1">;
5400 def err_illegal_decl_array_incomplete_type : Error<
5401   "array has incomplete element type %0">;
5402 def err_illegal_message_expr_incomplete_type : Error<
5403   "Objective-C message has incomplete result type %0">;
5404 def err_illegal_decl_array_of_references : Error<
5405   "'%0' declared as array of references of type %1">;
5406 def err_decl_negative_array_size : Error<
5407   "'%0' declared as an array with a negative size">;
5408 def err_array_static_outside_prototype : Error<
5409   "%0 used in array declarator outside of function prototype">;
5410 def err_array_static_not_outermost : Error<
5411   "%0 used in non-outermost array type derivation">;
5412 def err_array_star_outside_prototype : Error<
5413   "star modifier used outside of function prototype">;
5414 def err_illegal_decl_pointer_to_reference : Error<
5415   "'%0' declared as a pointer to a reference of type %1">;
5416 def err_illegal_decl_mempointer_to_reference : Error<
5417   "'%0' declared as a member pointer to a reference of type %1">;
5418 def err_illegal_decl_mempointer_to_void : Error<
5419   "'%0' declared as a member pointer to void">;
5420 def err_illegal_decl_mempointer_in_nonclass : Error<
5421   "'%0' does not point into a class">;
5422 def err_mempointer_in_nonclass_type : Error<
5423   "member pointer refers into non-class type %0">;
5424 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5425 def err_nonfunction_block_type : Error<
5426   "block pointer to non-function type is invalid">;
5427 def err_return_block_has_expr : Error<"void block should not return a value">;
5428 def err_block_return_missing_expr : Error<
5429   "non-void block should return a value">;
5430 def err_func_def_incomplete_result : Error<
5431   "incomplete result type %0 in function definition">;
5432 def err_atomic_specifier_bad_type : Error<
5433   "_Atomic cannot be applied to "
5434   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5435   "%1 %select{||||||which is not trivially copyable}0">;
5436
5437 // Expressions.
5438 def ext_sizeof_alignof_function_type : Extension<
5439   "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
5440   "function type">, InGroup<PointerArith>;
5441 def ext_sizeof_alignof_void_type : Extension<
5442   "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
5443   "type">, InGroup<PointerArith>;
5444 def err_opencl_sizeof_alignof_type : Error<
5445   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
5446 def err_sizeof_alignof_incomplete_type : Error<
5447   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
5448   "incomplete type %1">;
5449 def err_sizeof_alignof_function_type : Error<
5450   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
5451   "function type">;
5452 def err_openmp_default_simd_align_expr : Error<
5453   "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5454 def err_sizeof_alignof_typeof_bitfield : Error<
5455   "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5456 def err_alignof_member_of_incomplete_type : Error<
5457   "invalid application of 'alignof' to a field of a class still being defined">;
5458 def err_vecstep_non_scalar_vector_type : Error<
5459   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5460 def err_offsetof_incomplete_type : Error<
5461   "offsetof of incomplete type %0">;
5462 def err_offsetof_record_type : Error<
5463   "offsetof requires struct, union, or class type, %0 invalid">;
5464 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5465 def ext_offsetof_extended_field_designator : Extension<
5466   "using extended field designator is an extension">,
5467   InGroup<DiagGroup<"extended-offsetof">>;
5468 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5469   InGroup<InvalidOffsetof>;
5470 def ext_offsetof_non_standardlayout_type : ExtWarn<
5471   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5472 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5473 def err_offsetof_field_of_virtual_base : Error<
5474   "invalid application of 'offsetof' to a field of a virtual base">;
5475 def warn_sub_ptr_zero_size_types : Warning<
5476   "subtraction of pointers to type %0 of zero size has undefined behavior">,
5477   InGroup<PointerArith>;
5478
5479 def warn_floatingpoint_eq : Warning<
5480   "comparing floating point with == or != is unsafe">,
5481   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5482
5483 def warn_remainder_division_by_zero : Warning<
5484   "%select{remainder|division}0 by zero is undefined">,
5485   InGroup<DivZero>;
5486 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5487   InGroup<DiagGroup<"shift-negative-value">>;
5488 def warn_shift_negative : Warning<"shift count is negative">,
5489   InGroup<DiagGroup<"shift-count-negative">>;
5490 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5491   InGroup<DiagGroup<"shift-count-overflow">>;
5492 def warn_shift_result_gt_typewidth : Warning<
5493   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5494   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5495 def warn_shift_result_sets_sign_bit : Warning<
5496   "signed shift result (%0) sets the sign bit of the shift expression's "
5497   "type (%1) and becomes negative">,
5498   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5499
5500 def warn_precedence_bitwise_rel : Warning<
5501   "%0 has lower precedence than %1; %1 will be evaluated first">,
5502   InGroup<Parentheses>;
5503 def note_precedence_bitwise_first : Note<
5504   "place parentheses around the %0 expression to evaluate it first">;
5505 def note_precedence_silence : Note<
5506   "place parentheses around the '%0' expression to silence this warning">;
5507
5508 def warn_precedence_conditional : Warning<
5509   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5510   InGroup<Parentheses>;
5511 def note_precedence_conditional_first : Note<
5512   "place parentheses around the '?:' expression to evaluate it first">;
5513
5514 def warn_logical_instead_of_bitwise : Warning<
5515   "use of logical '%0' with constant operand">,
5516   InGroup<DiagGroup<"constant-logical-operand">>;
5517 def note_logical_instead_of_bitwise_change_operator : Note<
5518   "use '%0' for a bitwise operation">;
5519 def note_logical_instead_of_bitwise_remove_constant : Note<
5520   "remove constant to silence this warning">;
5521
5522 def warn_bitwise_op_in_bitwise_op : Warning<
5523   "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5524
5525 def warn_logical_and_in_logical_or : Warning<
5526   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5527
5528 def warn_overloaded_shift_in_comparison :Warning<
5529   "overloaded operator %select{>>|<<}0 has higher precedence than "
5530   "comparison operator">,
5531   InGroup<OverloadedShiftOpParentheses>;
5532 def note_evaluate_comparison_first :Note<
5533   "place parentheses around comparison expression to evaluate it first">;
5534
5535 def warn_addition_in_bitshift : Warning<
5536   "operator '%0' has lower precedence than '%1'; "
5537   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5538
5539 def warn_self_assignment : Warning<
5540   "explicitly assigning value of variable of type %0 to itself">,
5541   InGroup<SelfAssignment>, DefaultIgnore;
5542 def warn_self_move : Warning<
5543   "explicitly moving variable of type %0 to itself">,
5544   InGroup<SelfMove>, DefaultIgnore;
5545
5546 def warn_redundant_move_on_return : Warning<
5547   "redundant move in return statement">,
5548   InGroup<RedundantMove>, DefaultIgnore;
5549 def warn_pessimizing_move_on_return : Warning<
5550   "moving a local object in a return statement prevents copy elision">,
5551   InGroup<PessimizingMove>, DefaultIgnore;
5552 def warn_pessimizing_move_on_initialization : Warning<
5553   "moving a temporary object prevents copy elision">,
5554   InGroup<PessimizingMove>, DefaultIgnore;
5555 def note_remove_move : Note<"remove std::move call here">;
5556
5557 def warn_string_plus_int : Warning<
5558   "adding %0 to a string does not append to the string">,
5559   InGroup<StringPlusInt>;
5560 def warn_string_plus_char : Warning<
5561   "adding %0 to a string pointer does not append to the string">,
5562   InGroup<StringPlusChar>;
5563 def note_string_plus_scalar_silence : Note<
5564   "use array indexing to silence this warning">;
5565
5566 def warn_sizeof_array_param : Warning<
5567   "sizeof on array function parameter will return size of %0 instead of %1">,
5568   InGroup<SizeofArrayArgument>;
5569
5570 def warn_sizeof_array_decay : Warning<
5571   "sizeof on pointer operation will return size of %0 instead of %1">,
5572   InGroup<SizeofArrayDecay>;
5573
5574 def err_sizeof_nonfragile_interface : Error<
5575   "application of '%select{alignof|sizeof}1' to interface %0 is "
5576   "not supported on this architecture and platform">;
5577 def err_atdef_nonfragile_interface : Error<
5578   "use of @defs is not supported on this architecture and platform">;
5579 def err_subscript_nonfragile_interface : Error<
5580   "subscript requires size of interface %0, which is not constant for "
5581   "this architecture and platform">;
5582
5583 def err_arithmetic_nonfragile_interface : Error<
5584   "arithmetic on pointer to interface %0, which is not a constant size for "
5585   "this architecture and platform">;
5586
5587
5588 def ext_subscript_non_lvalue : Extension<
5589   "ISO C90 does not allow subscripting non-lvalue array">;
5590 def err_typecheck_subscript_value : Error<
5591   "subscripted value is not an array, pointer, or vector">;
5592 def err_typecheck_subscript_not_integer : Error<
5593   "array subscript is not an integer">;
5594 def err_subscript_function_type : Error<
5595   "subscript of pointer to function type %0">;
5596 def err_subscript_incomplete_type : Error<
5597   "subscript of pointer to incomplete type %0">;
5598 def err_dereference_incomplete_type : Error<
5599   "dereference of pointer to incomplete type %0">;
5600 def ext_gnu_subscript_void_type : Extension<
5601   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5602 def err_typecheck_member_reference_struct_union : Error<
5603   "member reference base type %0 is not a structure or union">;
5604 def err_typecheck_member_reference_ivar : Error<
5605   "%0 does not have a member named %1">;
5606 def err_arc_weak_ivar_access : Error<
5607   "dereferencing a __weak pointer is not allowed due to possible "
5608   "null value caused by race condition, assign it to strong variable first">;
5609 def err_typecheck_member_reference_arrow : Error<
5610   "member reference type %0 is not a pointer">;
5611 def err_typecheck_member_reference_suggestion : Error<
5612   "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5613 def note_typecheck_member_reference_suggestion : Note<
5614   "did you mean to use '.' instead?">;
5615 def note_member_reference_arrow_from_operator_arrow : Note<
5616   "'->' applied to return value of the operator->() declared here">;
5617 def err_typecheck_member_reference_type : Error<
5618   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5619 def err_typecheck_member_reference_unknown : Error<
5620   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5621 def err_member_reference_needs_call : Error<
5622   "base of member reference is a function; perhaps you meant to call "
5623   "it%select{| with no arguments}0?">;
5624 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5625   InGroup<CharSubscript>, DefaultIgnore;
5626
5627 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5628 def err_no_member : Error<"no member named %0 in %1">;
5629 def err_no_member_overloaded_arrow : Error<
5630   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5631
5632 def err_member_not_yet_instantiated : Error<
5633   "no member %0 in %1; it has not yet been instantiated">;
5634 def note_non_instantiated_member_here : Note<
5635   "not-yet-instantiated member is declared here">;
5636
5637 def err_enumerator_does_not_exist : Error<
5638   "enumerator %0 does not exist in instantiation of %1">;
5639 def note_enum_specialized_here : Note<
5640   "enum %0 was explicitly specialized here">;
5641
5642 def err_specialization_not_primary_template : Error<
5643   "cannot reference member of primary template because deduced class "
5644   "template specialization %0 is %select{instantiated from a partial|"
5645   "an explicit}1 specialization">;
5646
5647 def err_member_redeclared : Error<"class member cannot be redeclared">;
5648 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5649   InGroup<RedeclaredClassMember>;
5650 def err_member_redeclared_in_instantiation : Error<
5651   "multiple overloads of %0 instantiate to the same signature %1">;
5652 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5653 def err_member_def_undefined_record : Error<
5654   "out-of-line definition of %0 from class %1 without definition">;
5655 def err_member_decl_does_not_match : Error<
5656   "out-of-line %select{declaration|definition}2 of %0 "
5657   "does not match any declaration in %1">;
5658 def err_friend_decl_with_def_arg_must_be_def : Error<
5659   "friend declaration specifying a default argument must be a definition">;
5660 def err_friend_decl_with_def_arg_redeclared : Error<
5661   "friend declaration specifying a default argument must be the only declaration">;
5662 def err_friend_decl_does_not_match : Error<
5663   "friend declaration of %0 does not match any declaration in %1">;
5664 def err_member_decl_does_not_match_suggest : Error<
5665   "out-of-line %select{declaration|definition}2 of %0 "
5666   "does not match any declaration in %1; did you mean %3?">;
5667 def err_member_def_does_not_match_ret_type : Error<
5668   "return type of out-of-line definition of %q0 differs from "
5669   "that in the declaration">;
5670 def err_nonstatic_member_out_of_line : Error<
5671   "non-static data member defined out-of-line">;
5672 def err_qualified_typedef_declarator : Error<
5673   "typedef declarator cannot be qualified">;
5674 def err_qualified_param_declarator : Error<
5675   "parameter declarator cannot be qualified">;
5676 def ext_out_of_line_declaration : ExtWarn<
5677   "out-of-line declaration of a member must be a definition">,
5678   InGroup<OutOfLineDeclaration>, DefaultError;
5679 def err_member_extra_qualification : Error<
5680   "extra qualification on member %0">;
5681 def warn_member_extra_qualification : Warning<
5682   err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5683 def warn_namespace_member_extra_qualification : Warning<
5684   "extra qualification on member %0">,
5685   InGroup<DiagGroup<"extra-qualification">>;
5686 def err_member_qualification : Error<
5687   "non-friend class member %0 cannot have a qualified name">;  
5688 def note_member_def_close_match : Note<"member declaration nearly matches">;
5689 def note_member_def_close_const_match : Note<
5690   "member declaration does not match because "
5691   "it %select{is|is not}0 const qualified">;
5692 def note_member_def_close_param_match : Note<
5693   "type of %ordinal0 parameter of member declaration does not match definition"
5694   "%diff{ ($ vs $)|}1,2">;
5695 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5696 def note_local_decl_close_param_match : Note<
5697   "type of %ordinal0 parameter of local declaration does not match definition"
5698   "%diff{ ($ vs $)|}1,2">;
5699 def err_typecheck_ivar_variable_size : Error<
5700   "instance variables must have a constant size">;
5701 def err_ivar_reference_type : Error<
5702   "instance variables cannot be of reference type">;
5703 def err_typecheck_illegal_increment_decrement : Error<
5704   "cannot %select{decrement|increment}1 value of type %0">;
5705 def err_typecheck_expect_int : Error<
5706   "used type %0 where integer is required">;
5707 def err_typecheck_arithmetic_incomplete_type : Error<
5708   "arithmetic on a pointer to an incomplete type %0">;
5709 def err_typecheck_pointer_arith_function_type : Error<
5710   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5711   "function type%select{|s}2 %1%select{| and %3}2">;
5712 def err_typecheck_pointer_arith_void_type : Error<
5713   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5714 def err_typecheck_decl_incomplete_type : Error<
5715   "variable has incomplete type %0">;
5716 def ext_typecheck_decl_incomplete_type : ExtWarn<
5717   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5718   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5719 def err_tentative_def_incomplete_type : Error<
5720   "tentative definition has type %0 that is never completed">;
5721 def warn_tentative_incomplete_array : Warning<
5722   "tentative array definition assumed to have one element">;
5723 def err_typecheck_incomplete_array_needs_initializer : Error<
5724   "definition of variable with array type needs an explicit size "
5725   "or an initializer">;
5726 def err_array_init_not_init_list : Error<
5727   "array initializer must be an initializer "
5728   "list%select{| or string literal| or wide string literal}0">;
5729 def err_array_init_narrow_string_into_wchar : Error<
5730   "initializing wide char array with non-wide string literal">;
5731 def err_array_init_wide_string_into_char : Error<
5732   "initializing char array with wide string literal">;
5733 def err_array_init_incompat_wide_string_into_wchar : Error<
5734   "initializing wide char array with incompatible wide string literal">;
5735 def err_array_init_different_type : Error<
5736   "cannot initialize array %diff{of type $ with array of type $|"
5737   "with different type of array}0,1">;
5738 def err_array_init_non_constant_array : Error<
5739   "cannot initialize array %diff{of type $ with non-constant array of type $|"
5740   "with different type of array}0,1">;
5741 def ext_array_init_copy : Extension<
5742   "initialization of an array "
5743   "%diff{of type $ from a compound literal of type $|"
5744   "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5745 // This is intentionally not disabled by -Wno-gnu.
5746 def ext_array_init_parens : ExtWarn<
5747   "parenthesized initialization of a member array is a GNU extension">,
5748   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5749 def warn_deprecated_string_literal_conversion : Warning<
5750   "conversion from string literal to %0 is deprecated">,
5751   InGroup<CXX11CompatDeprecatedWritableStr>;
5752 def ext_deprecated_string_literal_conversion : ExtWarn<
5753   "ISO C++11 does not allow conversion from string literal to %0">,
5754   InGroup<WritableStrings>, SFINAEFailure;
5755 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5756 def err_typecheck_sclass_fscope : Error<
5757   "illegal storage class on file-scoped variable">;
5758 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5759   InGroup<MissingDeclarations>;
5760 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5761   "of a type">, InGroup<MissingDeclarations>;
5762 def err_standalone_class_nested_name_specifier : Error<
5763   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5764   "have a nested name specifier">;
5765 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5766 def err_static_block_func : Error<
5767   "function declared in block scope cannot have 'static' storage class">;
5768 def err_typecheck_address_of : Error<"address of %select{bit-field"
5769   "|vector element|property expression|register variable}0 requested">;
5770 def ext_typecheck_addrof_void : Extension<
5771   "ISO C forbids taking the address of an expression of type 'void'">;
5772 def err_unqualified_pointer_member_function : Error<
5773   "must explicitly qualify name of member function when taking its address">;
5774 def err_invalid_form_pointer_member_function : Error<
5775   "cannot create a non-constant pointer to member function">;
5776 def err_address_of_function_with_pass_object_size_params: Error<
5777   "cannot take address of function %0 because parameter %1 has "
5778   "pass_object_size attribute">;
5779 def err_parens_pointer_member_function : Error<
5780   "cannot parenthesize the name of a method when forming a member pointer">;
5781 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5782   "extra '&' taking address of overloaded function">;
5783 def err_typecheck_invalid_lvalue_addrof : Error<
5784   "cannot take the address of an rvalue of type %0">;
5785 def ext_typecheck_addrof_temporary : ExtWarn<
5786   "taking the address of a temporary object of type %0">, 
5787   InGroup<AddressOfTemporary>, DefaultError;
5788 def err_typecheck_addrof_temporary : Error<
5789   "taking the address of a temporary object of type %0">;
5790 def err_typecheck_addrof_dtor : Error<
5791   "taking the address of a destructor">;
5792 def err_typecheck_unary_expr : Error<
5793   "invalid argument type %0 to unary expression">;
5794 def err_typecheck_indirection_requires_pointer : Error<
5795   "indirection requires pointer operand (%0 invalid)">;
5796 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5797   "ISO C++ does not allow indirection on operand of type %0">,
5798   InGroup<DiagGroup<"void-ptr-dereference">>;
5799 def warn_indirection_through_null : Warning<
5800   "indirection of non-volatile null pointer will be deleted, not trap">,
5801   InGroup<NullDereference>;
5802 def warn_binding_null_to_reference : Warning<
5803   "binding dereferenced null pointer to reference has undefined behavior">,
5804   InGroup<NullDereference>;
5805 def note_indirection_through_null : Note<
5806   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5807 def warn_pointer_indirection_from_incompatible_type : Warning<
5808   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5809   "behavior">,
5810   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5811 def warn_taking_address_of_packed_member : Warning<
5812   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5813   InGroup<DiagGroup<"address-of-packed-member">>;
5814
5815 def err_objc_object_assignment : Error<
5816   "cannot assign to class object (%0 invalid)">;
5817 def err_typecheck_invalid_operands : Error<
5818   "invalid operands to binary expression (%0 and %1)">;
5819 def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
5820   "logical expression with vector %select{type %1 and non-vector type %2|types"
5821   " %1 and %2}0 is only supported in C++">;
5822 def err_typecheck_sub_ptr_compatible : Error<
5823   "%diff{$ and $ are not pointers to compatible types|"
5824   "pointers to incompatible types}0,1">;
5825 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5826   "ordered comparison between pointer and integer (%0 and %1)">;
5827 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5828   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5829 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5830   "ordered comparison between pointer and zero (%0 and %1)">;
5831 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5832   "ordered comparison of function pointers (%0 and %1)">;
5833 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5834   "equality comparison between function pointer and void pointer (%0 and %1)">;
5835 def err_typecheck_comparison_of_fptr_to_void : Error<
5836   "equality comparison between function pointer and void pointer (%0 and %1)">;
5837 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5838   "comparison between pointer and integer (%0 and %1)">;
5839 def err_typecheck_comparison_of_pointer_integer : Error<
5840   "comparison between pointer and integer (%0 and %1)">;
5841 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5842   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5843   InGroup<CompareDistinctPointerType>;
5844 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5845   "incompatible operand types (%0 and %1)">;
5846 def err_cond_voidptr_arc : Error <
5847   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5848   "in ARC mode">;
5849 def err_typecheck_comparison_of_distinct_pointers : Error<
5850   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5851 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5852   "%select{comparison between %diff{ ($ and $)|}0,1"
5853   "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
5854   "|conditional operator with the second and third operands of type "
5855   "%diff{ ($ and $)|}0,1}2"
5856   " which are pointers to non-overlapping address spaces">;
5857
5858 def err_typecheck_assign_const : Error<
5859   "%select{"
5860   "cannot assign to return value because function %1 returns a const value|"
5861   "cannot assign to variable %1 with const-qualified type %2|"
5862   "cannot assign to %select{non-|}1static data member %2 "
5863   "with const-qualified type %3|"
5864   "cannot assign to non-static data member within const member function %1|"
5865   "read-only variable is not assignable}0">;
5866
5867 def note_typecheck_assign_const : Note<
5868   "%select{"
5869   "function %1 which returns const-qualified type %2 declared here|"
5870   "variable %1 declared const here|"
5871   "%select{non-|}1static data member %2 declared const here|"
5872   "member function %q1 is declared const here}0">;
5873
5874 def warn_mixed_sign_comparison : Warning<
5875   "comparison of integers of different signs: %0 and %1">,
5876   InGroup<SignCompare>, DefaultIgnore;
5877 def warn_lunsigned_always_true_comparison : Warning<
5878   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
5879   InGroup<TautologicalCompare>;
5880 def warn_out_of_range_compare : Warning<
5881   "comparison of %select{constant %0|true|false}1 with " 
5882   "%select{expression of type %2|boolean expression}3 is always "
5883   "%select{false|true}4">, InGroup<TautologicalOutOfRangeCompare>;
5884 def warn_runsigned_always_true_comparison : Warning<
5885   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
5886   InGroup<TautologicalCompare>;
5887 def warn_comparison_of_mixed_enum_types : Warning<
5888   "comparison of two values with different enumeration types"
5889   "%diff{ ($ and $)|}0,1">,
5890   InGroup<DiagGroup<"enum-compare">>;
5891 def warn_null_in_arithmetic_operation : Warning<
5892   "use of NULL in arithmetic operation">,
5893   InGroup<NullArithmetic>;
5894 def warn_null_in_comparison_operation : Warning<
5895   "comparison between NULL and non-pointer "
5896   "%select{(%1 and NULL)|(NULL and %1)}0">,
5897   InGroup<NullArithmetic>;
5898 def err_shift_rhs_only_vector : Error<
5899   "requested shift is a vector of type %0 but the first operand is not a "
5900   "vector (%1)">;
5901
5902 def warn_logical_not_on_lhs_of_check : Warning<
5903   "logical not is only applied to the left hand side of this "
5904   "%select{comparison|bitwise operator}0">,
5905   InGroup<LogicalNotParentheses>;
5906 def note_logical_not_fix : Note<
5907   "add parentheses after the '!' to evaluate the "
5908   "%select{comparison|bitwise operator}0 first">;
5909 def note_logical_not_silence_with_parens : Note<
5910   "add parentheses around left hand side expression to silence this warning">;
5911
5912 def err_invalid_this_use : Error<
5913   "invalid use of 'this' outside of a non-static member function">;
5914 def err_this_static_member_func : Error<
5915   "'this' cannot be%select{| implicitly}0 used in a static member function "
5916   "declaration">;
5917 def err_invalid_member_use_in_static_method : Error<
5918   "invalid use of member %0 in static member function">;
5919 def err_invalid_qualified_function_type : Error<
5920   "%select{non-member function|static member function|deduction guide}0 "
5921   "%select{of type %2 |}1cannot have '%3' qualifier">;
5922 def err_compound_qualified_function_type : Error<
5923   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
5924   "cannot have '%3' qualifier">;
5925
5926 def err_ref_qualifier_overload : Error<
5927   "cannot overload a member function %select{without a ref-qualifier|with "
5928   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
5929   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
5930
5931 def err_invalid_non_static_member_use : Error<
5932   "invalid use of non-static data member %0">;
5933 def err_nested_non_static_member_use : Error<
5934   "%select{call to non-static member function|use of non-static data member}0 "
5935   "%2 of %1 from nested type %3">;
5936 def warn_cxx98_compat_non_static_member_use : Warning<
5937   "use of non-static data member %0 in an unevaluated context is "
5938   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5939 def err_invalid_incomplete_type_use : Error<
5940   "invalid use of incomplete type %0">;
5941 def err_builtin_func_cast_more_than_one_arg : Error<
5942   "function-style cast to a builtin type can only take one argument">;
5943 def err_value_init_for_array_type : Error<
5944   "array types cannot be value-initialized">;
5945 def err_init_for_function_type : Error<
5946   "cannot create object of function type %0">;
5947 def warn_format_nonliteral_noargs : Warning<
5948   "format string is not a string literal (potentially insecure)">,
5949   InGroup<FormatSecurity>;
5950 def warn_format_nonliteral : Warning<
5951   "format string is not a string literal">,
5952   InGroup<FormatNonLiteral>, DefaultIgnore;
5953
5954 def err_unexpected_interface : Error<
5955   "unexpected interface name %0: expected expression">;
5956 def err_ref_non_value : Error<"%0 does not refer to a value">;
5957 def err_ref_vm_type : Error<
5958   "cannot refer to declaration with a variably modified type inside block">;
5959 def err_ref_flexarray_type : Error<
5960   "cannot refer to declaration of structure variable with flexible array member "
5961   "inside block">;
5962 def err_ref_array_type : Error<
5963   "cannot refer to declaration with an array type inside block">;
5964 def err_property_not_found : Error<
5965   "property %0 not found on object of type %1">;
5966 def err_invalid_property_name : Error<
5967   "%0 is not a valid property name (accessing an object of type %1)">;
5968 def err_getter_not_found : Error<
5969   "no getter method for read from property">;
5970 def err_objc_subscript_method_not_found : Error<
5971   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
5972   "found on object of type %0">;
5973 def err_objc_subscript_index_type : Error<
5974   "method index parameter type %0 is not integral type">;
5975 def err_objc_subscript_key_type : Error<
5976   "method key parameter type %0 is not object type">;
5977 def err_objc_subscript_dic_object_type : Error<
5978   "method object parameter type %0 is not object type">;
5979 def err_objc_subscript_object_type : Error<
5980   "cannot assign to this %select{dictionary|array}1 because assigning method's "
5981   "2nd parameter of type %0 is not an Objective-C pointer type">;
5982 def err_objc_subscript_base_type : Error<
5983   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
5984 def err_objc_multiple_subscript_type_conversion : Error<
5985   "indexing expression is invalid because subscript type %0 has "
5986   "multiple type conversion functions">;
5987 def err_objc_subscript_type_conversion : Error<
5988   "indexing expression is invalid because subscript type %0 is not an integral"
5989   " or Objective-C pointer type">;
5990 def err_objc_subscript_pointer : Error<
5991   "indexing expression is invalid because subscript type %0 is not an"
5992   " Objective-C pointer">;
5993 def err_objc_indexing_method_result_type : Error<
5994   "method for accessing %select{dictionary|array}1 element must have Objective-C"
5995   " object return type instead of %0">;
5996 def err_objc_index_incomplete_class_type : Error<
5997   "Objective-C index expression has incomplete class type %0">;
5998 def err_illegal_container_subscripting_op : Error<
5999   "illegal operation on Objective-C container subscripting">;
6000 def err_property_not_found_forward_class : Error<
6001   "property %0 cannot be found in forward class object %1">;
6002 def err_property_not_as_forward_class : Error<
6003   "property %0 refers to an incomplete Objective-C class %1 "
6004   "(with no @interface available)">;
6005 def note_forward_class : Note<
6006   "forward declaration of class here">;
6007 def err_duplicate_property : Error<
6008   "property has a previous declaration">;
6009 def ext_gnu_void_ptr : Extension<
6010   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
6011   InGroup<PointerArith>;
6012 def ext_gnu_ptr_func_arith : Extension<
6013   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
6014   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
6015   InGroup<PointerArith>;
6016 def err_readonly_message_assignment : Error<
6017   "assigning to 'readonly' return result of an Objective-C message not allowed">;
6018 def ext_integer_increment_complex : Extension<
6019   "ISO C does not support '++'/'--' on complex integer type %0">;
6020 def ext_integer_complement_complex : Extension<
6021   "ISO C does not support '~' for complex conjugation of %0">;
6022 def err_nosetter_property_assignment : Error<
6023   "%select{assignment to readonly property|"
6024   "no setter method %1 for assignment to property}0">;
6025 def err_nosetter_property_incdec : Error<
6026   "%select{%select{increment|decrement}1 of readonly property|"
6027   "no setter method %2 for %select{increment|decrement}1 of property}0">;
6028 def err_nogetter_property_compound_assignment : Error<
6029   "a getter method is needed to perform a compound assignment on a property">;
6030 def err_nogetter_property_incdec : Error<
6031   "no getter method %1 for %select{increment|decrement}0 of property">;
6032 def err_no_subobject_property_setting : Error<
6033   "expression is not assignable">;
6034 def err_qualified_objc_access : Error<
6035   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
6036   
6037 def ext_freestanding_complex : Extension<
6038   "complex numbers are an extension in a freestanding C99 implementation">;
6039
6040 // FIXME: Remove when we support imaginary.
6041 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
6042
6043 // Obj-c expressions
6044 def warn_root_inst_method_not_found : Warning<
6045   "instance method %0 is being used on 'Class' which is not in the root class">,
6046   InGroup<MethodAccess>;
6047 def warn_class_method_not_found : Warning<
6048   "class method %objcclass0 not found (return type defaults to 'id')">,
6049   InGroup<MethodAccess>;
6050 def warn_instance_method_on_class_found : Warning<
6051   "instance method %0 found instead of class method %1">,
6052   InGroup<MethodAccess>;
6053 def warn_inst_method_not_found : Warning<
6054   "instance method %objcinstance0 not found (return type defaults to 'id')">,
6055   InGroup<MethodAccess>;
6056 def warn_instance_method_not_found_with_typo : Warning<
6057   "instance method %objcinstance0 not found (return type defaults to 'id')"
6058   "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6059 def warn_class_method_not_found_with_typo : Warning<
6060   "class method %objcclass0 not found (return type defaults to 'id')"
6061   "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6062 def err_method_not_found_with_typo : Error<
6063   "%select{instance|class}1 method %0 not found "
6064   "; did you mean %2?">;
6065 def err_no_super_class_message : Error<
6066   "no @interface declaration found in class messaging of %0">;
6067 def err_root_class_cannot_use_super : Error<
6068   "%0 cannot use 'super' because it is a root class">;
6069 def err_invalid_receiver_to_message_super : Error<
6070   "'super' is only valid in a method body">;
6071 def err_invalid_receiver_class_message : Error<
6072   "receiver type %0 is not an Objective-C class">;
6073 def err_missing_open_square_message_send : Error<
6074   "missing '[' at start of message send expression">;
6075 def warn_bad_receiver_type : Warning<
6076   "receiver type %0 is not 'id' or interface pointer, consider "
6077   "casting it to 'id'">,InGroup<ObjCReceiver>;
6078 def err_bad_receiver_type : Error<"bad receiver type %0">;
6079 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6080 def err_unknown_receiver_suggest : Error<
6081   "unknown receiver %0; did you mean %1?">;
6082 def err_objc_throw_expects_object : Error<
6083   "@throw requires an Objective-C object type (%0 invalid)">;
6084 def err_objc_synchronized_expects_object : Error<
6085   "@synchronized requires an Objective-C object type (%0 invalid)">;
6086 def err_rethrow_used_outside_catch : Error<
6087   "@throw (rethrow) used outside of a @catch block">;
6088 def err_attribute_multiple_objc_gc : Error<
6089   "multiple garbage collection attributes specified for type">;
6090 def err_catch_param_not_objc_type : Error<
6091   "@catch parameter is not a pointer to an interface type">;
6092 def err_illegal_qualifiers_on_catch_parm : Error<
6093   "illegal qualifiers on @catch parameter">;
6094 def err_storage_spec_on_catch_parm : Error<
6095   "@catch parameter cannot have storage specifier '%0'">;
6096 def warn_register_objc_catch_parm : Warning<
6097   "'register' storage specifier on @catch parameter will be ignored">;
6098 def err_qualified_objc_catch_parm : Error<
6099   "@catch parameter declarator cannot be qualified">;
6100 def warn_objc_pointer_cxx_catch_fragile : Warning<
6101   "cannot catch an exception thrown with @throw in C++ in the non-unified "
6102   "exception model">, InGroup<ObjCNonUnifiedException>;
6103 def err_objc_object_catch : Error<
6104   "cannot catch an Objective-C object by value">;
6105 def err_incomplete_type_objc_at_encode : Error<
6106   "'@encode' of incomplete type %0">;
6107 def warn_objc_circular_container : Warning<
6108   "adding '%0' to '%1' might cause circular dependency in container">,
6109   InGroup<DiagGroup<"objc-circular-container">>;
6110 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
6111 def warn_objc_unsafe_perform_selector : Warning<
6112   "%0 is incompatible with selectors that return a "
6113   "%select{struct|union|vector}1 type">,
6114   InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
6115 def note_objc_unsafe_perform_selector_method_declared_here :  Note<
6116   "method %0 that returns %1 declared here">;
6117
6118 def warn_setter_getter_impl_required : Warning<
6119   "property %0 requires method %1 to be defined - "
6120   "use @synthesize, @dynamic or provide a method implementation "
6121   "in this class implementation">,
6122   InGroup<ObjCPropertyImpl>;
6123 def warn_setter_getter_impl_required_in_category : Warning<
6124   "property %0 requires method %1 to be defined - "
6125   "use @dynamic or provide a method implementation in this category">,
6126   InGroup<ObjCPropertyImpl>;
6127 def note_parameter_named_here : Note<
6128   "passing argument to parameter %0 here">;
6129 def note_parameter_here : Note<
6130   "passing argument to parameter here">;
6131 def note_method_return_type_change : Note<
6132   "compiler has implicitly changed method %0 return type">;
6133
6134 def warn_impl_required_for_class_property : Warning<
6135   "class property %0 requires method %1 to be defined - "
6136   "use @dynamic or provide a method implementation "
6137   "in this class implementation">,
6138   InGroup<ObjCPropertyImpl>;
6139 def warn_impl_required_in_category_for_class_property : Warning<
6140   "class property %0 requires method %1 to be defined - "
6141   "use @dynamic or provide a method implementation in this category">,
6142   InGroup<ObjCPropertyImpl>;
6143
6144 // C++ casts
6145 // These messages adhere to the TryCast pattern: %0 is an int specifying the
6146 // cast type, %1 is the source type, %2 is the destination type.
6147 def err_bad_reinterpret_cast_overload : Error<
6148   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
6149
6150 def warn_reinterpret_different_from_static : Warning<
6151   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
6152   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
6153   "'static_cast'">, InGroup<ReinterpretBaseClass>;
6154 def note_reinterpret_updowncast_use_static: Note<
6155   "use 'static_cast' to adjust the pointer correctly while "
6156   "%select{upcasting|downcasting}0">;
6157
6158 def err_bad_static_cast_overload : Error<
6159   "address of overloaded function %0 cannot be static_cast to type %1">;
6160
6161 def err_bad_cstyle_cast_overload : Error<
6162   "address of overloaded function %0 cannot be cast to type %1">;
6163
6164
6165 def err_bad_cxx_cast_generic : Error<
6166   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6167   "functional-style cast}0 from %1 to %2 is not allowed">;
6168 def err_bad_cxx_cast_unrelated_class : Error<
6169   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6170   "functional-style cast}0 from %1 to %2, which are not related by "
6171   "inheritance, is not allowed">;
6172 def note_type_incomplete : Note<"%0 is incomplete">;
6173 def err_bad_cxx_cast_rvalue : Error<
6174   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6175   "functional-style cast}0 from rvalue to reference type %2">;
6176 def err_bad_cxx_cast_bitfield : Error<
6177   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6178   "functional-style cast}0 from bit-field lvalue to reference type %2">;
6179 def err_bad_cxx_cast_qualifiers_away : Error<
6180   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6181   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
6182 def err_bad_const_cast_dest : Error<
6183   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
6184   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
6185 def ext_cast_fn_obj : Extension<
6186   "cast between pointer-to-function and pointer-to-object is an extension">;
6187 def ext_ms_cast_fn_obj : ExtWarn<
6188   "static_cast between pointer-to-function and pointer-to-object is a "
6189   "Microsoft extension">, InGroup<MicrosoftCast>;
6190 def warn_cxx98_compat_cast_fn_obj : Warning<
6191   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
6192   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6193 def err_bad_reinterpret_cast_small_int : Error<
6194   "cast from pointer to smaller type %2 loses information">;
6195 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
6196   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6197   "to scalar %2 of different size">;
6198 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6199   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
6200   "to vector %2 of different size">;
6201 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6202   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6203   "to vector %2 of different size">;
6204 def err_bad_lvalue_to_rvalue_cast : Error<
6205   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6206   "not compatible">;
6207 def err_bad_rvalue_to_rvalue_cast : Error<
6208   "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6209   "not compatible">;
6210 def err_bad_static_cast_pointer_nonpointer : Error<
6211   "cannot cast from type %1 to pointer type %2">;
6212 def err_bad_static_cast_member_pointer_nonmp : Error<
6213   "cannot cast from type %1 to member pointer type %2">;
6214 def err_bad_cxx_cast_member_pointer_size : Error<
6215   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6216   "type %1 to member pointer type %2 of different size">;
6217 def err_bad_reinterpret_cast_reference : Error<
6218   "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6219 def warn_undefined_reinterpret_cast : Warning<
6220   "reinterpret_cast from %0 to %1 has undefined behavior">,
6221   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6222
6223 // These messages don't adhere to the pattern.
6224 // FIXME: Display the path somehow better.
6225 def err_ambiguous_base_to_derived_cast : Error<
6226   "ambiguous cast from base %0 to derived %1:%2">;
6227 def err_static_downcast_via_virtual : Error<
6228   "cannot cast %0 to %1 via virtual base %2">;
6229 def err_downcast_from_inaccessible_base : Error<
6230   "cannot cast %select{private|protected}2 base class %1 to %0">;
6231 def err_upcast_to_inaccessible_base : Error<
6232   "cannot cast %0 to its %select{private|protected}2 base class %1">;
6233 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6234   "%0 is not a reference or pointer">;
6235 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6236 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6237 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6238 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6239
6240 // Other C++ expressions
6241 def err_need_header_before_typeid : Error<
6242   "you need to include <typeinfo> before using the 'typeid' operator">;
6243 def err_need_header_before_ms_uuidof : Error<
6244   "you need to include <guiddef.h> before using the '__uuidof' operator">;
6245 def err_ms___leave_not_in___try : Error<
6246   "'__leave' statement not in __try block">;
6247 def err_uuidof_without_guid : Error<
6248   "cannot call operator __uuidof on a type with no GUID">;
6249 def err_uuidof_with_multiple_guids : Error<
6250   "cannot call operator __uuidof on a type with multiple GUIDs">;
6251 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6252 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6253 def err_static_illegal_in_new : Error<
6254   "the 'static' modifier for the array size is not legal in new expressions">;
6255 def err_array_new_needs_size : Error<
6256   "array size must be specified in new expressions">;
6257 def err_bad_new_type : Error<
6258   "cannot allocate %select{function|reference}1 type %0 with new">;
6259 def err_new_incomplete_type : Error<
6260   "allocation of incomplete type %0">;
6261 def err_new_array_nonconst : Error<
6262   "only the first dimension of an allocated array may have dynamic size">;
6263 def err_new_array_init_args : Error<
6264   "array 'new' cannot have initialization arguments">;
6265 def ext_new_paren_array_nonconst : ExtWarn<
6266   "when type is in parentheses, array cannot have dynamic size">;
6267 def err_placement_new_non_placement_delete : Error<
6268   "'new' expression with placement arguments refers to non-placement "
6269   "'operator delete'">;
6270 def err_array_size_not_integral : Error<
6271   "array size expression must have integral or %select{|unscoped }0"
6272   "enumeration type, not %1">;
6273 def err_array_size_incomplete_type : Error<
6274   "array size expression has incomplete class type %0">;
6275 def err_array_size_explicit_conversion : Error<
6276   "array size expression of type %0 requires explicit conversion to type %1">;
6277 def note_array_size_conversion : Note<
6278   "conversion to %select{integral|enumeration}0 type %1 declared here">;
6279 def err_array_size_ambiguous_conversion : Error<
6280   "ambiguous conversion of array size expression of type %0 to an integral or "
6281   "enumeration type">;
6282 def ext_array_size_conversion : Extension<
6283   "implicit conversion from array size expression of type %0 to "
6284   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6285   InGroup<CXX11>;
6286 def warn_cxx98_compat_array_size_conversion : Warning<
6287   "implicit conversion from array size expression of type %0 to "
6288   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6289   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6290 def err_address_space_qualified_new : Error<
6291   "'new' cannot allocate objects of type %0 in address space '%1'">;
6292 def err_address_space_qualified_delete : Error<
6293   "'delete' cannot delete objects of type %0 in address space '%1'">;
6294
6295 def err_default_init_const : Error<
6296   "default initialization of an object of const type %0"
6297   "%select{| without a user-provided default constructor}1">;
6298 def ext_default_init_const : ExtWarn<
6299   "default initialization of an object of const type %0"
6300   "%select{| without a user-provided default constructor}1 "
6301   "is a Microsoft extension">,
6302   InGroup<MicrosoftConstInit>;
6303 def err_delete_operand : Error<"cannot delete expression of type %0">;
6304 def ext_delete_void_ptr_operand : ExtWarn<
6305   "cannot delete expression with pointer-to-'void' type %0">,
6306   InGroup<DeleteIncomplete>;
6307 def err_ambiguous_delete_operand : Error<
6308   "ambiguous conversion of delete expression of type %0 to a pointer">;
6309 def warn_delete_incomplete : Warning<
6310   "deleting pointer to incomplete type %0 may cause undefined behavior">,
6311   InGroup<DeleteIncomplete>;
6312 def err_delete_incomplete_class_type : Error<
6313   "deleting incomplete class type %0; no conversions to pointer type">;
6314 def err_delete_explicit_conversion : Error<
6315   "converting delete expression from type %0 to type %1 invokes an explicit "
6316   "conversion function">;
6317 def note_delete_conversion : Note<"conversion to pointer type %0">;
6318 def warn_delete_array_type : Warning<
6319   "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6320 def warn_mismatched_delete_new : Warning<
6321   "'delete%select{|[]}0' applied to a pointer that was allocated with "
6322   "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6323   InGroup<DiagGroup<"mismatched-new-delete">>;
6324 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6325 def err_no_suitable_delete_member_function_found : Error<
6326   "no suitable member %0 in %1">;
6327 def err_ambiguous_suitable_delete_member_function_found : Error<
6328   "multiple suitable %0 functions in %1">;
6329 def warn_ambiguous_suitable_delete_function_found : Warning<
6330   "multiple suitable %0 functions for %1; no 'operator delete' function "
6331   "will be invoked if initialization throws an exception">,
6332   InGroup<DiagGroup<"ambiguous-delete">>;
6333 def note_member_declared_here : Note<
6334   "member %0 declared here">;
6335 def note_member_first_declared_here : Note<
6336   "member %0 first declared here">;
6337 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6338 def warn_increment_bool : Warning<
6339   "incrementing expression of type bool is deprecated and "
6340   "incompatible with C++17">, InGroup<DeprecatedIncrementBool>;
6341 def ext_increment_bool : ExtWarn<
6342   "ISO C++17 does not allow incrementing expression of type bool">,
6343   DefaultError, InGroup<IncrementBool>;
6344 def err_increment_decrement_enum : Error<
6345   "cannot %select{decrement|increment}0 expression of enum type %1">;
6346 def err_catch_incomplete_ptr : Error<
6347   "cannot catch pointer to incomplete type %0">;
6348 def err_catch_incomplete_ref : Error<
6349   "cannot catch reference to incomplete type %0">;
6350 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6351 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6352 def err_catch_variably_modified : Error<
6353   "cannot catch variably modified type %0">;
6354 def err_qualified_catch_declarator : Error<
6355   "exception declarator cannot be qualified">;
6356 def err_early_catch_all : Error<"catch-all handler must come last">;
6357 def err_bad_memptr_rhs : Error<
6358   "right hand operand to %0 has non-pointer-to-member type %1">;
6359 def err_bad_memptr_lhs : Error<
6360   "left hand operand to %0 must be a %select{|pointer to }1class "
6361   "compatible with the right hand operand, but is %2">;
6362 def warn_exception_caught_by_earlier_handler : Warning<
6363   "exception of type %0 will be caught by earlier handler">,
6364   InGroup<Exceptions>;
6365 def note_previous_exception_handler : Note<"for type %0">;
6366 def err_exceptions_disabled : Error<
6367   "cannot use '%0' with exceptions disabled">;
6368 def err_objc_exceptions_disabled : Error<
6369   "cannot use '%0' with Objective-C exceptions disabled">;
6370 def warn_throw_in_noexcept_func : Warning<
6371   "%0 has a non-throwing exception specification but can still throw">,
6372   InGroup<Exceptions>;
6373 def note_throw_in_dtor : Note<
6374   "%select{destructor|deallocator}0 has a %select{non-throwing|implicit "
6375   "non-throwing}1 exception specification">;
6376 def note_throw_in_function : Note<"function declared non-throwing here">;
6377 def err_seh_try_outside_functions : Error<
6378   "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6379 def err_mixing_cxx_try_seh_try : Error<
6380   "cannot use C++ 'try' in the same function as SEH '__try'">;
6381 def err_seh_try_unsupported : Error<
6382   "SEH '__try' is not supported on this target">;
6383 def note_conflicting_try_here : Note<
6384   "conflicting %0 here">;
6385 def warn_jump_out_of_seh_finally : Warning<
6386   "jump out of __finally block has undefined behavior">,
6387   InGroup<DiagGroup<"jump-seh-finally">>;
6388 def warn_non_virtual_dtor : Warning<
6389   "%0 has virtual functions but non-virtual destructor">,
6390   InGroup<NonVirtualDtor>, DefaultIgnore;
6391 def warn_delete_non_virtual_dtor : Warning<
6392   "%select{delete|destructor}0 called on non-final %1 that has "
6393   "virtual functions but non-virtual destructor">,
6394   InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
6395 def note_delete_non_virtual : Note<
6396   "qualify call to silence this warning">;
6397 def warn_delete_abstract_non_virtual_dtor : Warning<
6398   "%select{delete|destructor}0 called on %1 that is abstract but has "
6399   "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>;
6400 def warn_overloaded_virtual : Warning<
6401   "%q0 hides overloaded virtual %select{function|functions}1">,
6402   InGroup<OverloadedVirtual>, DefaultIgnore;
6403 def note_hidden_overloaded_virtual_declared_here : Note<
6404   "hidden overloaded virtual function %q0 declared here"
6405   "%select{|: different classes%diff{ ($ vs $)|}2,3"
6406   "|: different number of parameters (%2 vs %3)"
6407   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6408   "|: different return type%diff{ ($ vs $)|}2,3"
6409   "|: different qualifiers ("
6410   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6411   "volatile and restrict|const, volatile, and restrict}2 vs "
6412   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6413   "volatile and restrict|const, volatile, and restrict}3)"
6414   "|: different exception specifications}1">;
6415 def warn_using_directive_in_header : Warning<
6416   "using namespace directive in global context in header">,
6417   InGroup<HeaderHygiene>, DefaultIgnore;
6418 def warn_overaligned_type : Warning<
6419   "type %0 requires %1 bytes of alignment and the default allocator only "
6420   "guarantees %2 bytes">,
6421   InGroup<OveralignedType>, DefaultIgnore;
6422 def warn_aligned_allocation_unavailable :Warning<
6423   "aligned %select{allocation|deallocation}0 function of type '%1' possibly "
6424   "unavailable on %2">, InGroup<AlignedAllocationUnavailable>, DefaultError;
6425 def note_silence_unligned_allocation_unavailable : Note<
6426   "if you supply your own aligned allocation functions, use "
6427   "-Wno-aligned-allocation-unavailable to silence this diagnostic">;
6428
6429 def err_conditional_void_nonvoid : Error<
6430   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6431   "is of type %0">;
6432 def err_conditional_ambiguous : Error<
6433   "conditional expression is ambiguous; "
6434   "%diff{$ can be converted to $ and vice versa|"
6435   "types can be convert to each other}0,1">;
6436 def err_conditional_ambiguous_ovl : Error<
6437   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6438   "can be converted to several common types">;
6439 def err_conditional_vector_size : Error<
6440   "vector condition type %0 and result type %1 do not have the same number "
6441   "of elements">;
6442 def err_conditional_vector_element_size : Error<
6443   "vector condition type %0 and result type %1 do not have elements of the "
6444   "same size">;
6445
6446 def err_throw_incomplete : Error<
6447   "cannot throw object of incomplete type %0">;
6448 def err_throw_incomplete_ptr : Error<
6449   "cannot throw pointer to object of incomplete type %0">;
6450 def err_return_in_constructor_handler : Error<
6451   "return in the catch of a function try block of a constructor is illegal">;
6452 def warn_cdtor_function_try_handler_mem_expr : Warning<
6453   "cannot refer to a non-static member from the handler of a "
6454   "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6455
6456 let CategoryName = "Lambda Issue" in {
6457   def err_capture_more_than_once : Error<
6458     "%0 can appear only once in a capture list">;
6459   def err_reference_capture_with_reference_default : Error<
6460     "'&' cannot precede a capture when the capture default is '&'">;
6461   def err_this_capture_with_copy_default : Error<
6462     "'this' cannot be explicitly captured when the capture default is '='">;
6463   def err_copy_capture_with_copy_default : Error<
6464     "'&' must precede a capture when the capture default is '='">;
6465   def err_capture_does_not_name_variable : Error<
6466     "%0 in capture list does not name a variable">;
6467   def err_capture_non_automatic_variable : Error<
6468     "%0 cannot be captured because it does not have automatic storage "
6469     "duration">;
6470   def err_this_capture : Error<
6471     "'this' cannot be %select{implicitly |}0captured in this context">;
6472   def err_lambda_capture_anonymous_var : Error<
6473     "unnamed variable cannot be implicitly captured in a lambda expression">;
6474   def err_lambda_capture_flexarray_type : Error<
6475     "variable %0 with flexible array member cannot be captured in "
6476     "a lambda expression">;
6477   def err_lambda_impcap : Error<
6478     "variable %0 cannot be implicitly captured in a lambda with no "
6479     "capture-default specified">;
6480   def note_lambda_decl : Note<"lambda expression begins here">;
6481   def err_lambda_unevaluated_operand : Error<
6482     "lambda expression in an unevaluated operand">;
6483   def err_lambda_in_constant_expression : Error<
6484     "a lambda expression may not appear inside of a constant expression">;
6485   def err_lambda_return_init_list : Error<
6486     "cannot deduce lambda return type from initializer list">;
6487   def err_lambda_capture_default_arg : Error<
6488     "lambda expression in default argument cannot capture any entity">;
6489   def err_lambda_incomplete_result : Error<
6490     "incomplete result type %0 in lambda expression">;
6491   def err_noreturn_lambda_has_return_expr : Error<
6492     "lambda declared 'noreturn' should not return">;
6493   def warn_maybe_falloff_nonvoid_lambda : Warning<
6494     "control may reach end of non-void lambda">,
6495     InGroup<ReturnType>;
6496   def warn_falloff_nonvoid_lambda : Warning<
6497     "control reaches end of non-void lambda">,
6498     InGroup<ReturnType>;
6499   def err_access_lambda_capture : Error<
6500     // The ERRORs represent other special members that aren't constructors, in
6501     // hopes that someone will bother noticing and reporting if they appear
6502     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6503     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6504     AccessControl;
6505   def note_lambda_to_block_conv : Note<
6506     "implicit capture of lambda object due to conversion to block pointer "
6507     "here">;
6508   def note_var_explicitly_captured_here : Note<"variable %0 is"
6509     "%select{| explicitly}1 captured here">;
6510
6511   // C++14 lambda init-captures.
6512   def warn_cxx11_compat_init_capture : Warning<
6513     "initialized lambda captures are incompatible with C++ standards "
6514     "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6515   def ext_init_capture : ExtWarn<
6516     "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6517   def err_init_capture_no_expression : Error<
6518     "initializer missing for lambda capture %0">;
6519   def err_init_capture_multiple_expressions : Error<
6520     "initializer for lambda capture %0 contains multiple expressions">;
6521   def err_init_capture_paren_braces : Error<
6522     "cannot deduce type for lambda capture %1 from "
6523     "%select{parenthesized|nested}0 initializer list">;
6524   def err_init_capture_deduction_failure : Error<
6525     "cannot deduce type for lambda capture %0 from initializer of type %2">;
6526   def err_init_capture_deduction_failure_from_init_list : Error<
6527     "cannot deduce type for lambda capture %0 from initializer list">;
6528
6529   // C++1z '*this' captures.
6530   def warn_cxx14_compat_star_this_lambda_capture : Warning<
6531     "by value capture of '*this' is incompatible with C++ standards before C++17">,
6532      InGroup<CXXPre1zCompat>, DefaultIgnore;
6533   def ext_star_this_lambda_capture_cxx1z : ExtWarn<
6534     "capture of '*this' by copy is a C++17 extension">, InGroup<CXX17>;
6535 }
6536
6537 def err_return_in_captured_stmt : Error<
6538   "cannot return from %0">;
6539 def err_capture_block_variable : Error<
6540   "__block variable %0 cannot be captured in a "
6541   "%select{lambda expression|captured statement}1">;
6542
6543 def err_operator_arrow_circular : Error<
6544   "circular pointer delegation detected">;
6545 def err_operator_arrow_depth_exceeded : Error<
6546   "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6547   "'operator->' calls">;
6548 def note_operator_arrow_here : Note<
6549   "'operator->' declared here produces an object of type %0">;
6550 def note_operator_arrows_suppressed : Note<
6551   "(skipping %0 'operator->'%s0 in backtrace)">;
6552 def note_operator_arrow_depth : Note<
6553   "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6554
6555 def err_pseudo_dtor_base_not_scalar : Error<
6556   "object expression of non-scalar type %0 cannot be used in a "
6557   "pseudo-destructor expression">;
6558 def ext_pseudo_dtor_on_void : ExtWarn<
6559   "pseudo-destructors on type void are a Microsoft extension">,
6560   InGroup<MicrosoftVoidPseudoDtor>;
6561 def err_pseudo_dtor_type_mismatch : Error<
6562   "the type of object expression "
6563   "%diff{($) does not match the type being destroyed ($)|"
6564   "does not match the type being destroyed}0,1 "
6565   "in pseudo-destructor expression">;
6566 def err_pseudo_dtor_call_with_args : Error<
6567   "call to pseudo-destructor cannot have any arguments">;
6568 def err_dtor_expr_without_call : Error<
6569   "reference to %select{destructor|pseudo-destructor}0 must be called"
6570   "%select{|; did you mean to call it with no arguments?}1">;
6571 def err_pseudo_dtor_destructor_non_type : Error<
6572   "%0 does not refer to a type name in pseudo-destructor expression; expected "
6573   "the name of type %1">;
6574 def err_invalid_use_of_function_type : Error<
6575   "a function type is not allowed here">;
6576 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6577 def err_typecheck_bool_condition : Error<
6578   "value of type %0 is not contextually convertible to 'bool'">;
6579 def err_typecheck_ambiguous_condition : Error<
6580   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6581 def err_typecheck_nonviable_condition : Error<
6582   "no viable conversion%select{%diff{ from $ to $|}1,2|"
6583   "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6584 def err_typecheck_nonviable_condition_incomplete : Error<
6585   "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6586 def err_typecheck_deleted_function : Error<
6587   "conversion function %diff{from $ to $|between types}0,1 "
6588   "invokes a deleted function">;
6589   
6590 def err_expected_class_or_namespace : Error<"%0 is not a class"
6591   "%select{ or namespace|, namespace, or enumeration}1">;
6592 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6593   "because namespace %1 does not enclose namespace %2">;
6594 def err_invalid_declarator_global_scope : Error<
6595   "definition or redeclaration of %0 cannot name the global scope">;
6596 def err_invalid_declarator_in_function : Error<
6597   "definition or redeclaration of %0 not allowed inside a function">;
6598 def err_invalid_declarator_in_block : Error<
6599   "definition or redeclaration of %0 not allowed inside a block">;
6600 def err_not_tag_in_scope : Error<
6601   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6602
6603 def err_no_typeid_with_fno_rtti : Error<
6604   "cannot use typeid with -fno-rtti">;
6605 def err_no_dynamic_cast_with_fno_rtti : Error<
6606   "cannot use dynamic_cast with -fno-rtti">;
6607
6608 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6609   "cannot form a pointer-to-member to member %0 of reference type %1">;
6610 def err_incomplete_object_call : Error<
6611   "incomplete type in call to object of type %0">;
6612
6613 def warn_condition_is_assignment : Warning<"using the result of an "
6614   "assignment as a condition without parentheses">,
6615   InGroup<Parentheses>;
6616 // Completely identical except off by default.
6617 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6618   "of an assignment as a condition without parentheses">,
6619   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6620 def note_condition_assign_to_comparison : Note<
6621   "use '==' to turn this assignment into an equality comparison">;
6622 def note_condition_or_assign_to_comparison : Note<
6623   "use '!=' to turn this compound assignment into an inequality comparison">;
6624 def note_condition_assign_silence : Note<
6625   "place parentheses around the assignment to silence this warning">;
6626
6627 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6628   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6629 def note_equality_comparison_to_assign : Note<
6630   "use '=' to turn this equality comparison into an assignment">;
6631 def note_equality_comparison_silence : Note<
6632   "remove extraneous parentheses around the comparison to silence this warning">;
6633
6634 // assignment related diagnostics (also for argument passing, returning, etc).
6635 // In most of these diagnostics the %2 is a value from the
6636 // Sema::AssignmentAction enumeration
6637 def err_typecheck_convert_incompatible : Error<
6638   "%select{%diff{assigning to $ from incompatible type $|"
6639   "assigning to type from incompatible type}0,1"
6640   "|%diff{passing $ to parameter of incompatible type $|"
6641   "passing type to parameter of incompatible type}0,1"
6642   "|%diff{returning $ from a function with incompatible result type $|"
6643   "returning type from a function with incompatible result type}0,1"
6644   "|%diff{converting $ to incompatible type $|"
6645   "converting type to incompatible type}0,1"
6646   "|%diff{initializing $ with an expression of incompatible type $|"
6647   "initializing type with an expression of incompatible type}0,1"
6648   "|%diff{sending $ to parameter of incompatible type $|"
6649   "sending type to parameter of incompatible type}0,1"
6650   "|%diff{casting $ to incompatible type $|"
6651   "casting type to incompatible type}0,1}2"
6652   "%select{|; dereference with *|"
6653   "; take the address with &|"
6654   "; remove *|"
6655   "; remove &}3"
6656   "%select{|: different classes%diff{ ($ vs $)|}5,6"
6657   "|: different number of parameters (%5 vs %6)"
6658   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6659   "|: different return type%diff{ ($ vs $)|}5,6"
6660   "|: different qualifiers ("
6661   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6662   "volatile and restrict|const, volatile, and restrict}5 vs "
6663   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6664   "volatile and restrict|const, volatile, and restrict}6)"
6665   "|: different exception specifications}4">;
6666 def err_typecheck_missing_return_type_incompatible : Error<
6667   "%diff{return type $ must match previous return type $|"
6668   "return type must match previous return type}0,1 when %select{block "
6669   "literal|lambda expression}2 has unspecified explicit return type">;
6670
6671 def note_incomplete_class_and_qualified_id : Note<
6672   "conformance of forward class %0 to protocol %1 can not be confirmed">;
6673 def warn_incompatible_qualified_id : Warning<
6674   "%select{%diff{assigning to $ from incompatible type $|"
6675   "assigning to type from incompatible type}0,1"
6676   "|%diff{passing $ to parameter of incompatible type $|"
6677   "passing type to parameter of incompatible type}0,1"
6678   "|%diff{returning $ from a function with incompatible result type $|"
6679   "returning type from a function with incompatible result type}0,1"
6680   "|%diff{converting $ to incompatible type $|"
6681   "converting type to incompatible type}0,1"
6682   "|%diff{initializing $ with an expression of incompatible type $|"
6683   "initializing type with an expression of incompatible type}0,1"
6684   "|%diff{sending $ to parameter of incompatible type $|"
6685   "sending type to parameter of incompatible type}0,1"
6686   "|%diff{casting $ to incompatible type $|"
6687   "casting type to incompatible type}0,1}2">;
6688 def ext_typecheck_convert_pointer_int : ExtWarn<
6689   "incompatible pointer to integer conversion "
6690   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6691   "|%diff{passing $ to parameter of type $|"
6692   "passing to parameter of different type}0,1"
6693   "|%diff{returning $ from a function with result type $|"
6694   "returning from function with different return type}0,1"
6695   "|%diff{converting $ to type $|converting between types}0,1"
6696   "|%diff{initializing $ with an expression of type $|"
6697   "initializing with expression of different type}0,1"
6698   "|%diff{sending $ to parameter of type $|"
6699   "sending to parameter of different type}0,1"
6700   "|%diff{casting $ to type $|casting between types}0,1}2"
6701   "%select{|; dereference with *|"
6702   "; take the address with &|"
6703   "; remove *|"
6704   "; remove &}3">,
6705   InGroup<IntConversion>;
6706 def ext_typecheck_convert_int_pointer : ExtWarn<
6707   "incompatible integer to pointer conversion "
6708   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6709   "|%diff{passing $ to parameter of type $|"
6710   "passing to parameter of different type}0,1"
6711   "|%diff{returning $ from a function with result type $|"
6712   "returning from function with different return type}0,1"
6713   "|%diff{converting $ to type $|converting between types}0,1"
6714   "|%diff{initializing $ with an expression of type $|"
6715   "initializing with expression of different type}0,1"
6716   "|%diff{sending $ to parameter of type $|"
6717   "sending to parameter of different type}0,1"
6718   "|%diff{casting $ to type $|casting between types}0,1}2"
6719   "%select{|; dereference with *|"
6720   "; take the address with &|"
6721   "; remove *|"
6722   "; remove &}3">,
6723   InGroup<IntConversion>;
6724 def ext_typecheck_convert_pointer_void_func : Extension<
6725   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6726   "|%diff{passing $ to parameter of type $|"
6727   "passing to parameter of different type}0,1"
6728   "|%diff{returning $ from a function with result type $|"
6729   "returning from function with different return type}0,1"
6730   "|%diff{converting $ to type $|converting between types}0,1"
6731   "|%diff{initializing $ with an expression of type $|"
6732   "initializing with expression of different type}0,1"
6733   "|%diff{sending $ to parameter of type $|"
6734   "sending to parameter of different type}0,1"
6735   "|%diff{casting $ to type $|casting between types}0,1}2"
6736   " converts between void pointer and function pointer">;
6737 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6738   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6739   "|%diff{passing $ to parameter of type $|"
6740   "passing to parameter of different type}0,1"
6741   "|%diff{returning $ from a function with result type $|"
6742   "returning from function with different return type}0,1"
6743   "|%diff{converting $ to type $|converting between types}0,1"
6744   "|%diff{initializing $ with an expression of type $|"
6745   "initializing with expression of different type}0,1"
6746   "|%diff{sending $ to parameter of type $|"
6747   "sending to parameter of different type}0,1"
6748   "|%diff{casting $ to type $|casting between types}0,1}2"
6749   " converts between pointers to integer types with different sign">,
6750   InGroup<DiagGroup<"pointer-sign">>;
6751 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6752   "incompatible pointer types "
6753   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6754   "|%diff{passing $ to parameter of type $|"
6755   "passing to parameter of different type}0,1"
6756   "|%diff{returning $ from a function with result type $|"
6757   "returning from function with different return type}0,1"
6758   "|%diff{converting $ to type $|converting between types}0,1"
6759   "|%diff{initializing $ with an expression of type $|"
6760   "initializing with expression of different type}0,1"
6761   "|%diff{sending $ to parameter of type $|"
6762   "sending to parameter of different type}0,1"
6763   "|%diff{casting $ to type $|casting between types}0,1}2"
6764   "%select{|; dereference with *|"
6765   "; take the address with &|"
6766   "; remove *|"
6767   "; remove &}3">,
6768   InGroup<IncompatiblePointerTypes>;
6769 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6770   "incompatible function pointer types "
6771   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6772   "|%diff{passing $ to parameter of type $|"
6773   "passing to parameter of different type}0,1"
6774   "|%diff{returning $ from a function with result type $|"
6775   "returning from function with different return type}0,1"
6776   "|%diff{converting $ to type $|converting between types}0,1"
6777   "|%diff{initializing $ with an expression of type $|"
6778   "initializing with expression of different type}0,1"
6779   "|%diff{sending $ to parameter of type $|"
6780   "sending to parameter of different type}0,1"
6781   "|%diff{casting $ to type $|casting between types}0,1}2"
6782   "%select{|; dereference with *|"
6783   "; take the address with &|"
6784   "; remove *|"
6785   "; remove &}3">,
6786   InGroup<IncompatibleFunctionPointerTypes>;
6787 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6788   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6789   "|%diff{passing $ to parameter of type $|"
6790   "passing to parameter of different type}0,1"
6791   "|%diff{returning $ from a function with result type $|"
6792   "returning from function with different return type}0,1"
6793   "|%diff{converting $ to type $|converting between types}0,1"
6794   "|%diff{initializing $ with an expression of type $|"
6795   "initializing with expression of different type}0,1"
6796   "|%diff{sending $ to parameter of type $|"
6797   "sending to parameter of different type}0,1"
6798   "|%diff{casting $ to type $|casting between types}0,1}2"
6799   " discards qualifiers">,
6800   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6801 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6802   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6803   "|%diff{passing $ to parameter of type $|"
6804   "passing to parameter of different type}0,1"
6805   "|%diff{returning $ from a function with result type $|"
6806   "returning from function with different return type}0,1"
6807   "|%diff{converting $ to type $|converting between types}0,1"
6808   "|%diff{initializing $ with an expression of type $|"
6809   "initializing with expression of different type}0,1"
6810   "|%diff{sending $ to parameter of type $|"
6811   "sending to parameter of different type}0,1"
6812   "|%diff{casting $ to type $|casting between types}0,1}2"
6813   " discards qualifiers in nested pointer types">,
6814   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6815 def warn_incompatible_vectors : Warning<
6816   "incompatible vector types "
6817   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6818   "|%diff{passing $ to parameter of type $|"
6819   "passing to parameter of different type}0,1"
6820   "|%diff{returning $ from a function with result type $|"
6821   "returning from function with different return type}0,1"
6822   "|%diff{converting $ to type $|converting between types}0,1"
6823   "|%diff{initializing $ with an expression of type $|"
6824   "initializing with expression of different type}0,1"
6825   "|%diff{sending $ to parameter of type $|"
6826   "sending to parameter of different type}0,1"
6827   "|%diff{casting $ to type $|casting between types}0,1}2">,
6828   InGroup<VectorConversion>, DefaultIgnore;
6829 def err_int_to_block_pointer : Error<
6830   "invalid block pointer conversion "
6831   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6832   "|%diff{passing $ to parameter of type $|"
6833   "passing to parameter of different type}0,1"
6834   "|%diff{returning $ from a function with result type $|"
6835   "returning from function with different return type}0,1"
6836   "|%diff{converting $ to type $|converting between types}0,1"
6837   "|%diff{initializing $ with an expression of type $|"
6838   "initializing with expression of different type}0,1"
6839   "|%diff{sending $ to parameter of type $|"
6840   "sending to parameter of different type}0,1"
6841   "|%diff{casting $ to type $|casting between types}0,1}2">;
6842 def err_typecheck_convert_incompatible_block_pointer : Error<
6843   "incompatible block 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 def err_typecheck_incompatible_address_space : Error<
6856   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6857   "|%diff{passing $ to parameter of type $|"
6858   "passing to parameter of different type}0,1"
6859   "|%diff{returning $ from a function with result type $|"
6860   "returning from function with different return type}0,1"
6861   "|%diff{converting $ to type $|converting between types}0,1"
6862   "|%diff{initializing $ with an expression of type $|"
6863   "initializing with expression of different type}0,1"
6864   "|%diff{sending $ to parameter of type $|"
6865   "sending to parameter of different type}0,1"
6866   "|%diff{casting $ to type $|casting between types}0,1}2"
6867   " changes address space of pointer">;
6868 def err_typecheck_incompatible_ownership : Error<
6869   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6870   "|%diff{passing $ to parameter of type $|"
6871   "passing to parameter of different type}0,1"
6872   "|%diff{returning $ from a function with result type $|"
6873   "returning from function with different return type}0,1"
6874   "|%diff{converting $ to type $|converting between types}0,1"
6875   "|%diff{initializing $ with an expression of type $|"
6876   "initializing with expression of different type}0,1"
6877   "|%diff{sending $ to parameter of type $|"
6878   "sending to parameter of different type}0,1"
6879   "|%diff{casting $ to type $|casting between types}0,1}2"
6880   " changes retain/release properties of pointer">;
6881 def err_typecheck_comparison_of_distinct_blocks : Error<
6882   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6883
6884 def err_typecheck_array_not_modifiable_lvalue : Error<
6885   "array type %0 is not assignable">;
6886 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6887   "non-object type %0 is not assignable">;
6888 def err_typecheck_expression_not_modifiable_lvalue : Error<
6889   "expression is not assignable">;
6890 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6891   "incomplete type %0 is not assignable">;
6892 def err_typecheck_lvalue_casts_not_supported : Error<
6893   "assignment to cast is illegal, lvalue casts are not supported">;
6894
6895 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6896   "vector is not assignable (contains duplicate components)">;
6897 def err_block_decl_ref_not_modifiable_lvalue : Error<
6898   "variable is not assignable (missing __block type specifier)">;
6899 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6900   "cannot assign to a variable captured by copy in a non-mutable lambda">;
6901 def err_typecheck_call_not_function : Error<
6902   "called object type %0 is not a function or function pointer">;
6903 def err_call_incomplete_return : Error<
6904   "calling function with incomplete return type %0">;
6905 def err_call_function_incomplete_return : Error<
6906   "calling %0 with incomplete return type %1">;
6907 def err_call_incomplete_argument : Error<
6908   "argument type %0 is incomplete">;
6909 def err_typecheck_call_too_few_args : Error<
6910   "too few %select{|||execution configuration }0arguments to "
6911   "%select{function|block|method|kernel function}0 call, "
6912   "expected %1, have %2">;
6913 def err_typecheck_call_too_few_args_one : Error<
6914   "too few %select{|||execution configuration }0arguments to "
6915   "%select{function|block|method|kernel function}0 call, "
6916   "single argument %1 was not specified">;
6917 def err_typecheck_call_too_few_args_at_least : Error<
6918   "too few %select{|||execution configuration }0arguments to "
6919   "%select{function|block|method|kernel function}0 call, "
6920   "expected at least %1, have %2">;
6921 def err_typecheck_call_too_few_args_at_least_one : Error<
6922   "too few %select{|||execution configuration }0arguments to "
6923   "%select{function|block|method|kernel function}0 call, "
6924   "at least argument %1 must be specified">;
6925 def err_typecheck_call_too_few_args_suggest : Error<
6926   "too few %select{|||execution configuration }0arguments to "
6927   "%select{function|block|method|kernel function}0 call, "
6928   "expected %1, have %2; did you mean %3?">;
6929 def err_typecheck_call_too_few_args_at_least_suggest : Error<
6930   "too few %select{|||execution configuration }0arguments to "
6931   "%select{function|block|method|kernel function}0 call, "
6932   "expected at least %1, have %2; did you mean %3?">;
6933 def err_typecheck_call_too_many_args : Error<
6934   "too many %select{|||execution configuration }0arguments to "
6935   "%select{function|block|method|kernel function}0 call, "
6936   "expected %1, have %2">;
6937 def err_typecheck_call_too_many_args_one : Error<
6938   "too many %select{|||execution configuration }0arguments to "
6939   "%select{function|block|method|kernel function}0 call, "
6940   "expected single argument %1, have %2 arguments">;
6941 def err_typecheck_call_too_many_args_at_most : Error<
6942   "too many %select{|||execution configuration }0arguments to "
6943   "%select{function|block|method|kernel function}0 call, "
6944   "expected at most %1, have %2">;
6945 def err_typecheck_call_too_many_args_at_most_one : Error<
6946   "too many %select{|||execution configuration }0arguments to "
6947   "%select{function|block|method|kernel function}0 call, "
6948   "expected at most single argument %1, have %2 arguments">;
6949 def err_typecheck_call_too_many_args_suggest : Error<
6950   "too many %select{|||execution configuration }0arguments to "
6951   "%select{function|block|method|kernel function}0 call, "
6952   "expected %1, have %2; did you mean %3?">;
6953 def err_typecheck_call_too_many_args_at_most_suggest : Error<
6954   "too many %select{|||execution configuration }0arguments to "
6955   "%select{function|block|method|kernel function}0 call, "
6956   "expected at most %1, have %2; did you mean %3?">;
6957   
6958 def err_arc_typecheck_convert_incompatible_pointer : Error<
6959   "incompatible pointer types passing retainable parameter of type %0"
6960   "to a CF function expecting %1 type">;
6961   
6962 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
6963
6964 def warn_call_wrong_number_of_arguments : Warning<
6965   "too %select{few|many}0 arguments in call to %1">;
6966 def err_atomic_builtin_must_be_pointer : Error<
6967   "address argument to atomic builtin must be a pointer (%0 invalid)">;
6968 def err_atomic_builtin_must_be_pointer_intptr : Error<
6969   "address argument to atomic builtin must be a pointer to integer or pointer"
6970   " (%0 invalid)">;
6971 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
6972   "address argument to atomic builtin must be a pointer to integer,"
6973   " floating-point or pointer (%0 invalid)">;
6974 def err_atomic_builtin_pointer_size : Error<
6975   "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
6976   "type (%0 invalid)">;
6977 def err_atomic_exclusive_builtin_pointer_size : Error<
6978   "address argument to load or store exclusive builtin must be a pointer to"
6979   " 1,2,4 or 8 byte type (%0 invalid)">;
6980 def err_atomic_op_needs_atomic : Error<
6981   "address argument to atomic operation must be a pointer to _Atomic "
6982   "type (%0 invalid)">;
6983 def err_atomic_op_needs_non_const_atomic : Error<
6984   "address argument to atomic operation must be a pointer to non-const _Atomic "
6985   "type (%0 invalid)">;
6986 def err_atomic_op_needs_non_const_pointer : Error<
6987   "address argument to atomic operation must be a pointer to non-const "
6988   "type (%0 invalid)">;
6989 def err_atomic_op_needs_trivial_copy : Error<
6990   "address argument to atomic operation must be a pointer to a "
6991   "trivially-copyable type (%0 invalid)">;
6992 def err_atomic_op_needs_atomic_int_or_ptr : Error<
6993   "address argument to atomic operation must be a pointer to %select{|atomic }0"
6994   "integer or pointer (%1 invalid)">;
6995 def err_atomic_op_bitwise_needs_atomic_int : Error<
6996   "address argument to bitwise atomic operation must be a pointer to "
6997   "%select{|atomic }0integer (%1 invalid)">;
6998 def warn_atomic_op_has_invalid_memory_order : Warning<
6999   "memory order argument to atomic operation is invalid">,
7000   InGroup<DiagGroup<"atomic-memory-ordering">>;
7001
7002 def err_overflow_builtin_must_be_int : Error<
7003   "operand argument to overflow builtin must be an integer (%0 invalid)">;
7004 def err_overflow_builtin_must_be_ptr_int : Error<
7005   "result argument to overflow builtin must be a pointer "
7006   "to a non-const integer (%0 invalid)">;
7007
7008 def err_atomic_load_store_uses_lib : Error<
7009   "atomic %select{load|store}0 requires runtime support that is not "
7010   "available for this target">;
7011
7012 def err_nontemporal_builtin_must_be_pointer : Error<
7013   "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
7014 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
7015   "address argument to nontemporal builtin must be a pointer to integer, float, "
7016   "pointer, or a vector of such types (%0 invalid)">;
7017
7018 def err_deleted_function_use : Error<"attempt to use a deleted function">;
7019 def err_deleted_inherited_ctor_use : Error<
7020   "constructor inherited by %0 from base class %1 is implicitly deleted">;
7021
7022 def note_called_by : Note<"called by %0">;
7023 def err_kern_type_not_void_return : Error<
7024   "kernel function type %0 must have void return type">;
7025 def err_kern_is_nonstatic_method : Error<
7026   "kernel function %0 must be a free function or static member function">;
7027 def err_config_scalar_return : Error<
7028   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
7029 def err_kern_call_not_global_function : Error<
7030   "kernel call to non-global function %0">;
7031 def err_global_call_not_config : Error<
7032   "call to global function %0 not configured">;
7033 def err_ref_bad_target : Error<
7034   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7035   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
7036 def err_ref_bad_target_global_initializer : Error<
7037   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
7038   "function %1 in global initializer">;
7039 def warn_kern_is_method : Extension<
7040   "kernel function %0 is a member function; this may not be accepted by nvcc">,
7041   InGroup<CudaCompat>;
7042 def warn_kern_is_inline : Warning<
7043   "ignored 'inline' attribute on kernel function %0">,
7044   InGroup<CudaCompat>;
7045 def err_variadic_device_fn : Error<
7046   "CUDA device code does not support variadic functions">;
7047 def err_va_arg_in_device : Error<
7048   "CUDA device code does not support va_arg">;
7049 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
7050 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
7051   "constexpr function '%0' without __host__ or __device__ attributes cannot "
7052   "overload __device__ function with same signature.  Add a __host__ "
7053   "attribute, or build with -fno-cuda-host-device-constexpr.">;
7054 def note_cuda_conflicting_device_function_declared_here : Note<
7055   "conflicting __device__ function declared here">;
7056 def err_cuda_device_exceptions : Error<
7057   "cannot use '%0' in "
7058   "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
7059 def err_dynamic_var_init : Error<
7060     "dynamic initialization is not supported for "
7061     "__device__, __constant__, and __shared__ variables.">;
7062 def err_shared_var_init : Error<
7063     "initialization is not supported for __shared__ variables.">;
7064 def err_device_static_local_var : Error<
7065     "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
7066     "function, only __shared__ variables may be marked 'static'">;
7067 def err_cuda_vla : Error<
7068     "cannot use variable-length arrays in "
7069     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7070 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
7071 def err_cuda_host_shared : Error<
7072     "__shared__ local variables not allowed in "
7073     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7074 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
7075 def err_cuda_ovl_target : Error<
7076   "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
7077   "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
7078 def note_cuda_ovl_candidate_target_mismatch : Note<
7079     "candidate template ignored: target attributes do not match">;
7080
7081 def warn_non_pod_vararg_with_format_string : Warning<
7082   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
7083   "%select{function|block|method|constructor}2; expected type from format "
7084   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
7085 // The arguments to this diagnostic should match the warning above.
7086 def err_cannot_pass_objc_interface_to_vararg_format : Error<
7087   "cannot pass object with interface type %1 by value to variadic "
7088   "%select{function|block|method|constructor}2; expected type from format "
7089   "string was %3">;
7090
7091 def err_cannot_pass_objc_interface_to_vararg : Error<
7092   "cannot pass object with interface type %0 by value through variadic "
7093   "%select{function|block|method|constructor}1">;
7094 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
7095   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
7096   " %select{function|block|method|constructor}2; call will abort at runtime">,
7097   InGroup<NonPODVarargs>, DefaultError;
7098 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
7099   "passing object of trivial but non-POD type %0 through variadic"
7100   " %select{function|block|method|constructor}1 is incompatible with C++98">,
7101   InGroup<CXX98Compat>, DefaultIgnore;
7102 def warn_pass_class_arg_to_vararg : Warning<
7103   "passing object of class type %0 through variadic "
7104   "%select{function|block|method|constructor}1"
7105   "%select{|; did you mean to call '%3'?}2">,
7106   InGroup<ClassVarargs>, DefaultIgnore;
7107 def err_cannot_pass_to_vararg : Error<
7108   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7109   "%select{function|block|method|constructor}2">;
7110 def err_cannot_pass_to_vararg_format : Error<
7111   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7112   "%select{function|block|method|constructor}2; expected type from format "
7113   "string was %3">;
7114
7115 def err_typecheck_call_invalid_ordered_compare : Error<
7116   "ordered compare requires two args of floating point type"
7117   "%diff{ ($ and $)|}0,1">;
7118 def err_typecheck_call_invalid_unary_fp : Error<
7119   "floating point classification requires argument of floating point type "
7120   "(passed in %0)">;
7121 def err_typecheck_cond_expect_int_float : Error<
7122   "used type %0 where integer or floating point type is required">;
7123 def err_typecheck_cond_expect_scalar : Error<
7124   "used type %0 where arithmetic or pointer type is required">;
7125 def err_typecheck_cond_expect_nonfloat : Error<
7126   "used type %0 where floating point type is not allowed">;
7127 def ext_typecheck_cond_one_void : Extension<
7128   "C99 forbids conditional expressions with only one void side">;
7129 def err_typecheck_cast_to_incomplete : Error<
7130   "cast to incomplete type %0">;
7131 def ext_typecheck_cast_nonscalar : Extension<
7132   "C99 forbids casting nonscalar type %0 to the same type">;
7133 def ext_typecheck_cast_to_union : Extension<
7134   "cast to union type is a GNU extension">,
7135   InGroup<GNUUnionCast>;
7136 def err_typecheck_cast_to_union_no_type : Error<
7137   "cast to union type from type %0 not present in union">;
7138 def err_cast_pointer_from_non_pointer_int : Error<
7139   "operand of type %0 cannot be cast to a pointer type">;
7140 def warn_cast_pointer_from_sel : Warning<
7141   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
7142   InGroup<SelTypeCast>;
7143 def warn_function_def_in_objc_container : Warning<
7144   "function definition inside an Objective-C container is deprecated">,
7145   InGroup<FunctionDefInObjCContainer>;
7146
7147 def warn_cast_calling_conv : Warning<
7148   "cast between incompatible calling conventions '%0' and '%1'; "
7149   "calls through this pointer may abort at runtime">,
7150   InGroup<DiagGroup<"cast-calling-convention">>;
7151 def note_change_calling_conv_fixit : Note<
7152   "consider defining %0 with the '%1' calling convention">;
7153 def warn_bad_function_cast : Warning<
7154   "cast from function call of type %0 to non-matching type %1">,
7155   InGroup<BadFunctionCast>, DefaultIgnore;
7156 def err_cast_pointer_to_non_pointer_int : Error<
7157   "pointer cannot be cast to type %0">;
7158 def err_typecheck_expect_scalar_operand : Error<
7159   "operand of type %0 where arithmetic or pointer type is required">;
7160 def err_typecheck_cond_incompatible_operands : Error<
7161   "incompatible operand types%diff{ ($ and $)|}0,1">;
7162 def err_cast_selector_expr : Error<
7163   "cannot type cast @selector expression">;
7164 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
7165   "pointer type mismatch%diff{ ($ and $)|}0,1">,
7166   InGroup<DiagGroup<"pointer-type-mismatch">>;
7167 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
7168   "pointer/integer type mismatch in conditional expression"
7169   "%diff{ ($ and $)|}0,1">,
7170   InGroup<DiagGroup<"conditional-type-mismatch">>;
7171 def err_typecheck_choose_expr_requires_constant : Error<
7172   "'__builtin_choose_expr' requires a constant expression">;
7173 def warn_unused_expr : Warning<"expression result unused">,
7174   InGroup<UnusedValue>;
7175 def warn_unused_voidptr : Warning<
7176   "expression result unused; should this cast be to 'void'?">,
7177   InGroup<UnusedValue>;
7178 def warn_unused_property_expr : Warning<
7179  "property access result unused - getters should not be used for side effects">,
7180   InGroup<UnusedGetterReturnValue>;
7181 def warn_unused_container_subscript_expr : Warning<
7182  "container access result unused - container access should not be used for side effects">,
7183   InGroup<UnusedValue>;
7184 def warn_unused_call : Warning<
7185   "ignoring return value of function declared with %0 attribute">,
7186   InGroup<UnusedValue>;
7187 def warn_side_effects_unevaluated_context : Warning<
7188   "expression with side effects has no effect in an unevaluated context">,
7189   InGroup<UnevaluatedExpression>;
7190 def warn_side_effects_typeid : Warning<
7191   "expression with side effects will be evaluated despite being used as an "
7192   "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
7193 def warn_unused_result : Warning<
7194   "ignoring return value of function declared with %0 attribute">,
7195   InGroup<UnusedResult>;
7196 def warn_unused_volatile : Warning<
7197   "expression result unused; assign into a variable to force a volatile load">,
7198   InGroup<DiagGroup<"unused-volatile-lvalue">>;
7199
7200 def ext_cxx14_attr : Extension<
7201   "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
7202 def ext_cxx1z_attr : Extension<
7203   "use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
7204
7205 def warn_unused_comparison : Warning<
7206   "%select{%select{|in}1equality|relational}0 comparison result unused">,
7207   InGroup<UnusedComparison>;
7208 def note_inequality_comparison_to_or_assign : Note<
7209   "use '|=' to turn this inequality comparison into an or-assignment">;
7210
7211 def err_incomplete_type_used_in_type_trait_expr : Error<
7212   "incomplete type %0 used in type trait expression">;
7213
7214 def err_require_constant_init_failed : Error<
7215   "variable does not have a constant initializer">;
7216 def note_declared_required_constant_init_here : Note<
7217   "required by 'require_constant_initialization' attribute here">;
7218
7219 def err_dimension_expr_not_constant_integer : Error<
7220   "dimension expression does not evaluate to a constant unsigned int">;
7221
7222 def err_typecheck_cond_incompatible_operands_null : Error<
7223   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7224 def ext_empty_struct_union : Extension<
7225   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7226 def ext_no_named_members_in_struct_union : Extension<
7227   "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7228 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7229   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7230   InGroup<CXXCompat>, DefaultIgnore;
7231 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7232   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7233   InGroup<ExternCCompat>;
7234 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7235   "volatile qualifiers|const qualifier|volatile qualifier}2">,
7236   InGroup<CastQual>, DefaultIgnore;
7237 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7238   "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7239 def warn_redefine_extname_not_applied : Warning<
7240   "#pragma redefine_extname is applicable to external C declarations only; "
7241   "not applied to %select{function|variable}0 %1">,
7242   InGroup<Pragmas>;
7243 } // End of general sema category.
7244
7245 // inline asm.
7246 let CategoryName = "Inline Assembly Issue" in {
7247   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7248   def err_asm_invalid_output_constraint : Error<
7249     "invalid output constraint '%0' in asm">;
7250   def err_asm_invalid_lvalue_in_input : Error<
7251     "invalid lvalue in asm input for constraint '%0'">;
7252   def err_asm_invalid_input_constraint : Error<
7253     "invalid input constraint '%0' in asm">;
7254   def err_asm_immediate_expected : Error<"constraint '%0' expects "
7255     "an integer constant expression">;
7256   def err_asm_invalid_type_in_input : Error<
7257     "invalid type %0 in asm input for constraint '%1'">;
7258   def err_asm_tying_incompatible_types : Error<
7259     "unsupported inline asm: input with type "
7260     "%diff{$ matching output with type $|}0,1">;
7261   def err_asm_unexpected_constraint_alternatives : Error<
7262     "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7263   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7264   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7265   def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7266     "global register variables on this target">;
7267   def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7268     "match variable size">;
7269   def err_asm_bad_register_type : Error<"bad type for named register variable">;
7270   def err_asm_invalid_input_size : Error<
7271     "invalid input size for constraint '%0'">;
7272   def err_asm_invalid_output_size : Error<
7273     "invalid output size for constraint '%0'">;
7274   def err_invalid_asm_cast_lvalue : Error<
7275     "invalid use of a cast in a inline asm context requiring an l-value: "
7276     "remove the cast or build with -fheinous-gnu-extensions">;
7277   def err_invalid_asm_value_for_constraint
7278       : Error <"value '%0' out of range for constraint '%1'">;
7279   def err_asm_non_addr_value_in_memory_constraint : Error <
7280     "reference to a %select{bit-field|vector element|global register variable}0"
7281     " in asm %select{input|output}1 with a memory constraint '%2'">;
7282   def err_asm_input_duplicate_match : Error<
7283     "more than one input constraint matches the same output '%0'">;
7284
7285   def warn_asm_label_on_auto_decl : Warning<
7286     "ignored asm label '%0' on automatic variable">;
7287   def warn_invalid_asm_cast_lvalue : Warning<
7288     "invalid use of a cast in an inline asm context requiring an l-value: "
7289     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7290     "for this in the future">;
7291   def warn_asm_mismatched_size_modifier : Warning<
7292     "value size does not match register size specified by the constraint "
7293     "and modifier">,
7294     InGroup<ASMOperandWidths>;
7295
7296   def note_asm_missing_constraint_modifier : Note<
7297     "use constraint modifier \"%0\"">;
7298   def note_asm_input_duplicate_first : Note<
7299     "constraint '%0' is already present here">;
7300 }
7301
7302   def error_inoutput_conflict_with_clobber : Error<
7303     "asm-specifier for input or output variable conflicts with asm"
7304     " clobber list">;
7305
7306 let CategoryName = "Semantic Issue" in {
7307
7308 def err_invalid_conversion_between_vectors : Error<
7309   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7310   "size">;
7311 def err_invalid_conversion_between_vector_and_integer : Error<
7312   "invalid conversion between vector type %0 and integer type %1 "
7313   "of different size">;
7314
7315 def err_opencl_function_pointer : Error<
7316   "pointers to functions are not allowed">;
7317
7318 def err_opencl_taking_function_address : Error<
7319   "taking address of function is not allowed">;
7320
7321 def err_invalid_conversion_between_vector_and_scalar : Error<
7322   "invalid conversion between vector type %0 and scalar type %1">;
7323
7324 // C++ member initializers.
7325 def err_only_constructors_take_base_inits : Error<
7326   "only constructors take base initializers">;
7327
7328 def err_multiple_mem_initialization : Error <
7329   "multiple initializations given for non-static member %0">;
7330 def err_multiple_mem_union_initialization : Error <
7331   "initializing multiple members of union">;
7332 def err_multiple_base_initialization : Error <
7333   "multiple initializations given for base %0">;
7334
7335 def err_mem_init_not_member_or_class : Error<
7336   "member initializer %0 does not name a non-static data member or base "
7337   "class">;
7338
7339 def warn_initializer_out_of_order : Warning<
7340   "%select{field|base class}0 %1 will be initialized after "
7341   "%select{field|base}2 %3">,
7342   InGroup<Reorder>, DefaultIgnore;
7343 def warn_abstract_vbase_init_ignored : Warning<
7344   "initializer for virtual base class %0 of abstract class %1 "
7345   "will never be used">,
7346   InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7347
7348 def err_base_init_does_not_name_class : Error<
7349   "constructor initializer %0 does not name a class">;
7350 def err_base_init_direct_and_virtual : Error<
7351   "base class initializer %0 names both a direct base class and an "
7352   "inherited virtual base class">;
7353 def err_not_direct_base_or_virtual : Error<
7354   "type %0 is not a direct or virtual base of %1">;
7355
7356 def err_in_class_initializer_non_const : Error<
7357   "non-const static data member must be initialized out of line">;
7358 def err_in_class_initializer_volatile : Error<
7359   "static const volatile data member must be initialized out of line">;
7360 def err_in_class_initializer_bad_type : Error<
7361   "static data member of type %0 must be initialized out of line">;
7362 def ext_in_class_initializer_float_type : ExtWarn<
7363   "in-class initializer for static data member of type %0 is a GNU extension">,
7364   InGroup<GNUStaticFloatInit>;
7365 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7366   "in-class initializer for static data member of type %0 requires "
7367   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7368 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7369 def err_in_class_initializer_literal_type : Error<
7370   "in-class initializer for static data member of type %0 requires "
7371   "'constexpr' specifier">;
7372 def err_in_class_initializer_non_constant : Error<
7373   "in-class initializer for static data member is not a constant expression">;
7374 def err_in_class_initializer_not_yet_parsed : Error<
7375   "default member initializer for %1 needed within definition of enclosing "
7376   "class %0 outside of member functions">;
7377 def note_in_class_initializer_not_yet_parsed : Note<
7378   "default member initializer declared here">;
7379 def err_in_class_initializer_cycle
7380     : Error<"default member initializer for %0 uses itself">;
7381 def err_exception_spec_cycle
7382     : Error<"exception specification of %0 uses itself">;
7383
7384 def ext_in_class_initializer_non_constant : Extension<
7385   "in-class initializer for static data member is not a constant expression; "
7386   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7387
7388 def err_thread_dynamic_init : Error<
7389   "initializer for thread-local variable must be a constant expression">;
7390 def err_thread_nontrivial_dtor : Error<
7391   "type of thread-local variable has non-trivial destruction">;
7392 def note_use_thread_local : Note<
7393   "use 'thread_local' to allow this">;
7394
7395 // C++ anonymous unions and GNU anonymous structs/unions
7396 def ext_anonymous_union : Extension<
7397   "anonymous unions are a C11 extension">, InGroup<C11>;
7398 def ext_gnu_anonymous_struct : Extension<
7399   "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7400 def ext_c11_anonymous_struct : Extension<
7401   "anonymous structs are a C11 extension">, InGroup<C11>;
7402 def err_anonymous_union_not_static : Error<
7403   "anonymous unions at namespace or global scope must be declared 'static'">;
7404 def err_anonymous_union_with_storage_spec : Error<
7405   "anonymous union at class scope must not have a storage specifier">;
7406 def err_anonymous_struct_not_member : Error<
7407   "anonymous %select{structs|structs and classes}0 must be "
7408   "%select{struct or union|class}0 members">;
7409 def err_anonymous_record_member_redecl : Error<
7410   "member of anonymous %select{struct|union}0 redeclares %1">;
7411 def err_anonymous_record_with_type : Error<
7412   "types cannot be declared in an anonymous %select{struct|union}0">;
7413 def ext_anonymous_record_with_type : Extension<
7414   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7415   "extension">, InGroup<MicrosoftAnonTag>;
7416 def ext_anonymous_record_with_anonymous_type : Extension<
7417   "anonymous types declared in an anonymous %select{struct|union}0 "
7418   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7419 def err_anonymous_record_with_function : Error<
7420   "functions cannot be declared in an anonymous %select{struct|union}0">;
7421 def err_anonymous_record_with_static : Error<
7422   "static members cannot be declared in an anonymous %select{struct|union}0">;
7423 def err_anonymous_record_bad_member : Error<
7424   "anonymous %select{struct|union}0 can only contain non-static data members">;
7425 def err_anonymous_record_nonpublic_member : Error<
7426   "anonymous %select{struct|union}0 cannot contain a "
7427   "%select{private|protected}1 data member">;
7428 def ext_ms_anonymous_record : ExtWarn<
7429   "anonymous %select{structs|unions}0 are a Microsoft extension">,
7430   InGroup<MicrosoftAnonTag>;
7431
7432 // C++ local classes
7433 def err_reference_to_local_in_enclosing_context : Error<
7434   "reference to local %select{variable|binding}1 %0 declared in enclosing "
7435   "%select{%3|block literal|lambda expression|context}2">;
7436
7437 def err_static_data_member_not_allowed_in_local_class : Error<
7438   "static data member %0 not allowed in local class %1">; 
7439   
7440 // C++ derived classes
7441 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7442 def err_base_must_be_class : Error<"base specifier must name a class">;
7443 def err_union_as_base_class : Error<"unions cannot be base classes">;
7444 def err_circular_inheritance : Error<
7445   "circular inheritance between %0 and %1">;
7446 def err_base_class_has_flexible_array_member : Error<
7447   "base class %0 has a flexible array member">;
7448 def err_incomplete_base_class : Error<"base class has incomplete type">;
7449 def err_duplicate_base_class : Error<
7450   "base class %0 specified more than once as a direct base class">;
7451 def warn_inaccessible_base_class : Warning<
7452   "direct base %0 is inaccessible due to ambiguity:%1">,
7453   InGroup<DiagGroup<"inaccessible-base">>;
7454 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
7455 def err_ambiguous_derived_to_base_conv : Error<
7456   "ambiguous conversion from derived class %0 to base class %1:%2">;
7457 def err_ambiguous_memptr_conv : Error<
7458   "ambiguous conversion from pointer to member of %select{base|derived}0 "
7459   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7460
7461 def err_memptr_conv_via_virtual : Error<
7462   "conversion from pointer to member of class %0 to pointer to member "
7463   "of class %1 via virtual base %2 is not allowed">;
7464
7465 // C++ member name lookup
7466 def err_ambiguous_member_multiple_subobjects : Error<
7467   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7468 def err_ambiguous_member_multiple_subobject_types : Error<
7469   "member %0 found in multiple base classes of different types">;
7470 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7471 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7472 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7473 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7474   "declaration in a different namespace">;
7475 def note_hidden_tag : Note<"type declaration hidden">;
7476 def note_hiding_object : Note<"declaration hides type">;
7477
7478 // C++ operator overloading
7479 def err_operator_overload_needs_class_or_enum : Error<
7480   "overloaded %0 must have at least one parameter of class "
7481   "or enumeration type">;
7482
7483 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7484 def err_operator_overload_static : Error<
7485   "overloaded %0 cannot be a static member function">;
7486 def err_operator_overload_default_arg : Error<
7487   "parameter of overloaded %0 cannot have a default argument">;
7488 def err_operator_overload_must_be : Error<
7489   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7490   "(has %1 parameter%s1)">;
7491
7492 def err_operator_overload_must_be_member : Error<
7493   "overloaded %0 must be a non-static member function">;
7494 def err_operator_overload_post_incdec_must_be_int : Error<
7495   "parameter of overloaded post-%select{increment|decrement}1 operator must "
7496   "have type 'int' (not %0)">;
7497
7498 // C++ allocation and deallocation functions.
7499 def err_operator_new_delete_declared_in_namespace : Error<
7500   "%0 cannot be declared inside a namespace">;
7501 def err_operator_new_delete_declared_static : Error<
7502   "%0 cannot be declared static in global scope">;
7503 def ext_operator_new_delete_declared_inline : ExtWarn<
7504   "replacement function %0 cannot be declared 'inline'">,
7505   InGroup<DiagGroup<"inline-new-delete">>;
7506 def err_operator_new_delete_invalid_result_type : Error<
7507   "%0 must return type %1">;
7508 def err_operator_new_delete_dependent_result_type : Error<
7509   "%0 cannot have a dependent return type; use %1 instead">;
7510 def err_operator_new_delete_too_few_parameters : Error<
7511   "%0 must have at least one parameter">;
7512 def err_operator_new_delete_template_too_few_parameters : Error<
7513   "%0 template must have at least two parameters">;
7514 def warn_operator_new_returns_null : Warning<
7515   "%0 should not return a null pointer unless it is declared 'throw()'"
7516   "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7517
7518 def err_operator_new_dependent_param_type : Error<
7519   "%0 cannot take a dependent type as first parameter; "
7520   "use size_t (%1) instead">;
7521 def err_operator_new_param_type : Error<
7522   "%0 takes type size_t (%1) as first parameter">;
7523 def err_operator_new_default_arg: Error<
7524   "parameter of %0 cannot have a default argument">;
7525 def err_operator_delete_dependent_param_type : Error<
7526   "%0 cannot take a dependent type as first parameter; use %1 instead">;
7527 def err_operator_delete_param_type : Error<
7528   "first parameter of %0 must have type %1">;
7529
7530 // C++ literal operators
7531 def err_literal_operator_outside_namespace : Error<
7532   "literal operator %0 must be in a namespace or global scope">;
7533 def err_literal_operator_id_outside_namespace : Error<
7534   "non-namespace scope '%0' cannot have a literal operator member">;
7535 def err_literal_operator_default_argument : Error<
7536   "literal operator cannot have a default argument">;
7537 def err_literal_operator_bad_param_count : Error<
7538   "non-template literal operator must have one or two parameters">;
7539 def err_literal_operator_invalid_param : Error<
7540   "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7541 def err_literal_operator_param : Error<
7542   "invalid literal operator parameter type %0, did you mean %1?">;
7543 def err_literal_operator_template_with_params : Error<
7544   "literal operator template cannot have any parameters">;
7545 def err_literal_operator_template : Error<
7546   "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7547 def err_literal_operator_extern_c : Error<
7548   "literal operator must have C++ linkage">;
7549 def ext_string_literal_operator_template : ExtWarn<
7550   "string literal operator templates are a GNU extension">,
7551   InGroup<GNUStringLiteralOperatorTemplate>;
7552 def warn_user_literal_reserved : Warning<
7553   "user-defined literal suffixes not starting with '_' are reserved"
7554   "%select{; no literal will invoke this operator|}0">,
7555   InGroup<UserDefinedLiterals>;
7556
7557 // C++ conversion functions
7558 def err_conv_function_not_member : Error<
7559   "conversion function must be a non-static member function">;
7560 def err_conv_function_return_type : Error<
7561   "conversion function cannot have a return type">;
7562 def err_conv_function_with_params : Error<
7563   "conversion function cannot have any parameters">;
7564 def err_conv_function_variadic : Error<
7565   "conversion function cannot be variadic">;
7566 def err_conv_function_to_array : Error<
7567   "conversion function cannot convert to an array type">;
7568 def err_conv_function_to_function : Error<
7569   "conversion function cannot convert to a function type">;
7570 def err_conv_function_with_complex_decl : Error<
7571   "cannot specify any part of a return type in the "
7572   "declaration of a conversion function"
7573   "%select{"
7574   "; put the complete type after 'operator'|"
7575   "; use a typedef to declare a conversion to %1|"
7576   "; use an alias template to declare a conversion to %1|"
7577   "}0">;
7578 def err_conv_function_redeclared : Error<
7579   "conversion function cannot be redeclared">;
7580 def warn_conv_to_self_not_used : Warning<
7581   "conversion function converting %0 to itself will never be used">;
7582 def warn_conv_to_base_not_used : Warning<
7583   "conversion function converting %0 to its base class %1 will never be used">;
7584 def warn_conv_to_void_not_used : Warning<
7585   "conversion function converting %0 to %1 will never be used">;
7586
7587 def warn_not_compound_assign : Warning<
7588   "use of unary operator that may be intended as compound assignment (%0=)">;
7589
7590 // C++11 explicit conversion operators
7591 def ext_explicit_conversion_functions : ExtWarn<
7592   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7593 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7594   "explicit conversion functions are incompatible with C++98">,
7595   InGroup<CXX98Compat>, DefaultIgnore;
7596
7597 // C++11 defaulted functions
7598 def err_defaulted_special_member_params : Error<
7599   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7600   "have default arguments">;
7601 def err_defaulted_special_member_variadic : Error<
7602   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7603   "be variadic">;
7604 def err_defaulted_special_member_return_type : Error<
7605   "explicitly-defaulted %select{copy|move}0 assignment operator must "
7606   "return %1">;
7607 def err_defaulted_special_member_quals : Error<
7608   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7609   "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7610 def err_defaulted_special_member_volatile_param : Error<
7611   "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
7612   "copy constructor|move constructor|copy assignment operator|"
7613   "move assignment operator|<<ERROR>>}0 may not be volatile">;
7614 def err_defaulted_special_member_move_const_param : Error<
7615   "the parameter for an explicitly-defaulted move "
7616   "%select{constructor|assignment operator}0 may not be const">;
7617 def err_defaulted_special_member_copy_const_param : Error<
7618   "the parameter for this explicitly-defaulted copy "
7619   "%select{constructor|assignment operator}0 is const, but a member or base "
7620   "requires it to be non-const">;
7621 def err_defaulted_copy_assign_not_ref : Error<
7622   "the parameter for an explicitly-defaulted copy assignment operator must be an "
7623   "lvalue reference type">;
7624 def err_incorrect_defaulted_exception_spec : Error<
7625   "exception specification of explicitly defaulted %select{default constructor|"
7626   "copy constructor|move constructor|copy assignment operator|move assignment "
7627   "operator|destructor}0 does not match the "
7628   "calculated one">;
7629 def err_incorrect_defaulted_constexpr : Error<
7630   "defaulted definition of %select{default constructor|copy constructor|"
7631   "move constructor|copy assignment operator|move assignment operator}0 "
7632   "is not constexpr">;
7633 def err_out_of_line_default_deletes : Error<
7634   "defaulting this %select{default constructor|copy constructor|move "
7635   "constructor|copy assignment operator|move assignment operator|destructor}0 "
7636   "would delete it after its first declaration">;
7637 def warn_vbase_moved_multiple_times : Warning<
7638   "defaulted move assignment operator of %0 will move assign virtual base "
7639   "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7640 def note_vbase_moved_here : Note<
7641   "%select{%1 is a virtual base class of base class %2 declared here|"
7642   "virtual base class %1 declared here}0">;
7643
7644 def ext_implicit_exception_spec_mismatch : ExtWarn<
7645   "function previously declared with an %select{explicit|implicit}0 exception "
7646   "specification redeclared with an %select{implicit|explicit}0 exception "
7647   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7648
7649 def warn_ptr_arith_precedes_bounds : Warning<
7650   "the pointer decremented by %0 refers before the beginning of the array">,
7651   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7652 def warn_ptr_arith_exceeds_bounds : Warning<
7653   "the pointer incremented by %0 refers past the end of the array (that "
7654   "contains %1 element%s2)">,
7655   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7656 def warn_array_index_precedes_bounds : Warning<
7657   "array index %0 is before the beginning of the array">,
7658   InGroup<ArrayBounds>;
7659 def warn_array_index_exceeds_bounds : Warning<
7660   "array index %0 is past the end of the array (which contains %1 "
7661   "element%s2)">, InGroup<ArrayBounds>;
7662 def note_array_index_out_of_bounds : Note<
7663   "array %0 declared here">;
7664
7665 def warn_printf_insufficient_data_args : Warning<
7666   "more '%%' conversions than data arguments">, InGroup<Format>;
7667 def warn_printf_data_arg_not_used : Warning<
7668   "data argument not used by format string">, InGroup<FormatExtraArgs>;
7669 def warn_format_invalid_conversion : Warning<
7670   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7671 def warn_printf_incomplete_specifier : Warning<
7672   "incomplete format specifier">, InGroup<Format>;
7673 def warn_missing_format_string : Warning<
7674   "format string missing">, InGroup<Format>;
7675 def warn_scanf_nonzero_width : Warning<
7676   "zero field width in scanf format string is unused">,
7677   InGroup<Format>;
7678 def warn_format_conversion_argument_type_mismatch : Warning<
7679   "format specifies type %0 but the argument has "
7680   "%select{type|underlying type}2 %1">,
7681   InGroup<Format>;
7682 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7683   "format specifies type %0 but the argument has "
7684   "%select{type|underlying type}2 %1">,
7685   InGroup<FormatPedantic>;
7686 def warn_format_argument_needs_cast : Warning<
7687   "%select{values of type|enum values with underlying type}2 '%0' should not "
7688   "be used as format arguments; add an explicit cast to %1 instead">,
7689   InGroup<Format>;
7690 def warn_printf_positional_arg_exceeds_data_args : Warning <
7691   "data argument position '%0' exceeds the number of data arguments (%1)">,
7692   InGroup<Format>;
7693 def warn_format_zero_positional_specifier : Warning<
7694   "position arguments in format strings start counting at 1 (not 0)">,
7695   InGroup<Format>;
7696 def warn_format_invalid_positional_specifier : Warning<
7697   "invalid position specified for %select{field width|field precision}0">,
7698   InGroup<Format>;
7699 def warn_format_mix_positional_nonpositional_args : Warning<
7700   "cannot mix positional and non-positional arguments in format string">,
7701   InGroup<Format>;
7702 def warn_static_array_too_small : Warning<
7703   "array argument is too small; contains %0 elements, callee requires at least %1">,
7704   InGroup<ArrayBounds>;
7705 def note_callee_static_array : Note<
7706   "callee declares array parameter as static here">;
7707 def warn_empty_format_string : Warning<
7708   "format string is empty">, InGroup<FormatZeroLength>;
7709 def warn_format_string_is_wide_literal : Warning<
7710   "format string should not be a wide string">, InGroup<Format>;
7711 def warn_printf_format_string_contains_null_char : Warning<
7712   "format string contains '\\0' within the string body">, InGroup<Format>;
7713 def warn_printf_format_string_not_null_terminated : Warning<
7714   "format string is not null-terminated">, InGroup<Format>;
7715 def warn_printf_asterisk_missing_arg : Warning<
7716   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7717   InGroup<Format>;
7718 def warn_printf_asterisk_wrong_type : Warning<
7719   "field %select{width|precision}0 should have type %1, but argument has type %2">,
7720   InGroup<Format>;
7721 def warn_printf_nonsensical_optional_amount: Warning<
7722   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7723   InGroup<Format>;
7724 def warn_printf_nonsensical_flag: Warning<
7725   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7726   InGroup<Format>;
7727 def warn_format_nonsensical_length: Warning<
7728   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7729   InGroup<Format>;
7730 def warn_format_non_standard_positional_arg: Warning<
7731   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7732 def warn_format_non_standard: Warning<
7733   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7734   InGroup<FormatNonStandard>, DefaultIgnore;
7735 def warn_format_non_standard_conversion_spec: Warning<
7736   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7737   InGroup<FormatNonStandard>, DefaultIgnore;
7738 def warn_format_invalid_annotation : Warning<
7739   "using '%0' format specifier annotation outside of os_log()/os_trace()">,
7740   InGroup<Format>;
7741 def warn_format_P_no_precision : Warning<
7742   "using '%%P' format specifier without precision">,
7743   InGroup<Format>;
7744 def warn_printf_ignored_flag: Warning<
7745   "flag '%0' is ignored when flag '%1' is present">,
7746   InGroup<Format>;
7747 def warn_printf_empty_objc_flag: Warning<
7748   "missing object format flag">,
7749   InGroup<Format>;
7750 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7751   "object format flags cannot be used with '%0' conversion specifier">,
7752   InGroup<Format>;
7753 def warn_printf_invalid_objc_flag: Warning<
7754     "'%0' is not a valid object format flag">,
7755     InGroup<Format>;
7756 def warn_scanf_scanlist_incomplete : Warning<
7757   "no closing ']' for '%%[' in scanf format string">,
7758   InGroup<Format>;
7759 def note_format_string_defined : Note<"format string is defined here">;
7760 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7761 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7762 def note_format_security_fixit: Note<
7763   "treat the string as an argument to avoid this">;
7764
7765 def warn_null_arg : Warning<
7766   "null passed to a callee that requires a non-null argument">,
7767   InGroup<NonNull>;
7768 def warn_null_ret : Warning<
7769   "null returned from %select{function|method}0 that requires a non-null return value">,
7770   InGroup<NonNull>;
7771
7772 // CHECK: returning address/reference of stack memory
7773 def warn_ret_stack_addr_ref : Warning<
7774   "%select{address of|reference to}0 stack memory associated with local "
7775   "variable %1 returned">,
7776   InGroup<ReturnStackAddress>;
7777 def warn_ret_local_temp_addr_ref : Warning<
7778   "returning %select{address of|reference to}0 local temporary object">,
7779   InGroup<ReturnStackAddress>;
7780 def warn_ret_addr_label : Warning<
7781   "returning address of label, which is local">,
7782   InGroup<ReturnStackAddress>;
7783 def err_ret_local_block : Error<
7784   "returning block that lives on the local stack">;
7785 def note_ref_var_local_bind : Note<
7786   "binding reference variable %0 here">;
7787
7788 // Check for initializing a member variable with the address or a reference to
7789 // a constructor parameter.
7790 def warn_bind_ref_member_to_parameter : Warning<
7791   "binding reference member %0 to stack allocated parameter %1">,
7792   InGroup<DanglingField>;
7793 def warn_init_ptr_member_to_parameter_addr : Warning<
7794   "initializing pointer member %0 with the stack address of parameter %1">,
7795   InGroup<DanglingField>;
7796 def warn_bind_ref_member_to_temporary : Warning<
7797   "binding reference %select{|subobject of }1member %0 to a temporary value">,
7798   InGroup<DanglingField>;
7799 def note_ref_or_ptr_member_declared_here : Note<
7800   "%select{reference|pointer}0 member declared here">;
7801 def note_ref_subobject_of_member_declared_here : Note<
7802   "member with reference subobject declared here">;
7803
7804 // For non-floating point, expressions of the form x == x or x != x
7805 // should result in a warning, since these always evaluate to a constant.
7806 // Array comparisons have similar warnings
7807 def warn_comparison_always : Warning<
7808   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
7809   InGroup<TautologicalCompare>;
7810 def warn_comparison_bitwise_always : Warning<
7811   "bitwise comparison always evaluates to %select{false|true}0">,
7812   InGroup<TautologicalCompare>;
7813 def warn_tautological_overlap_comparison : Warning<
7814   "overlapping comparisons always evaluate to %select{false|true}0">,
7815   InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7816
7817 def warn_stringcompare : Warning<
7818   "result of comparison against %select{a string literal|@encode}0 is "
7819   "unspecified (use strncmp instead)">,
7820   InGroup<StringCompare>;
7821
7822 def warn_identity_field_assign : Warning<
7823   "assigning %select{field|instance variable}0 to itself">,
7824   InGroup<SelfAssignmentField>;
7825
7826 // Type safety attributes
7827 def err_type_tag_for_datatype_not_ice : Error<
7828   "'type_tag_for_datatype' attribute requires the initializer to be "
7829   "an %select{integer|integral}0 constant expression">;
7830 def err_type_tag_for_datatype_too_large : Error<
7831   "'type_tag_for_datatype' attribute requires the initializer to be "
7832   "an %select{integer|integral}0 constant expression "
7833   "that can be represented by a 64 bit integer">;
7834 def warn_type_tag_for_datatype_wrong_kind : Warning<
7835   "this type tag was not designed to be used with this function">,
7836   InGroup<TypeSafety>;
7837 def warn_type_safety_type_mismatch : Warning<
7838   "argument type %0 doesn't match specified %1 type tag "
7839   "%select{that requires %3|}2">, InGroup<TypeSafety>;
7840 def warn_type_safety_null_pointer_required : Warning<
7841   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7842
7843 // Generic selections.
7844 def err_assoc_type_incomplete : Error<
7845   "type %0 in generic association incomplete">;
7846 def err_assoc_type_nonobject : Error<
7847   "type %0 in generic association not an object type">;
7848 def err_assoc_type_variably_modified : Error<
7849   "type %0 in generic association is a variably modified type">;
7850 def err_assoc_compatible_types : Error<
7851   "type %0 in generic association compatible with previously specified type %1">;
7852 def note_compat_assoc : Note<
7853   "compatible type %0 specified here">;
7854 def err_generic_sel_no_match : Error<
7855   "controlling expression type %0 not compatible with any generic association type">;
7856 def err_generic_sel_multi_match : Error<
7857   "controlling expression type %0 compatible with %1 generic association types">;
7858
7859
7860 // Blocks
7861 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7862   " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">;
7863 def err_block_returning_array_function : Error<
7864   "block cannot return %select{array|function}0 type %1">;
7865
7866 // Builtin annotation
7867 def err_builtin_annotation_first_arg : Error<
7868   "first argument to __builtin_annotation must be an integer">;
7869 def err_builtin_annotation_second_arg : Error<
7870   "second argument to __builtin_annotation must be a non-wide string constant">;
7871
7872 // CFString checking
7873 def err_cfstring_literal_not_string_constant : Error<
7874   "CFString literal is not a string constant">;
7875 def warn_cfstring_truncated : Warning<
7876   "input conversion stopped due to an input byte that does not "
7877   "belong to the input codeset UTF-8">,
7878   InGroup<DiagGroup<"CFString-literal">>;
7879
7880 // os_log checking
7881 // TODO: separate diagnostic for os_trace()
7882 def err_os_log_format_not_string_constant : Error<
7883   "os_log() format argument is not a string constant">;
7884 def err_os_log_argument_too_big : Error<
7885   "os_log() argument %0 is too big (%1 bytes, max %2)">;
7886 def warn_os_log_format_narg : Error<
7887  "os_log() '%%n' format specifier is not allowed">, DefaultError;
7888
7889 // Statements.
7890 def err_continue_not_in_loop : Error<
7891   "'continue' statement not in loop statement">;
7892 def err_break_not_in_loop_or_switch : Error<
7893   "'break' statement not in loop or switch statement">;
7894 def warn_loop_ctrl_binds_to_inner : Warning<
7895   "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
7896   InGroup<GccCompat>;
7897 def warn_break_binds_to_switch : Warning<
7898   "'break' is bound to loop, GCC binds it to switch">,
7899   InGroup<GccCompat>;
7900 def err_default_not_in_switch : Error<
7901   "'default' statement not in switch statement">;
7902 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
7903 def warn_bool_switch_condition : Warning<
7904   "switch condition has boolean value">, InGroup<SwitchBool>;
7905 def warn_case_value_overflow : Warning<
7906   "overflow converting case value to switch condition type (%0 to %1)">,
7907   InGroup<Switch>;
7908 def err_duplicate_case : Error<"duplicate case value '%0'">;
7909 def err_duplicate_case_differing_expr : Error<
7910   "duplicate case value: '%0' and '%1' both equal '%2'">;
7911 def warn_case_empty_range : Warning<"empty case range specified">;
7912 def warn_missing_case_for_condition :
7913   Warning<"no case matching constant switch condition '%0'">;
7914
7915 def warn_def_missing_case : Warning<"%plural{"
7916   "1:enumeration value %1 not explicitly handled in switch|"
7917   "2:enumeration values %1 and %2 not explicitly handled in switch|"
7918   "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
7919   ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
7920   InGroup<SwitchEnum>, DefaultIgnore;
7921
7922 def warn_missing_case : Warning<"%plural{"
7923   "1:enumeration value %1 not handled in switch|"
7924   "2:enumeration values %1 and %2 not handled in switch|"
7925   "3:enumeration values %1, %2, and %3 not handled in switch|"
7926   ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
7927   InGroup<Switch>;
7928
7929 def warn_unannotated_fallthrough : Warning<
7930   "unannotated fall-through between switch labels">,
7931   InGroup<ImplicitFallthrough>, DefaultIgnore;
7932 def warn_unannotated_fallthrough_per_function : Warning<
7933   "unannotated fall-through between switch labels in partly-annotated "
7934   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
7935 def note_insert_fallthrough_fixit : Note<
7936   "insert '%0;' to silence this warning">;
7937 def note_insert_break_fixit : Note<
7938   "insert 'break;' to avoid fall-through">;
7939 def err_fallthrough_attr_wrong_target : Error<
7940   "%0 attribute is only allowed on empty statements">;
7941 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
7942 def err_fallthrough_attr_outside_switch : Error<
7943   "fallthrough annotation is outside switch statement">;
7944 def err_fallthrough_attr_invalid_placement : Error<
7945   "fallthrough annotation does not directly precede switch label">;
7946 def warn_fallthrough_attr_unreachable : Warning<
7947   "fallthrough annotation in unreachable code">,
7948   InGroup<ImplicitFallthrough>, DefaultIgnore;
7949
7950 def warn_unreachable_default : Warning<
7951   "default label in switch which covers all enumeration values">,
7952   InGroup<CoveredSwitchDefault>, DefaultIgnore;
7953 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
7954   InGroup<Switch>;
7955 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
7956   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
7957 def err_typecheck_statement_requires_scalar : Error<
7958   "statement requires expression of scalar type (%0 invalid)">;
7959 def err_typecheck_statement_requires_integer : Error<
7960   "statement requires expression of integer type (%0 invalid)">;
7961 def err_multiple_default_labels_defined : Error<
7962   "multiple default labels in one switch">;
7963 def err_switch_multiple_conversions : Error<
7964   "multiple conversions from switch condition type %0 to an integral or "
7965   "enumeration type">;
7966 def note_switch_conversion : Note<
7967   "conversion to %select{integral|enumeration}0 type %1">;
7968 def err_switch_explicit_conversion : Error<
7969   "switch condition type %0 requires explicit conversion to %1">;
7970 def err_switch_incomplete_class_type : Error<
7971   "switch condition has incomplete class type %0">;
7972
7973 def warn_empty_if_body : Warning<
7974   "if statement has empty body">, InGroup<EmptyBody>;
7975 def warn_empty_for_body : Warning<
7976   "for loop has empty body">, InGroup<EmptyBody>;
7977 def warn_empty_range_based_for_body : Warning<
7978   "range-based for loop has empty body">, InGroup<EmptyBody>;
7979 def warn_empty_while_body : Warning<
7980   "while loop has empty body">, InGroup<EmptyBody>;
7981 def warn_empty_switch_body : Warning<
7982   "switch statement has empty body">, InGroup<EmptyBody>;
7983 def note_empty_body_on_separate_line : Note<
7984   "put the semicolon on a separate line to silence this warning">;
7985
7986 def err_va_start_captured_stmt : Error<
7987   "'va_start' cannot be used in a captured statement">;
7988 def err_va_start_outside_function : Error<
7989   "'va_start' cannot be used outside a function">;
7990 def err_va_start_fixed_function : Error<
7991   "'va_start' used in function with fixed args">;
7992 def err_va_start_used_in_wrong_abi_function : Error<
7993   "'va_start' used in %select{System V|Win64}0 ABI function">;
7994 def err_ms_va_start_used_in_sysv_function : Error<
7995   "'__builtin_ms_va_start' used in System V ABI function">;
7996 def warn_second_arg_of_va_start_not_last_named_param : Warning<
7997   "second argument to 'va_start' is not the last named parameter">,
7998   InGroup<Varargs>;
7999 def warn_va_start_type_is_undefined : Warning<
8000   "passing %select{an object that undergoes default argument promotion|"
8001   "an object of reference type|a parameter declared with the 'register' "
8002   "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
8003 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
8004   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
8005 def err_second_parameter_to_va_arg_incomplete: Error<
8006   "second argument to 'va_arg' is of incomplete type %0">;
8007 def err_second_parameter_to_va_arg_abstract: Error<
8008   "second argument to 'va_arg' is of abstract type %0">;
8009 def warn_second_parameter_to_va_arg_not_pod : Warning<
8010   "second argument to 'va_arg' is of non-POD type %0">,
8011   InGroup<NonPODVarargs>, DefaultError;
8012 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
8013   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
8014   InGroup<NonPODVarargs>, DefaultError;
8015 def warn_second_parameter_to_va_arg_never_compatible : Warning<
8016   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
8017   "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
8018
8019 def warn_return_missing_expr : Warning<
8020   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8021   InGroup<ReturnType>;
8022 def ext_return_missing_expr : ExtWarn<
8023   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
8024   InGroup<ReturnType>;
8025 def ext_return_has_expr : ExtWarn<
8026   "%select{void function|void method|constructor|destructor}1 %0 "
8027   "should not return a value">,
8028   DefaultError, InGroup<ReturnType>;
8029 def ext_return_has_void_expr : Extension<
8030   "void %select{function|method|block}1 %0 should not return void expression">;
8031 def err_return_init_list : Error<
8032   "%select{void function|void method|constructor|destructor}1 %0 "
8033   "must not return a value">;
8034 def err_ctor_dtor_returns_void : Error<
8035   "%select{constructor|destructor}1 %0 must not return void expression">;
8036 def warn_noreturn_function_has_return_expr : Warning<
8037   "function %0 declared 'noreturn' should not return">,
8038   InGroup<InvalidNoreturn>;
8039 def warn_falloff_noreturn_function : Warning<
8040   "function declared 'noreturn' should not return">,
8041   InGroup<InvalidNoreturn>;
8042 def err_noreturn_block_has_return_expr : Error<
8043   "block declared 'noreturn' should not return">;
8044 def err_noreturn_missing_on_first_decl : Error<
8045   "function declared '[[noreturn]]' after its first declaration">;
8046 def note_noreturn_missing_first_decl : Note<
8047   "declaration missing '[[noreturn]]' attribute is here">;
8048 def err_carries_dependency_missing_on_first_decl : Error<
8049   "%select{function|parameter}0 declared '[[carries_dependency]]' "
8050   "after its first declaration">;
8051 def note_carries_dependency_missing_first_decl : Note<
8052   "declaration missing '[[carries_dependency]]' attribute is here">;
8053 def err_carries_dependency_param_not_function_decl : Error<
8054   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
8055   "declaration or lambda">;
8056 def err_block_on_nonlocal : Error<
8057   "__block attribute not allowed, only allowed on local variables">;
8058 def err_block_on_vm : Error<
8059   "__block attribute not allowed on declaration with a variably modified type">;
8060
8061 def err_vec_builtin_non_vector : Error<
8062  "first two arguments to %0 must be vectors">;
8063 def err_vec_builtin_incompatible_vector : Error<
8064   "first two arguments to %0 must have the same type">;
8065 def err_vsx_builtin_nonconstant_argument : Error<
8066   "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">;
8067
8068 def err_shufflevector_nonconstant_argument : Error<
8069   "index for __builtin_shufflevector must be a constant integer">;
8070 def err_shufflevector_argument_too_large : Error<
8071   "index for __builtin_shufflevector must be less than the total number "
8072   "of vector elements">;
8073
8074 def err_convertvector_non_vector : Error<
8075   "first argument to __builtin_convertvector must be a vector">;
8076 def err_convertvector_non_vector_type : Error<
8077   "second argument to __builtin_convertvector must be a vector type">;
8078 def err_convertvector_incompatible_vector : Error<
8079   "first two arguments to __builtin_convertvector must have the same number of elements">;
8080
8081 def err_first_argument_to_cwsc_not_call : Error<
8082   "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
8083 def err_first_argument_to_cwsc_block_call : Error<
8084   "first argument to __builtin_call_with_static_chain must not be a block call">;
8085 def err_first_argument_to_cwsc_builtin_call : Error<
8086   "first argument to __builtin_call_with_static_chain must not be a builtin call">;
8087 def err_first_argument_to_cwsc_pdtor_call : Error<
8088   "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
8089 def err_second_argument_to_cwsc_not_pointer : Error<
8090   "second argument to __builtin_call_with_static_chain must be of pointer type">;
8091
8092 def err_vector_incorrect_num_initializers : Error<
8093   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
8094 def err_altivec_empty_initializer : Error<"expected initializer">;
8095
8096 def err_invalid_neon_type_code : Error<
8097   "incompatible constant for this __builtin_neon function">; 
8098 def err_argument_invalid_range : Error<
8099   "argument should be a value from %0 to %1">;
8100 def err_argument_not_multiple : Error<
8101   "argument should be a multiple of %0">;
8102 def warn_neon_vector_initializer_non_portable : Warning<
8103   "vector initializers are not compatible with NEON intrinsics in big endian "
8104   "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
8105 def note_neon_vector_initializer_non_portable : Note<
8106   "consider using vld1_%0%1() to initialize a vector from memory, or "
8107   "vcreate_%0%1() to initialize from an integer constant">;
8108 def note_neon_vector_initializer_non_portable_q : Note<
8109   "consider using vld1q_%0%1() to initialize a vector from memory, or "
8110   "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
8111   "constants">;
8112 def err_systemz_invalid_tabort_code : Error<
8113   "invalid transaction abort code">;
8114 def err_64_bit_builtin_32_bit_tgt : Error<
8115   "this builtin is only available on 64-bit targets">;
8116 def err_builtin_x64_aarch64_only : Error<
8117   "this builtin is only available on x86-64 and aarch64 targets">;
8118 def err_ppc_builtin_only_on_pwr7 : Error<
8119   "this builtin is only valid on POWER7 or later CPUs">;
8120 def err_x86_builtin_invalid_rounding : Error<
8121   "invalid rounding argument">;
8122 def err_x86_builtin_invalid_scale : Error<
8123   "scale argument must be 1, 2, 4, or 8">;
8124
8125 def err_builtin_longjmp_unsupported : Error<
8126   "__builtin_longjmp is not supported for the current target">;
8127 def err_builtin_setjmp_unsupported : Error<
8128   "__builtin_setjmp is not supported for the current target">;
8129
8130 def err_builtin_longjmp_invalid_val : Error<
8131   "argument to __builtin_longjmp must be a constant 1">;
8132 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
8133
8134 def err_constant_integer_arg_type : Error<
8135   "argument to %0 must be a constant integer">;
8136
8137 def ext_mixed_decls_code : Extension<
8138   "ISO C90 forbids mixing declarations and code">,
8139   InGroup<DiagGroup<"declaration-after-statement">>;
8140   
8141 def err_non_local_variable_decl_in_for : Error<
8142   "declaration of non-local variable in 'for' loop">;
8143 def err_non_variable_decl_in_for : Error<
8144   "non-variable declaration in 'for' loop">;
8145 def err_toomany_element_decls : Error<
8146   "only one element declaration is allowed">;
8147 def err_selector_element_not_lvalue : Error<
8148   "selector element is not a valid lvalue">;
8149 def err_selector_element_type : Error<
8150   "selector element type %0 is not a valid object">;
8151 def err_selector_element_const_type : Error<
8152   "selector element of type %0 cannot be a constant l-value expression">;
8153 def err_collection_expr_type : Error<
8154   "the type %0 is not a pointer to a fast-enumerable object">;
8155 def warn_collection_expr_type : Warning<
8156   "collection expression type %0 may not respond to %1">;
8157
8158 def err_invalid_conversion_between_ext_vectors : Error<
8159   "invalid conversion between ext-vector type %0 and %1">;
8160
8161 def warn_duplicate_attribute_exact : Warning<
8162   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
8163
8164 def warn_duplicate_attribute : Warning<
8165   "attribute %0 is already applied with different parameters">,
8166   InGroup<IgnoredAttributes>;
8167
8168 def warn_sync_fetch_and_nand_semantics_change : Warning<
8169   "the semantics of this intrinsic changed with GCC "
8170   "version 4.4 - the newer semantics are provided here">,
8171   InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
8172
8173 // Type
8174 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
8175 def warn_receiver_forward_class : Warning<
8176     "receiver %0 is a forward class and corresponding @interface may not exist">,
8177     InGroup<ForwardClassReceiver>;
8178 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
8179 def ext_missing_declspec : ExtWarn<
8180   "declaration specifier missing, defaulting to 'int'">;
8181 def ext_missing_type_specifier : ExtWarn<
8182   "type specifier missing, defaults to 'int'">,
8183   InGroup<ImplicitInt>;
8184 def err_decimal_unsupported : Error<
8185   "GNU decimal type extension not supported">;
8186 def err_missing_type_specifier : Error<
8187   "C++ requires a type specifier for all declarations">;
8188 def err_objc_array_of_interfaces : Error<
8189   "array of interface %0 is invalid (probably should be an array of pointers)">;
8190 def ext_c99_array_usage : Extension<
8191   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8192   "feature">, InGroup<C99>;
8193 def err_c99_array_usage_cxx : Error<
8194   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8195   "feature, not permitted in C++">;
8196 def err_type_unsupported : Error<
8197   "%0 is not supported on this target">;
8198 def err_nsconsumed_attribute_mismatch : Error<
8199   "overriding method has mismatched ns_consumed attribute on its"
8200   " parameter">;
8201 def err_nsreturns_retained_attribute_mismatch : Error<
8202   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
8203   " attributes">;
8204   
8205 def note_getter_unavailable : Note<
8206   "or because setter is declared here, but no getter method %0 is found">;
8207 def err_invalid_protocol_qualifiers : Error<
8208   "invalid protocol qualifiers on non-ObjC type">;
8209 def warn_ivar_use_hidden : Warning<
8210   "local declaration of %0 hides instance variable">,
8211    InGroup<ShadowIvar>;
8212 def warn_direct_initialize_call : Warning<
8213   "explicit call to +initialize results in duplicate call to +initialize">,
8214    InGroup<ExplicitInitializeCall>;
8215 def warn_direct_super_initialize_call : Warning<
8216   "explicit call to [super initialize] should only be in implementation "
8217   "of +initialize">,
8218    InGroup<ExplicitInitializeCall>;
8219 def err_ivar_use_in_class_method : Error<
8220   "instance variable %0 accessed in class method">;
8221 def err_private_ivar_access : Error<"instance variable %0 is private">,
8222   AccessControl;
8223 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8224   AccessControl;
8225 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8226 def ext_typecheck_base_super : Warning<
8227   "method parameter type "
8228   "%diff{$ does not match super class method parameter type $|"
8229   "does not match super class method parameter type}0,1">,
8230    InGroup<SuperSubClassMismatch>, DefaultIgnore;
8231 def warn_missing_method_return_type : Warning<
8232   "method has no return type specified; defaults to 'id'">,
8233   InGroup<MissingMethodReturnType>, DefaultIgnore;
8234 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8235   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8236
8237 // Spell-checking diagnostics
8238 def err_unknown_typename : Error<
8239   "unknown type name %0">;
8240 def err_unknown_type_or_class_name_suggest : Error<
8241   "unknown %select{type|class}1 name %0; did you mean %2?">;
8242 def err_unknown_typename_suggest : Error<
8243   "unknown type name %0; did you mean %1?">;
8244 def err_unknown_nested_typename_suggest : Error<
8245   "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8246 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8247 def err_undeclared_use_suggest : Error<
8248   "use of undeclared %0; did you mean %1?">;
8249 def err_undeclared_var_use_suggest : Error<
8250   "use of undeclared identifier %0; did you mean %1?">;
8251 def err_no_template : Error<"no template named %0">;
8252 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8253 def err_no_member_template : Error<"no template named %0 in %1">;
8254 def err_no_member_template_suggest : Error<
8255   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8256 def err_non_template_in_template_id : Error<
8257   "%0 does not name a template but is followed by template arguments">;
8258 def err_non_template_in_template_id_suggest : Error<
8259   "%0 does not name a template but is followed by template arguments; "
8260   "did you mean %1?">;
8261 def err_non_template_in_member_template_id_suggest : Error<
8262   "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
8263 def note_non_template_in_template_id_found : Note<
8264   "non-template declaration found by name lookup">;
8265 def err_mem_init_not_member_or_class_suggest : Error<
8266   "initializer %0 does not name a non-static data member or base "
8267   "class; did you mean the %select{base class|member}1 %2?">;
8268 def err_field_designator_unknown_suggest : Error<
8269   "field designator %0 does not refer to any field in type %1; did you mean "
8270   "%2?">;
8271 def err_typecheck_member_reference_ivar_suggest : Error<
8272   "%0 does not have a member named %1; did you mean %2?">;
8273 def err_property_not_found_suggest : Error<
8274   "property %0 not found on object of type %1; did you mean %2?">;
8275 def err_class_property_found : Error<
8276   "property %0 is a class property; did you mean to access it with class '%1'?">;
8277 def err_ivar_access_using_property_syntax_suggest : Error<
8278   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8279 def warn_property_access_suggest : Warning<
8280 "property %0 not found on object of type %1; did you mean to access property %2?">,
8281 InGroup<PropertyAccessDotSyntax>;
8282 def err_property_found_suggest : Error<
8283   "property %0 found on object of type %1; did you mean to access "
8284   "it with the \".\" operator?">;
8285 def err_undef_interface_suggest : Error<
8286   "cannot find interface declaration for %0; did you mean %1?">;
8287 def warn_undef_interface_suggest : Warning<
8288   "cannot find interface declaration for %0; did you mean %1?">;
8289 def err_undef_superclass_suggest : Error<
8290   "cannot find interface declaration for %0, superclass of %1; did you mean "
8291   "%2?">;
8292 def err_undeclared_protocol_suggest : Error<
8293   "cannot find protocol declaration for %0; did you mean %1?">;
8294 def note_base_class_specified_here : Note<
8295   "base class %0 specified here">;
8296 def err_using_directive_suggest : Error<
8297   "no namespace named %0; did you mean %1?">;
8298 def err_using_directive_member_suggest : Error<
8299   "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8300 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8301 def err_sizeof_pack_no_pack_name_suggest : Error<
8302   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8303 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8304
8305 def err_uncasted_use_of_unknown_any : Error<
8306   "%0 has unknown type; cast it to its declared type to use it">;
8307 def err_uncasted_call_of_unknown_any : Error<
8308   "%0 has unknown return type; cast the call to its declared return type">;
8309 def err_uncasted_send_to_unknown_any_method : Error<
8310   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8311   "message send to the method's return type">;
8312 def err_unsupported_unknown_any_decl : Error<
8313   "%0 has unknown type, which is not supported for this kind of declaration">;
8314 def err_unsupported_unknown_any_expr : Error<
8315   "unsupported expression with unknown type">;
8316 def err_unsupported_unknown_any_call : Error<
8317   "call to unsupported expression with unknown type">;
8318 def err_unknown_any_addrof : Error<
8319   "the address of a declaration with unknown type "
8320   "can only be cast to a pointer type">;
8321 def err_unknown_any_addrof_call : Error<
8322   "address-of operator cannot be applied to a call to a function with "
8323   "unknown return type">;
8324 def err_unknown_any_var_function_type : Error<
8325   "variable %0 with unknown type cannot be given a function type">;
8326 def err_unknown_any_function : Error<
8327   "function %0 with unknown type must be given a function type">;
8328
8329 def err_filter_expression_integral : Error<
8330   "filter expression type should be an integral value not %0">;
8331
8332 def err_non_asm_stmt_in_naked_function : Error<
8333   "non-ASM statement in naked function is not supported">;
8334 def err_asm_naked_this_ref : Error<
8335   "'this' pointer references not allowed in naked functions">;
8336 def err_asm_naked_parm_ref : Error<
8337   "parameter references not allowed in naked functions">;
8338
8339 // OpenCL warnings and errors.
8340 def err_invalid_astype_of_different_size : Error<
8341   "invalid reinterpretation: sizes of %0 and %1 must match">;
8342 def err_static_kernel : Error<
8343   "kernel functions cannot be declared static">;
8344 def err_opencl_ptrptr_kernel_param : Error<
8345   "kernel parameter cannot be declared as a pointer to a pointer">;
8346 def err_kernel_arg_address_space : Error<
8347   "pointer arguments to kernel functions must reside in '__global', "
8348   "'__constant' or '__local' address space">;
8349 def err_opencl_ext_vector_component_invalid_length : Error<
8350   "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
8351 def err_opencl_function_variable : Error<
8352   "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8353 def err_opencl_addrspace_scope : Error<
8354   "variables in the %0 address space can only be declared in the outermost "
8355   "scope of a kernel function">;
8356 def err_static_function_scope : Error<
8357   "variables in function scope cannot be declared static">;
8358 def err_opencl_bitfields : Error<
8359   "bit-fields are not supported in OpenCL">;
8360 def err_opencl_vla : Error<
8361   "variable length arrays are not supported in OpenCL">;
8362 def err_opencl_scalar_type_rank_greater_than_vector_type : Error<
8363     "scalar operand type has greater rank than the type of the vector "
8364     "element. (%0 and %1)">;
8365 def err_bad_kernel_param_type : Error<
8366   "%0 cannot be used as the type of a kernel parameter">;
8367 def err_opencl_implicit_function_decl : Error<
8368   "implicit declaration of function %0 is invalid in OpenCL">;
8369 def err_record_with_pointers_kernel_param : Error<
8370   "%select{struct|union}0 kernel parameters may not contain pointers">;
8371 def note_within_field_of_type : Note<
8372   "within field of type %0 declared here">;
8373 def note_illegal_field_declared_here : Note<
8374   "field of illegal %select{type|pointer type}0 %1 declared here">;
8375 def err_opencl_type_struct_or_union_field : Error<
8376   "the %0 type cannot be used to declare a structure or union field">;
8377 def err_event_t_addr_space_qual : Error<
8378   "the event_t type can only be used with __private address space qualifier">;
8379 def err_expected_kernel_void_return_type : Error<
8380   "kernel must have void return type">;
8381 def err_sampler_initializer_not_integer : Error<
8382   "sampler_t initialization requires 32-bit integer, not %0">;
8383 def warn_sampler_initializer_invalid_bits : Warning<
8384   "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8385 def err_sampler_argument_required : Error<
8386   "sampler_t variable required - got %0">;
8387 def err_wrong_sampler_addressspace: Error<
8388   "sampler type cannot be used with the __local and __global address space qualifiers">;
8389 def err_opencl_nonconst_global_sampler : Error<
8390   "global sampler requires a const or constant address space qualifier">;
8391 def err_opencl_cast_non_zero_to_event_t : Error<
8392   "cannot cast non-zero value '%0' to 'event_t'">;
8393 def err_opencl_global_invalid_addr_space : Error<
8394   "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8395 def err_missing_actual_pipe_type : Error<
8396   "missing actual type specifier for pipe">;
8397 def err_reference_pipe_type : Error <
8398   "pipes packet types cannot be of reference type">;
8399 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8400 def err_opencl_kernel_attr :
8401   Error<"attribute %0 can only be applied to a kernel function">;
8402 def err_opencl_return_value_with_address_space : Error<
8403   "return value cannot be qualified with address space">;
8404 def err_opencl_constant_no_init : Error<
8405   "variable in constant address space must be initialized">;
8406 def err_opencl_atomic_init: Error<
8407   "atomic variable can be %select{assigned|initialized}0 to a variable only "
8408   "in global address space">;
8409 def err_opencl_implicit_vector_conversion : Error<
8410   "implicit conversions between vector types (%0 and %1) are not permitted">;
8411 def err_opencl_invalid_type_array : Error<
8412   "array of %0 type is invalid in OpenCL">;
8413 def err_opencl_ternary_with_block : Error<
8414   "block type cannot be used as expression in ternary expression in OpenCL">;
8415 def err_opencl_pointer_to_type : Error<
8416   "pointer to type %0 is invalid in OpenCL">;
8417 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8418   "type %0 can only be used as a function parameter in OpenCL">;
8419 def warn_opencl_attr_deprecated_ignored : Warning <
8420   "%0 attribute is deprecated and ignored in OpenCL version %1">,
8421   InGroup<IgnoredAttributes>;
8422 def err_opencl_variadic_function : Error<
8423   "invalid prototype, variadic arguments are not allowed in OpenCL">;
8424 def err_opencl_requires_extension : Error<
8425   "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">;
8426
8427 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8428 def err_opencl_builtin_pipe_first_arg : Error<
8429   "first argument to %0 must be a pipe type">;
8430 def err_opencl_builtin_pipe_arg_num : Error<
8431   "invalid number of arguments to function: %0">;
8432 def err_opencl_builtin_pipe_invalid_arg : Error<
8433   "invalid argument type to function %0 (expecting %1 having %2)">;
8434 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8435   "invalid pipe access modifier (expecting %0)">;
8436
8437 // OpenCL access qualifier
8438 def err_opencl_invalid_access_qualifier : Error<
8439   "access qualifier can only be used for pipe and image type">;
8440 def err_opencl_invalid_read_write : Error<
8441   "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8442 def err_opencl_multiple_access_qualifiers : Error<
8443   "multiple access qualifiers">;
8444 def note_opencl_typedef_access_qualifier : Note<
8445   "previously declared '%0' here">;
8446
8447 // OpenCL Section 6.8.g
8448 def err_opencl_unknown_type_specifier : Error<
8449   "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">;
8450
8451 // OpenCL v2.0 s6.12.5 Blocks restrictions
8452 def err_opencl_block_storage_type : Error<
8453   "the __block storage type is not permitted">;
8454 def err_opencl_invalid_block_declaration : Error<
8455   "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8456 def err_opencl_extern_block_declaration : Error<
8457   "invalid block variable declaration - using 'extern' storage class is disallowed">;
8458 def err_opencl_block_ref_block : Error<
8459   "cannot refer to a block inside block">;
8460
8461 // OpenCL v2.0 s6.13.9 - Address space qualifier functions. 
8462 def err_opencl_builtin_to_addr_arg_num : Error<
8463   "invalid number of arguments to function: %0">;
8464 def err_opencl_builtin_to_addr_invalid_arg : Error<
8465   "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8466
8467 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8468 def err_opencl_enqueue_kernel_incorrect_args : Error<
8469   "illegal call to enqueue_kernel, incorrect argument types">;
8470 def err_opencl_enqueue_kernel_local_size_args : Error<
8471   "mismatch in number of block parameters and local size arguments passed">;
8472 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8473   "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8474 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8475   "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
8476 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8477   "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
8478
8479 def err_opencl_builtin_expected_type : Error<
8480   "illegal call to %0, expected %1 argument type">;
8481
8482 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8483 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8484   "vector component name '%0' is an OpenCL version 2.2 feature">,
8485   InGroup<OpenCLUnsupportedRGBA>;
8486 } // end of sema category
8487
8488 let CategoryName = "OpenMP Issue" in {
8489 // OpenMP support.
8490 def err_omp_expected_var_arg : Error<
8491   "%0 is not a global variable, static local variable or static data member">;
8492 def err_omp_expected_var_arg_suggest : Error<
8493   "%0 is not a global variable, static local variable or static data member; "
8494   "did you mean %1">;
8495 def err_omp_global_var_arg : Error<
8496   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8497 def err_omp_ref_type_arg : Error<
8498   "arguments of '#pragma omp %0' cannot be of reference type %1">;
8499 def err_omp_region_not_file_context : Error<
8500   "directive must be at file or namespace scope">;
8501 def err_omp_var_scope : Error<
8502   "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8503 def err_omp_var_used : Error<
8504   "'#pragma omp %0' must precede all references to variable %q1">;
8505 def err_omp_var_thread_local : Error<
8506   "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8507 def err_omp_private_incomplete_type : Error<
8508   "a private variable with incomplete type %0">;
8509 def err_omp_firstprivate_incomplete_type : Error<
8510   "a firstprivate variable with incomplete type %0">;
8511 def err_omp_lastprivate_incomplete_type : Error<
8512   "a lastprivate variable with incomplete type %0">;
8513 def err_omp_reduction_incomplete_type : Error<
8514   "a reduction list item with incomplete type %0">;
8515 def err_omp_unexpected_clause_value : Error<
8516   "expected %0 in OpenMP clause '%1'">;
8517 def err_omp_expected_var_name_member_expr : Error<
8518   "expected variable name%select{| or data member of current class}0">;
8519 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8520   "expected variable name%select{|, data member of current class}0, array element or array section">;
8521 def err_omp_expected_named_var_member_or_array_expression: Error<
8522   "expected expression containing only member accesses and/or array sections based on named variables">;
8523 def err_omp_bit_fields_forbidden_in_clause : Error<
8524   "bit fields cannot be used to specify storage in a '%0' clause">;
8525 def err_array_section_does_not_specify_contiguous_storage : Error<
8526   "array section does not specify contiguous storage">;
8527 def err_omp_union_type_not_allowed : Error<
8528   "mapped storage cannot be derived from a union">;
8529 def err_omp_expected_access_to_data_field : Error<
8530   "expected access to data field">;
8531 def err_omp_multiple_array_items_in_map_clause : Error<
8532   "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8533 def err_omp_pointer_mapped_along_with_derived_section : Error<
8534   "pointer cannot be mapped along with a section derived from itself">;
8535 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8536   "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8537 def err_omp_same_pointer_derreferenced : Error<
8538   "same pointer derreferenced in multiple different ways in map clause expressions">;
8539 def note_omp_task_predetermined_firstprivate_here : Note<
8540   "predetermined as a firstprivate in a task construct here">;
8541 def err_omp_threadprivate_incomplete_type : Error<
8542   "threadprivate variable with incomplete type %0">;
8543 def err_omp_no_dsa_for_variable : Error<
8544   "variable %0 must have explicitly specified data sharing attributes">;
8545 def err_omp_wrong_dsa : Error<
8546   "%0 variable cannot be %1">;
8547 def err_omp_variably_modified_type_not_supported : Error<
8548   "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8549 def note_omp_explicit_dsa : Note<
8550   "defined as %0">;
8551 def note_omp_predetermined_dsa : Note<
8552   "%select{static data member is predetermined as shared|"
8553   "variable with static storage duration is predetermined as shared|"
8554   "loop iteration variable is predetermined as private|"
8555   "loop iteration variable is predetermined as linear|"
8556   "loop iteration variable is predetermined as lastprivate|"
8557   "constant variable is predetermined as shared|"
8558   "global variable is predetermined as shared|"
8559   "non-shared variable in a task construct is predetermined as firstprivate|"
8560   "variable with automatic storage duration is predetermined as private}0"
8561   "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8562 def note_omp_implicit_dsa : Note<
8563   "implicitly determined as %0">;
8564 def err_omp_loop_var_dsa : Error<
8565   "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8566 def err_omp_not_for : Error<
8567   "%select{statement after '#pragma omp %1' must be a for loop|"
8568   "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8569 def note_omp_collapse_ordered_expr : Note<
8570   "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8571 def err_omp_negative_expression_in_clause : Error<
8572   "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8573 def err_omp_not_integral : Error<
8574   "expression must have integral or unscoped enumeration "
8575   "type, not %0">;
8576 def err_omp_threadprivate_in_target : Error<
8577   "threadprivate variables cannot be used in target constructs">;
8578 def err_omp_incomplete_type : Error<
8579   "expression has incomplete class type %0">;
8580 def err_omp_explicit_conversion : Error<
8581   "expression requires explicit conversion from %0 to %1">;
8582 def note_omp_conversion_here : Note<
8583   "conversion to %select{integral|enumeration}0 type %1 declared here">;
8584 def err_omp_ambiguous_conversion : Error<
8585   "ambiguous conversion from type %0 to an integral or unscoped "
8586   "enumeration type">;
8587 def err_omp_required_access : Error<
8588   "%0 variable must be %1">;
8589 def err_omp_const_variable : Error<
8590   "const-qualified variable cannot be %0">;
8591 def err_omp_const_reduction_list_item : Error<
8592   "const-qualified list item cannot be reduction">;
8593 def err_omp_linear_incomplete_type : Error<
8594   "a linear variable with incomplete type %0">;
8595 def err_omp_linear_expected_int_or_ptr : Error<
8596   "argument of a linear clause should be of integral or pointer "
8597   "type, not %0">;
8598 def warn_omp_linear_step_zero : Warning<
8599   "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8600   InGroup<OpenMPClauses>;
8601 def warn_omp_alignment_not_power_of_two : Warning<
8602   "aligned clause will be ignored because the requested alignment is not a power of 2">,
8603   InGroup<OpenMPClauses>;
8604 def err_omp_enclosed_declare_target : Error<
8605   "declare target region may not be enclosed within another declare target region">;
8606 def err_omp_invalid_target_decl : Error<
8607   "%0 used in declare target directive is not a variable or a function name">;
8608 def err_omp_declare_target_multiple : Error<
8609   "%0 appears multiple times in clauses on the same declare target directive">;
8610 def err_omp_declare_target_to_and_link : Error<
8611   "%0 must not appear in both clauses 'to' and 'link'">;
8612 def warn_omp_not_in_target_context : Warning<
8613   "declaration is not declared in any declare target region">,
8614   InGroup<OpenMPTarget>;
8615 def err_omp_aligned_expected_array_or_ptr : Error<
8616   "argument of aligned clause should be array"
8617   "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8618   ", not %0">;
8619 def err_omp_aligned_twice : Error<
8620   "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8621 def err_omp_local_var_in_threadprivate_init : Error<
8622   "variable with local storage in initial value of threadprivate variable">;
8623 def err_omp_loop_not_canonical_init : Error<
8624   "initialization clause of OpenMP for loop is not in canonical form "
8625   "('var = init' or 'T var = init')">;
8626 def ext_omp_loop_not_canonical_init : ExtWarn<
8627   "initialization clause of OpenMP for loop is not in canonical form "
8628   "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8629 def err_omp_loop_not_canonical_cond : Error<
8630   "condition of OpenMP for loop must be a relational comparison "
8631   "('<', '<=', '>', or '>=') of loop variable %0">;
8632 def err_omp_loop_not_canonical_incr : Error<
8633   "increment clause of OpenMP for loop must perform simple addition "
8634   "or subtraction on loop variable %0">;
8635 def err_omp_loop_variable_type : Error<
8636   "variable must be of integer or %select{pointer|random access iterator}0 type">;
8637 def err_omp_loop_incr_not_compatible : Error<
8638   "increment expression must cause %0 to %select{decrease|increase}1 "
8639   "on each iteration of OpenMP for loop">;
8640 def note_omp_loop_cond_requres_compatible_incr : Note<
8641   "loop step is expected to be %select{negative|positive}0 due to this condition">;
8642 def err_omp_loop_diff_cxx : Error<
8643   "could not calculate number of iterations calling 'operator-' with "
8644   "upper and lower loop bounds">;
8645 def err_omp_loop_cannot_use_stmt : Error<
8646   "'%0' statement cannot be used in OpenMP for loop">;
8647 def err_omp_simd_region_cannot_use_stmt : Error<
8648   "'%0' statement cannot be used in OpenMP simd region">;
8649 def warn_omp_loop_64_bit_var : Warning<
8650   "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
8651   InGroup<OpenMPLoopForm>;
8652 def err_omp_unknown_reduction_identifier : Error<
8653   "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
8654   "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
8655 def err_omp_not_resolved_reduction_identifier : Error<
8656   "unable to resolve declare reduction construct for type %0">;
8657 def err_omp_reduction_ref_type_arg : Error<
8658   "argument of OpenMP clause '%0' must reference the same object in all threads">;
8659 def err_omp_clause_not_arithmetic_type_arg : Error<
8660   "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">;
8661 def err_omp_clause_floating_type_arg : Error<
8662   "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">;
8663 def err_omp_once_referenced : Error<
8664   "variable can appear only once in OpenMP '%0' clause">;
8665 def err_omp_once_referenced_in_target_update : Error<
8666   "variable can appear only once in OpenMP 'target update' construct">;
8667 def note_omp_referenced : Note<
8668   "previously referenced here">;
8669 def err_omp_reduction_in_task : Error<
8670   "reduction variables may not be accessed in an explicit task">;
8671 def err_omp_reduction_id_not_compatible : Error<
8672   "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
8673 def err_omp_prohibited_region : Error<
8674   "region cannot be%select{| closely}0 nested inside '%1' region"
8675   "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
8676   "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
8677   "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
8678   "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
8679 def err_omp_prohibited_region_simd : Error<
8680   "OpenMP constructs may not be nested inside a simd region">;
8681 def err_omp_prohibited_region_atomic : Error<
8682   "OpenMP constructs may not be nested inside an atomic region">;
8683 def err_omp_prohibited_region_critical_same_name : Error<
8684   "cannot nest 'critical' regions having the same name %0">;
8685 def note_omp_previous_critical_region : Note<
8686   "previous 'critical' region starts here">;
8687 def err_omp_sections_not_compound_stmt : Error<
8688   "the statement for '#pragma omp sections' must be a compound statement">;
8689 def err_omp_parallel_sections_not_compound_stmt : Error<
8690   "the statement for '#pragma omp parallel sections' must be a compound statement">;
8691 def err_omp_orphaned_section_directive : Error<
8692   "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
8693   " must be closely nested to a sections region%select{|, not a %1 region}0">;
8694 def err_omp_sections_substmt_not_section : Error<
8695   "statement in 'omp sections' directive must be enclosed into a section region">;
8696 def err_omp_parallel_sections_substmt_not_section : Error<
8697   "statement in 'omp parallel sections' directive must be enclosed into a section region">;
8698 def err_omp_parallel_reduction_in_task_firstprivate : Error<
8699   "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
8700 def err_omp_atomic_read_not_expression_statement : Error<
8701   "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
8702   " where v and x are both lvalue expressions with scalar type">;
8703 def note_omp_atomic_read_write: Note<
8704   "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
8705 def err_omp_atomic_write_not_expression_statement : Error<
8706   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
8707   " where x is a lvalue expression with scalar type">;
8708 def err_omp_atomic_update_not_expression_statement : Error<
8709   "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',"
8710   " where x is an l-value expression with scalar type">;
8711 def err_omp_atomic_not_expression_statement : Error<
8712   "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',"
8713   " where x is an l-value expression with scalar type">;
8714 def note_omp_atomic_update: Note<
8715   "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
8716   "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
8717   "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
8718 def err_omp_atomic_capture_not_expression_statement : Error<
8719   "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',"
8720   " where x and v are both l-value expressions with scalar type">;
8721 def err_omp_atomic_capture_not_compound_statement : Error<
8722   "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
8723   " '{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;}',"
8724   " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
8725   " where x is an l-value expression with scalar type">;
8726 def note_omp_atomic_capture: Note<
8727   "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
8728 def err_omp_atomic_several_clauses : Error<
8729   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
8730 def note_omp_atomic_previous_clause : Note<
8731   "'%0' clause used here">;
8732 def err_omp_target_contains_not_only_teams : Error<
8733   "target construct with nested teams region contains statements outside of the teams construct">;
8734 def note_omp_nested_teams_construct_here : Note<
8735   "nested teams construct here">;
8736 def note_omp_nested_statement_here : Note<
8737   "%select{statement|directive}0 outside teams construct here">;
8738 def err_omp_single_copyprivate_with_nowait : Error<
8739   "the 'copyprivate' clause must not be used with the 'nowait' clause">;
8740 def note_omp_nowait_clause_here : Note<
8741   "'nowait' clause is here">;
8742 def err_omp_single_decl_in_declare_simd : Error<
8743   "single declaration is expected after 'declare simd' directive">;
8744 def err_omp_function_expected : Error<
8745   "'#pragma omp declare simd' can only be applied to functions">;
8746 def err_omp_wrong_cancel_region : Error<
8747   "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
8748 def err_omp_parent_cancel_region_nowait : Error<
8749   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">;
8750 def err_omp_parent_cancel_region_ordered : Error<
8751   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">;
8752 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">;
8753 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">;
8754 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
8755 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
8756 def err_omp_typecheck_section_value : Error<
8757   "subscripted value is not an array or pointer">;
8758 def err_omp_typecheck_section_not_integer : Error<
8759   "array section %select{lower bound|length}0 is not an integer">;
8760 def err_omp_section_function_type : Error<
8761   "section of pointer to function type %0">;
8762 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
8763   InGroup<CharSubscript>, DefaultIgnore;
8764 def err_omp_section_incomplete_type : Error<
8765   "section of pointer to incomplete type %0">;
8766 def err_omp_section_not_subset_of_array : Error<
8767   "array section must be a subset of the original array">;
8768 def err_omp_section_length_negative : Error<
8769   "section length is evaluated to a negative value %0">;
8770 def err_omp_section_length_undefined : Error<
8771   "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
8772 def err_omp_wrong_linear_modifier : Error<
8773   "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
8774 def err_omp_wrong_linear_modifier_non_reference : Error<
8775   "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
8776 def err_omp_wrong_simdlen_safelen_values : Error<
8777   "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
8778 def err_omp_wrong_if_directive_name_modifier : Error<
8779   "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
8780 def err_omp_no_more_if_clause : Error<
8781   "no more 'if' clause is allowed">;
8782 def err_omp_unnamed_if_clause : Error<
8783   "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
8784 def note_omp_previous_named_if_clause : Note<
8785   "previous clause with directive name modifier specified here">;
8786 def err_omp_ordered_directive_with_param : Error<
8787   "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
8788 def err_omp_ordered_directive_without_param : Error<
8789   "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
8790 def note_omp_ordered_param : Note<
8791   "'ordered' clause with specified parameter">;
8792 def err_omp_expected_base_var_name : Error<
8793   "expected variable name as a base of the array %select{subscript|section}0">;
8794 def err_omp_map_shared_storage : Error<
8795   "variable already marked as mapped in current construct">;
8796 def err_omp_not_mappable_type : Error<
8797   "type %0 is not mappable to target">;
8798 def err_omp_invalid_map_type_for_directive : Error<
8799   "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
8800 def err_omp_no_clause_for_directive : Error<
8801   "expected at least one %0 clause for '#pragma omp %1'">;
8802 def note_omp_polymorphic_in_target : Note<
8803   "mappable type cannot be polymorphic">;
8804 def note_omp_static_member_in_target : Note<
8805   "mappable type cannot contain static members">;
8806 def err_omp_threadprivate_in_clause : Error<
8807   "threadprivate variables are not allowed in '%0' clause">;
8808 def err_omp_wrong_ordered_loop_count : Error<
8809   "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
8810 def note_collapse_loop_count : Note<
8811   "parameter of the 'collapse' clause">;
8812 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
8813   "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
8814 def note_omp_previous_grainsize_num_tasks : Note<
8815   "'%0' clause is specified here">;
8816 def err_omp_hint_clause_no_name : Error<
8817   "the name of the construct must be specified in presence of 'hint' clause">;
8818 def err_omp_critical_with_hint : Error<
8819   "constructs with the same name must have a 'hint' clause with the same value">;
8820 def note_omp_critical_hint_here : Note<
8821   "%select{|previous }0'hint' clause with value '%1'">;
8822 def note_omp_critical_no_hint : Note<
8823   "%select{|previous }0directive with no 'hint' clause specified">;
8824 def err_omp_firstprivate_distribute_private_teams : Error<
8825   "private variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8826 def err_omp_firstprivate_and_lastprivate_in_distribute : Error<
8827   "lastprivate variable cannot be firstprivate in '#pragma omp distribute'">;
8828 def err_omp_firstprivate_distribute_in_teams_reduction : Error<
8829   "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8830 def err_omp_depend_clause_thread_simd : Error<
8831   "'depend' clauses cannot be mixed with '%0' clause">;
8832 def err_omp_depend_sink_expected_loop_iteration : Error<
8833   "expected %0 loop iteration variable">;
8834 def err_omp_depend_sink_unexpected_expr : Error<
8835   "unexpected expression: number of expressions is larger than the number of associated loops">;
8836 def err_omp_depend_sink_expected_plus_minus : Error<
8837   "expected '+' or '-' operation">;
8838 def err_omp_depend_sink_source_not_allowed : Error<
8839   "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
8840 def err_omp_linear_ordered : Error<
8841   "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
8842 def err_omp_unexpected_schedule_modifier : Error<
8843   "modifier '%0' cannot be used along with modifier '%1'">;
8844 def err_omp_schedule_nonmonotonic_static : Error<
8845   "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
8846 def err_omp_schedule_nonmonotonic_ordered : Error<
8847   "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
8848 def err_omp_ordered_simd : Error<
8849   "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
8850 def err_omp_variable_in_given_clause_and_dsa : Error<
8851   "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
8852 def err_omp_param_or_this_in_clause : Error<
8853   "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
8854 def err_omp_expected_uniform_param : Error<
8855   "expected a reference to a parameter specified in a 'uniform' clause">;
8856 def err_omp_expected_int_param : Error<
8857   "expected a reference to an integer-typed parameter">;
8858 def err_omp_at_least_one_motion_clause_required : Error<
8859   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
8860 def err_omp_usedeviceptr_not_a_pointer : Error<
8861   "expected pointer or reference to pointer in 'use_device_ptr' clause">;
8862 def err_omp_argument_type_isdeviceptr : Error <
8863   "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
8864 def warn_omp_nesting_simd : Warning<
8865   "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
8866   InGroup<SourceUsesOpenMP>;
8867 def err_omp_orphaned_device_directive : Error<
8868   "orphaned 'omp %0' directives are prohibited"
8869   "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
8870 def err_omp_reduction_non_addressable_expression : Error<
8871   "expected addressable reduction item for the task-based directives">;
8872 def err_omp_reduction_with_nogroup : Error<
8873   "'reduction' clause cannot be used with 'nogroup' clause">;
8874 } // end of OpenMP category
8875
8876 let CategoryName = "Related Result Type Issue" in {
8877 // Objective-C related result type compatibility
8878 def warn_related_result_type_compatibility_class : Warning<
8879   "method is expected to return an instance of its class type "
8880   "%diff{$, but is declared to return $|"
8881   ", but is declared to return different type}0,1">;
8882 def warn_related_result_type_compatibility_protocol : Warning<
8883   "protocol method is expected to return an instance of the implementing "
8884   "class, but is declared to return %0">;
8885 def note_related_result_type_family : Note<
8886   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
8887   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
8888   "self}1' method family%select{| and is expected to return an instance of its "
8889   "class type}0">;
8890 def note_related_result_type_overridden : Note<
8891   "overridden method returns an instance of its class type">;
8892 def note_related_result_type_inferred : Note<
8893   "%select{class|instance}0 method %1 is assumed to return an instance of "
8894   "its receiver type (%2)">;
8895 def note_related_result_type_explicit : Note<
8896   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
8897   "%select{| and is expected to return an instance of its class type}0">;
8898 def err_invalid_type_for_program_scope_var : Error<
8899   "the %0 type cannot be used to declare a program scope variable">;
8900
8901 }
8902
8903 let CategoryName = "Modules Issue" in {
8904 def err_module_decl_in_module_map_module : Error<
8905   "'module' declaration found while building module from module map">;
8906 def err_module_interface_implementation_mismatch : Error<
8907   "missing 'export' specifier in module declaration while "
8908   "building module interface">;
8909 def err_current_module_name_mismatch : Error<
8910   "module name '%0' specified on command line does not match name of module">;
8911 def err_module_redefinition : Error<
8912   "redefinition of module '%0'">;
8913 def note_prev_module_definition : Note<"previously defined here">;
8914 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
8915 def err_module_private_specialization : Error<
8916   "%select{template|partial|member}0 specialization cannot be "
8917   "declared __module_private__">;
8918 def err_module_private_local : Error<
8919   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
8920   "__module_private__">;
8921 def err_module_private_local_class : Error<
8922   "local %select{struct|interface|union|class|enum}0 cannot be declared "
8923   "__module_private__">;
8924 def err_module_unimported_use : Error<
8925   "%select{declaration|definition|default argument|"
8926   "explicit specialization|partial specialization}0 of %1 must be imported "
8927   "from module '%2' before it is required">;
8928 def err_module_unimported_use_header : Error<
8929   "missing '#include %3'; "
8930   "%select{declaration|definition|default argument|"
8931   "explicit specialization|partial specialization}0 of %1 must be imported "
8932   "from module '%2' before it is required">;
8933 def err_module_unimported_use_multiple : Error<
8934   "%select{declaration|definition|default argument|"
8935   "explicit specialization|partial specialization}0 of %1 must be imported "
8936   "from one of the following modules before it is required:%2">;
8937 def ext_module_import_in_extern_c : ExtWarn<
8938   "import of C++ module '%0' appears within extern \"C\" language linkage "
8939   "specification">, DefaultError,
8940   InGroup<DiagGroup<"module-import-in-extern-c">>;
8941 def err_module_import_not_at_top_level_fatal : Error<
8942   "import of module '%0' appears within %1">, DefaultFatal;
8943 def ext_module_import_not_at_top_level_noop : ExtWarn<
8944   "redundant #include of module '%0' appears within %1">, DefaultError,
8945   InGroup<DiagGroup<"modules-import-nested-redundant">>;
8946 def note_module_import_not_at_top_level : Note<"%0 begins here">;
8947 def err_module_self_import : Error<
8948   "import of module '%0' appears within same top-level module '%1'">;
8949 def err_module_import_in_implementation : Error<
8950   "@import of module '%0' in implementation of '%1'; use #import">;
8951
8952 // C++ Modules TS
8953 def err_export_within_export : Error<
8954   "export declaration appears within another export declaration">;
8955 def err_export_not_in_module_interface : Error<
8956   "export declaration can only be used within a module interface unit after "
8957   "the module declaration">;
8958
8959 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
8960   "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
8961   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
8962 def note_equivalent_internal_linkage_decl : Note<
8963   "declared here%select{ in module '%1'|}0">;
8964
8965 def note_redefinition_modules_same_file : Note<
8966         "'%0' included multiple times, additional include site in header from module '%1'">;
8967 def note_redefinition_include_same_file : Note<
8968         "'%0' included multiple times, additional include site here">;
8969 }
8970
8971 let CategoryName = "Coroutines Issue" in {
8972 def err_return_in_coroutine : Error<
8973   "return statement not allowed in coroutine; did you mean 'co_return'?">;
8974 def note_declared_coroutine_here : Note<
8975   "function is a coroutine due to use of '%0' here">;
8976 def err_coroutine_objc_method : Error<
8977   "Objective-C methods as coroutines are not yet supported">;
8978 def err_coroutine_unevaluated_context : Error<
8979   "'%0' cannot be used in an unevaluated context">;
8980 def err_coroutine_outside_function : Error<
8981   "'%0' cannot be used outside a function">;
8982 def err_coroutine_invalid_func_context : Error<
8983   "'%1' cannot be used in %select{a constructor|a destructor"
8984   "|a copy assignment operator|a move assignment operator|the 'main' function"
8985   "|a constexpr function|a function with a deduced return type"
8986   "|a varargs function}0">;
8987 def err_implied_coroutine_type_not_found : Error<
8988   "%0 type was not found; include <experimental/coroutine> before defining "
8989   "a coroutine">;
8990 def err_implicit_coroutine_std_nothrow_type_not_found : Error<
8991   "std::nothrow was not found; include <new> before defining a coroutine which "
8992   "uses get_return_object_on_allocation_failure()">;
8993 def err_malformed_std_nothrow : Error<
8994   "std::nothrow must be a valid variable declaration">;
8995 def err_malformed_std_coroutine_handle : Error<
8996   "std::experimental::coroutine_handle must be a class template">;
8997 def err_coroutine_handle_missing_member : Error<
8998   "std::experimental::coroutine_handle missing a member named '%0'">;
8999 def err_malformed_std_coroutine_traits : Error<
9000   "'std::experimental::coroutine_traits' must be a class template">;
9001 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
9002   "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
9003 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
9004   "this function cannot be a coroutine: %0 is not a class">;
9005 def err_coroutine_promise_type_incomplete : Error<
9006   "this function cannot be a coroutine: %0 is an incomplete type">;
9007 def err_coroutine_type_missing_specialization : Error<
9008   "this function cannot be a coroutine: missing definition of "
9009   "specialization %q0">;
9010 def err_coroutine_promise_incompatible_return_functions : Error<
9011   "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
9012 def err_coroutine_promise_requires_return_function : Error<
9013   "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">;
9014 def note_coroutine_promise_implicit_await_transform_required_here : Note<
9015   "call to 'await_transform' implicitly required by 'co_await' here">;
9016 def note_coroutine_promise_suspend_implicitly_required : Note<
9017   "call to '%select{initial_suspend|final_suspend}0' implicitly "
9018   "required by the %select{initial suspend point|final suspend point}0">;
9019 def err_coroutine_promise_unhandled_exception_required : Error<
9020   "%0 is required to declare the member 'unhandled_exception()'">;
9021 def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
9022   "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
9023   InGroup<CoroutineMissingUnhandledException>;
9024 def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
9025   "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
9026 def err_seh_in_a_coroutine_with_cxx_exceptions : Error<
9027   "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">;
9028 def err_coroutine_promise_new_requires_nothrow : Error<
9029   "%0 is required to have a non-throwing noexcept specification when the promise "
9030    "type declares 'get_return_object_on_allocation_failure()'">;
9031 def note_coroutine_promise_call_implicitly_required : Note<
9032   "call to %0 implicitly required by coroutine function here">;
9033 def err_await_suspend_invalid_return_type : Error<
9034   "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
9035 >;
9036 def note_await_ready_no_bool_conversion : Note<
9037   "return type of 'await_ready' is required to be contextually convertible to 'bool'"
9038 >;
9039 }
9040
9041 let CategoryName = "Documentation Issue" in {
9042 def warn_not_a_doxygen_trailing_member_comment : Warning<
9043   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
9044 } // end of documentation issue category
9045
9046 let CategoryName = "Instrumentation Issue" in {
9047 def warn_profile_data_out_of_date : Warning<
9048   "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
9049   " mismatched data that will be ignored">,
9050   InGroup<ProfileInstrOutOfDate>;
9051 def warn_profile_data_missing : Warning<
9052   "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1"
9053   " no data">,
9054   InGroup<ProfileInstrMissing>,
9055   DefaultIgnore;
9056 def warn_profile_data_unprofiled : Warning<
9057   "no profile data available for file \"%0\"">,
9058   InGroup<ProfileInstrUnprofiled>;
9059
9060 } // end of instrumentation issue category
9061
9062 let CategoryName = "Nullability Issue" in {
9063
9064 def warn_mismatched_nullability_attr : Warning<
9065   "nullability specifier %0 conflicts with existing specifier %1">,
9066   InGroup<Nullability>;
9067
9068 def warn_nullability_declspec : Warning<
9069   "nullability specifier %0 cannot be applied "
9070   "to non-pointer type %1; did you mean to apply the specifier to the "
9071   "%select{pointer|block pointer|member pointer|function pointer|"
9072   "member function pointer}2?">,
9073   InGroup<NullabilityDeclSpec>,
9074   DefaultError;
9075
9076 def note_nullability_here : Note<"%0 specified here">;
9077
9078 def err_nullability_nonpointer : Error<
9079   "nullability specifier %0 cannot be applied to non-pointer type %1">;
9080
9081 def warn_nullability_lost : Warning<
9082   "implicit conversion from nullable pointer %0 to non-nullable pointer "
9083   "type %1">,
9084   InGroup<NullableToNonNullConversion>, DefaultIgnore;
9085 def warn_zero_as_null_pointer_constant : Warning<
9086   "zero as null pointer constant">,
9087   InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
9088
9089 def err_nullability_cs_multilevel : Error<
9090   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
9091 def note_nullability_type_specifier : Note<
9092   "use nullability type specifier %0 to affect the innermost "
9093   "pointer type of %1">;
9094
9095 def warn_null_resettable_setter : Warning<
9096   "synthesized setter %0 for null_resettable property %1 does not handle nil">,
9097   InGroup<Nullability>;
9098
9099 def warn_nullability_missing : Warning<
9100   "%select{pointer|block pointer|member pointer}0 is missing a nullability "
9101   "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
9102   InGroup<NullabilityCompleteness>;
9103 def warn_nullability_missing_array : Warning<
9104   "array parameter is missing a nullability type specifier (_Nonnull, "
9105   "_Nullable, or _Null_unspecified)">,
9106   InGroup<NullabilityCompletenessOnArrays>;
9107 def note_nullability_fix_it : Note<
9108   "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
9109   "%select{pointer|block pointer|member pointer|array parameter}1 "
9110   "%select{should never be null|may be null|should not declare nullability}0">;
9111
9112 def warn_nullability_inferred_on_nested_type : Warning<
9113   "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
9114   "deprecated">,
9115   InGroup<NullabilityInferredOnNestedType>;
9116
9117 def err_objc_type_arg_explicit_nullability : Error<
9118   "type argument %0 cannot explicitly specify nullability">;
9119
9120 def err_objc_type_param_bound_explicit_nullability : Error<
9121   "type parameter %0 bound %1 cannot explicitly specify nullability">;
9122
9123 }
9124
9125 let CategoryName = "Generics Issue" in {
9126
9127 def err_objc_type_param_bound_nonobject : Error<
9128   "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
9129
9130 def err_objc_type_param_bound_missing_pointer : Error<
9131   "missing '*' in type bound %0 for type parameter %1">;
9132 def err_objc_type_param_bound_qualified : Error<
9133   "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
9134
9135 def err_objc_type_param_redecl : Error<
9136   "redeclaration of type parameter %0">;
9137
9138 def err_objc_type_param_arity_mismatch : Error<
9139   "%select{forward class declaration|class definition|category|extension}0 has "
9140   "too %select{few|many}1 type parameters (expected %2, have %3)">;
9141
9142 def err_objc_type_param_bound_conflict : Error<
9143   "type bound %0 for type parameter %1 conflicts with "
9144   "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
9145
9146 def err_objc_type_param_variance_conflict : Error<
9147   "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
9148   "%select{in|co|contra}2variant type parameter %3">;
9149
9150 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
9151
9152 def err_objc_type_param_bound_missing : Error<
9153   "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
9154
9155 def err_objc_parameterized_category_nonclass : Error<
9156   "%select{extension|category}0 of non-parameterized class %1 cannot have type "
9157   "parameters">;
9158
9159 def err_objc_parameterized_forward_class : Error<
9160   "forward declaration of non-parameterized class %0 cannot have type "
9161   "parameters">;
9162
9163 def err_objc_parameterized_forward_class_first : Error<
9164   "class %0 previously declared with type parameters">;
9165
9166 def err_objc_type_arg_missing_star : Error<
9167   "type argument %0 must be a pointer (requires a '*')">;
9168 def err_objc_type_arg_qualified : Error<
9169   "type argument %0 cannot be qualified with '%1'">;
9170
9171 def err_objc_type_arg_missing : Error<
9172   "no type or protocol named %0">;
9173
9174 def err_objc_type_args_and_protocols : Error<
9175   "angle brackets contain both a %select{type|protocol}0 (%1) and a "
9176   "%select{protocol|type}0 (%2)">;
9177
9178 def err_objc_type_args_non_class : Error<
9179   "type arguments cannot be applied to non-class type %0">;
9180
9181 def err_objc_type_args_non_parameterized_class : Error<
9182   "type arguments cannot be applied to non-parameterized class %0">;
9183
9184 def err_objc_type_args_specialized_class : Error<
9185   "type arguments cannot be applied to already-specialized class type %0">;
9186
9187 def err_objc_type_args_wrong_arity : Error<
9188   "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
9189 }
9190
9191 def err_objc_type_arg_not_id_compatible : Error<
9192   "type argument %0 is neither an Objective-C object nor a block type">;
9193
9194 def err_objc_type_arg_does_not_match_bound : Error<
9195   "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
9196
9197 def warn_objc_redundant_qualified_class_type : Warning<
9198   "parameterized class %0 already conforms to the protocols listed; did you "
9199   "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
9200
9201 def warn_block_literal_attributes_on_omitted_return_type : Warning<
9202   "attribute %0 ignored, because it cannot be applied to omitted return type">,
9203   InGroup<IgnoredAttributes>;
9204
9205 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
9206   "'%0' qualifier on omitted return type %1 has no effect">,
9207   InGroup<IgnoredQualifiers>;
9208
9209 def ext_warn_gnu_final : ExtWarn<
9210   "__final is a GNU extension, consider using C++11 final">,
9211   InGroup<GccCompat>;
9212
9213 def warn_shadow_field :
9214   Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">,
9215   InGroup<ShadowField>, DefaultIgnore;
9216 def note_shadow_field : Note<"declared here">;
9217
9218 } // end of sema component.